Index: services/ui/ws/gpu_client.cc |
diff --git a/services/ui/ws/gpu_client.cc b/services/ui/ws/gpu_client.cc |
index f5508b363b525967775f2086c73a128ad7de2bef..a16229f87dee1daae918a3b0ff3351dcefd16f76 100644 |
--- a/services/ui/ws/gpu_client.cc |
+++ b/services/ui/ws/gpu_client.cc |
@@ -7,6 +7,15 @@ |
#include "components/viz/common/server_gpu_memory_buffer_manager.h" |
#include "services/ui/gpu/interfaces/gpu_service.mojom.h" |
+namespace { |
+ |
+void RunCallback(const ui::mojom::Gpu::CreateGpuMemoryBufferCallback& callback, |
+ const gfx::GpuMemoryBufferHandle& handle) { |
+ callback.Run(handle); |
+} |
+ |
+} // namespace |
+ |
namespace ui { |
namespace ws { |
@@ -53,9 +62,9 @@ void GpuClient::CreateGpuMemoryBuffer( |
gfx::BufferFormat format, |
gfx::BufferUsage usage, |
const mojom::Gpu::CreateGpuMemoryBufferCallback& callback) { |
- auto handle = gpu_memory_buffer_manager_->CreateGpuMemoryBufferHandle( |
- id, client_id_, size, format, usage, gpu::kNullSurfaceHandle); |
- callback.Run(handle); |
+ gpu_memory_buffer_manager_->AllocateGpuMemoryBufferHandle( |
+ id, client_id_, size, format, usage, gpu::kNullSurfaceHandle, |
+ base::BindOnce(&RunCallback, callback)); |
} |
void GpuClient::DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, |