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

Unified Diff: Source/web/FrameLoaderClientImpl.cpp

Issue 1055503002: Eliminate MediaPlayer & MediaPlayerClient abstractions (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: address comments Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/web/FrameLoaderClientImpl.h ('k') | Source/web/WebKit.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/FrameLoaderClientImpl.cpp
diff --git a/Source/web/FrameLoaderClientImpl.cpp b/Source/web/FrameLoaderClientImpl.cpp
index 117a1781b35de6c09bc334ba962a887de1ce5c74..ff67ca3c273ba97a8a5c8adc010a36b5897a0c88 100644
--- a/Source/web/FrameLoaderClientImpl.cpp
+++ b/Source/web/FrameLoaderClientImpl.cpp
@@ -42,6 +42,7 @@
#include "core/frame/FrameView.h"
#include "core/frame/Settings.h"
#include "core/html/HTMLAppletElement.h"
+#include "core/html/HTMLMediaElement.h"
#include "core/input/EventHandler.h"
#include "core/layout/HitTestResult.h"
#include "core/loader/DocumentLoader.h"
@@ -53,6 +54,7 @@
#include "modules/device_light/DeviceLightController.h"
#include "modules/device_orientation/DeviceMotionController.h"
#include "modules/device_orientation/DeviceOrientationController.h"
+#include "modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h"
#include "modules/gamepad/NavigatorGamepad.h"
#include "modules/serviceworkers/NavigatorServiceWorker.h"
#include "modules/storage/DOMWindowStorageController.h"
@@ -777,6 +779,22 @@ PassRefPtrWillBeRawPtr<Widget> FrameLoaderClientImpl::createJavaAppletWidget(
"application/x-java-applet", false, FailOnDetachedPlugin);
}
+PassOwnPtr<WebMediaPlayer> FrameLoaderClientImpl::createWebMediaPlayer(
+ HTMLMediaElement* htmlMediaElement,
+ const WebURL& url)
+{
+ WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(
+ htmlMediaElement->document().frame());
+
+ if (!webFrame || !webFrame->client())
+ return nullptr;
+
+ HTMLMediaElementEncryptedMedia& encryptedMedia = HTMLMediaElementEncryptedMedia::from(*htmlMediaElement);
+ return adoptPtr(webFrame->client()->createMediaPlayer(webFrame, url,
+ htmlMediaElement,
+ &encryptedMedia, encryptedMedia.contentDecryptionModule()));
+}
+
ObjectContentType FrameLoaderClientImpl::objectContentType(
const KURL& url,
const String& explicitMimeType,
« no previous file with comments | « Source/web/FrameLoaderClientImpl.h ('k') | Source/web/WebKit.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698