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

Side by Side Diff: third_party/WebKit/Source/modules/audio_output_devices/AudioOutputDeviceClient.cpp

Issue 1416123005: Implement setSinkId() for media elements without src. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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/AudioOutputDeviceClient.h"
7
8 #include "core/dom/Document.h"
9 #include "core/dom/ExecutionContext.h"
10 #include "core/frame/LocalFrame.h"
11
12 namespace blink {
13
14 const char* AudioOutputDeviceClient::supplementName()
15 {
16 return "AudioOutputDeviceClient";
17 }
18
19 AudioOutputDeviceClient* AudioOutputDeviceClient::from(ExecutionContext* context )
20 {
21 if (!context->isDocument())
22 return nullptr;
23
24 const Document* document = toDocument(context);
25 if (!document->frame() || !document->frame()->isLocalFrame())
26 return nullptr;
27
28 return static_cast<AudioOutputDeviceClient*>(WillBeHeapSupplement<LocalFrame >::from(document->frame(), supplementName()));
29 }
30
31 void provideAudioOutputDeviceClientTo(LocalFrame& frame, PassOwnPtrWillBeRawPtr< AudioOutputDeviceClient> client)
32 {
33 frame.provideSupplement(AudioOutputDeviceClient::supplementName(), client);
34 }
35
36 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698