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

Side by Side Diff: ui/ozone/platform/drm/mojo/drm_ipc_init_helper.cc

Issue 1309273005: native_viewport support for ozone (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: addressing review feedback Created 5 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 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 #include "mojo/public/cpp/application/application_connection.h"
6 #include "mojo/public/cpp/application/interface_factory_impl.h"
7 #include "mojo/services/ozone_drm_gpu/public/interfaces/ozone_drm_gpu.mojom.h"
8 #include "mojo/services/ozone_drm_host/public/interfaces/ozone_drm_host.mojom.h"
9 #include "ui/ozone/platform/drm/mojo/drm_gpu_delegate.h"
10 #include "ui/ozone/platform/drm/mojo/drm_gpu_impl.h"
11 #include "ui/ozone/platform/drm/mojo/drm_host_delegate.h"
12 #include "ui/ozone/platform/drm/mojo/drm_host_impl.h"
13 #include "ui/ozone/public/ipc_init_helper_mojo.h"
14
15 namespace ui {
16
17 class InterfaceFactoryDrmHost
18 : public mojo::InterfaceFactory<mojo::OzoneDrmHost> {
19 // mojo::InterfaceFactory implementation.
20 void Create(mojo::ApplicationConnection* connection,
21 mojo::InterfaceRequest<mojo::OzoneDrmHost> request) override;
22 };
23
24 class InterfaceFactoryDrmGpu
25 : public mojo::InterfaceFactory<mojo::OzoneDrmGpu> {
26 // mojo::InterfaceFactory<OzoneDrmGpu> implementation.
27 void Create(mojo::ApplicationConnection* connection,
28 mojo::InterfaceRequest<mojo::OzoneDrmGpu> request) override;
29 };
30
31 void InterfaceFactoryDrmHost::Create(
32 mojo::ApplicationConnection* connection,
33 mojo::InterfaceRequest<mojo::OzoneDrmHost> request) {
34 new MojoDrmHostImpl(request.Pass());
35 }
36
37 void InterfaceFactoryDrmGpu::Create(
38 mojo::ApplicationConnection* connection,
39 mojo::InterfaceRequest<mojo::OzoneDrmGpu> request) {
40 new MojoDrmGpuImpl(request.Pass());
41 }
42
43 class DrmIpcInitHelperMojo : public IpcInitHelperMojo {
44 public:
jamesr 2015/08/27 19:35:48 is this just default-constructed? might be useful
cdotstout 2015/08/27 21:28:34 Yes. Done.
45 void HostInitialize(mojo::ApplicationImpl* application) override;
46 bool HostConfigureIncomingConnection(
47 mojo::ApplicationConnection* connection) override;
48
49 void GpuInitialize(mojo::ApplicationImpl* application) override;
50 bool GpuConfigureIncomingConnection(
51 mojo::ApplicationConnection* connection) override;
52
53 private:
54 mojo::OzoneDrmHostPtr ozone_drm_host_;
55 mojo::OzoneDrmGpuPtr ozone_drm_gpu_;
56 };
57
58 void DrmIpcInitHelperMojo::HostInitialize(mojo::ApplicationImpl* application) {
59 application->ConnectToService("mojo:native_viewport_service",
60 &ozone_drm_gpu_);
61 new MojoDrmHostDelegate(ozone_drm_gpu_.get());
62 }
63
64 void DrmIpcInitHelperMojo::GpuInitialize(mojo::ApplicationImpl* application) {
65 application->ConnectToService("mojo:native_viewport_service",
66 &ozone_drm_host_);
67 new MojoDrmGpuDelegate(ozone_drm_host_.get());
68 }
69
70 bool DrmIpcInitHelperMojo::HostConfigureIncomingConnection(
71 mojo::ApplicationConnection* connection) {
72 connection->AddService<mojo::OzoneDrmHost>(new InterfaceFactoryDrmHost());
73 return true;
74 }
75
76 bool DrmIpcInitHelperMojo::GpuConfigureIncomingConnection(
77 mojo::ApplicationConnection* connection) {
78 connection->AddService<mojo::OzoneDrmGpu>(new InterfaceFactoryDrmGpu());
79 return true;
80 }
81
82 // static
83 IpcInitHelperOzone* IpcInitHelperOzone::Create() {
84 return new DrmIpcInitHelperMojo();
85 }
86
87 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698