| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.net; | 5 package org.chromium.net; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.os.Build; | 8 import android.os.Build; |
| 9 import android.os.ConditionVariable; | 9 import android.os.ConditionVariable; |
| 10 import android.os.Handler; | 10 import android.os.Handler; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 return new CronetUrlRequest(this, url, priority, callback, executor,
requestAnnotations, | 144 return new CronetUrlRequest(this, url, priority, callback, executor,
requestAnnotations, |
| 145 metricsCollectionEnabled, disableCache, disableConnectionMig
ration); | 145 metricsCollectionEnabled, disableCache, disableConnectionMig
ration); |
| 146 } | 146 } |
| 147 } | 147 } |
| 148 | 148 |
| 149 @Override | 149 @Override |
| 150 BidirectionalStream createBidirectionalStream(String url, BidirectionalStrea
m.Callback callback, | 150 BidirectionalStream createBidirectionalStream(String url, BidirectionalStrea
m.Callback callback, |
| 151 Executor executor, String httpMethod, List<Map.Entry<String, String>
> requestHeaders, | 151 Executor executor, String httpMethod, List<Map.Entry<String, String>
> requestHeaders, |
| 152 @BidirectionalStream.Builder.StreamPriority int priority, boolean di
sableAutoFlush) { | 152 @BidirectionalStream.Builder.StreamPriority int priority, boolean di
sableAutoFlush, |
| 153 boolean delayRequestHeadersUntilFirstFlush) { |
| 153 synchronized (mLock) { | 154 synchronized (mLock) { |
| 154 checkHaveAdapter(); | 155 checkHaveAdapter(); |
| 155 return new CronetBidirectionalStream(this, url, priority, callback,
executor, | 156 return new CronetBidirectionalStream(this, url, priority, callback,
executor, |
| 156 httpMethod, requestHeaders, disableAutoFlush); | 157 httpMethod, requestHeaders, disableAutoFlush, |
| 158 delayRequestHeadersUntilFirstFlush); |
| 157 } | 159 } |
| 158 } | 160 } |
| 159 | 161 |
| 160 @Override | 162 @Override |
| 161 public boolean isEnabled() { | 163 public boolean isEnabled() { |
| 162 return Build.VERSION.SDK_INT >= 14; | 164 return Build.VERSION.SDK_INT >= 14; |
| 163 } | 165 } |
| 164 | 166 |
| 165 @Override | 167 @Override |
| 166 public String getVersionString() { | 168 public String getVersionString() { |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 508 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
| 507 private native void nativeEnableNetworkQualityEstimator( | 509 private native void nativeEnableNetworkQualityEstimator( |
| 508 long nativePtr, boolean useLocalHostRequests, boolean useSmallerResp
onses); | 510 long nativePtr, boolean useLocalHostRequests, boolean useSmallerResp
onses); |
| 509 | 511 |
| 510 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 512 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
| 511 private native void nativeProvideRTTObservations(long nativePtr, boolean sho
uld); | 513 private native void nativeProvideRTTObservations(long nativePtr, boolean sho
uld); |
| 512 | 514 |
| 513 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 515 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
| 514 private native void nativeProvideThroughputObservations(long nativePtr, bool
ean should); | 516 private native void nativeProvideThroughputObservations(long nativePtr, bool
ean should); |
| 515 } | 517 } |
| OLD | NEW |