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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 void NetworkInformation::stopObserving() | 153 void NetworkInformation::stopObserving() |
154 { | 154 { |
155 if (m_observing) { | 155 if (m_observing) { |
156 networkStateNotifier().removeObserver(this, getExecutionContext()); | 156 networkStateNotifier().removeObserver(this, getExecutionContext()); |
157 m_observing = false; | 157 m_observing = false; |
158 } | 158 } |
159 } | 159 } |
160 | 160 |
161 NetworkInformation::NetworkInformation(ExecutionContext* context) | 161 NetworkInformation::NetworkInformation(ExecutionContext* context) |
162 : ActiveDOMObject(context) | 162 : ActiveScriptWrappable(this) |
| 163 , ActiveDOMObject(context) |
163 , m_type(networkStateNotifier().connectionType()) | 164 , m_type(networkStateNotifier().connectionType()) |
164 , m_downlinkMaxMbps(networkStateNotifier().maxBandwidth()) | 165 , m_downlinkMaxMbps(networkStateNotifier().maxBandwidth()) |
165 , m_observing(false) | 166 , m_observing(false) |
166 , m_contextStopped(false) | 167 , m_contextStopped(false) |
167 { | 168 { |
168 } | 169 } |
169 | 170 |
170 DEFINE_TRACE(NetworkInformation) | 171 DEFINE_TRACE(NetworkInformation) |
171 { | 172 { |
172 RefCountedGarbageCollectedEventTargetWithInlineData<NetworkInformation>::tra
ce(visitor); | 173 RefCountedGarbageCollectedEventTargetWithInlineData<NetworkInformation>::tra
ce(visitor); |
173 ActiveDOMObject::trace(visitor); | 174 ActiveDOMObject::trace(visitor); |
174 } | 175 } |
175 | 176 |
176 } // namespace blink | 177 } // namespace blink |
OLD | NEW |