| 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 #ifndef NetworkInformation_h | 5 #ifndef NetworkInformation_h |
| 6 #define NetworkInformation_h | 6 #define NetworkInformation_h |
| 7 | 7 |
| 8 #include "core/dom/ActiveDOMObject.h" | 8 #include "core/dom/ActiveDOMObject.h" |
| 9 #include "core/events/EventTarget.h" | 9 #include "core/events/EventTarget.h" |
| 10 #include "core/page/NetworkStateNotifier.h" | 10 #include "core/page/NetworkStateNotifier.h" |
| 11 #include "public/platform/WebConnectionType.h" | 11 #include "public/platform/WebConnectionType.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class ExecutionContext; | 15 class ExecutionContext; |
| 16 | 16 |
| 17 class NetworkInformation final | 17 class NetworkInformation final |
| 18 : public RefCountedGarbageCollectedEventTargetWithInlineData<NetworkInformat
ion> | 18 : public RefCountedGarbageCollectedEventTargetWithInlineData<NetworkInformat
ion> |
| 19 , public ActiveDOMObject | 19 , public ActiveDOMObject |
| 20 , public NetworkStateNotifier::NetworkStateObserver { | 20 , public NetworkStateNotifier::NetworkStateObserver { |
| 21 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<N
etworkInformation>); | 21 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(NetworkInformation); |
| 22 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NetworkInformation); | 22 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(NetworkInformation); |
| 23 DEFINE_WRAPPERTYPEINFO(); | 23 DEFINE_WRAPPERTYPEINFO(); |
| 24 public: | 24 public: |
| 25 static NetworkInformation* create(ExecutionContext*); | 25 static NetworkInformation* create(ExecutionContext*); |
| 26 virtual ~NetworkInformation(); | 26 virtual ~NetworkInformation(); |
| 27 | 27 |
| 28 String type() const; | 28 String type() const; |
| 29 | 29 |
| 30 virtual void connectionTypeChange(WebConnectionType) override; | 30 virtual void connectionTypeChange(WebConnectionType) override; |
| 31 | 31 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 55 // Whether this object is listening for events from NetworkStateNotifier. | 55 // Whether this object is listening for events from NetworkStateNotifier. |
| 56 bool m_observing; | 56 bool m_observing; |
| 57 | 57 |
| 58 // Whether ActiveDOMObject::stop has been called. | 58 // Whether ActiveDOMObject::stop has been called. |
| 59 bool m_contextStopped; | 59 bool m_contextStopped; |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 } // namespace blink | 62 } // namespace blink |
| 63 | 63 |
| 64 #endif // NetworkInformation_h | 64 #endif // NetworkInformation_h |
| OLD | NEW |