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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_SERVICE_H_
6 #define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_SERVICE_H_
7
8 #include "mojo/public/cpp/bindings/binding.h"
9 #include "third_party/WebKit/public/platform/modules/mediasession/media_session. mojom.h"
10
11 namespace content {
12
13 class RenderFrameHost;
14
15 class MediaSessionService
16 : public NON_EXPORTED_BASE(blink::mojom::MediaSession) {
17 public:
18 ~MediaSessionService() override;
19
20 static void Create(RenderFrameHost* render_frame_host,
21 blink::mojom::MediaSessionRequest request);
22
23 private:
24 explicit MediaSessionService(RenderFrameHost* render_frame_host);
25
26 void SetMetadata(
27 const base::Optional<content::MediaMetadata>& metadata) override;
28
29 void Bind(mojo::InterfaceRequest<blink::mojom::MediaSession> request);
30
31 RenderFrameHost* render_frame_host_;
32
33 // RAII binding of |this| to an MediaSession interface request.
34 // The binding is removed when binding_ is cleared or goes out of scope.
35 std::unique_ptr<mojo::Binding<blink::mojom::MediaSession>> binding_;
36
37 DISALLOW_COPY_AND_ASSIGN(MediaSessionService);
38 };
39
40 } // namespace content
41
42 #endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698