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

Unified Diff: content/browser/media/android/media_web_contents_observer_android.h

Issue 1570043002: Implement MediaSession on top of the WebMediaPlayerDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@media_session
Patch Set: Created 4 years, 11 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
Index: content/browser/media/android/media_web_contents_observer_android.h
diff --git a/content/browser/media/android/media_web_contents_observer_android.h b/content/browser/media/android/media_web_contents_observer_android.h
index b04a30cb1b80ea89cc0e6267fb8e7a8df1616fd5..547762ceb28f8714e6e6da7636f2855b25a45b73 100644
--- a/content/browser/media/android/media_web_contents_observer_android.h
+++ b/content/browser/media/android/media_web_contents_observer_android.h
@@ -24,6 +24,7 @@ namespace content {
class BrowserCdmManager;
class BrowserMediaPlayerManager;
class BrowserMediaSessionManager;
+class MediaSessionController;
// This class adds Android specific extensions to the MediaWebContentsObserver.
class CONTENT_EXPORT MediaWebContentsObserverAndroid
@@ -54,6 +55,22 @@ class CONTENT_EXPORT MediaWebContentsObserverAndroid
RenderFrameHost* render_frame_host) override;
private:
+ // Handles messages for the media player delgate; does not modify the handled
mlamouri (slow - plz ping) 2016/01/14 15:43:08 typo: delegate
+ // state since the superclass needs to handle these as well.
+ void OnMediaPlayerDelegateMessageReceived(const IPC::Message& msg,
+ RenderFrameHost* render_frame_host);
+ void OnMediaDestroyedNotification(RenderFrameHost* render_frame_host,
+ int64_t player_cookie);
+ void OnMediaPlayingNotification(RenderFrameHost* render_frame_host,
+ int64_t player_cookie,
+ bool has_video,
+ bool has_audio,
+ bool is_remote,
+ base::TimeDelta duration);
+ void OnMediaPausedNotification(RenderFrameHost* render_frame_host,
+ int64_t player_cookie,
+ bool reached_end_of_stream);
+
// Helper functions to handle media player IPC messages. Returns whether the
// |message| is handled in the function.
bool OnMediaPlayerMessageReceived(const IPC::Message& message,
@@ -76,6 +93,11 @@ class CONTENT_EXPORT MediaWebContentsObserverAndroid
scoped_ptr<BrowserMediaSessionManager>>;
MediaSessionManagerMap media_session_managers_;
+ // Map of renderer side media players to session controllers.
+ using MediaSessionMap =
+ std::map<MediaPlayerId, scoped_ptr<MediaSessionController>>;
+ MediaSessionMap media_session_map_;
+
DISALLOW_COPY_AND_ASSIGN(MediaWebContentsObserverAndroid);
};

Powered by Google App Engine
This is Rietveld 408576698