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

Side by Side Diff: media/mojo/clients/mojo_android_overlay.h

Issue 2688193002: Mojo framework for AndroidOverlay. (Closed)
Patch Set: cl comments, refactored MojoAndroidOverlay to inherit from mojom:... Created 3 years, 10 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 2017 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 MEDIA_BASE_MOJO_ANDROID_OVERLAY_H_
6 #define MEDIA_BASE_MOJO_ANDROID_OVERLAY_H_
7
8 #include "base/macros.h"
9 #include "media/base/android/android_overlay.h"
10 #include "media/mojo/interfaces/android_overlay.mojom.h"
11 #include "mojo/public/cpp/bindings/binding.h"
12
13 namespace service_manager {
14 namespace mojom {
15 class InterfaceProvider;
16 }
17 }
18
19 namespace media {
20
21 // AndroidOverlay implementation via mojo.
22 class MojoAndroidOverlay : public AndroidOverlay,
23 public mojom::AndroidOverlayClient {
24 public:
25 MojoAndroidOverlay(
26 service_manager::mojom::InterfaceProvider* interface_provider,
27 int render_frame_id,
28 int renderer_pid,
29 const AndroidOverlay::Config& config);
30
31 // Testing only.
32 MojoAndroidOverlay(mojom::AndroidOverlayProviderPtr provider_ptr,
dcheng 2017/02/28 05:22:03 Since InterfaceProvider is a mojo interface, can't
liberato (no reviews please) 2017/03/06 07:51:04 good point. done.
33 int render_frame_id,
34 int renderer_pid,
35 const AndroidOverlay::Config& config);
36
37 ~MojoAndroidOverlay() override;
38
39 void ScheduleLayout(const gfx::Rect& rect) override;
40
41 // mojom::AndroidOverlayClient
42 void OnInitialized(mojom::AndroidOverlayPtr ptr) override;
43 void OnSurfaceReady(uint64_t surface_key) override;
44 void OnDestroyed() override;
45
46 private:
47 void Setup(mojom::AndroidOverlayProviderPtr provider_ptr,
48 int render_frame_id,
49 int renderer_pid,
50 const AndroidOverlay::Config& config);
51 service_manager::mojom::InterfaceProvider* interface_provider_;
52 AndroidOverlay::Config config_;
53 mojom::AndroidOverlayProviderPtr provider_ptr_;
54 mojom::AndroidOverlayPtr overlay_ptr_;
55 std::unique_ptr<mojo::Binding<mojom::AndroidOverlayClient>> binding_;
56
57 // Have we received OnSurfaceReady yet?
58 bool received_surface_ = false;
59
60 DISALLOW_COPY_AND_ASSIGN(MojoAndroidOverlay);
61 };
62
63 } // namespace media
64
65 #endif // MEDIA_BASE_MOJO_ANDROID_OVERLAY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698