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

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

Issue 1980763002: ApplicationConnection devolution, part 2.3. (Closed) Base URL: https://github.com/domokit/mojo.git@work794_app_conn_devo_2.2
Patch Set: Created 4 years, 7 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
« no previous file with comments | « shell/test/pingable_app.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/public/cpp/application/application_connection.h" 5 #include "mojo/public/cpp/application/application_connection.h"
6 #include "mojo/public/cpp/application/connect.h" 6 #include "mojo/public/cpp/application/connect.h"
7 #include "mojo/services/ozone_drm_gpu/interfaces/ozone_drm_gpu.mojom.h" 7 #include "mojo/services/ozone_drm_gpu/interfaces/ozone_drm_gpu.mojom.h"
8 #include "mojo/services/ozone_drm_host/interfaces/ozone_drm_host.mojom.h" 8 #include "mojo/services/ozone_drm_host/interfaces/ozone_drm_host.mojom.h"
9 #include "ui/ozone/platform/drm/mojo/drm_gpu_delegate.h" 9 #include "ui/ozone/platform/drm/mojo/drm_gpu_delegate.h"
10 #include "ui/ozone/platform/drm/mojo/drm_gpu_impl.h" 10 #include "ui/ozone/platform/drm/mojo/drm_gpu_impl.h"
11 #include "ui/ozone/platform/drm/mojo/drm_host_delegate.h" 11 #include "ui/ozone/platform/drm/mojo/drm_host_delegate.h"
12 #include "ui/ozone/platform/drm/mojo/drm_host_impl.h" 12 #include "ui/ozone/platform/drm/mojo/drm_host_impl.h"
13 #include "ui/ozone/public/ipc_init_helper_mojo.h" 13 #include "ui/ozone/public/ipc_init_helper_mojo.h"
14 14
15 namespace ui { 15 namespace ui {
16 16
17 class InterfaceFactoryDrmHost
18 : public mojo::InterfaceFactory<mojo::OzoneDrmHost> {
19 // mojo::InterfaceFactory implementation.
20 void Create(const mojo::ConnectionContext& connection_context,
21 mojo::InterfaceRequest<mojo::OzoneDrmHost> request) override {
22 new MojoDrmHostImpl(request.Pass());
23 }
24 };
25
26 class InterfaceFactoryDrmGpu
27 : public mojo::InterfaceFactory<mojo::OzoneDrmGpu> {
28 // mojo::InterfaceFactory<OzoneDrmGpu> implementation.
29 void Create(const mojo::ConnectionContext& connection_context,
30 mojo::InterfaceRequest<mojo::OzoneDrmGpu> request) override {
31 new MojoDrmGpuImpl(request.Pass());
32 }
33 };
34
35 class DrmIpcInitHelperMojo : public IpcInitHelperMojo { 17 class DrmIpcInitHelperMojo : public IpcInitHelperMojo {
36 public: 18 public:
37 DrmIpcInitHelperMojo(); 19 DrmIpcInitHelperMojo();
38 ~DrmIpcInitHelperMojo(); 20 ~DrmIpcInitHelperMojo();
39 21
40 void HostInitialize(mojo::ApplicationImpl* application) override; 22 void HostInitialize(mojo::ApplicationImpl* application) override;
41 bool HostConfigureIncomingConnection( 23 bool HostConfigureIncomingConnection(
42 mojo::ApplicationConnection* connection) override; 24 mojo::ApplicationConnection* connection) override;
43 25
44 void GpuInitialize(mojo::ApplicationImpl* application) override; 26 void GpuInitialize(mojo::ApplicationImpl* application) override;
(...skipping 16 matching lines...) Expand all
61 } 43 }
62 44
63 void DrmIpcInitHelperMojo::GpuInitialize(mojo::ApplicationImpl* application) { 45 void DrmIpcInitHelperMojo::GpuInitialize(mojo::ApplicationImpl* application) {
64 mojo::ConnectToService(application->shell(), "mojo:native_viewport_service", 46 mojo::ConnectToService(application->shell(), "mojo:native_viewport_service",
65 GetProxy(&ozone_drm_host_)); 47 GetProxy(&ozone_drm_host_));
66 new MojoDrmGpuDelegate(ozone_drm_host_.get()); 48 new MojoDrmGpuDelegate(ozone_drm_host_.get());
67 } 49 }
68 50
69 bool DrmIpcInitHelperMojo::HostConfigureIncomingConnection( 51 bool DrmIpcInitHelperMojo::HostConfigureIncomingConnection(
70 mojo::ApplicationConnection* connection) { 52 mojo::ApplicationConnection* connection) {
71 connection->AddService<mojo::OzoneDrmHost>(new InterfaceFactoryDrmHost()); 53 connection->GetServiceProviderImpl().AddService<mojo::OzoneDrmHost>(
54 [](const mojo::ConnectionContext& connection_context,
55 mojo::InterfaceRequest<mojo::OzoneDrmHost> request) {
56 new MojoDrmHostImpl(request.Pass());
57 });
72 return true; 58 return true;
73 } 59 }
74 60
75 bool DrmIpcInitHelperMojo::GpuConfigureIncomingConnection( 61 bool DrmIpcInitHelperMojo::GpuConfigureIncomingConnection(
76 mojo::ApplicationConnection* connection) { 62 mojo::ApplicationConnection* connection) {
77 connection->AddService<mojo::OzoneDrmGpu>(new InterfaceFactoryDrmGpu()); 63 connection->GetServiceProviderImpl().AddService<mojo::OzoneDrmGpu>(
64 [](const mojo::ConnectionContext& connection_context,
65 mojo::InterfaceRequest<mojo::OzoneDrmGpu> request) {
66 new MojoDrmGpuImpl(request.Pass());
67 });
78 return true; 68 return true;
79 } 69 }
80 70
81 // static 71 // static
82 IpcInitHelperOzone* IpcInitHelperOzone::Create() { 72 IpcInitHelperOzone* IpcInitHelperOzone::Create() {
83 return new DrmIpcInitHelperMojo(); 73 return new DrmIpcInitHelperMojo();
84 } 74 }
85 75
86 } // namespace ui 76 } // namespace ui
OLDNEW
« no previous file with comments | « shell/test/pingable_app.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698