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

Unified Diff: components/mus/common/gpu_service.cc

Issue 2049083002: Implement MusGpuMemoryBufferManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update the mojom document Created 4 years, 6 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
« no previous file with comments | « components/mus/common/generic_shared_memory_id_generator.cc ('k') | components/mus/gpu/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/common/gpu_service.cc
diff --git a/components/mus/common/gpu_service.cc b/components/mus/common/gpu_service.cc
index 37c0635078b4a1920dddd9241ac26f1b235f6f59..ab9a3ad06d5cb61e9c2bc426ed0a2afc3f3a614b 100644
--- a/components/mus/common/gpu_service.cc
+++ b/components/mus/common/gpu_service.cc
@@ -14,20 +14,6 @@
namespace mus {
-namespace {
-
-void GpuChannelEstablishCallback(int* client_id_out,
- IPC::ChannelHandle* channel_handle_out,
- gpu::GPUInfo* gpu_info_out,
- int client_id,
- mus::mojom::ChannelHandlePtr channel_handle,
- mus::mojom::GpuInfoPtr gpu_info) {
- *client_id_out = client_id;
- *channel_handle_out = channel_handle.To<IPC::ChannelHandle>();
- // TODO(penghuang): Get the gpu info.
-}
-}
-
GpuService::GpuService()
: main_message_loop_(base::MessageLoop::current()),
shutdown_event_(base::WaitableEvent::ResetPolicy::AUTOMATIC,
@@ -68,18 +54,19 @@ scoped_refptr<gpu::GpuChannelHost> GpuService::EstablishGpuChannel(
connector->ConnectToInterface("mojo:mus", &gpu_service);
int client_id = 0;
- IPC::ChannelHandle channel_handle;
- gpu::GPUInfo gpu_info;
- gpu_service->EstablishGpuChannel(base::Bind(
- &GpuChannelEstablishCallback, &client_id, &channel_handle, &gpu_info));
- if (!gpu_service.WaitForIncomingResponse()) {
+ mojom::ChannelHandlePtr channel_handle;
+ mojom::GpuInfoPtr gpu_info;
+ if (!gpu_service->EstablishGpuChannel(&client_id, &channel_handle,
+ &gpu_info)) {
DLOG(WARNING)
<< "Channel encountered error while establishing gpu channel.";
return nullptr;
}
- gpu_channel_ = gpu::GpuChannelHost::Create(this, client_id, gpu_info,
- channel_handle, &shutdown_event_,
- gpu_memory_buffer_manager_.get());
+
+ // TODO(penghuang): Get the real gpu info from mus.
+ gpu_channel_ = gpu::GpuChannelHost::Create(
+ this, client_id, gpu::GPUInfo(), channel_handle.To<IPC::ChannelHandle>(),
+ &shutdown_event_, gpu_memory_buffer_manager_.get());
return gpu_channel_;
}
« no previous file with comments | « components/mus/common/generic_shared_memory_id_generator.cc ('k') | components/mus/gpu/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698