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

Unified Diff: services/ui/ws/gpu_client.h

Issue 2741343003: Update liftetime management of GpuClient (Closed)
Patch Set: fix x11 re-definition Created 3 years, 9 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 | « services/ui/ws/DEPS ('k') | services/ui/ws/gpu_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/gpu_client.h
diff --git a/services/ui/ws/gpu_client.h b/services/ui/ws/gpu_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..ac5f07292b23d2fe1859076bc803b9280cadf2ec
--- /dev/null
+++ b/services/ui/ws/gpu_client.h
@@ -0,0 +1,69 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SERVICES_UI_WS_GPU_CLIENT_H_
+#define SERVICES_UI_WS_GPU_CLIENT_H_
+
+#include "base/memory/weak_ptr.h"
+#include "gpu/config/gpu_info.h"
+#include "services/ui/public/interfaces/gpu.mojom.h"
+
+namespace ui {
+
+namespace mojom {
+class GpuService;
+} // namespace mojom
+
+class ServerGpuMemoryBufferManager;
+
+namespace ws {
+
+namespace test {
+class GpuHostTest;
+} // namespace test
+
+// The implementation that relays requests from clients to the real
+// service implementation in the GPU process over mojom.GpuService.
+class GpuClient : public mojom::Gpu {
+ public:
+ GpuClient(int client_id,
+ gpu::GPUInfo* gpu_info,
+ ServerGpuMemoryBufferManager* gpu_memory_buffer_manager,
+ mojom::GpuService* gpu_service);
+ ~GpuClient() override;
+
+ private:
+ friend class test::GpuHostTest;
+
+ // EstablishGpuChannelCallback:
+ void OnGpuChannelEstablished(const EstablishGpuChannelCallback& callback,
+ mojo::ScopedMessagePipeHandle channel_handle);
+ // mojom::Gpu overrides:
+ void EstablishGpuChannel(
+ const EstablishGpuChannelCallback& callback) override;
+ void CreateGpuMemoryBuffer(
+ gfx::GpuMemoryBufferId id,
+ const gfx::Size& size,
+ gfx::BufferFormat format,
+ gfx::BufferUsage usage,
+ const mojom::Gpu::CreateGpuMemoryBufferCallback& callback) override;
+ void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
+ const gpu::SyncToken& sync_token) override;
+
+ const int client_id_;
+
+ // The objects these pointers refer to are owned by the GpuHost object.
+ const gpu::GPUInfo* gpu_info_;
+ ServerGpuMemoryBufferManager* gpu_memory_buffer_manager_;
+ mojom::GpuService* gpu_service_;
+
+ base::WeakPtrFactory<GpuClient> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(GpuClient);
+};
+
+} // namespace ws
+} // namespace ui
+
+#endif // SERVICES_UI_WS_GPU_CLIENT_H_
« no previous file with comments | « services/ui/ws/DEPS ('k') | services/ui/ws/gpu_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698