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

Unified Diff: content/renderer/media/android/renderer_media_session_manager.h

Issue 1441883003: Hook up RendererMediaSessionManager with browser side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years 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 | « content/content_common.gypi ('k') | content/renderer/media/android/renderer_media_session_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/android/renderer_media_session_manager.h
diff --git a/content/renderer/media/android/renderer_media_session_manager.h b/content/renderer/media/android/renderer_media_session_manager.h
index f07b230c113f671884dc25c30d4b714c7bd0a258..c7f7504430a0a7a2a4a154de1cbaac072eabfcb5 100644
--- a/content/renderer/media/android/renderer_media_session_manager.h
+++ b/content/renderer/media/android/renderer_media_session_manager.h
@@ -7,9 +7,11 @@
#include <map>
+#include "base/id_map.h"
#include "base/macros.h"
#include "content/common/content_export.h"
#include "content/public/renderer/render_frame_observer.h"
+#include "third_party/WebKit/public/platform/modules/mediasession/WebMediaSession.h"
namespace content {
@@ -20,15 +22,35 @@ class CONTENT_EXPORT RendererMediaSessionManager : public RenderFrameObserver {
RendererMediaSessionManager(RenderFrame* render_frame);
~RendererMediaSessionManager() override;
+ // RenderFrameObserver override.
+ bool OnMessageReceived(const IPC::Message& msg) override;
+
int RegisterMediaSession(WebMediaSessionAndroid* session);
void UnregisterMediaSession(int session_id);
+ void Activate(int session_id,
+ scoped_ptr<blink::WebMediaSessionActivateCallback> callback);
+ void Deactivate(
+ int session_id,
+ scoped_ptr<blink::WebMediaSessionDeactivateCallback> callback);
+
+ void OnDidActivate(int request_id, bool success);
+ void OnDidDeactivate(int request_id);
+
private:
friend class WebMediaSessionTest;
std::map<int, WebMediaSessionAndroid*> sessions_;
int next_session_id_;
+ using ActivationRequests =
+ IDMap<blink::WebMediaSessionActivateCallback, IDMapOwnPointer>;
+ ActivationRequests pending_activation_requests_;
+
+ using DeactivationRequests =
+ IDMap<blink::WebMediaSessionDeactivateCallback, IDMapOwnPointer>;
+ DeactivationRequests pending_deactivation_requests_;
+
DISALLOW_COPY_AND_ASSIGN(RendererMediaSessionManager);
};
« no previous file with comments | « content/content_common.gypi ('k') | content/renderer/media/android/renderer_media_session_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698