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( |