CronetBidirectionalStream.smali
.class public Laegon/chrome/net/impl/CronetBidirectionalStream;
.super Laegon/chrome/net/ExperimentalBidirectionalStream;
# annotations
.annotation build Laegon/chrome/base/VisibleForTesting;
.end annotation
.annotation runtime Laegon/chrome/base/annotations/JNINamespace;
value = "cronet"
.end annotation
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Laegon/chrome/net/impl/CronetBidirectionalStream$OnWriteCompletedRunnable;,
Laegon/chrome/net/impl/CronetBidirectionalStream$OnReadCompletedRunnable;,
Laegon/chrome/net/impl/CronetBidirectionalStream$State;
}
.end annotation
# static fields
.field static final synthetic $assertionsDisabled:Z
# instance fields
.field private final mCallback:Laegon/chrome/net/impl/VersionSafeCallbacks$BidirectionalStreamCallback;
.field private final mDelayRequestHeadersUntilFirstFlush:Z
.field private mEndOfStreamWritten:Z
.annotation build Ljavax/annotation/concurrent/GuardedBy;
value = "mNativeStreamLock"
.end annotation
.end field
.field private mException:Laegon/chrome/net/CronetException;
.field private final mExecutor:Ljava/util/concurrent/Executor;
.field private mFlushData:Ljava/util/LinkedList;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/LinkedList",
"<",
"Ljava/nio/ByteBuffer;",
">;"
}
.end annotation
.annotation build Ljavax/annotation/concurrent/GuardedBy;
value = "mNativeStreamLock"
.end annotation
.end field
.field private final mInitialMethod:Ljava/lang/String;
.field private final mInitialPriority:I
.field private final mInitialUrl:Ljava/lang/String;
.field private mMetrics:Laegon/chrome/net/RequestFinishedInfo$Metrics;
.annotation build Ljavax/annotation/concurrent/GuardedBy;
value = "mNativeStreamLock"
.end annotation
.end field
.field private mNativeStream:J
.annotation build Ljavax/annotation/concurrent/GuardedBy;
value = "mNativeStreamLock"
.end annotation
.end field
.field private final mNativeStreamLock:Ljava/lang/Object;
.field private mOnDestroyedCallbackForTesting:Ljava/lang/Runnable;
.field private mOnReadCompletedTask:Laegon/chrome/net/impl/CronetBidirectionalStream$OnReadCompletedRunnable;
.field private mPendingData:Ljava/util/LinkedList;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/LinkedList",
"<",
"Ljava/nio/ByteBuffer;",
">;"
}
.end annotation
.annotation build Ljavax/annotation/concurrent/GuardedBy;
value = "mNativeStreamLock"
.end annotation
.end field
.field private mReadState:I
.annotation build Ljavax/annotation/concurrent/GuardedBy;
value = "mNativeStreamLock"
.end annotation
.end field
.field private final mRequestAnnotations:Ljava/util/Collection;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/Collection",
"<",
"Ljava/lang/Object;",
">;"
}
.end annotation
.end field
.field private final mRequestContext:Laegon/chrome/net/impl/CronetUrlRequestContext;
.field private final mRequestHeaders:[Ljava/lang/String;
.field private mRequestHeadersSent:Z
.annotation build Ljavax/annotation/concurrent/GuardedBy;
value = "mNativeStreamLock"
.end annotation
.end field
.field private mResponseInfo:Laegon/chrome/net/impl/UrlResponseInfoImpl;
.field private final mTrafficStatsTag:I
.field private final mTrafficStatsTagSet:Z
.field private final mTrafficStatsUid:I
.field private final mTrafficStatsUidSet:Z
.field private mWriteState:I
.annotation build Ljavax/annotation/concurrent/GuardedBy;
value = "mNativeStreamLock"
.end annotation
.end field
# direct methods
.method static constructor <clinit>()V
.registers 1
const-class v0, Laegon/chrome/net/impl/CronetBidirectionalStream;
invoke-virtual {v0}, Ljava/lang/Class;->desiredAssertionStatus()Z
move-result v0
if-nez v0, :cond_c
const/4 v0, 0x1
:goto_9
sput-boolean v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->$assertionsDisabled:Z
return-void
:cond_c
const/4 v0, 0x0
goto :goto_9
.end method
.method constructor <init>(Laegon/chrome/net/impl/CronetUrlRequestContext;Ljava/lang/String;ILaegon/chrome/net/BidirectionalStream$Callback;Ljava/util/concurrent/Executor;Ljava/lang/String;Ljava/util/List;ZLjava/util/Collection;ZIZI)V
.registers 16
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Laegon/chrome/net/impl/CronetUrlRequestContext;",
"Ljava/lang/String;",
"I",
"Laegon/chrome/net/BidirectionalStream$Callback;",
"Ljava/util/concurrent/Executor;",
"Ljava/lang/String;",
"Ljava/util/List",
"<",
"Ljava/util/Map$Entry",
"<",
"Ljava/lang/String;",
"Ljava/lang/String;",
">;>;Z",
"Ljava/util/Collection",
"<",
"Ljava/lang/Object;",
">;ZIZI)V"
}
.end annotation
const/4 v1, 0x0
invoke-direct {p0}, Laegon/chrome/net/ExperimentalBidirectionalStream;-><init>()V
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
iput-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStreamLock:Ljava/lang/Object;
iput v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
iput v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mWriteState:I
iput-object p1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mRequestContext:Laegon/chrome/net/impl/CronetUrlRequestContext;
iput-object p2, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mInitialUrl:Ljava/lang/String;
invoke-static {p3}, Laegon/chrome/net/impl/CronetBidirectionalStream;->convertStreamPriority(I)I
move-result v0
iput v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mInitialPriority:I
new-instance v0, Laegon/chrome/net/impl/VersionSafeCallbacks$BidirectionalStreamCallback;
invoke-direct {v0, p4}, Laegon/chrome/net/impl/VersionSafeCallbacks$BidirectionalStreamCallback;-><init>(Laegon/chrome/net/BidirectionalStream$Callback;)V
iput-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mCallback:Laegon/chrome/net/impl/VersionSafeCallbacks$BidirectionalStreamCallback;
iput-object p5, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mExecutor:Ljava/util/concurrent/Executor;
iput-object p6, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mInitialMethod:Ljava/lang/String;
invoke-static {p7}, Laegon/chrome/net/impl/CronetBidirectionalStream;->stringsFromHeaderList(Ljava/util/List;)[Ljava/lang/String;
move-result-object v0
iput-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mRequestHeaders:[Ljava/lang/String;
iput-boolean p8, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mDelayRequestHeadersUntilFirstFlush:Z
new-instance v0, Ljava/util/LinkedList;
invoke-direct {v0}, Ljava/util/LinkedList;-><init>()V
iput-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mPendingData:Ljava/util/LinkedList;
new-instance v0, Ljava/util/LinkedList;
invoke-direct {v0}, Ljava/util/LinkedList;-><init>()V
iput-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mFlushData:Ljava/util/LinkedList;
iput-object p9, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mRequestAnnotations:Ljava/util/Collection;
iput-boolean p10, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mTrafficStatsTagSet:Z
iput p11, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mTrafficStatsTag:I
iput-boolean p12, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mTrafficStatsUidSet:Z
iput p13, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mTrafficStatsUid:I
return-void
.end method
.method static synthetic access$000(Laegon/chrome/net/impl/CronetBidirectionalStream;)Ljava/lang/Object;
.registers 2
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStreamLock:Ljava/lang/Object;
return-object v0
.end method
.method static synthetic access$100(Laegon/chrome/net/impl/CronetBidirectionalStream;)Z
.registers 2
invoke-direct {p0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->isDoneLocked()Z
move-result v0
return v0
.end method
.method static synthetic access$1000(Laegon/chrome/net/impl/CronetBidirectionalStream;)Ljava/lang/String;
.registers 2
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mInitialMethod:Ljava/lang/String;
return-object v0
.end method
.method static synthetic access$1100(Ljava/lang/String;)Z
.registers 2
invoke-static {p0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->doesMethodAllowWriteData(Ljava/lang/String;)Z
move-result v0
return v0
.end method
.method static synthetic access$1200(Laegon/chrome/net/impl/CronetBidirectionalStream;Laegon/chrome/net/CronetException;)V
.registers 2
invoke-direct {p0, p1}, Laegon/chrome/net/impl/CronetBidirectionalStream;->failWithExceptionOnExecutor(Laegon/chrome/net/CronetException;)V
return-void
.end method
.method static synthetic access$200(Laegon/chrome/net/impl/CronetBidirectionalStream;)I
.registers 2
iget v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
return v0
.end method
.method static synthetic access$202(Laegon/chrome/net/impl/CronetBidirectionalStream;I)I
.registers 2
iput p1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
return p1
.end method
.method static synthetic access$300(Laegon/chrome/net/impl/CronetBidirectionalStream;)I
.registers 2
iget v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mWriteState:I
return v0
.end method
.method static synthetic access$302(Laegon/chrome/net/impl/CronetBidirectionalStream;I)I
.registers 2
iput p1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mWriteState:I
return p1
.end method
.method static synthetic access$400(Laegon/chrome/net/impl/CronetBidirectionalStream;)Laegon/chrome/net/impl/UrlResponseInfoImpl;
.registers 2
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mResponseInfo:Laegon/chrome/net/impl/UrlResponseInfoImpl;
return-object v0
.end method
.method static synthetic access$500(Laegon/chrome/net/impl/CronetBidirectionalStream;)Laegon/chrome/net/impl/VersionSafeCallbacks$BidirectionalStreamCallback;
.registers 2
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mCallback:Laegon/chrome/net/impl/VersionSafeCallbacks$BidirectionalStreamCallback;
return-object v0
.end method
.method static synthetic access$600(Laegon/chrome/net/impl/CronetBidirectionalStream;)V
.registers 1
invoke-direct {p0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->maybeOnSucceededOnExecutor()V
return-void
.end method
.method static synthetic access$700(Laegon/chrome/net/impl/CronetBidirectionalStream;Ljava/lang/Exception;)V
.registers 2
invoke-direct {p0, p1}, Laegon/chrome/net/impl/CronetBidirectionalStream;->onCallbackException(Ljava/lang/Exception;)V
return-void
.end method
.method static synthetic access$900(Laegon/chrome/net/impl/CronetBidirectionalStream;)Z
.registers 2
iget-boolean v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mRequestHeadersSent:Z
return v0
.end method
.method static synthetic access$902(Laegon/chrome/net/impl/CronetBidirectionalStream;Z)Z
.registers 2
iput-boolean p1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mRequestHeadersSent:Z
return p1
.end method
.method private static convertStreamPriority(I)I
.registers 3
packed-switch p0, :pswitch_data_16
new-instance v0, Ljava/lang/IllegalArgumentException;
const-string v1, "Invalid stream priority."
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
:pswitch_b
const/4 v0, 0x1
:goto_c
return v0
:pswitch_d
const/4 v0, 0x2
goto :goto_c
:pswitch_f
const/4 v0, 0x3
goto :goto_c
:pswitch_11
const/4 v0, 0x4
goto :goto_c
:pswitch_13
const/4 v0, 0x5
goto :goto_c
nop
:pswitch_data_16
.packed-switch 0x0
:pswitch_b
:pswitch_d
:pswitch_f
:pswitch_11
:pswitch_13
.end packed-switch
.end method
.method private destroyNativeStreamLocked(Z)V
.registers 8
.annotation build Ljavax/annotation/concurrent/GuardedBy;
value = "mNativeStreamLock"
.end annotation
const-wide/16 v4, 0x0
sget-object v0, Laegon/chrome/net/impl/CronetUrlRequestContext;->LOG_TAG:Ljava/lang/String;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "destroyNativeStreamLocked "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object v2
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
const/4 v2, 0x0
new-array v2, v2, [Ljava/lang/Object;
invoke-static {v0, v1, v2}, Laegon/chrome/base/Log;->i(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
iget-wide v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStream:J
cmp-long v0, v0, v4
if-nez v0, :cond_28
:cond_27
:goto_27
return-void
:cond_28
iget-wide v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStream:J
invoke-direct {p0, v0, v1, p1}, Laegon/chrome/net/impl/CronetBidirectionalStream;->nativeDestroy(JZ)V
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mRequestContext:Laegon/chrome/net/impl/CronetUrlRequestContext;
invoke-virtual {v0}, Laegon/chrome/net/impl/CronetUrlRequestContext;->onRequestDestroyed()V
iput-wide v4, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStream:J
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mOnDestroyedCallbackForTesting:Ljava/lang/Runnable;
if-eqz v0, :cond_27
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mOnDestroyedCallbackForTesting:Ljava/lang/Runnable;
invoke-interface {v0}, Ljava/lang/Runnable;->run()V
goto :goto_27
.end method
.method private static doesMethodAllowWriteData(Ljava/lang/String;)Z
.registers 2
const-string v0, "GET"
invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-nez v0, :cond_12
const-string v0, "HEAD"
invoke-virtual {p0, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-nez v0, :cond_12
const/4 v0, 0x1
:goto_11
return v0
:cond_12
const/4 v0, 0x0
goto :goto_11
.end method
.method private failWithException(Laegon/chrome/net/CronetException;)V
.registers 3
new-instance v0, Laegon/chrome/net/impl/CronetBidirectionalStream$5;
invoke-direct {v0, p0, p1}, Laegon/chrome/net/impl/CronetBidirectionalStream$5;-><init>(Laegon/chrome/net/impl/CronetBidirectionalStream;Laegon/chrome/net/CronetException;)V
invoke-direct {p0, v0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->postTaskToExecutor(Ljava/lang/Runnable;)V
return-void
.end method
.method private failWithExceptionOnExecutor(Laegon/chrome/net/CronetException;)V
.registers 7
const/4 v4, 0x0
iput-object p1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mException:Laegon/chrome/net/CronetException;
iget-object v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStreamLock:Ljava/lang/Object;
monitor-enter v1
:try_start_6
invoke-direct {p0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->isDoneLocked()Z
move-result v0
if-eqz v0, :cond_e
monitor-exit v1
:goto_d
return-void
:cond_e
const/4 v0, 0x6
iput v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mWriteState:I
iput v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
const/4 v0, 0x0
invoke-direct {p0, v0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->destroyNativeStreamLocked(Z)V
monitor-exit v1
:try_end_18
.catchall {:try_start_6 .. :try_end_18} :catchall_2e
:try_start_18
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mCallback:Laegon/chrome/net/impl/VersionSafeCallbacks$BidirectionalStreamCallback;
iget-object v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mResponseInfo:Laegon/chrome/net/impl/UrlResponseInfoImpl;
invoke-virtual {v0, p0, v1, p1}, Laegon/chrome/net/impl/VersionSafeCallbacks$BidirectionalStreamCallback;->onFailed(Laegon/chrome/net/BidirectionalStream;Laegon/chrome/net/UrlResponseInfo;Laegon/chrome/net/CronetException;)V
:try_end_1f
.catch Ljava/lang/Exception; {:try_start_18 .. :try_end_1f} :catch_20
goto :goto_d
:catch_20
move-exception v0
sget-object v1, Laegon/chrome/net/impl/CronetUrlRequestContext;->LOG_TAG:Ljava/lang/String;
const-string v2, "Exception notifying of failed request"
const/4 v3, 0x1
new-array v3, v3, [Ljava/lang/Object;
aput-object v0, v3, v4
invoke-static {v1, v2, v3}, Laegon/chrome/base/Log;->e(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
goto :goto_d
:catchall_2e
move-exception v0
:try_start_2f
monitor-exit v1
:try_end_30
.catchall {:try_start_2f .. :try_end_30} :catchall_2e
throw v0
.end method
.method private static headersListFromStrings([Ljava/lang/String;)Ljava/util/ArrayList;
.registers 6
.annotation system Ldalvik/annotation/Signature;
value = {
"([",
"Ljava/lang/String;",
")",
"Ljava/util/ArrayList",
"<",
"Ljava/util/Map$Entry",
"<",
"Ljava/lang/String;",
"Ljava/lang/String;",
">;>;"
}
.end annotation
new-instance v1, Ljava/util/ArrayList;
array-length v0, p0
div-int/lit8 v0, v0, 0x2
invoke-direct {v1, v0}, Ljava/util/ArrayList;-><init>(I)V
const/4 v0, 0x0
:goto_9
array-length v2, p0
if-ge v0, v2, :cond_1d
new-instance v2, Ljava/util/AbstractMap$SimpleImmutableEntry;
aget-object v3, p0, v0
add-int/lit8 v4, v0, 0x1
aget-object v4, p0, v4
invoke-direct {v2, v3, v4}, Ljava/util/AbstractMap$SimpleImmutableEntry;-><init>(Ljava/lang/Object;Ljava/lang/Object;)V
invoke-virtual {v1, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
add-int/lit8 v0, v0, 0x2
goto :goto_9
:cond_1d
return-object v1
.end method
.method private isDoneLocked()Z
.registers 5
.annotation build Ljavax/annotation/concurrent/GuardedBy;
value = "mNativeStreamLock"
.end annotation
iget v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
if-eqz v0, :cond_e
iget-wide v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStream:J
const-wide/16 v2, 0x0
cmp-long v0, v0, v2
if-nez v0, :cond_e
const/4 v0, 0x1
:goto_d
return v0
:cond_e
const/4 v0, 0x0
goto :goto_d
.end method
.method private maybeOnSucceededOnExecutor()V
.registers 6
const/4 v4, 0x0
iget-object v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStreamLock:Ljava/lang/Object;
monitor-enter v1
:try_start_4
invoke-direct {p0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->isDoneLocked()Z
move-result v0
if-eqz v0, :cond_c
monitor-exit v1
:goto_b
return-void
:cond_c
iget v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mWriteState:I
const/16 v2, 0xa
if-ne v0, v2, :cond_17
iget v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
const/4 v2, 0x4
if-eq v0, v2, :cond_1c
:cond_17
monitor-exit v1
goto :goto_b
:catchall_19
move-exception v0
monitor-exit v1
:try_end_1b
.catchall {:try_start_4 .. :try_end_1b} :catchall_19
throw v0
:cond_1c
const/4 v0, 0x7
:try_start_1d
iput v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mWriteState:I
iput v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
const/4 v0, 0x0
invoke-direct {p0, v0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->destroyNativeStreamLocked(Z)V
monitor-exit v1
:try_end_26
.catchall {:try_start_1d .. :try_end_26} :catchall_19
:try_start_26
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mCallback:Laegon/chrome/net/impl/VersionSafeCallbacks$BidirectionalStreamCallback;
iget-object v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mResponseInfo:Laegon/chrome/net/impl/UrlResponseInfoImpl;
invoke-virtual {v0, p0, v1}, Laegon/chrome/net/impl/VersionSafeCallbacks$BidirectionalStreamCallback;->onSucceeded(Laegon/chrome/net/BidirectionalStream;Laegon/chrome/net/UrlResponseInfo;)V
:try_end_2d
.catch Ljava/lang/Exception; {:try_start_26 .. :try_end_2d} :catch_2e
goto :goto_b
:catch_2e
move-exception v0
sget-object v1, Laegon/chrome/net/impl/CronetUrlRequestContext;->LOG_TAG:Ljava/lang/String;
const-string v2, "Exception in onSucceeded method"
const/4 v3, 0x1
new-array v3, v3, [Ljava/lang/Object;
aput-object v0, v3, v4
invoke-static {v1, v2, v3}, Laegon/chrome/base/Log;->e(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
goto :goto_b
.end method
.method private native nativeCreateBidirectionalStream(JZZZIZI)J
.end method
.method private native nativeDestroy(JZ)V
.annotation runtime Laegon/chrome/base/annotations/NativeClassQualifiedName;
value = "CronetBidirectionalStreamAdapter"
.end annotation
.end method
.method private native nativeReadData(JLjava/nio/ByteBuffer;II)Z
.annotation runtime Laegon/chrome/base/annotations/NativeClassQualifiedName;
value = "CronetBidirectionalStreamAdapter"
.end annotation
.end method
.method private native nativeSendRequestHeaders(J)V
.annotation runtime Laegon/chrome/base/annotations/NativeClassQualifiedName;
value = "CronetBidirectionalStreamAdapter"
.end annotation
.end method
.method private native nativeStart(JLjava/lang/String;ILjava/lang/String;[Ljava/lang/String;Z)I
.annotation runtime Laegon/chrome/base/annotations/NativeClassQualifiedName;
value = "CronetBidirectionalStreamAdapter"
.end annotation
.end method
.method private native nativeWritevData(J[Ljava/nio/ByteBuffer;[I[IZ)Z
.annotation runtime Laegon/chrome/base/annotations/NativeClassQualifiedName;
value = "CronetBidirectionalStreamAdapter"
.end annotation
.end method
.method private onCallbackException(Ljava/lang/Exception;)V
.registers 7
new-instance v0, Laegon/chrome/net/impl/CallbackExceptionImpl;
const-string v1, "CalledByNative method has thrown an exception"
invoke-direct {v0, v1, p1}, Laegon/chrome/net/impl/CallbackExceptionImpl;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
sget-object v1, Laegon/chrome/net/impl/CronetUrlRequestContext;->LOG_TAG:Ljava/lang/String;
const-string v2, "Exception in CalledByNative method"
const/4 v3, 0x1
new-array v3, v3, [Ljava/lang/Object;
const/4 v4, 0x0
aput-object p1, v3, v4
invoke-static {v1, v2, v3}, Laegon/chrome/base/Log;->e(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
invoke-direct {p0, v0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->failWithExceptionOnExecutor(Laegon/chrome/net/CronetException;)V
return-void
.end method
.method private onCanceled()V
.registers 2
.annotation build Laegon/chrome/base/annotations/CalledByNative;
.end annotation
new-instance v0, Laegon/chrome/net/impl/CronetBidirectionalStream$4;
invoke-direct {v0, p0}, Laegon/chrome/net/impl/CronetBidirectionalStream$4;-><init>(Laegon/chrome/net/impl/CronetBidirectionalStream;)V
invoke-direct {p0, v0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->postTaskToExecutor(Ljava/lang/Runnable;)V
return-void
.end method
.method private onError(IIILjava/lang/String;J)V
.registers 10
.annotation build Laegon/chrome/base/annotations/CalledByNative;
.end annotation
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mResponseInfo:Laegon/chrome/net/impl/UrlResponseInfoImpl;
if-eqz v0, :cond_9
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mResponseInfo:Laegon/chrome/net/impl/UrlResponseInfoImpl;
invoke-virtual {v0, p5, p6}, Laegon/chrome/net/impl/UrlResponseInfoImpl;->setReceivedByteCount(J)V
:cond_9
const/16 v0, 0xa
if-eq p1, v0, :cond_10
const/4 v0, 0x3
if-ne p1, v0, :cond_2c
:cond_10
new-instance v0, Laegon/chrome/net/impl/QuicExceptionImpl;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "Exception in BidirectionalStream: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1, p1, p2, p3}, Laegon/chrome/net/impl/QuicExceptionImpl;-><init>(Ljava/lang/String;III)V
invoke-direct {p0, v0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->failWithException(Laegon/chrome/net/CronetException;)V
:goto_2b
return-void
:cond_2c
new-instance v0, Laegon/chrome/net/impl/BidirectionalStreamNetworkException;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "Exception in BidirectionalStream: "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1, p4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v1
invoke-direct {v0, v1, p1, p2}, Laegon/chrome/net/impl/BidirectionalStreamNetworkException;-><init>(Ljava/lang/String;II)V
invoke-direct {p0, v0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->failWithException(Laegon/chrome/net/CronetException;)V
goto :goto_2b
.end method
.method private onMetricsCollected(JJJJJJJJJJJJJZJJ)V
.registers 69
.annotation build Laegon/chrome/base/annotations/CalledByNative;
.end annotation
move-object/from16 v0, p0
iget-object v0, v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStreamLock:Ljava/lang/Object;
move-object/from16 v35, v0
monitor-enter v35
:try_start_7
move-object/from16 v0, p0
iget-object v2, v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mMetrics:Laegon/chrome/net/RequestFinishedInfo$Metrics;
if-eqz v2, :cond_18
new-instance v2, Ljava/lang/IllegalStateException;
const-string v3, "Metrics collection should only happen once."
invoke-direct {v2, v3}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v2
:catchall_15
move-exception v2
monitor-exit v35
:try_end_17
.catchall {:try_start_7 .. :try_end_17} :catchall_15
throw v2
:cond_18
:try_start_18
new-instance v3, Laegon/chrome/net/impl/CronetMetrics;
move-wide/from16 v4, p1
move-wide/from16 v6, p3
move-wide/from16 v8, p5
move-wide/from16 v10, p7
move-wide/from16 v12, p9
move-wide/from16 v14, p11
move-wide/from16 v16, p13
move-wide/from16 v18, p15
move-wide/from16 v20, p17
move-wide/from16 v22, p19
move-wide/from16 v24, p21
move-wide/from16 v26, p23
move-wide/from16 v28, p25
move/from16 v30, p27
move-wide/from16 v31, p28
move-wide/from16 v33, p30
invoke-direct/range {v3 .. v34}, Laegon/chrome/net/impl/CronetMetrics;-><init>(JJJJJJJJJJJJJZJJ)V
move-object/from16 v0, p0
iput-object v3, v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mMetrics:Laegon/chrome/net/RequestFinishedInfo$Metrics;
sget-boolean v2, Laegon/chrome/net/impl/CronetBidirectionalStream;->$assertionsDisabled:Z
if-nez v2, :cond_55
move-object/from16 v0, p0
iget v2, v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
move-object/from16 v0, p0
iget v3, v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mWriteState:I
if-eq v2, v3, :cond_55
new-instance v2, Ljava/lang/AssertionError;
invoke-direct {v2}, Ljava/lang/AssertionError;-><init>()V
throw v2
:cond_55
sget-boolean v2, Laegon/chrome/net/impl/CronetBidirectionalStream;->$assertionsDisabled:Z
if-nez v2, :cond_74
move-object/from16 v0, p0
iget v2, v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
const/4 v3, 0x7
if-eq v2, v3, :cond_74
move-object/from16 v0, p0
iget v2, v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
const/4 v3, 0x6
if-eq v2, v3, :cond_74
move-object/from16 v0, p0
iget v2, v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
const/4 v3, 0x5
if-eq v2, v3, :cond_74
new-instance v2, Ljava/lang/AssertionError;
invoke-direct {v2}, Ljava/lang/AssertionError;-><init>()V
throw v2
:cond_74
move-object/from16 v0, p0
iget v2, v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
const/4 v3, 0x7
if-ne v2, v3, :cond_9e
const/4 v6, 0x0
:goto_7c
new-instance v2, Laegon/chrome/net/impl/RequestFinishedInfoImpl;
move-object/from16 v0, p0
iget-object v3, v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mInitialUrl:Ljava/lang/String;
move-object/from16 v0, p0
iget-object v4, v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mRequestAnnotations:Ljava/util/Collection;
move-object/from16 v0, p0
iget-object v5, v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mMetrics:Laegon/chrome/net/RequestFinishedInfo$Metrics;
move-object/from16 v0, p0
iget-object v7, v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mResponseInfo:Laegon/chrome/net/impl/UrlResponseInfoImpl;
move-object/from16 v0, p0
iget-object v8, v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mException:Laegon/chrome/net/CronetException;
invoke-direct/range {v2 .. v8}, Laegon/chrome/net/impl/RequestFinishedInfoImpl;-><init>(Ljava/lang/String;Ljava/util/Collection;Laegon/chrome/net/RequestFinishedInfo$Metrics;ILaegon/chrome/net/UrlResponseInfo;Laegon/chrome/net/CronetException;)V
move-object/from16 v0, p0
iget-object v3, v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mRequestContext:Laegon/chrome/net/impl/CronetUrlRequestContext;
invoke-virtual {v3, v2}, Laegon/chrome/net/impl/CronetUrlRequestContext;->reportRequestFinished(Laegon/chrome/net/RequestFinishedInfo;)V
monitor-exit v35
return-void
:cond_9e
move-object/from16 v0, p0
iget v2, v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
:try_end_a2
.catchall {:try_start_18 .. :try_end_a2} :catchall_15
const/4 v3, 0x5
if-ne v2, v3, :cond_a7
const/4 v6, 0x2
goto :goto_7c
:cond_a7
const/4 v6, 0x1
goto :goto_7c
.end method
.method private onReadCompleted(Ljava/nio/ByteBuffer;IIIJ)V
.registers 10
.annotation build Laegon/chrome/base/annotations/CalledByNative;
.end annotation
const/4 v2, 0x0
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mResponseInfo:Laegon/chrome/net/impl/UrlResponseInfoImpl;
invoke-virtual {v0, p5, p6}, Laegon/chrome/net/impl/UrlResponseInfoImpl;->setReceivedByteCount(J)V
invoke-virtual {p1}, Ljava/nio/ByteBuffer;->position()I
move-result v0
if-ne v0, p3, :cond_12
invoke-virtual {p1}, Ljava/nio/ByteBuffer;->limit()I
move-result v0
if-eq v0, p4, :cond_1d
:cond_12
new-instance v0, Laegon/chrome/net/impl/CronetExceptionImpl;
const-string v1, "ByteBuffer modified externally during read"
invoke-direct {v0, v1, v2}, Laegon/chrome/net/impl/CronetExceptionImpl;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
invoke-direct {p0, v0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->failWithException(Laegon/chrome/net/CronetException;)V
:goto_1c
return-void
:cond_1d
if-ltz p2, :cond_23
add-int v0, p3, p2
if-le v0, p4, :cond_2e
:cond_23
new-instance v0, Laegon/chrome/net/impl/CronetExceptionImpl;
const-string v1, "Invalid number of bytes read"
invoke-direct {v0, v1, v2}, Laegon/chrome/net/impl/CronetExceptionImpl;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
invoke-direct {p0, v0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->failWithException(Laegon/chrome/net/CronetException;)V
goto :goto_1c
:cond_2e
add-int v0, p3, p2
invoke-virtual {p1, v0}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer;
sget-boolean v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->$assertionsDisabled:Z
if-nez v0, :cond_43
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mOnReadCompletedTask:Laegon/chrome/net/impl/CronetBidirectionalStream$OnReadCompletedRunnable;
iget-object v0, v0, Laegon/chrome/net/impl/CronetBidirectionalStream$OnReadCompletedRunnable;->mByteBuffer:Ljava/nio/ByteBuffer;
if-eqz v0, :cond_43
new-instance v0, Ljava/lang/AssertionError;
invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V
throw v0
:cond_43
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mOnReadCompletedTask:Laegon/chrome/net/impl/CronetBidirectionalStream$OnReadCompletedRunnable;
iput-object p1, v0, Laegon/chrome/net/impl/CronetBidirectionalStream$OnReadCompletedRunnable;->mByteBuffer:Ljava/nio/ByteBuffer;
iget-object v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mOnReadCompletedTask:Laegon/chrome/net/impl/CronetBidirectionalStream$OnReadCompletedRunnable;
if-nez p2, :cond_54
const/4 v0, 0x1
:goto_4c
iput-boolean v0, v1, Laegon/chrome/net/impl/CronetBidirectionalStream$OnReadCompletedRunnable;->mEndOfStream:Z
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mOnReadCompletedTask:Laegon/chrome/net/impl/CronetBidirectionalStream$OnReadCompletedRunnable;
invoke-direct {p0, v0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->postTaskToExecutor(Ljava/lang/Runnable;)V
goto :goto_1c
:cond_54
const/4 v0, 0x0
goto :goto_4c
.end method
.method private onResponseHeadersReceived(ILjava/lang/String;[Ljava/lang/String;J)V
.registers 10
.annotation build Laegon/chrome/base/annotations/CalledByNative;
.end annotation
:try_start_0
invoke-direct/range {p0 .. p5}, Laegon/chrome/net/impl/CronetBidirectionalStream;->prepareResponseInfoOnNetworkThread(ILjava/lang/String;[Ljava/lang/String;J)Laegon/chrome/net/impl/UrlResponseInfoImpl;
move-result-object v0
iput-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mResponseInfo:Laegon/chrome/net/impl/UrlResponseInfoImpl;
:try_end_6
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_6} :catch_f
new-instance v0, Laegon/chrome/net/impl/CronetBidirectionalStream$2;
invoke-direct {v0, p0}, Laegon/chrome/net/impl/CronetBidirectionalStream$2;-><init>(Laegon/chrome/net/impl/CronetBidirectionalStream;)V
invoke-direct {p0, v0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->postTaskToExecutor(Ljava/lang/Runnable;)V
:goto_e
return-void
:catch_f
move-exception v0
new-instance v0, Laegon/chrome/net/impl/CronetExceptionImpl;
const-string v1, "Cannot prepare ResponseInfo"
const/4 v2, 0x0
invoke-direct {v0, v1, v2}, Laegon/chrome/net/impl/CronetExceptionImpl;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
invoke-direct {p0, v0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->failWithException(Laegon/chrome/net/CronetException;)V
goto :goto_e
.end method
.method private onResponseTrailersReceived([Ljava/lang/String;)V
.registers 4
.annotation build Laegon/chrome/base/annotations/CalledByNative;
.end annotation
new-instance v0, Laegon/chrome/net/impl/UrlResponseInfoImpl$HeaderBlockImpl;
invoke-static {p1}, Laegon/chrome/net/impl/CronetBidirectionalStream;->headersListFromStrings([Ljava/lang/String;)Ljava/util/ArrayList;
move-result-object v1
invoke-direct {v0, v1}, Laegon/chrome/net/impl/UrlResponseInfoImpl$HeaderBlockImpl;-><init>(Ljava/util/List;)V
new-instance v1, Laegon/chrome/net/impl/CronetBidirectionalStream$3;
invoke-direct {v1, p0, v0}, Laegon/chrome/net/impl/CronetBidirectionalStream$3;-><init>(Laegon/chrome/net/impl/CronetBidirectionalStream;Laegon/chrome/net/UrlResponseInfo$HeaderBlock;)V
invoke-direct {p0, v1}, Laegon/chrome/net/impl/CronetBidirectionalStream;->postTaskToExecutor(Ljava/lang/Runnable;)V
return-void
.end method
.method private onStreamReady(Z)V
.registers 3
.annotation build Laegon/chrome/base/annotations/CalledByNative;
.end annotation
new-instance v0, Laegon/chrome/net/impl/CronetBidirectionalStream$1;
invoke-direct {v0, p0, p1}, Laegon/chrome/net/impl/CronetBidirectionalStream$1;-><init>(Laegon/chrome/net/impl/CronetBidirectionalStream;Z)V
invoke-direct {p0, v0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->postTaskToExecutor(Ljava/lang/Runnable;)V
return-void
.end method
.method private onWritevCompleted([Ljava/nio/ByteBuffer;[I[IZ)V
.registers 10
.annotation build Laegon/chrome/base/annotations/CalledByNative;
.end annotation
const/4 v1, 0x0
sget-boolean v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->$assertionsDisabled:Z
if-nez v0, :cond_f
array-length v0, p1
array-length v2, p2
if-eq v0, v2, :cond_f
new-instance v0, Ljava/lang/AssertionError;
invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V
throw v0
:cond_f
sget-boolean v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->$assertionsDisabled:Z
if-nez v0, :cond_1d
array-length v0, p1
array-length v2, p3
if-eq v0, v2, :cond_1d
new-instance v0, Ljava/lang/AssertionError;
invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V
throw v0
:cond_1d
iget-object v2, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStreamLock:Ljava/lang/Object;
monitor-enter v2
:try_start_20
invoke-direct {p0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->isDoneLocked()Z
move-result v0
if-eqz v0, :cond_28
monitor-exit v2
:cond_27
:goto_27
return-void
:cond_28
const/16 v0, 0x8
iput v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mWriteState:I
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mFlushData:Ljava/util/LinkedList;
invoke-virtual {v0}, Ljava/util/LinkedList;->isEmpty()Z
move-result v0
if-nez v0, :cond_37
invoke-direct {p0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->sendFlushDataLocked()V
:cond_37
monitor-exit v2
:try_end_38
.catchall {:try_start_20 .. :try_end_38} :catchall_5a
move v0, v1
:goto_39
array-length v2, p1
if-ge v0, v2, :cond_27
aget-object v3, p1, v0
invoke-virtual {v3}, Ljava/nio/ByteBuffer;->position()I
move-result v2
aget v4, p2, v0
if-ne v2, v4, :cond_4e
invoke-virtual {v3}, Ljava/nio/ByteBuffer;->limit()I
move-result v2
aget v4, p3, v0
if-eq v2, v4, :cond_5d
:cond_4e
new-instance v0, Laegon/chrome/net/impl/CronetExceptionImpl;
const-string v1, "ByteBuffer modified externally during write"
const/4 v2, 0x0
invoke-direct {v0, v1, v2}, Laegon/chrome/net/impl/CronetExceptionImpl;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
invoke-direct {p0, v0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->failWithException(Laegon/chrome/net/CronetException;)V
goto :goto_27
:catchall_5a
move-exception v0
:try_start_5b
monitor-exit v2
:try_end_5c
.catchall {:try_start_5b .. :try_end_5c} :catchall_5a
throw v0
:cond_5d
invoke-virtual {v3}, Ljava/nio/ByteBuffer;->limit()I
move-result v2
invoke-virtual {v3, v2}, Ljava/nio/ByteBuffer;->position(I)Ljava/nio/Buffer;
new-instance v4, Laegon/chrome/net/impl/CronetBidirectionalStream$OnWriteCompletedRunnable;
if-eqz p4, :cond_77
array-length v2, p1
add-int/lit8 v2, v2, -0x1
if-ne v0, v2, :cond_77
const/4 v2, 0x1
:goto_6e
invoke-direct {v4, p0, v3, v2}, Laegon/chrome/net/impl/CronetBidirectionalStream$OnWriteCompletedRunnable;-><init>(Laegon/chrome/net/impl/CronetBidirectionalStream;Ljava/nio/ByteBuffer;Z)V
invoke-direct {p0, v4}, Laegon/chrome/net/impl/CronetBidirectionalStream;->postTaskToExecutor(Ljava/lang/Runnable;)V
add-int/lit8 v0, v0, 0x1
goto :goto_39
:cond_77
move v2, v1
goto :goto_6e
.end method
.method private postTaskToExecutor(Ljava/lang/Runnable;)V
.registers 7
const/4 v4, 0x0
:try_start_1
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mExecutor:Ljava/util/concurrent/Executor;
invoke-interface {v0, p1}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
:try_end_6
.catch Ljava/util/concurrent/RejectedExecutionException; {:try_start_1 .. :try_end_6} :catch_7
:goto_6
return-void
:catch_7
move-exception v0
sget-object v1, Laegon/chrome/net/impl/CronetUrlRequestContext;->LOG_TAG:Ljava/lang/String;
const-string v2, "Exception posting task to executor"
const/4 v3, 0x1
new-array v3, v3, [Ljava/lang/Object;
aput-object v0, v3, v4
invoke-static {v1, v2, v3}, Laegon/chrome/base/Log;->e(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V
iget-object v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStreamLock:Ljava/lang/Object;
monitor-enter v1
const/4 v0, 0x6
:try_start_18
iput v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mWriteState:I
iput v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
const/4 v0, 0x0
invoke-direct {p0, v0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->destroyNativeStreamLocked(Z)V
monitor-exit v1
goto :goto_6
:catchall_22
move-exception v0
monitor-exit v1
:try_end_24
.catchall {:try_start_18 .. :try_end_24} :catchall_22
throw v0
.end method
.method private prepareResponseInfoOnNetworkThread(ILjava/lang/String;[Ljava/lang/String;J)Laegon/chrome/net/impl/UrlResponseInfoImpl;
.registers 16
const/4 v5, 0x0
new-instance v0, Laegon/chrome/net/impl/UrlResponseInfoImpl;
const/4 v1, 0x1
new-array v1, v1, [Ljava/lang/String;
iget-object v2, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mInitialUrl:Ljava/lang/String;
aput-object v2, v1, v5
invoke-static {v1}, Ljava/util/Arrays;->asList([Ljava/lang/Object;)Ljava/util/List;
move-result-object v1
const-string v3, ""
invoke-static {p3}, Laegon/chrome/net/impl/CronetBidirectionalStream;->headersListFromStrings([Ljava/lang/String;)Ljava/util/ArrayList;
move-result-object v4
const/4 v7, 0x0
move v2, p1
move-object v6, p2
move-wide v8, p4
invoke-direct/range {v0 .. v9}, Laegon/chrome/net/impl/UrlResponseInfoImpl;-><init>(Ljava/util/List;ILjava/lang/String;Ljava/util/List;ZLjava/lang/String;Ljava/lang/String;J)V
return-object v0
.end method
.method private sendFlushDataLocked()V
.registers 11
const/16 v9, 0x8
const/4 v1, 0x0
const/4 v7, 0x1
sget-boolean v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->$assertionsDisabled:Z
if-nez v0, :cond_12
iget v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mWriteState:I
if-eq v0, v9, :cond_12
new-instance v0, Ljava/lang/AssertionError;
invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V
throw v0
:cond_12
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mFlushData:Ljava/util/LinkedList;
invoke-virtual {v0}, Ljava/util/LinkedList;->size()I
move-result v3
new-array v4, v3, [Ljava/nio/ByteBuffer;
new-array v5, v3, [I
new-array v6, v3, [I
move v2, v1
:goto_1f
if-ge v2, v3, :cond_3b
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mFlushData:Ljava/util/LinkedList;
invoke-virtual {v0}, Ljava/util/LinkedList;->poll()Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/nio/ByteBuffer;
aput-object v0, v4, v2
invoke-virtual {v0}, Ljava/nio/ByteBuffer;->position()I
move-result v8
aput v8, v5, v2
invoke-virtual {v0}, Ljava/nio/ByteBuffer;->limit()I
move-result v0
aput v0, v6, v2
add-int/lit8 v0, v2, 0x1
move v2, v0
goto :goto_1f
:cond_3b
sget-boolean v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->$assertionsDisabled:Z
if-nez v0, :cond_4d
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mFlushData:Ljava/util/LinkedList;
invoke-virtual {v0}, Ljava/util/LinkedList;->isEmpty()Z
move-result v0
if-nez v0, :cond_4d
new-instance v0, Ljava/lang/AssertionError;
invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V
throw v0
:cond_4d
sget-boolean v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->$assertionsDisabled:Z
if-nez v0, :cond_5a
array-length v0, v4
if-ge v0, v7, :cond_5a
new-instance v0, Ljava/lang/AssertionError;
invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V
throw v0
:cond_5a
const/16 v0, 0x9
iput v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mWriteState:I
iput-boolean v7, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mRequestHeadersSent:Z
iget-wide v2, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStream:J
iget-boolean v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mEndOfStreamWritten:Z
if-eqz v0, :cond_7f
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mPendingData:Ljava/util/LinkedList;
invoke-virtual {v0}, Ljava/util/LinkedList;->isEmpty()Z
move-result v0
if-eqz v0, :cond_7f
:goto_6e
move-object v1, p0
invoke-direct/range {v1 .. v7}, Laegon/chrome/net/impl/CronetBidirectionalStream;->nativeWritevData(J[Ljava/nio/ByteBuffer;[I[IZ)Z
move-result v0
if-nez v0, :cond_81
iput v9, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mWriteState:I
new-instance v0, Ljava/lang/IllegalArgumentException;
const-string v1, "Unable to call native writev."
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
:cond_7f
move v7, v1
goto :goto_6e
:cond_81
return-void
.end method
.method private static stringsFromHeaderList(Ljava/util/List;)[Ljava/lang/String;
.registers 7
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List",
"<",
"Ljava/util/Map$Entry",
"<",
"Ljava/lang/String;",
"Ljava/lang/String;",
">;>;)[",
"Ljava/lang/String;"
}
.end annotation
invoke-interface {p0}, Ljava/util/List;->size()I
move-result v0
mul-int/lit8 v0, v0, 0x2
new-array v3, v0, [Ljava/lang/String;
const/4 v0, 0x0
invoke-interface {p0}, Ljava/util/List;->iterator()Ljava/util/Iterator;
move-result-object v4
move v2, v0
:goto_e
invoke-interface {v4}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_30
invoke-interface {v4}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/util/Map$Entry;
add-int/lit8 v5, v2, 0x1
invoke-interface {v0}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
move-result-object v1
check-cast v1, Ljava/lang/String;
aput-object v1, v3, v2
add-int/lit8 v1, v5, 0x1
invoke-interface {v0}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/String;
aput-object v0, v3, v5
move v2, v1
goto :goto_e
:cond_30
return-object v3
.end method
# virtual methods
.method public cancel()V
.registers 3
iget-object v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStreamLock:Ljava/lang/Object;
monitor-enter v1
:try_start_3
invoke-direct {p0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->isDoneLocked()Z
move-result v0
if-nez v0, :cond_d
iget v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
if-nez v0, :cond_f
:cond_d
monitor-exit v1
:goto_e
return-void
:cond_f
const/4 v0, 0x5
iput v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mWriteState:I
iput v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
const/4 v0, 0x1
invoke-direct {p0, v0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->destroyNativeStreamLocked(Z)V
monitor-exit v1
goto :goto_e
:catchall_1a
move-exception v0
monitor-exit v1
:try_end_1c
.catchall {:try_start_3 .. :try_end_1c} :catchall_1a
throw v0
.end method
.method public flush()V
.registers 5
const/16 v3, 0x9
iget-object v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStreamLock:Ljava/lang/Object;
monitor-enter v1
:try_start_5
invoke-direct {p0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->isDoneLocked()Z
move-result v0
if-nez v0, :cond_15
iget v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mWriteState:I
const/16 v2, 0x8
if-eq v0, v2, :cond_17
iget v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mWriteState:I
if-eq v0, v3, :cond_17
:cond_15
monitor-exit v1
:goto_16
return-void
:cond_17
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mPendingData:Ljava/util/LinkedList;
invoke-virtual {v0}, Ljava/util/LinkedList;->isEmpty()Z
move-result v0
if-eqz v0, :cond_44
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mFlushData:Ljava/util/LinkedList;
invoke-virtual {v0}, Ljava/util/LinkedList;->isEmpty()Z
move-result v0
if-eqz v0, :cond_44
iget-boolean v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mRequestHeadersSent:Z
if-nez v0, :cond_3f
const/4 v0, 0x1
iput-boolean v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mRequestHeadersSent:Z
iget-wide v2, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStream:J
invoke-direct {p0, v2, v3}, Laegon/chrome/net/impl/CronetBidirectionalStream;->nativeSendRequestHeaders(J)V
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mInitialMethod:Ljava/lang/String;
invoke-static {v0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->doesMethodAllowWriteData(Ljava/lang/String;)Z
move-result v0
if-nez v0, :cond_3f
const/16 v0, 0xa
iput v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mWriteState:I
:cond_3f
monitor-exit v1
goto :goto_16
:catchall_41
move-exception v0
monitor-exit v1
:try_end_43
.catchall {:try_start_5 .. :try_end_43} :catchall_41
throw v0
:cond_44
:try_start_44
sget-boolean v0, Laegon/chrome/net/impl/CronetBidirectionalStream;->$assertionsDisabled:Z
if-nez v0, :cond_5e
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mPendingData:Ljava/util/LinkedList;
invoke-virtual {v0}, Ljava/util/LinkedList;->isEmpty()Z
move-result v0
if-eqz v0, :cond_5e
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mFlushData:Ljava/util/LinkedList;
invoke-virtual {v0}, Ljava/util/LinkedList;->isEmpty()Z
move-result v0
if-eqz v0, :cond_5e
new-instance v0, Ljava/lang/AssertionError;
invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V
throw v0
:cond_5e
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mPendingData:Ljava/util/LinkedList;
invoke-virtual {v0}, Ljava/util/LinkedList;->isEmpty()Z
move-result v0
if-nez v0, :cond_72
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mFlushData:Ljava/util/LinkedList;
iget-object v2, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mPendingData:Ljava/util/LinkedList;
invoke-virtual {v0, v2}, Ljava/util/LinkedList;->addAll(Ljava/util/Collection;)Z
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mPendingData:Ljava/util/LinkedList;
invoke-virtual {v0}, Ljava/util/LinkedList;->clear()V
:cond_72
iget v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mWriteState:I
if-ne v0, v3, :cond_78
monitor-exit v1
goto :goto_16
:cond_78
invoke-direct {p0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->sendFlushDataLocked()V
monitor-exit v1
:try_end_7c
.catchall {:try_start_44 .. :try_end_7c} :catchall_41
goto :goto_16
.end method
.method public getFlushDataForTesting()Ljava/util/List;
.registers 5
.annotation build Laegon/chrome/base/VisibleForTesting;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/List",
"<",
"Ljava/nio/ByteBuffer;",
">;"
}
.end annotation
iget-object v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStreamLock:Ljava/lang/Object;
monitor-enter v1
:try_start_3
new-instance v2, Ljava/util/LinkedList;
invoke-direct {v2}, Ljava/util/LinkedList;-><init>()V
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mFlushData:Ljava/util/LinkedList;
invoke-virtual {v0}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;
move-result-object v3
:goto_e
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_25
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/nio/ByteBuffer;
invoke-virtual {v0}, Ljava/nio/ByteBuffer;->asReadOnlyBuffer()Ljava/nio/ByteBuffer;
move-result-object v0
invoke-interface {v2, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_e
:catchall_22
move-exception v0
monitor-exit v1
:try_end_24
.catchall {:try_start_3 .. :try_end_24} :catchall_22
throw v0
:cond_25
:try_start_25
monitor-exit v1
:try_end_26
.catchall {:try_start_25 .. :try_end_26} :catchall_22
return-object v2
.end method
.method public getPendingDataForTesting()Ljava/util/List;
.registers 5
.annotation build Laegon/chrome/base/VisibleForTesting;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"()",
"Ljava/util/List",
"<",
"Ljava/nio/ByteBuffer;",
">;"
}
.end annotation
iget-object v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStreamLock:Ljava/lang/Object;
monitor-enter v1
:try_start_3
new-instance v2, Ljava/util/LinkedList;
invoke-direct {v2}, Ljava/util/LinkedList;-><init>()V
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mPendingData:Ljava/util/LinkedList;
invoke-virtual {v0}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;
move-result-object v3
:goto_e
invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z
move-result v0
if-eqz v0, :cond_25
invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/nio/ByteBuffer;
invoke-virtual {v0}, Ljava/nio/ByteBuffer;->asReadOnlyBuffer()Ljava/nio/ByteBuffer;
move-result-object v0
invoke-interface {v2, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_e
:catchall_22
move-exception v0
monitor-exit v1
:try_end_24
.catchall {:try_start_3 .. :try_end_24} :catchall_22
throw v0
:cond_25
:try_start_25
monitor-exit v1
:try_end_26
.catchall {:try_start_25 .. :try_end_26} :catchall_22
return-object v2
.end method
.method public isDone()Z
.registers 3
iget-object v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStreamLock:Ljava/lang/Object;
monitor-enter v1
:try_start_3
invoke-direct {p0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->isDoneLocked()Z
move-result v0
monitor-exit v1
return v0
:catchall_9
move-exception v0
monitor-exit v1
:try_end_b
.catchall {:try_start_3 .. :try_end_b} :catchall_9
throw v0
.end method
.method public read(Ljava/nio/ByteBuffer;)V
.registers 10
const/4 v1, 0x2
iget-object v7, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStreamLock:Ljava/lang/Object;
monitor-enter v7
:try_start_4
invoke-static {p1}, Laegon/chrome/net/impl/Preconditions;->checkHasRemaining(Ljava/nio/ByteBuffer;)V
invoke-static {p1}, Laegon/chrome/net/impl/Preconditions;->checkDirect(Ljava/nio/ByteBuffer;)V
iget v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
if-eq v0, v1, :cond_19
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "Unexpected read attempt."
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
:catchall_16
move-exception v0
monitor-exit v7
:try_end_18
.catchall {:try_start_4 .. :try_end_18} :catchall_16
throw v0
:cond_19
:try_start_19
invoke-direct {p0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->isDoneLocked()Z
move-result v0
if-eqz v0, :cond_21
monitor-exit v7
:goto_20
return-void
:cond_21
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mOnReadCompletedTask:Laegon/chrome/net/impl/CronetBidirectionalStream$OnReadCompletedRunnable;
if-nez v0, :cond_2d
new-instance v0, Laegon/chrome/net/impl/CronetBidirectionalStream$OnReadCompletedRunnable;
const/4 v1, 0x0
invoke-direct {v0, p0, v1}, Laegon/chrome/net/impl/CronetBidirectionalStream$OnReadCompletedRunnable;-><init>(Laegon/chrome/net/impl/CronetBidirectionalStream;Laegon/chrome/net/impl/CronetBidirectionalStream$1;)V
iput-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mOnReadCompletedTask:Laegon/chrome/net/impl/CronetBidirectionalStream$OnReadCompletedRunnable;
:cond_2d
const/4 v0, 0x3
iput v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
iget-wide v2, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStream:J
invoke-virtual {p1}, Ljava/nio/ByteBuffer;->position()I
move-result v5
invoke-virtual {p1}, Ljava/nio/ByteBuffer;->limit()I
move-result v6
move-object v1, p0
move-object v4, p1
invoke-direct/range {v1 .. v6}, Laegon/chrome/net/impl/CronetBidirectionalStream;->nativeReadData(JLjava/nio/ByteBuffer;II)Z
move-result v0
if-nez v0, :cond_4d
const/4 v0, 0x2
iput v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
new-instance v0, Ljava/lang/IllegalArgumentException;
const-string v1, "Unable to call native read"
invoke-direct {v0, v1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
:cond_4d
monitor-exit v7
:try_end_4e
.catchall {:try_start_19 .. :try_end_4e} :catchall_16
goto :goto_20
.end method
.method public setOnDestroyedCallbackForTesting(Ljava/lang/Runnable;)V
.registers 2
.annotation build Laegon/chrome/base/VisibleForTesting;
.end annotation
iput-object p1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mOnDestroyedCallbackForTesting:Ljava/lang/Runnable;
return-void
.end method
.method public start()V
.registers 13
const/4 v0, 0x1
const/4 v10, 0x0
iget-object v11, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStreamLock:Ljava/lang/Object;
monitor-enter v11
:try_start_5
iget v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
if-eqz v1, :cond_14
new-instance v0, Ljava/lang/IllegalStateException;
const-string v1, "Stream is already started."
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw v0
:catchall_11
move-exception v0
monitor-exit v11
:try_end_13
.catchall {:try_start_5 .. :try_end_13} :catchall_11
throw v0
:cond_14
:try_start_14
iget-object v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mRequestContext:Laegon/chrome/net/impl/CronetUrlRequestContext;
invoke-virtual {v1}, Laegon/chrome/net/impl/CronetUrlRequestContext;->getUrlRequestContextAdapter()J
move-result-wide v2
iget-boolean v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mDelayRequestHeadersUntilFirstFlush:Z
if-nez v1, :cond_75
move v4, v0
:goto_1f
iget-object v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mRequestContext:Laegon/chrome/net/impl/CronetUrlRequestContext;
invoke-virtual {v1}, Laegon/chrome/net/impl/CronetUrlRequestContext;->hasRequestFinishedListener()Z
move-result v5
iget-boolean v6, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mTrafficStatsTagSet:Z
iget v7, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mTrafficStatsTag:I
iget-boolean v8, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mTrafficStatsUidSet:Z
iget v9, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mTrafficStatsUid:I
move-object v1, p0
invoke-direct/range {v1 .. v9}, Laegon/chrome/net/impl/CronetBidirectionalStream;->nativeCreateBidirectionalStream(JZZZIZI)J
move-result-wide v2
iput-wide v2, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStream:J
iget-object v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mRequestContext:Laegon/chrome/net/impl/CronetUrlRequestContext;
invoke-virtual {v1}, Laegon/chrome/net/impl/CronetUrlRequestContext;->onRequestStarted()V
iget-wide v2, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStream:J
iget-object v4, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mInitialUrl:Ljava/lang/String;
iget v5, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mInitialPriority:I
iget-object v6, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mInitialMethod:Ljava/lang/String;
iget-object v7, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mRequestHeaders:[Ljava/lang/String;
iget-object v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mInitialMethod:Ljava/lang/String;
invoke-static {v1}, Laegon/chrome/net/impl/CronetBidirectionalStream;->doesMethodAllowWriteData(Ljava/lang/String;)Z
move-result v1
if-nez v1, :cond_77
move v8, v0
:goto_4c
move-object v1, p0
invoke-direct/range {v1 .. v8}, Laegon/chrome/net/impl/CronetBidirectionalStream;->nativeStart(JLjava/lang/String;ILjava/lang/String;[Ljava/lang/String;Z)I
move-result v0
const/4 v1, -0x1
if-ne v0, v1, :cond_79
new-instance v0, Ljava/lang/IllegalArgumentException;
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "Invalid http method "
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
iget-object v2, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mInitialMethod:Ljava/lang/String;
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
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_6f
.catch Ljava/lang/RuntimeException; {:try_start_14 .. :try_end_6f} :catch_6f
.catchall {:try_start_14 .. :try_end_6f} :catchall_11
:catch_6f
move-exception v0
const/4 v1, 0x0
:try_start_71
invoke-direct {p0, v1}, Laegon/chrome/net/impl/CronetBidirectionalStream;->destroyNativeStreamLocked(Z)V
throw v0
:try_end_75
.catchall {:try_start_71 .. :try_end_75} :catchall_11
:cond_75
move v4, v10
goto :goto_1f
:cond_77
move v8, v10
goto :goto_4c
:cond_79
if-lez v0, :cond_aa
add-int/lit8 v0, v0, -0x1
:try_start_7d
new-instance v1, Ljava/lang/IllegalArgumentException;
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const-string v3, "Invalid header "
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
iget-object v3, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mRequestHeaders:[Ljava/lang/String;
aget-object v3, v3, v0
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
const-string v3, "="
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v2
iget-object v3, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mRequestHeaders:[Ljava/lang/String;
add-int/lit8 v0, v0, 0x1
aget-object v0, v3, v0
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
invoke-direct {v1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v1
:cond_aa
const/4 v0, 0x1
iput v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mWriteState:I
iput v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mReadState:I
:try_end_af
.catch Ljava/lang/RuntimeException; {:try_start_7d .. :try_end_af} :catch_6f
.catchall {:try_start_7d .. :try_end_af} :catchall_11
:try_start_af
monitor-exit v11
:try_end_b0
.catchall {:try_start_af .. :try_end_b0} :catchall_11
return-void
.end method
.method public write(Ljava/nio/ByteBuffer;Z)V
.registers 6
iget-object v1, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mNativeStreamLock:Ljava/lang/Object;
monitor-enter v1
:try_start_3
invoke-static {p1}, Laegon/chrome/net/impl/Preconditions;->checkDirect(Ljava/nio/ByteBuffer;)V
invoke-virtual {p1}, Ljava/nio/ByteBuffer;->hasRemaining()Z
move-result v0
if-nez v0, :cond_19
if-nez p2, :cond_19
new-instance v0, Ljava/lang/IllegalArgumentException;
const-string v2, "Empty buffer before end of stream."
invoke-direct {v0, v2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
:catchall_16
move-exception v0
monitor-exit v1
:try_end_18
.catchall {:try_start_3 .. :try_end_18} :catchall_16
throw v0
:cond_19
:try_start_19
iget-boolean v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mEndOfStreamWritten:Z
if-eqz v0, :cond_25
new-instance v0, Ljava/lang/IllegalArgumentException;
const-string v2, "Write after writing end of stream."
invoke-direct {v0, v2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
:cond_25
invoke-direct {p0}, Laegon/chrome/net/impl/CronetBidirectionalStream;->isDoneLocked()Z
move-result v0
if-eqz v0, :cond_2d
monitor-exit v1
:goto_2c
return-void
:cond_2d
iget-object v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mPendingData:Ljava/util/LinkedList;
invoke-virtual {v0, p1}, Ljava/util/LinkedList;->add(Ljava/lang/Object;)Z
if-eqz p2, :cond_37
const/4 v0, 0x1
iput-boolean v0, p0, Laegon/chrome/net/impl/CronetBidirectionalStream;->mEndOfStreamWritten:Z
:cond_37
monitor-exit v1
:try_end_38
.catchall {:try_start_19 .. :try_end_38} :catchall_16
goto :goto_2c
.end method