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 | 14 // EffectiveConnectionType is the connection type whose typical performance is |
15 // most similar to the measured performance of the network in use. In many | 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 | 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 | 17 // use are the same, but often a network connection performs significantly |
18 // differently, usually worse, from its expected capabilities. | 18 // differently, usually worse, from its expected capabilities. |
19 // EffectiveConnectionType of a network is independent of if the current | 19 // EffectiveConnectionType of a network is independent of if the current |
20 // connection is metered or not. For example, an unmetered slow connection may | 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 | 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. | 22 // effective connection type enums are be in increasing order of quality. |
23 // An invalid Java prefix to strip is specified to prevent the Java class | |
24 // generator from automatically stripping off the common prefix | |
25 // ("EFFECTIVE_CONNECTION_TYPE_"). | |
26 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net | 23 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.net |
27 // GENERATED_JAVA_PREFIX_TO_STRIP: PREFIX_NOT_PRESENT_ | 24 // GENERATED_JAVA_PREFIX_TO_STRIP: EFFECTIVE_CONNECTION_ |
28 enum EffectiveConnectionType { | 25 enum EffectiveConnectionType { |
29 // Effective connection type reported when the network quality is unknown. | 26 // Effective connection type reported when the network quality is unknown. |
30 EFFECTIVE_CONNECTION_TYPE_UNKNOWN = 0, | 27 EFFECTIVE_CONNECTION_TYPE_UNKNOWN = 0, |
31 | 28 |
32 // Effective connection type reported when the Internet is unreachable, either | 29 // Effective connection type reported when the Internet is unreachable, either |
33 // because the device does not have a connection or because the | 30 // because the device does not have a connection or because the |
34 // connection is too slow to be usable. | 31 // connection is too slow to be usable. |
35 EFFECTIVE_CONNECTION_TYPE_OFFLINE, | 32 EFFECTIVE_CONNECTION_TYPE_OFFLINE, |
36 | 33 |
37 // Effective connection type reported when the network has the quality of a | 34 // Effective connection type reported when the network has the quality of a |
(...skipping 26 matching lines...) Expand all Loading... |
64 // returned, and |effective_connection_type| is set to | 61 // returned, and |effective_connection_type| is set to |
65 // EFFECTIVE_CONNECTION_TYPE_UNKNOWN. |effective_connection_type| must be | 62 // EFFECTIVE_CONNECTION_TYPE_UNKNOWN. |effective_connection_type| must be |
66 // non-null. | 63 // non-null. |
67 NET_EXPORT bool GetEffectiveConnectionTypeForName( | 64 NET_EXPORT bool GetEffectiveConnectionTypeForName( |
68 const std::string& connection_type_name, | 65 const std::string& connection_type_name, |
69 EffectiveConnectionType* effective_connection_type); | 66 EffectiveConnectionType* effective_connection_type); |
70 | 67 |
71 } // namespace net | 68 } // namespace net |
72 | 69 |
73 #endif // NET_NQE_EFFECTIVE_CONNECTION_TYPE_H_ | 70 #endif // NET_NQE_EFFECTIVE_CONNECTION_TYPE_H_ |
OLD | NEW |