123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955 |
- .class public final Lokhttp3/Dispatcher;
- .super Ljava/lang/Object;
- .source ""
- # instance fields
- .field private executorService:Ljava/util/concurrent/ExecutorService;
- .field private idleCallback:Ljava/lang/Runnable;
- .field private maxRequests:I
- .field private maxRequestsPerHost:I
- .field private final readyAsyncCalls:Ljava/util/Deque;
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "Ljava/util/Deque<",
- "Lokhttp3/RealCall$AsyncCall;",
- ">;"
- }
- .end annotation
- .end field
- .field private final runningAsyncCalls:Ljava/util/Deque;
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "Ljava/util/Deque<",
- "Lokhttp3/RealCall$AsyncCall;",
- ">;"
- }
- .end annotation
- .end field
- .field private final runningSyncCalls:Ljava/util/Deque;
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "Ljava/util/Deque<",
- "Lokhttp3/RealCall;",
- ">;"
- }
- .end annotation
- .end field
- # direct methods
- .method public constructor <init>()V
- .locals 1
- invoke-direct {p0}, Ljava/lang/Object;-><init>()V
- const/16 v0, 0x40
- iput v0, p0, Lokhttp3/Dispatcher;->maxRequests:I
- const/4 v0, 0x5
- iput v0, p0, Lokhttp3/Dispatcher;->maxRequestsPerHost:I
- new-instance v0, Ljava/util/ArrayDeque;
- invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
- iput-object v0, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/Deque;
- new-instance v0, Ljava/util/ArrayDeque;
- invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
- iput-object v0, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/Deque;
- new-instance v0, Ljava/util/ArrayDeque;
- invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
- iput-object v0, p0, Lokhttp3/Dispatcher;->runningSyncCalls:Ljava/util/Deque;
- return-void
- .end method
- .method public constructor <init>(Ljava/util/concurrent/ExecutorService;)V
- .locals 1
- invoke-direct {p0}, Ljava/lang/Object;-><init>()V
- const/16 v0, 0x40
- iput v0, p0, Lokhttp3/Dispatcher;->maxRequests:I
- const/4 v0, 0x5
- iput v0, p0, Lokhttp3/Dispatcher;->maxRequestsPerHost:I
- new-instance v0, Ljava/util/ArrayDeque;
- invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
- iput-object v0, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/Deque;
- new-instance v0, Ljava/util/ArrayDeque;
- invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
- iput-object v0, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/Deque;
- new-instance v0, Ljava/util/ArrayDeque;
- invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
- iput-object v0, p0, Lokhttp3/Dispatcher;->runningSyncCalls:Ljava/util/Deque;
- iput-object p1, p0, Lokhttp3/Dispatcher;->executorService:Ljava/util/concurrent/ExecutorService;
- return-void
- .end method
- .method private finished(Ljava/util/Deque;Ljava/lang/Object;Z)V
- .locals 0
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "<T:",
- "Ljava/lang/Object;",
- ">(",
- "Ljava/util/Deque<",
- "TT;>;TT;Z)V"
- }
- .end annotation
- monitor-enter p0
- :try_start_0
- invoke-interface {p1, p2}, Ljava/util/Deque;->remove(Ljava/lang/Object;)Z
- move-result p1
- if-eqz p1, :cond_2
- if-eqz p3, :cond_0
- invoke-direct {p0}, Lokhttp3/Dispatcher;->promoteCalls()V
- :cond_0
- invoke-virtual {p0}, Lokhttp3/Dispatcher;->runningCallsCount()I
- move-result p1
- iget-object p2, p0, Lokhttp3/Dispatcher;->idleCallback:Ljava/lang/Runnable;
- monitor-exit p0
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- if-nez p1, :cond_1
- if-eqz p2, :cond_1
- invoke-interface {p2}, Ljava/lang/Runnable;->run()V
- :cond_1
- return-void
- :cond_2
- :try_start_1
- new-instance p1, Ljava/lang/AssertionError;
- const-string p2, "Call wasn\'t in-flight!"
- invoke-direct {p1, p2}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
- throw p1
- :catchall_0
- move-exception p1
- monitor-exit p0
- :try_end_1
- .catchall {:try_start_1 .. :try_end_1} :catchall_0
- throw p1
- .end method
- .method private promoteCalls()V
- .locals 4
- iget-object v0, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/Deque;
- invoke-interface {v0}, Ljava/util/Deque;->size()I
- move-result v0
- iget v1, p0, Lokhttp3/Dispatcher;->maxRequests:I
- if-lt v0, v1, :cond_0
- return-void
- :cond_0
- iget-object v0, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/Deque;
- invoke-interface {v0}, Ljava/util/Deque;->isEmpty()Z
- move-result v0
- if-eqz v0, :cond_1
- return-void
- :cond_1
- iget-object v0, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/Deque;
- invoke-interface {v0}, Ljava/util/Deque;->iterator()Ljava/util/Iterator;
- move-result-object v0
- :cond_2
- invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
- move-result v1
- if-eqz v1, :cond_4
- invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
- move-result-object v1
- check-cast v1, Lokhttp3/RealCall$AsyncCall;
- invoke-direct {p0, v1}, Lokhttp3/Dispatcher;->runningCallsForHost(Lokhttp3/RealCall$AsyncCall;)I
- move-result v2
- iget v3, p0, Lokhttp3/Dispatcher;->maxRequestsPerHost:I
- if-ge v2, v3, :cond_3
- invoke-interface {v0}, Ljava/util/Iterator;->remove()V
- iget-object v2, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/Deque;
- invoke-interface {v2, v1}, Ljava/util/Deque;->add(Ljava/lang/Object;)Z
- invoke-virtual {p0}, Lokhttp3/Dispatcher;->executorService()Ljava/util/concurrent/ExecutorService;
- move-result-object v2
- invoke-interface {v2, v1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
- :cond_3
- iget-object v1, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/Deque;
- invoke-interface {v1}, Ljava/util/Deque;->size()I
- move-result v1
- iget v2, p0, Lokhttp3/Dispatcher;->maxRequests:I
- if-lt v1, v2, :cond_2
- :cond_4
- return-void
- .end method
- .method private runningCallsForHost(Lokhttp3/RealCall$AsyncCall;)I
- .locals 4
- iget-object v0, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/Deque;
- invoke-interface {v0}, Ljava/util/Deque;->iterator()Ljava/util/Iterator;
- move-result-object v0
- const/4 v1, 0x0
- :cond_0
- :goto_0
- invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
- move-result v2
- if-eqz v2, :cond_1
- invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
- move-result-object v2
- check-cast v2, Lokhttp3/RealCall$AsyncCall;
- invoke-virtual {v2}, Lokhttp3/RealCall$AsyncCall;->host()Ljava/lang/String;
- move-result-object v2
- invoke-virtual {p1}, Lokhttp3/RealCall$AsyncCall;->host()Ljava/lang/String;
- move-result-object v3
- invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
- move-result v2
- if-eqz v2, :cond_0
- add-int/lit8 v1, v1, 0x1
- goto :goto_0
- :cond_1
- return v1
- .end method
- # virtual methods
- .method public declared-synchronized cancelAll()V
- .locals 2
- monitor-enter p0
- :try_start_0
- iget-object v0, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/Deque;
- invoke-interface {v0}, Ljava/util/Deque;->iterator()Ljava/util/Iterator;
- move-result-object v0
- :goto_0
- invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
- move-result v1
- if-eqz v1, :cond_0
- invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
- move-result-object v1
- check-cast v1, Lokhttp3/RealCall$AsyncCall;
- invoke-virtual {v1}, Lokhttp3/RealCall$AsyncCall;->get()Lokhttp3/RealCall;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/RealCall;->cancel()V
- goto :goto_0
- :cond_0
- iget-object v0, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/Deque;
- invoke-interface {v0}, Ljava/util/Deque;->iterator()Ljava/util/Iterator;
- move-result-object v0
- :goto_1
- invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
- move-result v1
- if-eqz v1, :cond_1
- invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
- move-result-object v1
- check-cast v1, Lokhttp3/RealCall$AsyncCall;
- invoke-virtual {v1}, Lokhttp3/RealCall$AsyncCall;->get()Lokhttp3/RealCall;
- move-result-object v1
- invoke-virtual {v1}, Lokhttp3/RealCall;->cancel()V
- goto :goto_1
- :cond_1
- iget-object v0, p0, Lokhttp3/Dispatcher;->runningSyncCalls:Ljava/util/Deque;
- invoke-interface {v0}, Ljava/util/Deque;->iterator()Ljava/util/Iterator;
- move-result-object v0
- :goto_2
- invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
- move-result v1
- if-eqz v1, :cond_2
- invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
- move-result-object v1
- check-cast v1, Lokhttp3/RealCall;
- invoke-virtual {v1}, Lokhttp3/RealCall;->cancel()V
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- goto :goto_2
- :cond_2
- monitor-exit p0
- return-void
- :catchall_0
- move-exception v0
- monitor-exit p0
- goto :goto_4
- :goto_3
- throw v0
- :goto_4
- goto :goto_3
- .end method
- .method declared-synchronized enqueue(Lokhttp3/RealCall$AsyncCall;)V
- .locals 2
- monitor-enter p0
- :try_start_0
- iget-object v0, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/Deque;
- invoke-interface {v0}, Ljava/util/Deque;->size()I
- move-result v0
- iget v1, p0, Lokhttp3/Dispatcher;->maxRequests:I
- if-ge v0, v1, :cond_0
- invoke-direct {p0, p1}, Lokhttp3/Dispatcher;->runningCallsForHost(Lokhttp3/RealCall$AsyncCall;)I
- move-result v0
- iget v1, p0, Lokhttp3/Dispatcher;->maxRequestsPerHost:I
- if-ge v0, v1, :cond_0
- iget-object v0, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/Deque;
- invoke-interface {v0, p1}, Ljava/util/Deque;->add(Ljava/lang/Object;)Z
- invoke-virtual {p0}, Lokhttp3/Dispatcher;->executorService()Ljava/util/concurrent/ExecutorService;
- move-result-object v0
- invoke-interface {v0, p1}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V
- goto :goto_0
- :cond_0
- iget-object v0, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/Deque;
- invoke-interface {v0, p1}, Ljava/util/Deque;->add(Ljava/lang/Object;)Z
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- :goto_0
- monitor-exit p0
- return-void
- :catchall_0
- move-exception p1
- monitor-exit p0
- throw p1
- .end method
- .method declared-synchronized executed(Lokhttp3/RealCall;)V
- .locals 1
- monitor-enter p0
- :try_start_0
- iget-object v0, p0, Lokhttp3/Dispatcher;->runningSyncCalls:Ljava/util/Deque;
- invoke-interface {v0, p1}, Ljava/util/Deque;->add(Ljava/lang/Object;)Z
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- monitor-exit p0
- return-void
- :catchall_0
- move-exception p1
- monitor-exit p0
- throw p1
- .end method
- .method public declared-synchronized executorService()Ljava/util/concurrent/ExecutorService;
- .locals 9
- monitor-enter p0
- :try_start_0
- iget-object v0, p0, Lokhttp3/Dispatcher;->executorService:Ljava/util/concurrent/ExecutorService;
- if-nez v0, :cond_0
- new-instance v0, Ljava/util/concurrent/ThreadPoolExecutor;
- const/4 v2, 0x0
- const v3, 0x7fffffff
- const-wide/16 v4, 0x3c
- sget-object v6, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
- new-instance v7, Ljava/util/concurrent/SynchronousQueue;
- invoke-direct {v7}, Ljava/util/concurrent/SynchronousQueue;-><init>()V
- const-string v1, "OkHttp Dispatcher"
- const/4 v8, 0x0
- invoke-static {v1, v8}, Lokhttp3/internal/Util;->threadFactory(Ljava/lang/String;Z)Ljava/util/concurrent/ThreadFactory;
- move-result-object v8
- move-object v1, v0
- invoke-direct/range {v1 .. v8}, Ljava/util/concurrent/ThreadPoolExecutor;-><init>(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;)V
- iput-object v0, p0, Lokhttp3/Dispatcher;->executorService:Ljava/util/concurrent/ExecutorService;
- :cond_0
- iget-object v0, p0, Lokhttp3/Dispatcher;->executorService:Ljava/util/concurrent/ExecutorService;
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- monitor-exit p0
- return-object v0
- :catchall_0
- move-exception v0
- monitor-exit p0
- throw v0
- .end method
- .method finished(Lokhttp3/RealCall$AsyncCall;)V
- .locals 2
- iget-object v0, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/Deque;
- const/4 v1, 0x1
- invoke-direct {p0, v0, p1, v1}, Lokhttp3/Dispatcher;->finished(Ljava/util/Deque;Ljava/lang/Object;Z)V
- return-void
- .end method
- .method finished(Lokhttp3/RealCall;)V
- .locals 2
- iget-object v0, p0, Lokhttp3/Dispatcher;->runningSyncCalls:Ljava/util/Deque;
- const/4 v1, 0x0
- invoke-direct {p0, v0, p1, v1}, Lokhttp3/Dispatcher;->finished(Ljava/util/Deque;Ljava/lang/Object;Z)V
- return-void
- .end method
- .method public declared-synchronized getMaxRequests()I
- .locals 1
- monitor-enter p0
- :try_start_0
- iget v0, p0, Lokhttp3/Dispatcher;->maxRequests:I
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- monitor-exit p0
- return v0
- :catchall_0
- move-exception v0
- monitor-exit p0
- throw v0
- .end method
- .method public declared-synchronized getMaxRequestsPerHost()I
- .locals 1
- monitor-enter p0
- :try_start_0
- iget v0, p0, Lokhttp3/Dispatcher;->maxRequestsPerHost:I
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- monitor-exit p0
- return v0
- :catchall_0
- move-exception v0
- monitor-exit p0
- throw v0
- .end method
- .method public declared-synchronized queuedCalls()Ljava/util/List;
- .locals 3
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "()",
- "Ljava/util/List<",
- "Lokhttp3/Call;",
- ">;"
- }
- .end annotation
- monitor-enter p0
- :try_start_0
- new-instance v0, Ljava/util/ArrayList;
- invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
- iget-object v1, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/Deque;
- invoke-interface {v1}, Ljava/util/Deque;->iterator()Ljava/util/Iterator;
- move-result-object v1
- :goto_0
- invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
- move-result v2
- if-eqz v2, :cond_0
- invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
- move-result-object v2
- check-cast v2, Lokhttp3/RealCall$AsyncCall;
- invoke-virtual {v2}, Lokhttp3/RealCall$AsyncCall;->get()Lokhttp3/RealCall;
- move-result-object v2
- invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
- goto :goto_0
- :cond_0
- invoke-static {v0}, Ljava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List;
- move-result-object v0
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- monitor-exit p0
- return-object v0
- :catchall_0
- move-exception v0
- monitor-exit p0
- goto :goto_2
- :goto_1
- throw v0
- :goto_2
- goto :goto_1
- .end method
- .method public declared-synchronized queuedCallsCount()I
- .locals 1
- monitor-enter p0
- :try_start_0
- iget-object v0, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/Deque;
- invoke-interface {v0}, Ljava/util/Deque;->size()I
- move-result v0
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- monitor-exit p0
- return v0
- :catchall_0
- move-exception v0
- monitor-exit p0
- throw v0
- .end method
- .method public declared-synchronized runningCalls()Ljava/util/List;
- .locals 3
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "()",
- "Ljava/util/List<",
- "Lokhttp3/Call;",
- ">;"
- }
- .end annotation
- monitor-enter p0
- :try_start_0
- new-instance v0, Ljava/util/ArrayList;
- invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
- iget-object v1, p0, Lokhttp3/Dispatcher;->runningSyncCalls:Ljava/util/Deque;
- invoke-interface {v0, v1}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z
- iget-object v1, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/Deque;
- invoke-interface {v1}, Ljava/util/Deque;->iterator()Ljava/util/Iterator;
- move-result-object v1
- :goto_0
- invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
- move-result v2
- if-eqz v2, :cond_0
- invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
- move-result-object v2
- check-cast v2, Lokhttp3/RealCall$AsyncCall;
- invoke-virtual {v2}, Lokhttp3/RealCall$AsyncCall;->get()Lokhttp3/RealCall;
- move-result-object v2
- invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
- goto :goto_0
- :cond_0
- invoke-static {v0}, Ljava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List;
- move-result-object v0
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- monitor-exit p0
- return-object v0
- :catchall_0
- move-exception v0
- monitor-exit p0
- goto :goto_2
- :goto_1
- throw v0
- :goto_2
- goto :goto_1
- .end method
- .method public declared-synchronized runningCallsCount()I
- .locals 2
- monitor-enter p0
- :try_start_0
- iget-object v0, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/Deque;
- invoke-interface {v0}, Ljava/util/Deque;->size()I
- move-result v0
- iget-object v1, p0, Lokhttp3/Dispatcher;->runningSyncCalls:Ljava/util/Deque;
- invoke-interface {v1}, Ljava/util/Deque;->size()I
- move-result v1
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- add-int/2addr v0, v1
- monitor-exit p0
- return v0
- :catchall_0
- move-exception v0
- monitor-exit p0
- throw v0
- .end method
- .method public declared-synchronized setIdleCallback(Ljava/lang/Runnable;)V
- .locals 0
- monitor-enter p0
- :try_start_0
- iput-object p1, p0, Lokhttp3/Dispatcher;->idleCallback:Ljava/lang/Runnable;
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- monitor-exit p0
- return-void
- :catchall_0
- move-exception p1
- monitor-exit p0
- throw p1
- .end method
- .method public declared-synchronized setMaxRequests(I)V
- .locals 3
- monitor-enter p0
- const/4 v0, 0x1
- if-lt p1, v0, :cond_0
- :try_start_0
- iput p1, p0, Lokhttp3/Dispatcher;->maxRequests:I
- invoke-direct {p0}, Lokhttp3/Dispatcher;->promoteCalls()V
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- monitor-exit p0
- return-void
- :catchall_0
- move-exception p1
- goto :goto_0
- :cond_0
- :try_start_1
- new-instance v0, Ljava/lang/IllegalArgumentException;
- new-instance v1, Ljava/lang/StringBuilder;
- invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
- const-string v2, "max < 1: "
- invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
- invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p1
- invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw v0
- :try_end_1
- .catchall {:try_start_1 .. :try_end_1} :catchall_0
- :goto_0
- monitor-exit p0
- throw p1
- .end method
- .method public declared-synchronized setMaxRequestsPerHost(I)V
- .locals 3
- monitor-enter p0
- const/4 v0, 0x1
- if-lt p1, v0, :cond_0
- :try_start_0
- iput p1, p0, Lokhttp3/Dispatcher;->maxRequestsPerHost:I
- invoke-direct {p0}, Lokhttp3/Dispatcher;->promoteCalls()V
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- monitor-exit p0
- return-void
- :catchall_0
- move-exception p1
- goto :goto_0
- :cond_0
- :try_start_1
- new-instance v0, Ljava/lang/IllegalArgumentException;
- new-instance v1, Ljava/lang/StringBuilder;
- invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
- const-string v2, "max < 1: "
- invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
- invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
- invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
- move-result-object p1
- invoke-direct {v0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
- throw v0
- :try_end_1
- .catchall {:try_start_1 .. :try_end_1} :catchall_0
- :goto_0
- monitor-exit p0
- throw p1
- .end method
|