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

Side by Side Diff: components/cronet/android/api/src/org/chromium/net/ExperimentalCronetEngine.java

Issue 2794823003: [Cronet] Better document Experimental Cronet classes (Closed)
Patch Set: address Andrei's comments Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 package org.chromium.net; 4 package org.chromium.net;
5 5
6 import android.content.Context; 6 import android.content.Context;
7 import android.support.annotation.VisibleForTesting; 7 import android.support.annotation.VisibleForTesting;
8 8
9 import java.io.IOException; 9 import java.io.IOException;
10 import java.net.Proxy; 10 import java.net.Proxy;
11 import java.net.URL; 11 import java.net.URL;
12 import java.net.URLConnection; 12 import java.net.URLConnection;
13 import java.util.Date; 13 import java.util.Date;
14 import java.util.Set; 14 import java.util.Set;
15 import java.util.concurrent.Executor; 15 import java.util.concurrent.Executor;
16 16
17 /** 17 /**
18 * {@link CronetEngine} that exposes experimental features. Use {@link Builder} to build an 18 * {@link CronetEngine} that exposes experimental features. To obtain an
19 * instance of this class. Every instance of {@link CronetEngine} can be casted to an instance 19 * instance of this class, cast a {@code CronetEngine} to this type. Every
20 * of this class. 20 * instance of {@code CronetEngine} can be cast to an instance of this class,
21 * as they are backed by the same implementation and hence perform identically.
22 * Instances of this class are not meant for general use, but instead only
23 * to access experimental features. Experimental features may be deprecated in t he
24 * future. Use at your own risk.
21 * 25 *
22 * {@hide since this class exposes experimental features that should be hidden.} 26 * {@hide since this class exposes experimental features that should be hidden.}
23 */ 27 */
24 public abstract class ExperimentalCronetEngine extends CronetEngine { 28 public abstract class ExperimentalCronetEngine extends CronetEngine {
25 /** 29 /**
26 * The value of a connection metric is unknown. 30 * The value of a connection metric is unknown.
27 */ 31 */
28 public static final int CONNECTION_METRIC_UNKNOWN = -1; 32 public static final int CONNECTION_METRIC_UNKNOWN = -1;
29 33
30 /** 34 /**
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 public static final int EFFECTIVE_CONNECTION_TYPE_3G = 4; 67 public static final int EFFECTIVE_CONNECTION_TYPE_3G = 4;
64 68
65 /** 69 /**
66 * The estimate of the effective connection type is 4G. 70 * The estimate of the effective connection type is 4G.
67 * 71 *
68 * @see #getEffectiveConnectionType 72 * @see #getEffectiveConnectionType
69 */ 73 */
70 public static final int EFFECTIVE_CONNECTION_TYPE_4G = 5; 74 public static final int EFFECTIVE_CONNECTION_TYPE_4G = 5;
71 75
72 /** 76 /**
73 * Builder for building {@link ExperimentalCronetEngine}. 77 * A version of {@link CronetEngine.Builder} that exposes experimental
78 * features. Instances of this class are not meant for general use, but
79 * instead only to access experimental features. Experimental features
80 * may be deprecated in the future. Use at your own risk.
74 */ 81 */
75 public static class Builder extends CronetEngine.Builder { 82 public static class Builder extends CronetEngine.Builder {
76 /** 83 /**
77 * Constructs a {@link Builder} object that facilitates creating a 84 * Constructs a {@link Builder} object that facilitates creating a
78 * {@link CronetEngine}. The default configuration enables HTTP/2 and 85 * {@link CronetEngine}. The default configuration enables HTTP/2 and
79 * disables QUIC, SDCH and the HTTP cache. 86 * disables QUIC, SDCH and the HTTP cache.
80 * 87 *
81 * @param context Android {@link Context}, which is used by 88 * @param context Android {@link Context}, which is used by
82 * {@link Builder} to retrieve the application 89 * {@link Builder} to retrieve the application
83 * context. A reference to only the application 90 * context. A reference to only the application
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 * {@link #CONNECTION_METRIC_UNKNOWN} if the value is 442 * {@link #CONNECTION_METRIC_UNKNOWN} if the value is
436 * unavailable. This must be called after 443 * unavailable. This must be called after
437 * {@link Builder#enableNetworkQualityEstimator}, and will 444 * {@link Builder#enableNetworkQualityEstimator}, and will
438 * throw an exception otherwise. 445 * throw an exception otherwise.
439 * @return Estimate of the downstream throughput in kilobits per second. 446 * @return Estimate of the downstream throughput in kilobits per second.
440 */ 447 */
441 public int getDownstreamThroughputKbps() { 448 public int getDownstreamThroughputKbps() {
442 return CONNECTION_METRIC_UNKNOWN; 449 return CONNECTION_METRIC_UNKNOWN;
443 } 450 }
444 } 451 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698