| 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 "modules/netinfo/NetworkInformation.h" | 5 #include "modules/netinfo/NetworkInformation.h" |
| 6 | 6 |
| 7 #include "core/dom/ExecutionContext.h" | 7 #include "core/dom/ExecutionContext.h" |
| 8 #include "core/events/Event.h" | 8 #include "core/events/Event.h" |
| 9 #include "core/page/NetworkStateNotifier.h" | 9 #include "core/page/NetworkStateNotifier.h" |
| 10 #include "modules/EventTargetModules.h" | 10 #include "modules/EventTargetModules.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 const AtomicString& NetworkInformation::interfaceName() const | 96 const AtomicString& NetworkInformation::interfaceName() const |
| 97 { | 97 { |
| 98 return EventTargetNames::NetworkInformation; | 98 return EventTargetNames::NetworkInformation; |
| 99 } | 99 } |
| 100 | 100 |
| 101 ExecutionContext* NetworkInformation::getExecutionContext() const | 101 ExecutionContext* NetworkInformation::getExecutionContext() const |
| 102 { | 102 { |
| 103 return ActiveDOMObject::getExecutionContext(); | 103 return ActiveDOMObject::getExecutionContext(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 bool NetworkInformation::addEventListenerInternal(const AtomicString& eventType,
EventListener* listener, const EventListenerOptions& options) | 106 void NetworkInformation::addedEventListener(const AtomicString& eventType, Regis
teredEventListener& registeredListener) |
| 107 { | 107 { |
| 108 if (!EventTargetWithInlineData::addEventListenerInternal(eventType, listener
, options)) | 108 EventTargetWithInlineData::addedEventListener(eventType, registeredListener)
; |
| 109 return false; | |
| 110 startObserving(); | 109 startObserving(); |
| 111 return true; | |
| 112 } | 110 } |
| 113 | 111 |
| 114 bool NetworkInformation::removeEventListenerInternal(const AtomicString& eventTy
pe, EventListener* listener, const EventListenerOptions& options) | 112 void NetworkInformation::removedEventListener(const AtomicString& eventType, con
st RegisteredEventListener& registeredListener) |
| 115 { | 113 { |
| 116 if (!EventTargetWithInlineData::removeEventListenerInternal(eventType, liste
ner, options)) | 114 EventTargetWithInlineData::removedEventListener(eventType, registeredListene
r); |
| 117 return false; | |
| 118 if (!hasEventListeners()) | 115 if (!hasEventListeners()) |
| 119 stopObserving(); | 116 stopObserving(); |
| 120 return true; | |
| 121 } | 117 } |
| 122 | 118 |
| 123 void NetworkInformation::removeAllEventListeners() | 119 void NetworkInformation::removeAllEventListeners() |
| 124 { | 120 { |
| 125 EventTargetWithInlineData::removeAllEventListeners(); | 121 EventTargetWithInlineData::removeAllEventListeners(); |
| 126 ASSERT(!hasEventListeners()); | 122 ASSERT(!hasEventListeners()); |
| 127 stopObserving(); | 123 stopObserving(); |
| 128 } | 124 } |
| 129 | 125 |
| 130 bool NetworkInformation::hasPendingActivity() const | 126 bool NetworkInformation::hasPendingActivity() const |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 { | 164 { |
| 169 } | 165 } |
| 170 | 166 |
| 171 DEFINE_TRACE(NetworkInformation) | 167 DEFINE_TRACE(NetworkInformation) |
| 172 { | 168 { |
| 173 EventTargetWithInlineData::trace(visitor); | 169 EventTargetWithInlineData::trace(visitor); |
| 174 ActiveDOMObject::trace(visitor); | 170 ActiveDOMObject::trace(visitor); |
| 175 } | 171 } |
| 176 | 172 |
| 177 } // namespace blink | 173 } // namespace blink |
| OLD | NEW |