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" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 const AtomicString& NetworkInformation::interfaceName() const | 80 const AtomicString& NetworkInformation::interfaceName() const |
81 { | 81 { |
82 return EventTargetNames::NetworkInformation; | 82 return EventTargetNames::NetworkInformation; |
83 } | 83 } |
84 | 84 |
85 ExecutionContext* NetworkInformation::executionContext() const | 85 ExecutionContext* NetworkInformation::executionContext() const |
86 { | 86 { |
87 return ActiveDOMObject::executionContext(); | 87 return ActiveDOMObject::executionContext(); |
88 } | 88 } |
89 | 89 |
90 bool NetworkInformation::addEventListener(const AtomicString& eventType, PassRef
Ptr<EventListener> listener, bool useCapture) | 90 bool NetworkInformation::addEventListener(const AtomicString& eventType, PassRef
PtrWillBeRawPtr<EventListener> listener, bool useCapture) |
91 { | 91 { |
92 if (!EventTargetWithInlineData::addEventListener(eventType, listener, useCap
ture)) | 92 if (!EventTargetWithInlineData::addEventListener(eventType, listener, useCap
ture)) |
93 return false; | 93 return false; |
94 startObserving(); | 94 startObserving(); |
95 return true; | 95 return true; |
96 } | 96 } |
97 | 97 |
98 bool NetworkInformation::removeEventListener(const AtomicString& eventType, Pass
RefPtr<EventListener> listener, bool useCapture) | 98 bool NetworkInformation::removeEventListener(const AtomicString& eventType, Pass
RefPtrWillBeRawPtr<EventListener> listener, bool useCapture) |
99 { | 99 { |
100 if (!EventTargetWithInlineData::removeEventListener(eventType, listener, use
Capture)) | 100 if (!EventTargetWithInlineData::removeEventListener(eventType, listener, use
Capture)) |
101 return false; | 101 return false; |
102 if (!hasEventListeners()) | 102 if (!hasEventListeners()) |
103 stopObserving(); | 103 stopObserving(); |
104 return true; | 104 return true; |
105 } | 105 } |
106 | 106 |
107 void NetworkInformation::removeAllEventListeners() | 107 void NetworkInformation::removeAllEventListeners() |
108 { | 108 { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 { | 150 { |
151 } | 151 } |
152 | 152 |
153 DEFINE_TRACE(NetworkInformation) | 153 DEFINE_TRACE(NetworkInformation) |
154 { | 154 { |
155 RefCountedGarbageCollectedEventTargetWithInlineData<NetworkInformation>::tra
ce(visitor); | 155 RefCountedGarbageCollectedEventTargetWithInlineData<NetworkInformation>::tra
ce(visitor); |
156 ActiveDOMObject::trace(visitor); | 156 ActiveDOMObject::trace(visitor); |
157 } | 157 } |
158 | 158 |
159 } // namespace blink | 159 } // namespace blink |
OLD | NEW |