Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "config.h" | |
| 6 #include "modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.h" | |
| 7 | |
| 8 #include "bindings/core/v8/ScriptPromiseResolver.h" | |
| 9 #include "bindings/core/v8/ScriptState.h" | |
| 10 #include "core/dom/ExecutionContext.h" | |
| 11 #include "platform/Logging.h" | |
| 12 | |
| 13 namespace blink { | |
| 14 | |
| 15 HTMLMediaElementAudioOutputDevice::HTMLMediaElementAudioOutputDevice() | |
| 16 : m_sinkId("") | |
| 17 { | |
| 18 } | |
| 19 | |
| 20 String HTMLMediaElementAudioOutputDevice::sinkId(HTMLMediaElement& element) | |
| 21 { | |
| 22 WTF_LOG(Media, __FUNCTION__); | |
|
Peter Beverloo
2015/06/18 14:21:20
Did you mean to land these WTF_LOG statements?
| |
| 23 HTMLMediaElementAudioOutputDevice& aodElement = HTMLMediaElementAudioOutputD evice::from(element); | |
| 24 return aodElement.m_sinkId; | |
| 25 } | |
| 26 | |
| 27 ScriptPromise HTMLMediaElementAudioOutputDevice::setSinkId(ScriptState* scriptSt ate, HTMLMediaElement& element, const String& newSinkId) | |
| 28 { | |
| 29 WTF_LOG(Media, __FUNCTION__); | |
| 30 return ScriptPromise::rejectWithDOMException(scriptState, DOMException::crea te(NotSupportedError, "Operation not supported")); | |
| 31 } | |
| 32 | |
| 33 const char* HTMLMediaElementAudioOutputDevice::supplementName() | |
| 34 { | |
| 35 return "HTMLMediaElementAudioOutputDevice"; | |
| 36 } | |
| 37 | |
| 38 HTMLMediaElementAudioOutputDevice& HTMLMediaElementAudioOutputDevice::from(HTMLM ediaElement& element) | |
| 39 { | |
| 40 HTMLMediaElementAudioOutputDevice* supplement = static_cast<HTMLMediaElement AudioOutputDevice*>(WillBeHeapSupplement<HTMLMediaElement>::from(element, supple mentName())); | |
| 41 if (!supplement) { | |
| 42 supplement = new HTMLMediaElementAudioOutputDevice(); | |
| 43 provideTo(element, supplementName(), adoptPtrWillBeNoop(supplement)); | |
| 44 } | |
| 45 return *supplement; | |
| 46 } | |
| 47 | |
| 48 DEFINE_TRACE(HTMLMediaElementAudioOutputDevice) | |
| 49 { | |
| 50 WillBeHeapSupplement<HTMLMediaElement>::trace(visitor); | |
| 51 } | |
| 52 | |
| 53 } // namespace blink | |
| OLD | NEW |