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

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

Issue 2367393002: Migrating MediaSession messages to mojo (Closed)
Patch Set: blink typemap (need to revert blink typemap, only need content/ reivew) 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/media/android/media_session_service.h
diff --git a/content/browser/media/android/media_session_service.h b/content/browser/media/android/media_session_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..60092d30819067e9fcb5e8b234e77733cf6988a5
--- /dev/null
+++ b/content/browser/media/android/media_session_service.h
@@ -0,0 +1,42 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_SERVICE_H_
+#define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_SERVICE_H_
+
+#include "mojo/public/cpp/bindings/binding.h"
+#include "third_party/WebKit/public/platform/modules/mediasession/media_session.mojom.h"
+
+namespace content {
+
+class RenderFrameHost;
+
+class MediaSessionService
+ : public NON_EXPORTED_BASE(blink::mojom::MediaSession) {
+ public:
+ ~MediaSessionService() override;
+
+ static void Create(RenderFrameHost* render_frame_host,
+ blink::mojom::MediaSessionRequest request);
+
+ private:
+ explicit MediaSessionService(RenderFrameHost* render_frame_host);
+
+ void SetMetadata(
+ const base::Optional<content::MediaMetadata>& metadata) override;
+
+ void Bind(mojo::InterfaceRequest<blink::mojom::MediaSession> request);
+
+ RenderFrameHost* render_frame_host_;
+
+ // RAII binding of |this| to an MediaSession interface request.
+ // The binding is removed when binding_ is cleared or goes out of scope.
+ std::unique_ptr<mojo::Binding<blink::mojom::MediaSession>> binding_;
+
+ DISALLOW_COPY_AND_ASSIGN(MediaSessionService);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_SERVICE_H_

Powered by Google App Engine
This is Rietveld 408576698