Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef SERVICES_UI_GPU_GPU_SERVICE_IMPL_H_ | 5 #ifndef SERVICES_UI_WS_GPU_SERVICE_PROXY_H_ |
| 6 #define SERVICES_UI_GPU_GPU_SERVICE_IMPL_H_ | 6 #define SERVICES_UI_WS_GPU_SERVICE_PROXY_H_ |
| 7 | 7 |
| 8 #include "mojo/public/cpp/bindings/binding_set.h" | |
| 8 #include "mojo/public/cpp/bindings/interface_request.h" | 9 #include "mojo/public/cpp/bindings/interface_request.h" |
| 9 #include "mojo/public/cpp/bindings/strong_binding.h" | |
| 10 #include "services/ui/public/interfaces/gpu_memory_buffer.mojom.h" | 10 #include "services/ui/public/interfaces/gpu_memory_buffer.mojom.h" |
| 11 #include "services/ui/public/interfaces/gpu_service.mojom.h" | 11 #include "services/ui/public/interfaces/gpu_service.mojom.h" |
| 12 | 12 |
| 13 namespace ui { | 13 namespace ui { |
| 14 | 14 |
| 15 class GpuServiceImpl : public mojom::GpuService { | 15 class GpuServiceInternal; |
| 16 | |
| 17 // The proxy implementation that relays requests from clients to the real | |
| 18 // service implementation in the GPU process over mojom.GpuServiceInternal. | |
| 19 class GpuServiceProxy : public mojom::GpuService { | |
|
Fady Samuel
2016/08/24 15:44:11
Hmm, do we know that the gpu service interface wil
sadrul
2016/08/24 15:47:53
This is the client-facing interface. The one betwe
| |
| 16 public: | 20 public: |
| 17 GpuServiceImpl(mojo::InterfaceRequest<mojom::GpuService> request); | 21 GpuServiceProxy(); |
| 18 ~GpuServiceImpl() override; | 22 ~GpuServiceProxy() override; |
| 19 | 23 |
| 24 void Add(mojom::GpuServiceRequest request); | |
| 25 | |
| 26 private: | |
| 20 // mojom::GpuService overrides: | 27 // mojom::GpuService overrides: |
| 21 void EstablishGpuChannel( | 28 void EstablishGpuChannel( |
| 22 const mojom::GpuService::EstablishGpuChannelCallback& callback) override; | 29 const mojom::GpuService::EstablishGpuChannelCallback& callback) override; |
| 23 | 30 |
| 24 void CreateGpuMemoryBuffer( | 31 void CreateGpuMemoryBuffer( |
| 25 mojom::GpuMemoryBufferIdPtr id, | 32 mojom::GpuMemoryBufferIdPtr id, |
| 26 const gfx::Size& size, | 33 const gfx::Size& size, |
| 27 gfx::BufferFormat format, | 34 gfx::BufferFormat format, |
| 28 gfx::BufferUsage usage, | 35 gfx::BufferUsage usage, |
| 29 uint64_t surface_id, | 36 uint64_t surface_id, |
| 30 const mojom::GpuService::CreateGpuMemoryBufferCallback& callback) | 37 const mojom::GpuService::CreateGpuMemoryBufferCallback& callback) |
| 31 override; | 38 override; |
| 32 | 39 |
| 33 void DestroyGpuMemoryBuffer(mojom::GpuMemoryBufferIdPtr id, | 40 void DestroyGpuMemoryBuffer(mojom::GpuMemoryBufferIdPtr id, |
| 34 const gpu::SyncToken& sync_token) override; | 41 const gpu::SyncToken& sync_token) override; |
| 35 | 42 |
| 36 private: | 43 GpuServiceInternal* gpu_service_; |
| 37 mojo::StrongBinding<GpuService> binding_; | 44 mojo::BindingSet<GpuService> bindings_; |
| 38 | 45 |
| 39 DISALLOW_COPY_AND_ASSIGN(GpuServiceImpl); | 46 DISALLOW_COPY_AND_ASSIGN(GpuServiceProxy); |
| 40 }; | 47 }; |
| 41 | 48 |
| 42 } // namespace ui | 49 } // namespace ui |
| 43 | 50 |
| 44 #endif // SERVICES_UI_GPU_GPU_SERVICE_IMPL_H_ | 51 #endif // SERVICES_UI_WS_GPU_SERVICE_PROXY_H_ |
| OLD | NEW |