Chromium Code Reviews| Index: services/ui/ws/gpu_service_proxy.h |
| diff --git a/services/ui/ws/gpu_service_proxy.h b/services/ui/ws/gpu_service_proxy.h |
| index cb90c3c8ddadb1fc92b4d8d9ff47cc7e166f10dc..2c3d603010e31f51fb259f9bd5a10c01a5c5ae4f 100644 |
| --- a/services/ui/ws/gpu_service_proxy.h |
| +++ b/services/ui/ws/gpu_service_proxy.h |
| @@ -5,22 +5,41 @@ |
| #ifndef SERVICES_UI_WS_GPU_SERVICE_PROXY_H_ |
| #define SERVICES_UI_WS_GPU_SERVICE_PROXY_H_ |
| +#include "base/single_thread_task_runner.h" |
| +#include "base/synchronization/waitable_event.h" |
| +#include "base/threading/thread.h" |
| #include "gpu/config/gpu_info.h" |
| +#include "gpu/ipc/client/gpu_channel_host.h" |
| #include "mojo/public/cpp/bindings/binding_set.h" |
| #include "mojo/public/cpp/bindings/interface_request.h" |
| #include "services/ui/gpu/interfaces/gpu_service_internal.mojom.h" |
| #include "services/ui/public/interfaces/gpu_memory_buffer.mojom.h" |
| #include "services/ui/public/interfaces/gpu_service.mojom.h" |
| +namespace gpu { |
| +class GpuChannelHost; |
| +} |
| + |
| namespace ui { |
| class GpuServiceInternal; |
| +namespace ws { |
| + |
| +class MusGpuMemoryBufferManager; |
| + |
| // The proxy implementation that relays requests from clients to the real |
| // service implementation in the GPU process over mojom.GpuServiceInternal. |
| -class GpuServiceProxy : public mojom::GpuService { |
| +class GpuServiceProxy : public mojom::GpuService, |
|
Fady Samuel
2016/08/26 16:27:59
Huge optional bikeshed color: GpuServiceProxy=>Gpu
sadrul
2016/08/26 17:23:50
GpuServiceInternal could be named Gpu. I don't hav
|
| + public gpu::GpuChannelHostFactory { |
| public: |
| - GpuServiceProxy(); |
| + class Delegate { |
|
Fady Samuel
2016/08/26 16:27:59
Move this Delegate to a separate file?
sky
2016/08/26 16:46:30
+1
sadrul
2016/08/26 17:23:50
Done.
|
| + public: |
| + virtual void OnGpuChannelEstablished( |
| + scoped_refptr<gpu::GpuChannelHost> gpu_channel) = 0; |
| + }; |
| + |
| + explicit GpuServiceProxy(Delegate* delegate); |
| ~GpuServiceProxy() override; |
| void Add(mojom::GpuServiceRequest request); |
| @@ -30,11 +49,12 @@ class GpuServiceProxy : public mojom::GpuService { |
| void OnGpuChannelEstablished(const EstablishGpuChannelCallback& callback, |
| int32_t client_id, |
| mojo::ScopedMessagePipeHandle channel_handle); |
| + void OnInternalGpuChannelEstablished( |
| + mojo::ScopedMessagePipeHandle channel_handle); |
| // mojom::GpuService overrides: |
| void EstablishGpuChannel( |
| const EstablishGpuChannelCallback& callback) override; |
| - |
| void CreateGpuMemoryBuffer( |
| mojom::GpuMemoryBufferIdPtr id, |
| const gfx::Size& size, |
| @@ -43,18 +63,30 @@ class GpuServiceProxy : public mojom::GpuService { |
| uint64_t surface_id, |
| const mojom::GpuService::CreateGpuMemoryBufferCallback& callback) |
| override; |
| - |
| void DestroyGpuMemoryBuffer(mojom::GpuMemoryBufferIdPtr id, |
| const gpu::SyncToken& sync_token) override; |
| + // gpu::GpuChannelHostFactory overrides: |
| + bool IsMainThread() override; |
| + scoped_refptr<base::SingleThreadTaskRunner> GetIOThreadTaskRunner() override; |
| + std::unique_ptr<base::SharedMemory> AllocateSharedMemory( |
| + size_t size) override; |
| + |
| + Delegate* delegate_; |
| int32_t next_client_id_; |
| + scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; |
| mojom::GpuServiceInternalPtr gpu_service_; |
| - mojo::BindingSet<GpuService> bindings_; |
| + mojo::BindingSet<mojom::GpuService> bindings_; |
| gpu::GPUInfo gpu_info_; |
| + scoped_refptr<gpu::GpuChannelHost> gpu_channel_; |
| + base::WaitableEvent shutdown_event_; |
| + std::unique_ptr<base::Thread> io_thread_; |
| + std::unique_ptr<MusGpuMemoryBufferManager> gpu_memory_buffer_manager_; |
| DISALLOW_COPY_AND_ASSIGN(GpuServiceProxy); |
| }; |
| +} // namespace ws |
| } // namespace ui |
| #endif // SERVICES_UI_WS_GPU_SERVICE_PROXY_H_ |