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

Unified Diff: content/browser/gpu/gpu_client.h

Issue 2514923002: content: Use mus client-lib's gpu-service from renderers. (Closed)
Patch Set: . Created 4 years 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 | « content/browser/BUILD.gn ('k') | content/browser/gpu/gpu_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/gpu_client.h
diff --git a/content/browser/gpu/gpu_client.h b/content/browser/gpu/gpu_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..70eb29f4039c74f3474815043252974675eb2d10
--- /dev/null
+++ b/content/browser/gpu/gpu_client.h
@@ -0,0 +1,51 @@
+// Copyright 2016 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 CONTENT_BROWSER_GPU_GPU_CLIENT_H_
+#define CONTENT_BROWSER_GPU_GPU_CLIENT_H_
+
+#include "base/memory/weak_ptr.h"
+#include "ipc/ipc_channel_handle.h"
+#include "mojo/public/cpp/bindings/binding_set.h"
+#include "services/ui/public/interfaces/gpu.mojom.h"
+
+namespace content {
+
+class GpuClient : public ui::mojom::Gpu {
+ public:
+ explicit GpuClient(int render_process_id);
+ ~GpuClient() override;
+
+ void Add(ui::mojom::GpuRequest request);
+
+ private:
+ void OnError();
+ void OnEstablishGpuChannel(const EstablishGpuChannelCallback& callback,
+ const IPC::ChannelHandle& channel,
+ const gpu::GPUInfo& gpu_info);
+ void OnCreateGpuMemoryBuffer(const CreateGpuMemoryBufferCallback& callback,
+ const gfx::GpuMemoryBufferHandle& handle);
+
+ // ui::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 ui::mojom::Gpu::CreateGpuMemoryBufferCallback& callback) override;
+ void DestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id,
+ const gpu::SyncToken& sync_token) override;
+
+ const int render_process_id_;
+ mojo::BindingSet<ui::mojom::Gpu> bindings_;
+ base::WeakPtrFactory<GpuClient> weak_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(GpuClient);
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_GPU_GPU_CLIENT_H_
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/gpu/gpu_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698