Dispatcher.smali
.class public final Lokhttp3/Dispatcher;
.super Ljava/lang/Object;
.source "Dispatcher.java"
# instance fields
.field private executorService:Ljava/util/concurrent/ExecutorService;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end field
.field private idleCallback:Ljava/lang/Runnable;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end field
.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 static constructor <clinit>()V
.registers 1
return-void
.end method
.method public constructor <init>()V
.registers 2
.line 60
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 40
const/16 v0, 0x40
iput v0, p0, Lokhttp3/Dispatcher;->maxRequests:I
.line 41
const/4 v0, 0x5
iput v0, p0, Lokhttp3/Dispatcher;->maxRequestsPerHost:I
.line 48
new-instance v0, Ljava/util/ArrayDeque;
invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
iput-object v0, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/Deque;
.line 51
new-instance v0, Ljava/util/ArrayDeque;
invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
iput-object v0, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/Deque;
.line 54
new-instance v0, Ljava/util/ArrayDeque;
invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
iput-object v0, p0, Lokhttp3/Dispatcher;->runningSyncCalls:Ljava/util/Deque;
.line 61
return-void
.end method
.method public constructor <init>(Ljava/util/concurrent/ExecutorService;)V
.registers 3
.param p1, "executorService" # Ljava/util/concurrent/ExecutorService;
.line 56
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 40
const/16 v0, 0x40
iput v0, p0, Lokhttp3/Dispatcher;->maxRequests:I
.line 41
const/4 v0, 0x5
iput v0, p0, Lokhttp3/Dispatcher;->maxRequestsPerHost:I
.line 48
new-instance v0, Ljava/util/ArrayDeque;
invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
iput-object v0, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/Deque;
.line 51
new-instance v0, Ljava/util/ArrayDeque;
invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
iput-object v0, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/Deque;
.line 54
new-instance v0, Ljava/util/ArrayDeque;
invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
iput-object v0, p0, Lokhttp3/Dispatcher;->runningSyncCalls:Ljava/util/Deque;
.line 57
iput-object p1, p0, Lokhttp3/Dispatcher;->executorService:Ljava/util/concurrent/ExecutorService;
.line 58
return-void
.end method
.method private finished(Ljava/util/Deque;Ljava/lang/Object;Z)V
.registers 6
.param p3, "promoteCalls" # Z
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">(",
"Ljava/util/Deque<",
"TT;>;TT;Z)V"
}
.end annotation
.line 201
.local p1, "calls":Ljava/util/Deque;, "Ljava/util/Deque<TT;>;"
.local p2, "call":Ljava/lang/Object;, "TT;"
monitor-enter p0
.line 202
:try_start_1
invoke-interface {p1, p2}, Ljava/util/Deque;->remove(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :cond_1b
.line 203
if-eqz p3, :cond_c
invoke-direct {p0}, Lokhttp3/Dispatcher;->promoteCalls()V
.line 204
:cond_c
invoke-virtual {p0}, Lokhttp3/Dispatcher;->runningCallsCount()I
move-result v0
.line 205
.local v0, "runningCallsCount":I
iget-object v1, p0, Lokhttp3/Dispatcher;->idleCallback:Ljava/lang/Runnable;
.line 206
.local v1, "idleCallback":Ljava/lang/Runnable;
monitor-exit p0
:try_end_13
.catchall {:try_start_1 .. :try_end_13} :catchall_23
.line 208
if-nez v0, :cond_1a
if-eqz v1, :cond_1a
.line 209
invoke-interface {v1}, Ljava/lang/Runnable;->run()V
.line 211
:cond_1a
return-void
.line 202
.end local v0 # "runningCallsCount":I
.end local v1 # "idleCallback":Ljava/lang/Runnable;
:cond_1b
:try_start_1b
new-instance v0, Ljava/lang/AssertionError;
const-string v1, "Call wasn\'t in-flight!"
invoke-direct {v0, v1}, Ljava/lang/AssertionError;-><init>(Ljava/lang/Object;)V
.end local p1 # "calls":Ljava/util/Deque;, "Ljava/util/Deque<TT;>;"
.end local p2 # "call":Ljava/lang/Object;, "TT;"
.end local p3 # "promoteCalls":Z
throw v0
.line 206
.restart local p1 # "calls":Ljava/util/Deque;, "Ljava/util/Deque<TT;>;"
.restart local p2 # "call":Ljava/lang/Object;, "TT;"
.restart local p3 # "promoteCalls":Z
:catchall_23
move-exception v0
monitor-exit p0
:try_end_25
.catchall {:try_start_1b .. :try_end_25} :catchall_23
throw v0
.end method
.method private promoteCalls()V
.registers 5
.line 157
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_b
return-void
.line 158
:cond_b
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_14
return-void
.line 160
:cond_14
iget-object v0, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/Deque;
invoke-interface {v0}, Ljava/util/Deque;->iterator()Ljava/util/Iterator;
move-result-object v0
.local v0, "i":Ljava/util/Iterator;, "Ljava/util/Iterator<Lokhttp3/RealCall$AsyncCall;>;"
:goto_1a
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_49
.line 161
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lokhttp3/RealCall$AsyncCall;
.line 163
.local v1, "call":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_3d
.line 164
invoke-interface {v0}, Ljava/util/Iterator;->remove()V
.line 165
iget-object v2, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/Deque;
invoke-interface {v2, v1}, Ljava/util/Deque;->add(Ljava/lang/Object;)Z
.line 166
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
.line 169
:cond_3d
iget-object v2, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/Deque;
invoke-interface {v2}, Ljava/util/Deque;->size()I
move-result v2
iget v3, p0, Lokhttp3/Dispatcher;->maxRequests:I
if-lt v2, v3, :cond_48
return-void
.line 170
.end local v1 # "call":Lokhttp3/RealCall$AsyncCall;
:cond_48
goto :goto_1a
.line 171
.end local v0 # "i":Ljava/util/Iterator;, "Ljava/util/Iterator<Lokhttp3/RealCall$AsyncCall;>;"
:cond_49
return-void
.end method
.method private runningCallsForHost(Lokhttp3/RealCall$AsyncCall;)I
.registers 7
.param p1, "call" # Lokhttp3/RealCall$AsyncCall;
.line 175
const/4 v0, 0x0
.line 176
.local v0, "result":I
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_7
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_2d
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Lokhttp3/RealCall$AsyncCall;
.line 177
.local v2, "c":Lokhttp3/RealCall$AsyncCall;
invoke-virtual {v2}, Lokhttp3/RealCall$AsyncCall;->get()Lokhttp3/RealCall;
move-result-object v3
iget-boolean v3, v3, Lokhttp3/RealCall;->forWebSocket:Z
if-eqz v3, :cond_1c
goto :goto_7
.line 178
:cond_1c
invoke-virtual {v2}, Lokhttp3/RealCall$AsyncCall;->host()Ljava/lang/String;
move-result-object v3
invoke-virtual {p1}, Lokhttp3/RealCall$AsyncCall;->host()Ljava/lang/String;
move-result-object v4
invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v3
if-eqz v3, :cond_2c
add-int/lit8 v0, v0, 0x1
.line 179
.end local v2 # "c":Lokhttp3/RealCall$AsyncCall;
:cond_2c
goto :goto_7
.line 180
:cond_2d
return v0
.end method
# virtual methods
.method public declared-synchronized cancelAll()V
.registers 4
monitor-enter p0
.line 143
:try_start_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
:goto_7
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_1b
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lokhttp3/RealCall$AsyncCall;
.line 144
.local v1, "call":Lokhttp3/RealCall$AsyncCall;
invoke-virtual {v1}, Lokhttp3/RealCall$AsyncCall;->get()Lokhttp3/RealCall;
move-result-object v2
invoke-virtual {v2}, Lokhttp3/RealCall;->cancel()V
.line 145
.end local v1 # "call":Lokhttp3/RealCall$AsyncCall;
goto :goto_7
.line 147
.end local p0 # "this":Lokhttp3/Dispatcher;
:cond_1b
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_21
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_35
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lokhttp3/RealCall$AsyncCall;
.line 148
.restart local v1 # "call":Lokhttp3/RealCall$AsyncCall;
invoke-virtual {v1}, Lokhttp3/RealCall$AsyncCall;->get()Lokhttp3/RealCall;
move-result-object v2
invoke-virtual {v2}, Lokhttp3/RealCall;->cancel()V
.line 149
.end local v1 # "call":Lokhttp3/RealCall$AsyncCall;
goto :goto_21
.line 151
:cond_35
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_3b
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v1
if-eqz v1, :cond_4b
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lokhttp3/RealCall;
.line 152
.local v1, "call":Lokhttp3/RealCall;
invoke-virtual {v1}, Lokhttp3/RealCall;->cancel()V
:try_end_4a
.catchall {:try_start_1 .. :try_end_4a} :catchall_4d
.line 153
.end local v1 # "call":Lokhttp3/RealCall;
goto :goto_3b
.line 154
:cond_4b
monitor-exit p0
return-void
.line 142
:catchall_4d
move-exception v0
monitor-exit p0
goto :goto_51
:goto_50
throw v0
:goto_51
goto :goto_50
.end method
.method declared-synchronized enqueue(Lokhttp3/RealCall$AsyncCall;)V
.registers 4
.param p1, "call" # Lokhttp3/RealCall$AsyncCall;
monitor-enter p0
.line 130
:try_start_1
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_20
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_20
.line 131
iget-object v0, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/Deque;
invoke-interface {v0, p1}, Ljava/util/Deque;->add(Ljava/lang/Object;)Z
.line 132
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_25
.line 134
.end local p0 # "this":Lokhttp3/Dispatcher;
:cond_20
iget-object v0, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/Deque;
invoke-interface {v0, p1}, Ljava/util/Deque;->add(Ljava/lang/Object;)Z
:try_end_25
.catchall {:try_start_1 .. :try_end_25} :catchall_27
.line 136
:goto_25
monitor-exit p0
return-void
.line 129
.end local p1 # "call":Lokhttp3/RealCall$AsyncCall;
:catchall_27
move-exception p1
monitor-exit p0
throw p1
.end method
.method declared-synchronized executed(Lokhttp3/RealCall;)V
.registers 3
.param p1, "call" # Lokhttp3/RealCall;
monitor-enter p0
.line 185
:try_start_1
iget-object v0, p0, Lokhttp3/Dispatcher;->runningSyncCalls:Ljava/util/Deque;
invoke-interface {v0, p1}, Ljava/util/Deque;->add(Ljava/lang/Object;)Z
:try_end_6
.catchall {:try_start_1 .. :try_end_6} :catchall_8
.line 186
monitor-exit p0
return-void
.line 184
.end local p0 # "this":Lokhttp3/Dispatcher;
.end local p1 # "call":Lokhttp3/RealCall;
:catchall_8
move-exception p1
monitor-exit p0
throw p1
.end method
.method public declared-synchronized executorService()Ljava/util/concurrent/ExecutorService;
.registers 10
monitor-enter p0
.line 64
:try_start_1
iget-object v0, p0, Lokhttp3/Dispatcher;->executorService:Ljava/util/concurrent/ExecutorService;
if-nez v0, :cond_21
.line 65
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
.line 66
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;
.line 68
.end local p0 # "this":Lokhttp3/Dispatcher;
:cond_21
iget-object v0, p0, Lokhttp3/Dispatcher;->executorService:Ljava/util/concurrent/ExecutorService;
:try_end_23
.catchall {:try_start_1 .. :try_end_23} :catchall_25
monitor-exit p0
return-object v0
.line 63
:catchall_25
move-exception v0
monitor-exit p0
throw v0
.end method
.method finished(Lokhttp3/RealCall$AsyncCall;)V
.registers 4
.param p1, "call" # Lokhttp3/RealCall$AsyncCall;
.line 190
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
.line 191
return-void
.end method
.method finished(Lokhttp3/RealCall;)V
.registers 4
.param p1, "call" # Lokhttp3/RealCall;
.line 195
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
.line 196
return-void
.end method
.method public declared-synchronized getMaxRequests()I
.registers 2
monitor-enter p0
.line 87
:try_start_1
iget v0, p0, Lokhttp3/Dispatcher;->maxRequests:I
:try_end_3
.catchall {:try_start_1 .. :try_end_3} :catchall_5
monitor-exit p0
return v0
.end local p0 # "this":Lokhttp3/Dispatcher;
:catchall_5
move-exception v0
monitor-exit p0
throw v0
.end method
.method public declared-synchronized getMaxRequestsPerHost()I
.registers 2
monitor-enter p0
.line 110
:try_start_1
iget v0, p0, Lokhttp3/Dispatcher;->maxRequestsPerHost:I
:try_end_3
.catchall {:try_start_1 .. :try_end_3} :catchall_5
monitor-exit p0
return v0
.end local p0 # "this":Lokhttp3/Dispatcher;
:catchall_5
move-exception v0
monitor-exit p0
throw v0
.end method
.method public declared-synchronized queuedCalls()Ljava/util/List;
.registers 5
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/List<",
"Lokhttp3/Call;",
">;"
}
.end annotation
monitor-enter p0
.line 215
:try_start_1
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
.line 216
.local v0, "result":Ljava/util/List;, "Ljava/util/List<Lokhttp3/Call;>;"
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_c
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_21
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Lokhttp3/RealCall$AsyncCall;
.line 217
.local v2, "asyncCall":Lokhttp3/RealCall$AsyncCall;
invoke-virtual {v2}, Lokhttp3/RealCall$AsyncCall;->get()Lokhttp3/RealCall;
move-result-object v3
invoke-interface {v0, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 218
nop
.end local v2 # "asyncCall":Lokhttp3/RealCall$AsyncCall;
goto :goto_c
.line 219
.end local p0 # "this":Lokhttp3/Dispatcher;
:cond_21
invoke-static {v0}, Ljava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List;
move-result-object v1
:try_end_25
.catchall {:try_start_1 .. :try_end_25} :catchall_27
monitor-exit p0
return-object v1
.line 214
.end local v0 # "result":Ljava/util/List;, "Ljava/util/List<Lokhttp3/Call;>;"
:catchall_27
move-exception v0
monitor-exit p0
goto :goto_2b
:goto_2a
throw v0
:goto_2b
goto :goto_2a
.end method
.method public declared-synchronized queuedCallsCount()I
.registers 2
monitor-enter p0
.line 233
:try_start_1
iget-object v0, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/Deque;
invoke-interface {v0}, Ljava/util/Deque;->size()I
move-result v0
:try_end_7
.catchall {:try_start_1 .. :try_end_7} :catchall_9
monitor-exit p0
return v0
.end local p0 # "this":Lokhttp3/Dispatcher;
:catchall_9
move-exception v0
monitor-exit p0
throw v0
.end method
.method public declared-synchronized runningCalls()Ljava/util/List;
.registers 5
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/List<",
"Lokhttp3/Call;",
">;"
}
.end annotation
monitor-enter p0
.line 224
:try_start_1
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
.line 225
.local v0, "result":Ljava/util/List;, "Ljava/util/List<Lokhttp3/Call;>;"
iget-object v1, p0, Lokhttp3/Dispatcher;->runningSyncCalls:Ljava/util/Deque;
invoke-interface {v0, v1}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z
.line 226
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_11
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_26
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v2
check-cast v2, Lokhttp3/RealCall$AsyncCall;
.line 227
.local v2, "asyncCall":Lokhttp3/RealCall$AsyncCall;
invoke-virtual {v2}, Lokhttp3/RealCall$AsyncCall;->get()Lokhttp3/RealCall;
move-result-object v3
invoke-interface {v0, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
.line 228
nop
.end local v2 # "asyncCall":Lokhttp3/RealCall$AsyncCall;
goto :goto_11
.line 229
.end local p0 # "this":Lokhttp3/Dispatcher;
:cond_26
invoke-static {v0}, Ljava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List;
move-result-object v1
:try_end_2a
.catchall {:try_start_1 .. :try_end_2a} :catchall_2c
monitor-exit p0
return-object v1
.line 223
.end local v0 # "result":Ljava/util/List;, "Ljava/util/List<Lokhttp3/Call;>;"
:catchall_2c
move-exception v0
monitor-exit p0
goto :goto_30
:goto_2f
throw v0
:goto_30
goto :goto_2f
.end method
.method public declared-synchronized runningCallsCount()I
.registers 3
monitor-enter p0
.line 237
:try_start_1
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_d
.catchall {:try_start_1 .. :try_end_d} :catchall_10
add-int/2addr v0, v1
monitor-exit p0
return v0
.end local p0 # "this":Lokhttp3/Dispatcher;
:catchall_10
move-exception v0
monitor-exit p0
throw v0
.end method
.method public declared-synchronized setIdleCallback(Ljava/lang/Runnable;)V
.registers 2
.param p1, "idleCallback" # Ljava/lang/Runnable;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
monitor-enter p0
.line 126
:try_start_1
iput-object p1, p0, Lokhttp3/Dispatcher;->idleCallback:Ljava/lang/Runnable;
:try_end_3
.catchall {:try_start_1 .. :try_end_3} :catchall_5
.line 127
monitor-exit p0
return-void
.line 125
.end local p0 # "this":Lokhttp3/Dispatcher;
.end local p1 # "idleCallback":Ljava/lang/Runnable;
:catchall_5
move-exception p1
monitor-exit p0
throw p1
.end method
.method public declared-synchronized setMaxRequests(I)V
.registers 5
.param p1, "maxRequests" # I
monitor-enter p0
.line 79
const/4 v0, 0x1
if-lt p1, v0, :cond_d
.line 82
:try_start_4
iput p1, p0, Lokhttp3/Dispatcher;->maxRequests:I
.line 83
invoke-direct {p0}, Lokhttp3/Dispatcher;->promoteCalls()V
:try_end_9
.catchall {:try_start_4 .. :try_end_9} :catchall_b
.line 84
monitor-exit p0
return-void
.line 78
.end local p0 # "this":Lokhttp3/Dispatcher;
.end local p1 # "maxRequests":I
:catchall_b
move-exception p1
goto :goto_24
.line 80
.restart local p1 # "maxRequests":I
:cond_d
:try_start_d
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 v1
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
:try_end_24
.catchall {:try_start_d .. :try_end_24} :catchall_b
.line 78
.end local p1 # "maxRequests":I
:goto_24
monitor-exit p0
throw p1
.end method
.method public declared-synchronized setMaxRequestsPerHost(I)V
.registers 5
.param p1, "maxRequestsPerHost" # I
monitor-enter p0
.line 102
const/4 v0, 0x1
if-lt p1, v0, :cond_d
.line 105
:try_start_4
iput p1, p0, Lokhttp3/Dispatcher;->maxRequestsPerHost:I
.line 106
invoke-direct {p0}, Lokhttp3/Dispatcher;->promoteCalls()V
:try_end_9
.catchall {:try_start_4 .. :try_end_9} :catchall_b
.line 107
monitor-exit p0
return-void
.line 101
.end local p0 # "this":Lokhttp3/Dispatcher;
.end local p1 # "maxRequestsPerHost":I
:catchall_b
move-exception p1
goto :goto_24
.line 103
.restart local p1 # "maxRequestsPerHost":I
:cond_d
:try_start_d
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 v1
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
:try_end_24
.catchall {:try_start_d .. :try_end_24} :catchall_b
.line 101
.end local p1 # "maxRequestsPerHost":I
:goto_24
monitor-exit p0
throw p1
.end method