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

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

Issue 2433923005: Revert of Expose RTT and throughput estimates from Cronet (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: components/cronet/android/java/src/org/chromium/net/impl/CronetUrlRequestContext.java
diff --git a/components/cronet/android/java/src/org/chromium/net/impl/CronetUrlRequestContext.java b/components/cronet/android/java/src/org/chromium/net/impl/CronetUrlRequestContext.java
index 6b2022fa9bda9f4a4c9915b14cbbc69094685248..819347d57a1cad185362e7e0315d0afc3d09fe71 100644
--- a/components/cronet/android/java/src/org/chromium/net/impl/CronetUrlRequestContext.java
+++ b/components/cronet/android/java/src/org/chromium/net/impl/CronetUrlRequestContext.java
@@ -24,7 +24,6 @@
import org.chromium.net.NetworkQualityRttListener;
import org.chromium.net.NetworkQualityThroughputListener;
import org.chromium.net.RequestFinishedInfo;
-import org.chromium.net.RttThroughputValues;
import org.chromium.net.UrlRequest;
import org.chromium.net.urlconnection.CronetHttpURLConnection;
import org.chromium.net.urlconnection.CronetURLStreamHandlerFactory;
@@ -94,27 +93,6 @@
*/
@GuardedBy("mNetworkQualityLock")
private int mEffectiveConnectionType = EffectiveConnectionType.TYPE_UNKNOWN;
-
- /**
- * Current estimate of the HTTP RTT (in milliseconds) computed by the
- * network quality estimator.
- */
- @GuardedBy("mNetworkQualityLock")
- private int mHttpRttMs = RttThroughputValues.INVALID_RTT_THROUGHPUT;
-
- /**
- * Current estimate of the transport RTT (in milliseconds) computed by the
- * network quality estimator.
- */
- @GuardedBy("mNetworkQualityLock")
- private int mTransportRttMs = RttThroughputValues.INVALID_RTT_THROUGHPUT;
-
- /**
- * Current estimate of the downstream throughput (in kilobits per second)
- * computed by the network quality estimator.
- */
- @GuardedBy("mNetworkQualityLock")
- private int mDownstreamThroughputKbps = RttThroughputValues.INVALID_RTT_THROUGHPUT;
@GuardedBy("mNetworkQualityLock")
private final ObserverList<NetworkQualityRttListener> mRttListenerList =
@@ -349,37 +327,10 @@
throw new IllegalStateException("Network quality estimator must be enabled");
}
synchronized (mNetworkQualityLock) {
+ synchronized (mLock) {
+ checkHaveAdapter();
+ }
return mEffectiveConnectionType;
- }
- }
-
- @Override
- public int getHttpRttMs() {
- if (!mNetworkQualityEstimatorEnabled) {
- throw new IllegalStateException("Network quality estimator must be enabled");
- }
- synchronized (mNetworkQualityLock) {
- return mHttpRttMs;
- }
- }
-
- @Override
- public int getTransportRttMs() {
- if (!mNetworkQualityEstimatorEnabled) {
- throw new IllegalStateException("Network quality estimator must be enabled");
- }
- synchronized (mNetworkQualityLock) {
- return mTransportRttMs;
- }
- }
-
- @Override
- public int getDownstreamThroughputKbps() {
- if (!mNetworkQualityEstimatorEnabled) {
- throw new IllegalStateException("Network quality estimator must be enabled");
- }
- synchronized (mNetworkQualityLock) {
- return mDownstreamThroughputKbps;
}
}
@@ -571,17 +522,6 @@
// Convert the enum returned by the network quality estimator to an enum of type
// EffectiveConnectionType.
mEffectiveConnectionType = effectiveConnectionType;
- }
- }
-
- @SuppressWarnings("unused")
- @CalledByNative
- private void onRTTOrThroughputEstimatesComputed(
- final int httpRttMs, final int transportRttMs, final int downstreamThroughputKbps) {
- synchronized (mNetworkQualityLock) {
- mHttpRttMs = httpRttMs;
- mTransportRttMs = transportRttMs;
- mDownstreamThroughputKbps = downstreamThroughputKbps;
}
}

Powered by Google App Engine
This is Rietveld 408576698