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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 VersionSafeCallbacks.RequestFinishedInfoListener>(); | 133 VersionSafeCallbacks.RequestFinishedInfoListener>(); |
134 | 134 |
135 /** | 135 /** |
136 * Synchronize access to mCertVerifierData. | 136 * Synchronize access to mCertVerifierData. |
137 */ | 137 */ |
138 private ConditionVariable mWaitGetCertVerifierDataComplete = new ConditionVa
riable(); | 138 private ConditionVariable mWaitGetCertVerifierDataComplete = new ConditionVa
riable(); |
139 | 139 |
140 /** Holds CertVerifier data. */ | 140 /** Holds CertVerifier data. */ |
141 private String mCertVerifierData; | 141 private String mCertVerifierData; |
142 | 142 |
143 private ConditionVariable mStopNetLogCompleted; | 143 private volatile ConditionVariable mStopNetLogCompleted; |
144 | 144 |
145 /** | 145 /** |
146 * True if a NetLog observer is active. | 146 * True if a NetLog observer is active. |
147 */ | 147 */ |
148 @GuardedBy("mLock") | 148 @GuardedBy("mLock") |
149 private boolean mIsLogging; | 149 private boolean mIsLogging; |
150 | 150 |
151 @UsedByReflection("CronetEngine.java") | 151 @UsedByReflection("CronetEngine.java") |
152 public CronetUrlRequestContext(final CronetEngineBuilderImpl builder) { | 152 public CronetUrlRequestContext(final CronetEngineBuilderImpl builder) { |
153 CronetLibraryLoader.ensureInitialized(builder.getContext(), builder); | 153 CronetLibraryLoader.ensureInitialized(builder.getContext(), builder); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 } | 290 } |
291 } | 291 } |
292 | 292 |
293 @Override | 293 @Override |
294 public void stopNetLog() { | 294 public void stopNetLog() { |
295 synchronized (mLock) { | 295 synchronized (mLock) { |
296 if (!mIsLogging) { | 296 if (!mIsLogging) { |
297 return; | 297 return; |
298 } | 298 } |
299 checkHaveAdapter(); | 299 checkHaveAdapter(); |
| 300 mStopNetLogCompleted = new ConditionVariable(); |
300 nativeStopNetLog(mUrlRequestContextAdapter); | 301 nativeStopNetLog(mUrlRequestContextAdapter); |
301 mIsLogging = false; | 302 mIsLogging = false; |
302 mStopNetLogCompleted = new ConditionVariable(); | |
303 } | 303 } |
304 mStopNetLogCompleted.block(); | 304 mStopNetLogCompleted.block(); |
305 } | 305 } |
306 | 306 |
307 @CalledByNative | 307 @CalledByNative |
308 public void stopNetLogCompleted() { | 308 public void stopNetLogCompleted() { |
309 mStopNetLogCompleted.open(); | 309 mStopNetLogCompleted.open(); |
310 } | 310 } |
311 | 311 |
312 @Override | 312 @Override |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 724 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
725 private native void nativeProvideRTTObservations(long nativePtr, boolean sho
uld); | 725 private native void nativeProvideRTTObservations(long nativePtr, boolean sho
uld); |
726 | 726 |
727 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 727 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
728 private native void nativeProvideThroughputObservations(long nativePtr, bool
ean should); | 728 private native void nativeProvideThroughputObservations(long nativePtr, bool
ean should); |
729 | 729 |
730 public boolean isNetworkThread(Thread thread) { | 730 public boolean isNetworkThread(Thread thread) { |
731 return thread == mNetworkThread; | 731 return thread == mNetworkThread; |
732 } | 732 } |
733 } | 733 } |
OLD | NEW |