| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/mediastream/MediaDevices.h" | 5 #include "modules/mediastream/MediaDevices.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptPromise.h" | 7 #include "bindings/core/v8/ScriptPromise.h" |
| 8 #include "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 9 #include "bindings/core/v8/ScriptState.h" | 9 #include "bindings/core/v8/ScriptState.h" |
| 10 #include "core/dom/DOMException.h" | 10 #include "core/dom/DOMException.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 registeredListener); | 173 registeredListener); |
| 174 if (!hasEventListeners()) | 174 if (!hasEventListeners()) |
| 175 stopObserving(); | 175 stopObserving(); |
| 176 } | 176 } |
| 177 | 177 |
| 178 bool MediaDevices::hasPendingActivity() const { | 178 bool MediaDevices::hasPendingActivity() const { |
| 179 DCHECK(m_stopped || m_observing == hasEventListeners()); | 179 DCHECK(m_stopped || m_observing == hasEventListeners()); |
| 180 return m_observing; | 180 return m_observing; |
| 181 } | 181 } |
| 182 | 182 |
| 183 void MediaDevices::contextDestroyed() { | 183 void MediaDevices::contextDestroyed(ExecutionContext*) { |
| 184 if (m_stopped) | 184 if (m_stopped) |
| 185 return; | 185 return; |
| 186 | 186 |
| 187 m_stopped = true; | 187 m_stopped = true; |
| 188 stopObserving(); | 188 stopObserving(); |
| 189 } | 189 } |
| 190 | 190 |
| 191 void MediaDevices::suspend() { | 191 void MediaDevices::suspend() { |
| 192 m_dispatchScheduledEventRunner->suspend(); | 192 m_dispatchScheduledEventRunner->suspend(); |
| 193 } | 193 } |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 } | 246 } |
| 247 | 247 |
| 248 DEFINE_TRACE(MediaDevices) { | 248 DEFINE_TRACE(MediaDevices) { |
| 249 visitor->trace(m_dispatchScheduledEventRunner); | 249 visitor->trace(m_dispatchScheduledEventRunner); |
| 250 visitor->trace(m_scheduledEvents); | 250 visitor->trace(m_scheduledEvents); |
| 251 EventTargetWithInlineData::trace(visitor); | 251 EventTargetWithInlineData::trace(visitor); |
| 252 SuspendableObject::trace(visitor); | 252 SuspendableObject::trace(visitor); |
| 253 } | 253 } |
| 254 | 254 |
| 255 } // namespace blink | 255 } // namespace blink |
| OLD | NEW |