| 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 "bindings/core/v8/ActiveScriptWrappable.h" | 8 #include "bindings/core/v8/ActiveScriptWrappable.h" |
| 9 #include "core/dom/ActiveDOMObject.h" | 9 #include "core/dom/ActiveDOMObject.h" |
| 10 #include "core/events/EventTarget.h" | 10 #include "core/events/EventTarget.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // ActiveDOMObject overrides. | 43 // ActiveDOMObject overrides. |
| 44 void stop() override; | 44 void stop() override; |
| 45 | 45 |
| 46 DECLARE_VIRTUAL_TRACE(); | 46 DECLARE_VIRTUAL_TRACE(); |
| 47 | 47 |
| 48 DEFINE_ATTRIBUTE_EVENT_LISTENER(change); | 48 DEFINE_ATTRIBUTE_EVENT_LISTENER(change); |
| 49 DEFINE_ATTRIBUTE_EVENT_LISTENER(typechange); // Deprecated | 49 DEFINE_ATTRIBUTE_EVENT_LISTENER(typechange); // Deprecated |
| 50 | 50 |
| 51 protected: | 51 protected: |
| 52 // EventTarget overrides. | 52 // EventTarget overrides. |
| 53 bool addEventListenerInternal(const AtomicString& eventType, EventListener*,
const EventListenerOptions&) override; | 53 void addedEventListener(const AtomicString& eventType, RegisteredEventListen
er&) final; |
| 54 bool removeEventListenerInternal(const AtomicString& eventType, EventListene
r*, const EventListenerOptions&) override; | 54 void removedEventListener(const AtomicString& eventType, const RegisteredEve
ntListener&) final; |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 explicit NetworkInformation(ExecutionContext*); | 57 explicit NetworkInformation(ExecutionContext*); |
| 58 void startObserving(); | 58 void startObserving(); |
| 59 void stopObserving(); | 59 void stopObserving(); |
| 60 | 60 |
| 61 // Touched only on context thread. | 61 // Touched only on context thread. |
| 62 WebConnectionType m_type; | 62 WebConnectionType m_type; |
| 63 | 63 |
| 64 // Touched only on context thread. | 64 // Touched only on context thread. |
| 65 double m_downlinkMaxMbps; | 65 double m_downlinkMaxMbps; |
| 66 | 66 |
| 67 // Whether this object is listening for events from NetworkStateNotifier. | 67 // Whether this object is listening for events from NetworkStateNotifier. |
| 68 bool m_observing; | 68 bool m_observing; |
| 69 | 69 |
| 70 // Whether ActiveDOMObject::stop has been called. | 70 // Whether ActiveDOMObject::stop has been called. |
| 71 bool m_contextStopped; | 71 bool m_contextStopped; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 } // namespace blink | 74 } // namespace blink |
| 75 | 75 |
| 76 #endif // NetworkInformation_h | 76 #endif // NetworkInformation_h |
| OLD | NEW |