Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: components/cronet/android/java/src/org/chromium/net/CronetUrlRequestContext.java

Issue 1992953004: [Cronet] Make delaying sending request headers explicit in bidirectional stream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Andrei's comment and self review Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698