| 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/audio_output_devices/HTMLMediaElementAudioOutputDevice.h" | 5 #include "modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptPromiseResolver.h" | 7 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 8 #include "bindings/core/v8/ScriptState.h" | 8 #include "bindings/core/v8/ScriptState.h" |
| 9 #include "core/dom/DOMException.h" | 9 #include "core/dom/DOMException.h" |
| 10 #include "core/dom/ExecutionContext.h" | 10 #include "core/dom/ExecutionContext.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 WebSecurityOrigin(context->getSecurityOrigin()), | 74 WebSecurityOrigin(context->getSecurityOrigin()), |
| 75 callbacks.release()); | 75 callbacks.release()); |
| 76 } else { | 76 } else { |
| 77 if (AudioOutputDeviceClient* client = | 77 if (AudioOutputDeviceClient* client = |
| 78 AudioOutputDeviceClient::from(context)) { | 78 AudioOutputDeviceClient::from(context)) { |
| 79 client->checkIfAudioSinkExistsAndIsAuthorized(context, m_sinkId, | 79 client->checkIfAudioSinkExistsAndIsAuthorized(context, m_sinkId, |
| 80 std::move(callbacks)); | 80 std::move(callbacks)); |
| 81 } else { | 81 } else { |
| 82 // The context has been detached. Impossible to get a security origin to | 82 // The context has been detached. Impossible to get a security origin to |
| 83 // check. | 83 // check. |
| 84 ASSERT(context->activeDOMObjectsAreStopped()); | 84 DCHECK(context->isContextDestroyed()); |
| 85 reject(DOMException::create( | 85 reject(DOMException::create( |
| 86 SecurityError, | 86 SecurityError, |
| 87 "Impossible to authorize device for detached context")); | 87 "Impossible to authorize device for detached context")); |
| 88 } | 88 } |
| 89 } | 89 } |
| 90 } | 90 } |
| 91 | 91 |
| 92 DEFINE_TRACE(SetSinkIdResolver) { | 92 DEFINE_TRACE(SetSinkIdResolver) { |
| 93 visitor->trace(m_element); | 93 visitor->trace(m_element); |
| 94 ScriptPromiseResolver::trace(visitor); | 94 ScriptPromiseResolver::trace(visitor); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 provideTo(element, supplementName(), supplement); | 138 provideTo(element, supplementName(), supplement); |
| 139 } | 139 } |
| 140 return *supplement; | 140 return *supplement; |
| 141 } | 141 } |
| 142 | 142 |
| 143 DEFINE_TRACE(HTMLMediaElementAudioOutputDevice) { | 143 DEFINE_TRACE(HTMLMediaElementAudioOutputDevice) { |
| 144 Supplement<HTMLMediaElement>::trace(visitor); | 144 Supplement<HTMLMediaElement>::trace(visitor); |
| 145 } | 145 } |
| 146 | 146 |
| 147 } // namespace blink | 147 } // namespace blink |
| OLD | NEW |