| OLD | NEW |
| 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 | 4 |
| 5 #ifndef NET_NQE_EFFECTIVE_CONNECTION_TYPE_H_ | 5 #ifndef NET_NQE_EFFECTIVE_CONNECTION_TYPE_H_ |
| 6 #define NET_NQE_EFFECTIVE_CONNECTION_TYPE_H_ | 6 #define NET_NQE_EFFECTIVE_CONNECTION_TYPE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
| 11 | 11 |
| 12 namespace net { | 12 namespace net { |
| 13 | 13 |
| 14 // EffectiveConnectionType is the connection type whose typical performance is | |
| 15 // most similar to the measured performance of the network in use. In many | |
| 16 // cases, the "effective" connection type and the actual type of connection in | |
| 17 // use are the same, but often a network connection performs significantly | |
| 18 // differently, usually worse, from its expected capabilities. | |
| 19 // EffectiveConnectionType of a network is independent of if the current | |
| 20 // connection is metered or not. For example, an unmetered slow connection may | |
| 21 // have EFFECTIVE_CONNECTION_TYPE_SLOW_2G as its effective connection type. The | |
| 22 // effective connection type enums are be in increasing order of quality. | |
| 23 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net | 14 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net |
| 24 // GENERATED_JAVA_PREFIX_TO_STRIP: EFFECTIVE_CONNECTION_ | 15 // GENERATED_JAVA_PREFIX_TO_STRIP: EFFECTIVE_CONNECTION_ |
| 16 // GENERATED_JAVA_CLASS_COMMENT_BEGIN: |
| 17 // Set of values describing connection types whose typical performance is |
| 18 // most similar to the measured performance of a network. In many |
| 19 // cases, the "effective" connection type and the actual type of a connection |
| 20 // are the same, but often a network connection performs significantly |
| 21 // differently, usually worse, from its expected capabilities. |
| 22 // {@link EffectiveConnectionType} of a network is independent of whether the |
| 23 // current connection is metered or not. For example, an unmetered slow |
| 24 // connection may have {@link #EFFECTIVE_CONNECTION_TYPE_SLOW_2G} as its |
| 25 // effective connection type. The effective connection type values are in |
| 26 // increasing order of quality. |
| 27 // {@hide as it's experimental for now} |
| 28 // GENERATED_JAVA_CLASS_COMMENT_END |
| 25 enum EffectiveConnectionType { | 29 enum EffectiveConnectionType { |
| 26 // Effective connection type reported when the network quality is unknown. | 30 // Effective connection type reported when the network quality is unknown. |
| 27 EFFECTIVE_CONNECTION_TYPE_UNKNOWN = 0, | 31 EFFECTIVE_CONNECTION_TYPE_UNKNOWN = 0, |
| 28 | 32 |
| 29 // Effective connection type reported when the Internet is unreachable, either | 33 // Effective connection type reported when the Internet is unreachable, either |
| 30 // because the device does not have a connection or because the | 34 // because the device does not have a connection or because the |
| 31 // connection is too slow to be usable. | 35 // connection is too slow to be usable. |
| 32 EFFECTIVE_CONNECTION_TYPE_OFFLINE, | 36 EFFECTIVE_CONNECTION_TYPE_OFFLINE, |
| 33 | 37 |
| 34 // Effective connection type reported when the network has the quality of a | 38 // Effective connection type reported when the network has the quality of a |
| (...skipping 26 matching lines...) Expand all Loading... |
| 61 // returned, and |effective_connection_type| is set to | 65 // returned, and |effective_connection_type| is set to |
| 62 // EFFECTIVE_CONNECTION_TYPE_UNKNOWN. |effective_connection_type| must be | 66 // EFFECTIVE_CONNECTION_TYPE_UNKNOWN. |effective_connection_type| must be |
| 63 // non-null. | 67 // non-null. |
| 64 NET_EXPORT bool GetEffectiveConnectionTypeForName( | 68 NET_EXPORT bool GetEffectiveConnectionTypeForName( |
| 65 const std::string& connection_type_name, | 69 const std::string& connection_type_name, |
| 66 EffectiveConnectionType* effective_connection_type); | 70 EffectiveConnectionType* effective_connection_type); |
| 67 | 71 |
| 68 } // namespace net | 72 } // namespace net |
| 69 | 73 |
| 70 #endif // NET_NQE_EFFECTIVE_CONNECTION_TYPE_H_ | 74 #endif // NET_NQE_EFFECTIVE_CONNECTION_TYPE_H_ |
| OLD | NEW |