| 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.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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |