Chromium Code Reviews| 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 delayHeadersUntilNextWrite) { | |
|
mef
2016/06/01 21:33:21
nit: maybe delayHeadersUntilFirstFlush? In any cas
xunjieli
2016/06/01 22:27:16
Done.
| |
| 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, delayHeadersUn tilNextWrite); |
| 157 } | 158 } |
| 158 } | 159 } |
| 159 | 160 |
| 160 @Override | 161 @Override |
| 161 public boolean isEnabled() { | 162 public boolean isEnabled() { |
| 162 return Build.VERSION.SDK_INT >= 14; | 163 return Build.VERSION.SDK_INT >= 14; |
| 163 } | 164 } |
| 164 | 165 |
| 165 @Override | 166 @Override |
| 166 public String getVersionString() { | 167 public String getVersionString() { |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 506 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 507 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
| 507 private native void nativeEnableNetworkQualityEstimator( | 508 private native void nativeEnableNetworkQualityEstimator( |
| 508 long nativePtr, boolean useLocalHostRequests, boolean useSmallerResp onses); | 509 long nativePtr, boolean useLocalHostRequests, boolean useSmallerResp onses); |
| 509 | 510 |
| 510 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 511 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
| 511 private native void nativeProvideRTTObservations(long nativePtr, boolean sho uld); | 512 private native void nativeProvideRTTObservations(long nativePtr, boolean sho uld); |
| 512 | 513 |
| 513 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 514 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
| 514 private native void nativeProvideThroughputObservations(long nativePtr, bool ean should); | 515 private native void nativeProvideThroughputObservations(long nativePtr, bool ean should); |
| 515 } | 516 } |
| OLD | NEW |