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

Unified Diff: services/ui/ws/gpu_service_proxy.cc

Issue 2276963002: services/ui: Introduce mojom.GpuServiceInternal. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mus-gpu-renames
Patch Set: . Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
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(
« services/ui/gpu/interfaces/gpu_service_internal.mojom ('K') | « services/ui/ws/gpu_service_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698