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

Side by Side Diff: third_party/WebKit/Source/web/FrameLoaderClientImpl.cpp

Issue 2338223003: Unassociating MediaSession from media players (in blink & content) (Closed)
Patch Set: fixed tests Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2011 Apple Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 #include "core/loader/HistoryItem.h" 51 #include "core/loader/HistoryItem.h"
52 #include "core/page/Page.h" 52 #include "core/page/Page.h"
53 #include "core/page/WindowFeatures.h" 53 #include "core/page/WindowFeatures.h"
54 #include "modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.h" 54 #include "modules/audio_output_devices/HTMLMediaElementAudioOutputDevice.h"
55 #include "modules/device_light/DeviceLightController.h" 55 #include "modules/device_light/DeviceLightController.h"
56 #include "modules/device_orientation/DeviceMotionController.h" 56 #include "modules/device_orientation/DeviceMotionController.h"
57 #include "modules/device_orientation/DeviceOrientationAbsoluteController.h" 57 #include "modules/device_orientation/DeviceOrientationAbsoluteController.h"
58 #include "modules/device_orientation/DeviceOrientationController.h" 58 #include "modules/device_orientation/DeviceOrientationController.h"
59 #include "modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h" 59 #include "modules/encryptedmedia/HTMLMediaElementEncryptedMedia.h"
60 #include "modules/gamepad/NavigatorGamepad.h" 60 #include "modules/gamepad/NavigatorGamepad.h"
61 #include "modules/mediasession/HTMLMediaElementMediaSession.h"
62 #include "modules/mediasession/MediaSession.h" 61 #include "modules/mediasession/MediaSession.h"
63 #include "modules/serviceworkers/NavigatorServiceWorker.h" 62 #include "modules/serviceworkers/NavigatorServiceWorker.h"
64 #include "modules/serviceworkers/ServiceWorkerLinkResource.h" 63 #include "modules/serviceworkers/ServiceWorkerLinkResource.h"
65 #include "modules/storage/DOMWindowStorageController.h" 64 #include "modules/storage/DOMWindowStorageController.h"
66 #include "modules/vr/NavigatorVR.h" 65 #include "modules/vr/NavigatorVR.h"
67 #include "platform/Histogram.h" 66 #include "platform/Histogram.h"
68 #include "platform/MIMETypeRegistry.h" 67 #include "platform/MIMETypeRegistry.h"
69 #include "platform/RuntimeEnabledFeatures.h" 68 #include "platform/RuntimeEnabledFeatures.h"
70 #include "platform/UserGestureIndicator.h" 69 #include "platform/UserGestureIndicator.h"
71 #include "platform/exported/WrappedResourceRequest.h" 70 #include "platform/exported/WrappedResourceRequest.h"
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 HTMLMediaElement& htmlMediaElement, 779 HTMLMediaElement& htmlMediaElement,
781 const WebMediaPlayerSource& source, 780 const WebMediaPlayerSource& source,
782 WebMediaPlayerClient* client) 781 WebMediaPlayerClient* client)
783 { 782 {
784 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame( 783 WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(
785 htmlMediaElement.document().frame()); 784 htmlMediaElement.document().frame());
786 785
787 if (!webFrame || !webFrame->client()) 786 if (!webFrame || !webFrame->client())
788 return nullptr; 787 return nullptr;
789 788
790 WebMediaSession* webMediaSession = nullptr;
791 if (MediaSession* mediaSession = HTMLMediaElementMediaSession::session(htmlM ediaElement))
792 webMediaSession = mediaSession->getWebMediaSession();
793
794 HTMLMediaElementEncryptedMedia& encryptedMedia = HTMLMediaElementEncryptedMe dia::from(htmlMediaElement); 789 HTMLMediaElementEncryptedMedia& encryptedMedia = HTMLMediaElementEncryptedMe dia::from(htmlMediaElement);
795 WebString sinkId(HTMLMediaElementAudioOutputDevice::sinkId(htmlMediaElement) ); 790 WebString sinkId(HTMLMediaElementAudioOutputDevice::sinkId(htmlMediaElement) );
796 return wrapUnique(webFrame->client()->createMediaPlayer(source, 791 return wrapUnique(webFrame->client()->createMediaPlayer(source,
797 client, &encryptedMedia, 792 client, &encryptedMedia,
798 encryptedMedia.contentDecryptionModule(), sinkId, webMediaSession)); 793 encryptedMedia.contentDecryptionModule(), sinkId));
799 } 794 }
800 795
801 std::unique_ptr<WebMediaSession> FrameLoaderClientImpl::createWebMediaSession() 796 std::unique_ptr<WebMediaSession> FrameLoaderClientImpl::createWebMediaSession()
802 { 797 {
803 if (!m_webFrame->client()) 798 if (!m_webFrame->client())
804 return nullptr; 799 return nullptr;
805 800
806 return wrapUnique(m_webFrame->client()->createMediaSession()); 801 return wrapUnique(m_webFrame->client()->createMediaSession());
807 } 802 }
808 803
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
1002 { 997 {
1003 return WebLocalFrameImpl::fromFrame(m_webFrame->frame()->localFrameRoot())-> devToolsAgentImpl(); 998 return WebLocalFrameImpl::fromFrame(m_webFrame->frame()->localFrameRoot())-> devToolsAgentImpl();
1004 } 999 }
1005 1000
1006 KURL FrameLoaderClientImpl::overrideFlashEmbedWithHTML(const KURL& url) 1001 KURL FrameLoaderClientImpl::overrideFlashEmbedWithHTML(const KURL& url)
1007 { 1002 {
1008 return m_webFrame->client()->overrideFlashEmbedWithHTML(WebURL(url)); 1003 return m_webFrame->client()->overrideFlashEmbedWithHTML(WebURL(url));
1009 } 1004 }
1010 1005
1011 } // namespace blink 1006 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/modules_idl_files.gni ('k') | third_party/WebKit/public/web/WebFrameClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698