| 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; |
| 11 import android.util.Log; | |
| 12 | 11 |
| 12 import org.chromium.base.Log; |
| 13 import org.chromium.base.ObserverList; | 13 import org.chromium.base.ObserverList; |
| 14 import org.chromium.base.VisibleForTesting; | 14 import org.chromium.base.VisibleForTesting; |
| 15 import org.chromium.base.annotations.CalledByNative; | 15 import org.chromium.base.annotations.CalledByNative; |
| 16 import org.chromium.base.annotations.JNINamespace; | 16 import org.chromium.base.annotations.JNINamespace; |
| 17 import org.chromium.base.annotations.NativeClassQualifiedName; | 17 import org.chromium.base.annotations.NativeClassQualifiedName; |
| 18 import org.chromium.base.annotations.UsedByReflection; | 18 import org.chromium.base.annotations.UsedByReflection; |
| 19 import org.chromium.net.BidirectionalStream; | 19 import org.chromium.net.BidirectionalStream; |
| 20 import org.chromium.net.EffectiveConnectionType; | 20 import org.chromium.net.EffectiveConnectionType; |
| 21 import org.chromium.net.ExperimentalBidirectionalStream; | 21 import org.chromium.net.ExperimentalBidirectionalStream; |
| 22 import org.chromium.net.NetworkQualityRttListener; | 22 import org.chromium.net.NetworkQualityRttListener; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 45 /** | 45 /** |
| 46 * CronetEngine using Chromium HTTP stack implementation. | 46 * CronetEngine using Chromium HTTP stack implementation. |
| 47 */ | 47 */ |
| 48 @JNINamespace("cronet") | 48 @JNINamespace("cronet") |
| 49 @UsedByReflection("CronetEngine.java") | 49 @UsedByReflection("CronetEngine.java") |
| 50 @VisibleForTesting | 50 @VisibleForTesting |
| 51 public class CronetUrlRequestContext extends CronetEngineBase { | 51 public class CronetUrlRequestContext extends CronetEngineBase { |
| 52 private static final int LOG_NONE = 3; // LOG(FATAL), no VLOG. | 52 private static final int LOG_NONE = 3; // LOG(FATAL), no VLOG. |
| 53 private static final int LOG_DEBUG = -1; // LOG(FATAL...INFO), VLOG(1) | 53 private static final int LOG_DEBUG = -1; // LOG(FATAL...INFO), VLOG(1) |
| 54 private static final int LOG_VERBOSE = -2; // LOG(FATAL...INFO), VLOG(2) | 54 private static final int LOG_VERBOSE = -2; // LOG(FATAL...INFO), VLOG(2) |
| 55 static final String LOG_TAG = "ChromiumNetwork"; | 55 static final String LOG_TAG = CronetUrlRequestContext.class.getSimpleName(); |
| 56 | 56 |
| 57 /** | 57 /** |
| 58 * Synchronize access to mUrlRequestContextAdapter and shutdown routine. | 58 * Synchronize access to mUrlRequestContextAdapter and shutdown routine. |
| 59 */ | 59 */ |
| 60 private final Object mLock = new Object(); | 60 private final Object mLock = new Object(); |
| 61 private final ConditionVariable mInitCompleted = new ConditionVariable(false
); | 61 private final ConditionVariable mInitCompleted = new ConditionVariable(false
); |
| 62 private final AtomicInteger mActiveRequestCount = new AtomicInteger(0); | 62 private final AtomicInteger mActiveRequestCount = new AtomicInteger(0); |
| 63 | 63 |
| 64 @GuardedBy("mLock") | 64 @GuardedBy("mLock") |
| 65 private long mUrlRequestContextAdapter = 0; | 65 private long mUrlRequestContextAdapter = 0; |
| (...skipping 673 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 |