| 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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 if (Log.isLoggable(LOG_TAG, Log.VERBOSE)) { | 551 if (Log.isLoggable(LOG_TAG, Log.VERBOSE)) { |
| 552 loggingLevel = LOG_VERBOSE; | 552 loggingLevel = LOG_VERBOSE; |
| 553 } else if (Log.isLoggable(LOG_TAG, Log.DEBUG)) { | 553 } else if (Log.isLoggable(LOG_TAG, Log.DEBUG)) { |
| 554 loggingLevel = LOG_DEBUG; | 554 loggingLevel = LOG_DEBUG; |
| 555 } else { | 555 } else { |
| 556 loggingLevel = LOG_NONE; | 556 loggingLevel = LOG_NONE; |
| 557 } | 557 } |
| 558 return loggingLevel; | 558 return loggingLevel; |
| 559 } | 559 } |
| 560 | 560 |
| 561 private static int convertConnectionTypeToApiValue( | 561 private static int convertConnectionTypeToApiValue(@EffectiveConnectionType
int type) { |
| 562 @EffectiveConnectionType.EffectiveConnectionTypeEnum int type) { | |
| 563 switch (type) { | 562 switch (type) { |
| 564 case EffectiveConnectionType.TYPE_OFFLINE: | 563 case EffectiveConnectionType.TYPE_OFFLINE: |
| 565 return EFFECTIVE_CONNECTION_TYPE_OFFLINE; | 564 return EFFECTIVE_CONNECTION_TYPE_OFFLINE; |
| 566 case EffectiveConnectionType.TYPE_SLOW_2G: | 565 case EffectiveConnectionType.TYPE_SLOW_2G: |
| 567 return EFFECTIVE_CONNECTION_TYPE_SLOW_2G; | 566 return EFFECTIVE_CONNECTION_TYPE_SLOW_2G; |
| 568 case EffectiveConnectionType.TYPE_2G: | 567 case EffectiveConnectionType.TYPE_2G: |
| 569 return EFFECTIVE_CONNECTION_TYPE_2G; | 568 return EFFECTIVE_CONNECTION_TYPE_2G; |
| 570 case EffectiveConnectionType.TYPE_3G: | 569 case EffectiveConnectionType.TYPE_3G: |
| 571 return EFFECTIVE_CONNECTION_TYPE_3G; | 570 return EFFECTIVE_CONNECTION_TYPE_3G; |
| 572 case EffectiveConnectionType.TYPE_4G: | 571 case EffectiveConnectionType.TYPE_4G: |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 724 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
| 726 private native void nativeProvideRTTObservations(long nativePtr, boolean sho
uld); | 725 private native void nativeProvideRTTObservations(long nativePtr, boolean sho
uld); |
| 727 | 726 |
| 728 @NativeClassQualifiedName("CronetURLRequestContextAdapter") | 727 @NativeClassQualifiedName("CronetURLRequestContextAdapter") |
| 729 private native void nativeProvideThroughputObservations(long nativePtr, bool
ean should); | 728 private native void nativeProvideThroughputObservations(long nativePtr, bool
ean should); |
| 730 | 729 |
| 731 public boolean isNetworkThread(Thread thread) { | 730 public boolean isNetworkThread(Thread thread) { |
| 732 return thread == mNetworkThread; | 731 return thread == mNetworkThread; |
| 733 } | 732 } |
| 734 } | 733 } |
| OLD | NEW |