OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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; | 5 package org.chromium.net; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.content.Context; | 8 import android.content.Context; |
9 import android.net.http.HttpResponseCache; | 9 import android.net.http.HttpResponseCache; |
10 import android.support.annotation.IntDef; | 10 import android.support.annotation.IntDef; |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 public abstract byte[] getGlobalMetricsDeltas(); | 986 public abstract byte[] getGlobalMetricsDeltas(); |
987 | 987 |
988 /** | 988 /** |
989 * Returns the effective connection type computed by the network quality | 989 * Returns the effective connection type computed by the network quality |
990 * estimator. | 990 * estimator. |
991 * @hide as it's a prototype. | 991 * @hide as it's a prototype. |
992 */ | 992 */ |
993 public abstract int getEffectiveConnectionType(); | 993 public abstract int getEffectiveConnectionType(); |
994 | 994 |
995 /** | 995 /** |
996 * Returns the HTTP RTT estimate (in milliseconds) computed by the network | |
997 * quality estimator. Set to | |
998 * {@link RttThroughputValues.INVALID_RTT_THROUGHPUT} if a valid value | |
999 * is unavailable. This must be called after | |
1000 * {@link #enableNetworkQualityEstimator}, and will throw an | |
1001 * exception otherwise. | |
1002 * @hide as it's a prototype. | |
1003 * @return Estimate of the HTTP RTT in milliseconds. | |
1004 */ | |
1005 public abstract int getHttpRttMs(); | |
1006 | |
1007 /** | |
1008 * Returns the transport RTT estimate (in milliseconds) computed by the | |
1009 * network quality estimator. Set to | |
1010 * {@link RttThroughputValues.INVALID_RTT_THROUGHPUT} if a valid value is | |
1011 * unavailable. This must be called after | |
1012 * {@link #enableNetworkQualityEstimator}, and will throw an | |
1013 * exception otherwise. | |
1014 * @hide as it's a prototype. | |
1015 * @return Estimate of the transport RTT in milliseconds. | |
1016 */ | |
1017 public abstract int getTransportRttMs(); | |
1018 | |
1019 /** | |
1020 * Returns the downstream throughput estimate (in kilobits per second) | |
1021 * computed by the network quality estimator. Set to | |
1022 * {@link RttThroughputValues.INVALID_RTT_THROUGHPUT} if a valid value is | |
1023 * unavailable. This must be called after | |
1024 * {@link #enableNetworkQualityEstimator}, and will | |
1025 * throw an exception otherwise. | |
1026 * @hide as it's a prototype. | |
1027 * @return Estimate of the downstream throughput in kilobits per second. | |
1028 */ | |
1029 public abstract int getDownstreamThroughputKbps(); | |
1030 | |
1031 /** | |
1032 * Configures the network quality estimator for testing. This must be called | 996 * Configures the network quality estimator for testing. This must be called |
1033 * before round trip time and throughput listeners are added, and after the | 997 * before round trip time and throughput listeners are added, and after the |
1034 * network quality estimator has been enabled. | 998 * network quality estimator has been enabled. |
1035 * @param useLocalHostRequests include requests to localhost in estimates. | 999 * @param useLocalHostRequests include requests to localhost in estimates. |
1036 * @param useSmallerResponses include small responses in throughput | 1000 * @param useSmallerResponses include small responses in throughput |
1037 * estimates. | 1001 * estimates. |
1038 * @hide as it's a prototype. | 1002 * @hide as it's a prototype. |
1039 */ | 1003 */ |
1040 public abstract void configureNetworkQualityEstimatorForTesting( | 1004 public abstract void configureNetworkQualityEstimatorForTesting( |
1041 boolean useLocalHostRequests, boolean useSmallerResponses); | 1005 boolean useLocalHostRequests, boolean useSmallerResponses); |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1200 * | 1164 * |
1201 * @param url URL for the generated requests. | 1165 * @param url URL for the generated requests. |
1202 * @param callback callback object that gets invoked on different events. | 1166 * @param callback callback object that gets invoked on different events. |
1203 * @param executor {@link Executor} on which all callbacks will be invoked. | 1167 * @param executor {@link Executor} on which all callbacks will be invoked. |
1204 */ | 1168 */ |
1205 public UrlRequest.Builder newUrlRequestBuilder( | 1169 public UrlRequest.Builder newUrlRequestBuilder( |
1206 String url, UrlRequest.Callback callback, Executor executor) { | 1170 String url, UrlRequest.Callback callback, Executor executor) { |
1207 return new UrlRequest.Builder(url, callback, executor, this); | 1171 return new UrlRequest.Builder(url, callback, executor, this); |
1208 } | 1172 } |
1209 } | 1173 } |
OLD | NEW |