Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(666)

Side by Side Diff: Source/modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.cpp

Issue 1182243005: Add sinkId/setSinkId() extension to HTMLMediaElement. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update expected value for public interface/properties tests Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698