| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 } | 70 } |
| 71 | 71 |
| 72 MediaDevices::MediaDevices(ExecutionContext* context) | 72 MediaDevices::MediaDevices(ExecutionContext* context) |
| 73 : ActiveScriptWrappable(this), | 73 : ActiveScriptWrappable(this), |
| 74 SuspendableObject(context), | 74 SuspendableObject(context), |
| 75 m_observing(false), | 75 m_observing(false), |
| 76 m_stopped(false), | 76 m_stopped(false), |
| 77 m_dispatchScheduledEventRunner(AsyncMethodRunner<MediaDevices>::create( | 77 m_dispatchScheduledEventRunner(AsyncMethodRunner<MediaDevices>::create( |
| 78 this, | 78 this, |
| 79 &MediaDevices::dispatchScheduledEvent)) { | 79 &MediaDevices::dispatchScheduledEvent)) { |
| 80 ThreadState::current()->registerPreFinalizer(this); | |
| 81 } | 80 } |
| 82 | 81 |
| 83 MediaDevices::~MediaDevices() {} | 82 MediaDevices::~MediaDevices() {} |
| 84 | 83 |
| 85 ScriptPromise MediaDevices::enumerateDevices(ScriptState* scriptState) { | 84 ScriptPromise MediaDevices::enumerateDevices(ScriptState* scriptState) { |
| 86 Document* document = toDocument(scriptState->getExecutionContext()); | 85 Document* document = toDocument(scriptState->getExecutionContext()); |
| 87 UserMediaController* userMedia = UserMediaController::from(document->frame()); | 86 UserMediaController* userMedia = UserMediaController::from(document->frame()); |
| 88 if (!userMedia) | 87 if (!userMedia) |
| 89 return ScriptPromise::rejectWithDOMException( | 88 return ScriptPromise::rejectWithDOMException( |
| 90 scriptState, | 89 scriptState, |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 } | 248 } |
| 250 | 249 |
| 251 DEFINE_TRACE(MediaDevices) { | 250 DEFINE_TRACE(MediaDevices) { |
| 252 visitor->trace(m_dispatchScheduledEventRunner); | 251 visitor->trace(m_dispatchScheduledEventRunner); |
| 253 visitor->trace(m_scheduledEvents); | 252 visitor->trace(m_scheduledEvents); |
| 254 EventTargetWithInlineData::trace(visitor); | 253 EventTargetWithInlineData::trace(visitor); |
| 255 SuspendableObject::trace(visitor); | 254 SuspendableObject::trace(visitor); |
| 256 } | 255 } |
| 257 | 256 |
| 258 } // namespace blink | 257 } // namespace blink |
| OLD | NEW |