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

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

Issue 1273173002: Added Network Quality Estimator Real-time interface to Cronet (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed remaining comments Created 5 years, 3 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/UrlRequestContext.java
diff --git a/components/cronet/android/java/src/org/chromium/net/UrlRequestContext.java b/components/cronet/android/java/src/org/chromium/net/UrlRequestContext.java
index 3ed4106847cd8b989a84a32d38267655d98f8c2b..b4332c1694d20c59a02446cce66f015393c0ce91 100644
--- a/components/cronet/android/java/src/org/chromium/net/UrlRequestContext.java
+++ b/components/cronet/android/java/src/org/chromium/net/UrlRequestContext.java
@@ -94,6 +94,53 @@ public abstract class UrlRequestContext {
public abstract void stopNetLog();
/**
+ * Enables the network quality estimator. This must be called before round
+ * trip time and throughput observers are added.
+ * @param executor An executor on which all observers will be called.
+ */
+ public abstract void enableNetworkQualityEstimator(Executor executor);
+
+ /**
+ * Enables the network quality estimator for testing. This must be called
+ * before round trip time and throughput observers are added. Set both
+ * boolean parameters to false for default behavior.
+ * @param useLocalHostRequests Include requests to localhost in estimates.
+ * @param useSmallerResponses Include small responses in throughput estimates.
+ * @param executor An executor on which all observers will be called.
+ */
+ abstract void enableNetworkQualityEstimator(
+ boolean useLocalHostRequests, boolean useSmallerResponses, Executor executor);
+
+ /**
+ * Adds an observer of round trip time observations. This must be called
+ * after {@link #enableNetworkQualityEstimator}.
+ * @param observer The observer of round trip times.
+ */
+ public abstract void addRttObserver(NetworkQualityRttObserver observer);
+
+ /**
+ * Removes an observer of round trip times if on the observer list. This
+ * should be called after an RttObserver is added in order to stop
+ * receiving observations.
+ * @param observer The observer of round trip times.
+ */
+ public abstract void removeRttObserver(NetworkQualityRttObserver observer);
+
+ /**
+ * Adds an observer of throughout. This must be called after
+ * {@link #enableNetworkQualityEstimator}.
+ * @param observer The observer of throughput.
+ */
+ public abstract void addThroughputObserver(NetworkQualityThroughputObserver observer);
+
+ /**
+ * Removes an observer of throughput. This should be called after a
+ * ThroughputObserver is added in order to stop receiving observations.
+ * @param observer The observer of throughput.
+ */
+ public abstract void removeThroughputObserver(NetworkQualityThroughputObserver observer);
+
+ /**
* Creates a {@link UrlRequestContext} with the given
* {@link UrlRequestContextConfig}.
* @param context Android {@link Context}.

Powered by Google App Engine
This is Rietveld 408576698