Index: services/ui/ws/gpu_service_proxy.cc |
diff --git a/services/ui/ws/gpu_service_proxy.cc b/services/ui/ws/gpu_service_proxy.cc |
index bcae15fb5d86f2095b9f6e271ba125b5a69003a2..5779b4bfaa3a4d47bdf3e93a3af2f2e491fc8abe 100644 |
--- a/services/ui/ws/gpu_service_proxy.cc |
+++ b/services/ui/ws/gpu_service_proxy.cc |
@@ -10,39 +10,36 @@ |
namespace ui { |
-namespace { |
- |
-void EstablishGpuChannelDone( |
- const mojom::GpuService::EstablishGpuChannelCallback& callback, |
- int32_t client_id, |
- mojo::ScopedMessagePipeHandle handle) { |
- // TODO(penghuang): Send the real GPUInfo to the client. |
- callback.Run(client_id, std::move(handle), gpu::GPUInfo()); |
-} |
+GpuServiceProxy::GpuServiceProxy() { |
+ // TODO(sad): Once GPU process is split, this would look like: |
+ // connector->ConnectToInterface("mojo:gpu", &gpu_service_); |
+ GpuServiceInternal::GetInstance()->Add(GetProxy(&gpu_service_)); |
+ gpu_service_->Initialize( |
+ base::Bind(&GpuServiceProxy::OnInitialized, base::Unretained(this))); |
} |
-GpuServiceProxy::GpuServiceProxy() |
- : gpu_service_(GpuServiceInternal::GetInstance()) {} |
- |
GpuServiceProxy::~GpuServiceProxy() {} |
void GpuServiceProxy::Add(mojom::GpuServiceRequest request) { |
bindings_.AddBinding(this, std::move(request)); |
} |
+void GpuServiceProxy::OnInitialized(const gpu::GPUInfo& gpu_info) { |
+ gpu_info_ = gpu_info; |
+} |
+ |
+void GpuServiceProxy::OnGpuChannelEstablished( |
+ const EstablishGpuChannelCallback& callback, |
+ int32_t client_id, |
+ mojo::ScopedMessagePipeHandle channel_handle) { |
+ callback.Run(client_id, std::move(channel_handle), gpu_info_); |
+} |
+ |
void GpuServiceProxy::EstablishGpuChannel( |
- const mojom::GpuService::EstablishGpuChannelCallback& callback) { |
- // TODO(penghuang): crbug.com/617415 figure out how to generate a meaningful |
- // tracing id. |
- const uint64_t client_tracing_id = 0; |
- // TODO(penghuang): windows server may want to control those flags. |
- // Add a private interface for windows server. |
- const bool preempts = false; |
- const bool allow_view_command_buffers = false; |
- const bool allow_real_time_streams = false; |
+ const EstablishGpuChannelCallback& callback) { |
gpu_service_->EstablishGpuChannel( |
- client_tracing_id, preempts, allow_view_command_buffers, |
- allow_real_time_streams, base::Bind(&EstablishGpuChannelDone, callback)); |
+ base::Bind(&GpuServiceProxy::OnGpuChannelEstablished, |
+ base::Unretained(this), callback)); |
} |
void GpuServiceProxy::CreateGpuMemoryBuffer( |