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

Unified Diff: Source/web/FrameLoaderClientImpl.cpp

Issue 1325493002: NOT FOR LANDING Introduce and use WebMediaSession (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add missing files Created 5 years, 3 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') | public/BUILD.gn » ('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 cb6856a7f03c5e35f56726b814796aaf046e1233..d147a442284ad7a1812ffb58ea1d8acaad6a4dd1 100644
--- a/Source/web/FrameLoaderClientImpl.cpp
+++ b/Source/web/FrameLoaderClientImpl.cpp
@@ -56,6 +56,8 @@
#include "modules/device_orientation/DeviceOrientationController.h"
#include "modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h"
#include "modules/gamepad/NavigatorGamepad.h"
+#include "modules/mediasession/HTMLMediaElementMediaSession.h"
+#include "modules/mediasession/MediaSession.h"
#include "modules/serviceworkers/NavigatorServiceWorker.h"
#include "modules/storage/DOMWindowStorageController.h"
#include "modules/vr/NavigatorVRDevice.h"
@@ -76,6 +78,7 @@
#include "public/platform/WebURL.h"
#include "public/platform/WebURLError.h"
#include "public/platform/WebVector.h"
+#include "public/platform/modules/mediasession/WebMediaSession.h"
#include "public/web/WebAutofillClient.h"
#include "public/web/WebContentSettingsClient.h"
#include "public/web/WebDOMEvent.h"
@@ -759,10 +762,22 @@ PassOwnPtr<WebMediaPlayer> FrameLoaderClientImpl::createWebMediaPlayer(
if (!webFrame || !webFrame->client())
return nullptr;
+ WebMediaSession* webMediaSession = 0;
+ if (MediaSession* session = HTMLMediaElementMediaSession::session(htmlMediaElement))
+ webMediaSession = session->webMediaSession();
+
HTMLMediaElementEncryptedMedia& encryptedMedia = HTMLMediaElementEncryptedMedia::from(htmlMediaElement);
return adoptPtr(webFrame->client()->createMediaPlayer(webFrame, url,
client, &encryptedMedia,
- encryptedMedia.contentDecryptionModule()));
+ encryptedMedia.contentDecryptionModule(), webMediaSession));
+}
+
+PassOwnPtr<WebMediaSession> FrameLoaderClientImpl::createWebMediaSession()
+{
+ if (!m_webFrame->client())
+ return nullptr;
+
+ return adoptPtr(m_webFrame->client()->createMediaSession(m_webFrame));
}
ObjectContentType FrameLoaderClientImpl::objectContentType(
« no previous file with comments | « Source/web/FrameLoaderClientImpl.h ('k') | public/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698