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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/audio_output_devices/AudioOutputDeviceClient.cpp
diff --git a/third_party/WebKit/Source/modules/audio_output_devices/AudioOutputDeviceClient.cpp b/third_party/WebKit/Source/modules/audio_output_devices/AudioOutputDeviceClient.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..e73cb6fa626ee1ee707a51c4e352042d982f1dd0
--- /dev/null
+++ b/third_party/WebKit/Source/modules/audio_output_devices/AudioOutputDeviceClient.cpp
@@ -0,0 +1,36 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "modules/audio_output_devices/AudioOutputDeviceClient.h"
+
+#include "core/dom/Document.h"
+#include "core/dom/ExecutionContext.h"
+#include "core/frame/LocalFrame.h"
+
+namespace blink {
+
+const char* AudioOutputDeviceClient::supplementName()
+{
+ return "AudioOutputDeviceClient";
+}
+
+AudioOutputDeviceClient* AudioOutputDeviceClient::from(ExecutionContext* context)
+{
+ if (!context->isDocument())
+ return nullptr;
+
+ const Document* document = toDocument(context);
+ if (!document->frame() || !document->frame()->isLocalFrame())
+ return nullptr;
+
+ return static_cast<AudioOutputDeviceClient*>(WillBeHeapSupplement<LocalFrame>::from(document->frame(), supplementName()));
+}
+
+void provideAudioOutputDeviceClientTo(LocalFrame& frame, PassOwnPtrWillBeRawPtr<AudioOutputDeviceClient> client)
+{
+ frame.provideSupplement(AudioOutputDeviceClient::supplementName(), client);
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698