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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 m_timer(this, &SetSinkIdResolver::timerFired) {} | 58 m_timer(this, &SetSinkIdResolver::timerFired) {} |
59 | 59 |
60 void SetSinkIdResolver::startAsync() { | 60 void SetSinkIdResolver::startAsync() { |
61 m_timer.startOneShot(0, BLINK_FROM_HERE); | 61 m_timer.startOneShot(0, BLINK_FROM_HERE); |
62 } | 62 } |
63 | 63 |
64 void SetSinkIdResolver::timerFired(TimerBase* timer) { | 64 void SetSinkIdResolver::timerFired(TimerBase* timer) { |
65 ExecutionContext* context = getExecutionContext(); | 65 ExecutionContext* context = getExecutionContext(); |
66 ASSERT(context && context->isDocument()); | 66 ASSERT(context && context->isDocument()); |
67 std::unique_ptr<SetSinkIdCallbacks> callbacks = | 67 std::unique_ptr<SetSinkIdCallbacks> callbacks = |
68 wrapUnique(new SetSinkIdCallbacks(this, *m_element, m_sinkId)); | 68 WTF::wrapUnique(new SetSinkIdCallbacks(this, *m_element, m_sinkId)); |
69 WebMediaPlayer* webMediaPlayer = m_element->webMediaPlayer(); | 69 WebMediaPlayer* webMediaPlayer = m_element->webMediaPlayer(); |
70 if (webMediaPlayer) { | 70 if (webMediaPlayer) { |
71 // Using release() to transfer ownership because |webMediaPlayer| is a | 71 // Using release() to transfer ownership because |webMediaPlayer| is a |
72 // platform object that takes raw pointers. | 72 // platform object that takes raw pointers. |
73 webMediaPlayer->setSinkId(m_sinkId, | 73 webMediaPlayer->setSinkId(m_sinkId, |
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)) { |
(...skipping 59 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 |