Chromium Code Reviews| 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 cc0e63da4ec04af087ea1b8412088573b282c8a1..b9fcfabb7f650a3a1fde507aed83e236e528aa99 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( |
|
pauljensen
2015/09/02 16:54:48
@VisibleForTesting?
bengr
2015/09/14 21:04:35
Added to CronetUrlRequestContext.
|
| + boolean useLocalHostRequests, boolean useSmallerResponses, Executor executor); |
| + |
| + /** |
| + * Adds an observer of round trip time observations. This must be called |
| + * after the network quality estimator is enabled. |
|
pauljensen
2015/09/02 16:54:48
Can you add an @link to enableNetworkQualityEstima
bengr
2015/09/14 21:04:35
Done.
|
| + * @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 network |
| + * quality estimation is enabled. |
| + * @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}. |