| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "config.h" | 5 #include "config.h" |
| 6 #include "modules/netinfo/NetworkInformation.h" | 6 #include "modules/netinfo/NetworkInformation.h" |
| 7 | 7 |
| 8 #include "core/dom/ExecutionContext.h" | 8 #include "core/dom/ExecutionContext.h" |
| 9 #include "core/events/Event.h" | 9 #include "core/events/Event.h" |
| 10 #include "core/page/NetworkStateNotifier.h" | 10 #include "core/page/NetworkStateNotifier.h" |
| 11 #include "modules/EventTargetModules.h" | 11 #include "modules/EventTargetModules.h" |
| 12 #include "platform/RuntimeEnabledFeatures.h" | 12 #include "platform/RuntimeEnabledFeatures.h" |
| 13 #include "wtf/text/WTFString.h" | 13 #include "wtf/text/WTFString.h" |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 using namespace blink; | 17 using namespace blink; |
| 18 | 18 |
| 19 String connectionTypeToString(WebConnectionType type) | 19 String connectionTypeToString(WebConnectionType type) |
| 20 { | 20 { |
| 21 switch (type) { | 21 switch (type) { |
| 22 case ConnectionTypeCellular: | 22 case WebConnectionTypeCellular: |
| 23 return "cellular"; | 23 return "cellular"; |
| 24 case ConnectionTypeBluetooth: | 24 case WebConnectionTypeBluetooth: |
| 25 return "bluetooth"; | 25 return "bluetooth"; |
| 26 case ConnectionTypeEthernet: | 26 case WebConnectionTypeEthernet: |
| 27 return "ethernet"; | 27 return "ethernet"; |
| 28 case ConnectionTypeWifi: | 28 case WebConnectionTypeWifi: |
| 29 return "wifi"; | 29 return "wifi"; |
| 30 case ConnectionTypeWimax: | 30 case WebConnectionTypeWimax: |
| 31 return "wimax"; | 31 return "wimax"; |
| 32 case ConnectionTypeOther: | 32 case WebConnectionTypeOther: |
| 33 return "other"; | 33 return "other"; |
| 34 case ConnectionTypeNone: | 34 case WebConnectionTypeNone: |
| 35 return "none"; | 35 return "none"; |
| 36 case ConnectionTypeUnknown: | 36 case WebConnectionTypeUnknown: |
| 37 return "unknown"; | 37 return "unknown"; |
| 38 } | 38 } |
| 39 ASSERT_NOT_REACHED(); | 39 ASSERT_NOT_REACHED(); |
| 40 return "none"; | 40 return "none"; |
| 41 } | 41 } |
| 42 | 42 |
| 43 } // namespace | 43 } // namespace |
| 44 | 44 |
| 45 namespace blink { | 45 namespace blink { |
| 46 | 46 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 { | 166 { |
| 167 } | 167 } |
| 168 | 168 |
| 169 DEFINE_TRACE(NetworkInformation) | 169 DEFINE_TRACE(NetworkInformation) |
| 170 { | 170 { |
| 171 RefCountedGarbageCollectedEventTargetWithInlineData<NetworkInformation>::tra
ce(visitor); | 171 RefCountedGarbageCollectedEventTargetWithInlineData<NetworkInformation>::tra
ce(visitor); |
| 172 ActiveDOMObject::trace(visitor); | 172 ActiveDOMObject::trace(visitor); |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // namespace blink | 175 } // namespace blink |
| OLD | NEW |