| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 registeredListener); | 176 registeredListener); |
| 177 if (!hasEventListeners()) | 177 if (!hasEventListeners()) |
| 178 stopObserving(); | 178 stopObserving(); |
| 179 } | 179 } |
| 180 | 180 |
| 181 bool MediaDevices::hasPendingActivity() const { | 181 bool MediaDevices::hasPendingActivity() const { |
| 182 DCHECK(m_stopped || m_observing == hasEventListeners()); | 182 DCHECK(m_stopped || m_observing == hasEventListeners()); |
| 183 return m_observing; | 183 return m_observing; |
| 184 } | 184 } |
| 185 | 185 |
| 186 void MediaDevices::stop() { | 186 void MediaDevices::contextDestroyed() { |
| 187 if (m_stopped) | 187 if (m_stopped) |
| 188 return; | 188 return; |
| 189 | 189 |
| 190 m_stopped = true; | 190 m_stopped = true; |
| 191 stopObserving(); | 191 stopObserving(); |
| 192 } | 192 } |
| 193 | 193 |
| 194 void MediaDevices::suspend() { | 194 void MediaDevices::suspend() { |
| 195 m_dispatchScheduledEventRunner->suspend(); | 195 m_dispatchScheduledEventRunner->suspend(); |
| 196 } | 196 } |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 } | 249 } |
| 250 | 250 |
| 251 DEFINE_TRACE(MediaDevices) { | 251 DEFINE_TRACE(MediaDevices) { |
| 252 visitor->trace(m_dispatchScheduledEventRunner); | 252 visitor->trace(m_dispatchScheduledEventRunner); |
| 253 visitor->trace(m_scheduledEvents); | 253 visitor->trace(m_scheduledEvents); |
| 254 EventTargetWithInlineData::trace(visitor); | 254 EventTargetWithInlineData::trace(visitor); |
| 255 ActiveDOMObject::trace(visitor); | 255 ActiveDOMObject::trace(visitor); |
| 256 } | 256 } |
| 257 | 257 |
| 258 } // namespace blink | 258 } // namespace blink |
| OLD | NEW |