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

Unified Diff: components/cronet/android/api/src/org/chromium/net/CronetEngine.java

Issue 2417643007: Expose RTT and throughput estimates from Cronet (Closed)
Patch Set: Fix the java doc 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/api/src/org/chromium/net/CronetEngine.java
diff --git a/components/cronet/android/api/src/org/chromium/net/CronetEngine.java b/components/cronet/android/api/src/org/chromium/net/CronetEngine.java
index e386b670818795ac45ad4087aafae7d93410e0ff..69408cc3d61d2f9a9c93dafd4e41aaf4a3253533 100644
--- a/components/cronet/android/api/src/org/chromium/net/CronetEngine.java
+++ b/components/cronet/android/api/src/org/chromium/net/CronetEngine.java
@@ -780,6 +780,11 @@ public abstract class CronetEngine {
}
}
+ /**
+ * Value used for RTT and throughput estimates if a valid value is unavailable.
+ */
+ public static final int INVALID_RTT_THROUGHPUT = -1;
xunjieli 2016/10/18 21:52:00 nit: Reuse the one that you generated in RttThroug
tbansal1 2016/10/19 21:51:39 Done.
+
private static final String TAG = "UrlRequestFactory";
private static final String CRONET_URL_REQUEST_CONTEXT =
"org.chromium.net.impl.CronetUrlRequestContext";
@@ -993,6 +998,39 @@ public abstract class CronetEngine {
public abstract int getEffectiveConnectionType();
/**
+ * Returns the HTTP RTT estimate (in milliseconds) computed by the network
+ * quality estimator. Set to {@link INVALID_RTT_THROUGHPUT} if a valid value
+ * is unavailable. This must be called after
+ * {@link #enableNetworkQualityEstimator}, and will throw an
+ * exception otherwise.
+ * @hide as it's a prototype.
+ * @return Estimate of the HTTP RTT in milliseconds.
+ */
+ public abstract int getHttpRttMs();
+
+ /**
+ * Returns the transport RTT estimate (in milliseconds) computed by the
+ * network quality estimator. Set to {@link INVALID_RTT_THROUGHPUT} if a
+ * valid value is unavailable. This must be called after
+ * {@link #enableNetworkQualityEstimator}, and will throw an
+ * exception otherwise.
+ * @hide as it's a prototype.
+ * @return Estimate of the transport RTT in milliseconds.
+ */
+ public abstract int getTransportRttMs();
+
+ /**
+ * Returns the downstream throughput estimate (in kilobits per second)
+ * computed by the network quality estimator. Set to
+ * {@link INVALID_RTT_THROUGHPUT} if a valid value is unavailable. This
+ * must be called after {@link #enableNetworkQualityEstimator}, and will
+ * throw an exception otherwise.
+ * @hide as it's a prototype.
+ * @return Estimate of the downstream throughput in kilobits per second.
+ */
+ public abstract int getDownstreamThroughputKbps();
+
+ /**
* Configures the network quality estimator for testing. This must be called
* before round trip time and throughput listeners are added, and after the
* network quality estimator has been enabled.

Powered by Google App Engine
This is Rietveld 408576698