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

Unified Diff: content/gpu/gpu_memory_buffer_service.h

Issue 1656433002: Sample code: IPC Transport object for GPU Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: GpuMemoryBufferService + Transport object. TODO: Eliminate ChildThreadImpl dependency Created 4 years, 10 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 | « content/gpu/gpu_child_thread.cc ('k') | content/gpu/gpu_memory_buffer_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/gpu/gpu_memory_buffer_service.h
diff --git a/content/gpu/gpu_memory_buffer_service.h b/content/gpu/gpu_memory_buffer_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..c37cd3e4c741caf5468e33c09d6e18f629a3c90f
--- /dev/null
+++ b/content/gpu/gpu_memory_buffer_service.h
@@ -0,0 +1,45 @@
+// Copyright 2015 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_GPU_GPU_MEMORY_BUFFER_SERVICE_H_
+#define CONTENT_GPU_GPU_MEMORY_BUFFER_SERVICE_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "content/gpu/gpu_memory_buffer_service_ipc_transport.h"
+#include "ipc/message_filter.h"
+
+namespace content {
+
+class GpuMemoryBufferFactory;
+struct CreateGpuMemoryBufferFromHandleParams;
+struct CreateGpuMemoryBufferParams;
+
+// Message filter used to to handle GpuMsg_CreateGpuMemoryBuffer messages on
+// the IO thread. This allows the UI thread in the browser process to remain
+// fast at all times.
+class GpuMemoryBufferService
+ : public GpuMemoryBufferServiceIPCTransport::Client {
+ public:
+ explicit GpuMemoryBufferService(
+ GpuMemoryBufferFactory* gpu_memory_buffer_factory);
+
+ GpuMemoryBufferServiceIPCTransport* transport() { return transport_.get(); }
+
+ private:
+ ~GpuMemoryBufferService() override;
+
+ // GpuMemoryBufferServiceIPCTransport::Client:
+ void OnConnectionClosed() override;
+ void OnCreateGpuMemoryBuffer(
+ const CreateGpuMemoryBufferParams& params) override;
+ void OnCreateGpuMemoryBufferFromHandle(
+ const CreateGpuMemoryBufferFromHandleParams& params) override;
+
+ scoped_ptr<GpuMemoryBufferServiceIPCTransport> transport_;
+ GpuMemoryBufferFactory* const gpu_memory_buffer_factory_;
+};
+
+} // namespace content
+
+#endif // CONTENT_GPU_GPU_MEMROY_BUFFER_SERVICE_H_
« no previous file with comments | « content/gpu/gpu_child_thread.cc ('k') | content/gpu/gpu_memory_buffer_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698