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 #include "net/nqe/effective_connection_type.h" | 5 #include "net/nqe/effective_connection_type.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace { | 9 namespace { |
10 | 10 |
| 11 const char kDeprectedEffectiveConnectionTypeSlow2G[] = "Slow2G"; |
| 12 |
| 13 } // namespace |
| 14 |
| 15 namespace net { |
| 16 |
11 const char kEffectiveConnectionTypeUnknown[] = "Unknown"; | 17 const char kEffectiveConnectionTypeUnknown[] = "Unknown"; |
12 const char kEffectiveConnectionTypeOffline[] = "Offline"; | 18 const char kEffectiveConnectionTypeOffline[] = "Offline"; |
13 const char kEffectiveConnectionTypeSlow2G[] = "Slow-2G"; | 19 const char kEffectiveConnectionTypeSlow2G[] = "Slow-2G"; |
14 const char kEffectiveConnectionType2G[] = "2G"; | 20 const char kEffectiveConnectionType2G[] = "2G"; |
15 const char kEffectiveConnectionType3G[] = "3G"; | 21 const char kEffectiveConnectionType3G[] = "3G"; |
16 const char kEffectiveConnectionType4G[] = "4G"; | 22 const char kEffectiveConnectionType4G[] = "4G"; |
17 const char kDeprectedEffectiveConnectionTypeSlow2G[] = "Slow2G"; | |
18 | |
19 } // namespace | |
20 | |
21 namespace net { | |
22 | 23 |
23 const char* GetNameForEffectiveConnectionType(EffectiveConnectionType type) { | 24 const char* GetNameForEffectiveConnectionType(EffectiveConnectionType type) { |
24 switch (type) { | 25 switch (type) { |
25 case EFFECTIVE_CONNECTION_TYPE_UNKNOWN: | 26 case EFFECTIVE_CONNECTION_TYPE_UNKNOWN: |
26 return kEffectiveConnectionTypeUnknown; | 27 return kEffectiveConnectionTypeUnknown; |
27 case EFFECTIVE_CONNECTION_TYPE_OFFLINE: | 28 case EFFECTIVE_CONNECTION_TYPE_OFFLINE: |
28 return kEffectiveConnectionTypeOffline; | 29 return kEffectiveConnectionTypeOffline; |
29 case EFFECTIVE_CONNECTION_TYPE_SLOW_2G: | 30 case EFFECTIVE_CONNECTION_TYPE_SLOW_2G: |
30 return kEffectiveConnectionTypeSlow2G; | 31 return kEffectiveConnectionTypeSlow2G; |
31 case EFFECTIVE_CONNECTION_TYPE_2G: | 32 case EFFECTIVE_CONNECTION_TYPE_2G: |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 EffectiveConnectionType type) { | 84 EffectiveConnectionType type) { |
84 switch (type) { | 85 switch (type) { |
85 case EFFECTIVE_CONNECTION_TYPE_SLOW_2G: | 86 case EFFECTIVE_CONNECTION_TYPE_SLOW_2G: |
86 return kDeprectedEffectiveConnectionTypeSlow2G; | 87 return kDeprectedEffectiveConnectionTypeSlow2G; |
87 default: | 88 default: |
88 return GetNameForEffectiveConnectionType(type); | 89 return GetNameForEffectiveConnectionType(type); |
89 } | 90 } |
90 } | 91 } |
91 | 92 |
92 } // namespace net | 93 } // namespace net |
OLD | NEW |