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

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

Issue 2660963002: Cronet: a framework to provide alternative Cronet implementations (Closed)
Patch Set: Created 3 years, 10 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.impl; 5 package org.chromium.net.impl;
6 6
7 import android.os.ConditionVariable; 7 import android.os.ConditionVariable;
8 import android.os.Handler; 8 import android.os.Handler;
9 import android.os.Looper; 9 import android.os.Looper;
10 import android.os.Process; 10 import android.os.Process;
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 synchronized (mLock) { 237 synchronized (mLock) {
238 checkHaveAdapter(); 238 checkHaveAdapter();
239 return new CronetBidirectionalStream(this, url, priority, callback, executor, 239 return new CronetBidirectionalStream(this, url, priority, callback, executor,
240 httpMethod, requestHeaders, delayRequestHeadersUntilFirstFlu sh, 240 httpMethod, requestHeaders, delayRequestHeadersUntilFirstFlu sh,
241 requestAnnotations); 241 requestAnnotations);
242 } 242 }
243 } 243 }
244 244
245 @Override 245 @Override
246 public String getVersionString() { 246 public String getVersionString() {
247 return "Cronet/" + ImplVersion.getVersion(); 247 return "Cronet/" + ImplVersion.getCronetVersionWithLastChange();
248 } 248 }
249 249
250 @Override 250 @Override
251 public void shutdown() { 251 public void shutdown() {
252 synchronized (mLock) { 252 synchronized (mLock) {
253 checkHaveAdapter(); 253 checkHaveAdapter();
254 if (mActiveRequestCount.get() != 0) { 254 if (mActiveRequestCount.get() != 0) {
255 throw new IllegalStateException("Cannot shutdown with active req uests."); 255 throw new IllegalStateException("Cannot shutdown with active req uests.");
256 } 256 }
257 // Destroying adapter stops the network thread, so it cannot be 257 // Destroying adapter stops the network thread, so it cannot be
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 @NativeClassQualifiedName("CronetURLRequestContextAdapter") 739 @NativeClassQualifiedName("CronetURLRequestContextAdapter")
740 private native void nativeProvideRTTObservations(long nativePtr, boolean sho uld); 740 private native void nativeProvideRTTObservations(long nativePtr, boolean sho uld);
741 741
742 @NativeClassQualifiedName("CronetURLRequestContextAdapter") 742 @NativeClassQualifiedName("CronetURLRequestContextAdapter")
743 private native void nativeProvideThroughputObservations(long nativePtr, bool ean should); 743 private native void nativeProvideThroughputObservations(long nativePtr, bool ean should);
744 744
745 public boolean isNetworkThread(Thread thread) { 745 public boolean isNetworkThread(Thread thread) {
746 return thread == mNetworkThread; 746 return thread == mNetworkThread;
747 } 747 }
748 } 748 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698