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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 1436243002: Add render-side manager for MediaSession (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restructure includes somewhat and add another override to destructor 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: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 587efda8f7916d559f32690fc9a1fba6790b445c..616889e600f6e4719851d7ca5134bf7377ca9652 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -178,6 +178,7 @@
#include "content/renderer/android/synchronous_compositor_factory.h"
#include "content/renderer/java/gin_java_bridge_dispatcher.h"
#include "content/renderer/media/android/renderer_media_player_manager.h"
+#include "content/renderer/media/android/renderer_media_session_manager.h"
#include "content/renderer/media/android/stream_texture_factory_impl.h"
#include "content/renderer/media/android/webmediaplayer_android.h"
#include "content/renderer/media/android/webmediasession_android.h"
@@ -743,6 +744,7 @@ RenderFrameImpl::RenderFrameImpl(const CreateParams& params)
midi_dispatcher_(NULL),
#if defined(OS_ANDROID)
media_player_manager_(NULL),
+ media_session_manager_(NULL),
#endif
#if defined(ENABLE_BROWSER_CDMS)
cdm_manager_(NULL),
@@ -2210,7 +2212,7 @@ blink::WebMediaPlayer* RenderFrameImpl::createMediaPlayer(
blink::WebMediaSession* RenderFrameImpl::createMediaSession() {
#if defined(OS_ANDROID)
- return new WebMediaSessionAndroid();
+ return new WebMediaSessionAndroid(GetMediaSessionManager());
#else
return nullptr;
#endif // defined(OS_ANDROID)
@@ -5247,6 +5249,13 @@ RendererMediaPlayerManager* RenderFrameImpl::GetMediaPlayerManager() {
media_player_manager_ = new RendererMediaPlayerManager(this);
return media_player_manager_;
}
+
+RendererMediaSessionManager* RenderFrameImpl::GetMediaSessionManager() {
+ if (!media_session_manager_)
+ media_session_manager_ = new RendererMediaSessionManager(this);
+ return media_session_manager_;
+}
+
#endif // defined(OS_ANDROID)
scoped_ptr<media::MediaPermission> RenderFrameImpl::CreateMediaPermissionProxy(
« content/renderer/render_frame_impl.h ('K') | « content/renderer/render_frame_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698