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

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

Issue 2252783004: Implement MediaSession (metadata) per frame [NOT READY, HAS DEPENDENCY] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 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 | « no previous file | content/browser/media/android/browser_media_session_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/android/browser_media_session_manager.h
diff --git a/content/browser/media/android/browser_media_session_manager.h b/content/browser/media/android/browser_media_session_manager.h
index 45e6c7e0eab9bede232370e3c648af8010f3ccbe..442517a32f282b5d24fc62ee09441028bcbc8efd 100644
--- a/content/browser/media/android/browser_media_session_manager.h
+++ b/content/browser/media/android/browser_media_session_manager.h
@@ -8,6 +8,7 @@
#include "base/macros.h"
#include "base/optional.h"
#include "content/common/content_export.h"
+#include "content/public/common/media_metadata.h"
namespace IPC {
class Message;
@@ -16,17 +17,27 @@ class Message;
namespace content {
class RenderFrameHost;
-struct MediaMetadata;
+class WebContentsImpl;
class CONTENT_EXPORT BrowserMediaSessionManager {
public:
- explicit BrowserMediaSessionManager(RenderFrameHost* render_frame_host);
+ explicit BrowserMediaSessionManager(RenderFrameHost* render_frame_host,
+ WebContentsImpl* contents);
+ virtual ~BrowserMediaSessionManager();
// Message handlers.
virtual void OnActivate(int session_id, int request_id);
virtual void OnDeactivate(int session_id, int request_id);
+ // Handler for SetMetadata message.
+ // Since the message comes from IPC, |insecure_metadata| might be insecure
+ // since it might come from an attacker. The callback should check the its
+ // sanity before any further actions.
virtual void OnSetMetadata(
- int session_id, const base::Optional<MediaMetadata>& metadata);
+ int session_id, const base::Optional<MediaMetadata>& insecure_metadata);
+
+ const base::Optional<MediaMetadata>& media_metadata() const {
+ return media_metadata_;
+ }
int GetRoutingID() const;
@@ -34,6 +45,9 @@ class CONTENT_EXPORT BrowserMediaSessionManager {
private:
RenderFrameHost* const render_frame_host_;
+ WebContentsImpl* const contents_;
+
+ base::Optional<MediaMetadata> media_metadata_;
DISALLOW_COPY_AND_ASSIGN(BrowserMediaSessionManager);
};
« no previous file with comments | « no previous file | content/browser/media/android/browser_media_session_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698