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

Unified Diff: content/gpu/chrome_gpu_memory_buffer_service_ipc_transport.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/BUILD.gn ('k') | content/gpu/chrome_gpu_memory_buffer_service_ipc_transport.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/gpu/chrome_gpu_memory_buffer_service_ipc_transport.h
diff --git a/content/gpu/chrome_gpu_memory_buffer_service_ipc_transport.h b/content/gpu/chrome_gpu_memory_buffer_service_ipc_transport.h
new file mode 100644
index 0000000000000000000000000000000000000000..115d24bd9389f1ef93cd800da75605147807d45f
--- /dev/null
+++ b/content/gpu/chrome_gpu_memory_buffer_service_ipc_transport.h
@@ -0,0 +1,67 @@
+// 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_CHROME_GPU_MEMORY_BUFFER_SERVICE_IPC_TRANSPORT_H_
+#define CONTENT_GPU_CHROME_GPU_MEMORY_BUFFER_SERVICE_IPC_TRANSPORT_H_
+
+#include "content/gpu/gpu_memory_buffer_service_ipc_transport.h"
+
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
+#include "ipc/message_filter.h"
+
+namespace IPC {
+class Message;
+class Sender;
+}
+
+namespace content {
+
+namespace {
+class GpuMemoryBufferServiceMessageFilter;
+}
+
+class ChromeGpuMemoryBufferServiceIPCTransport
+ : public GpuMemoryBufferServiceIPCTransport {
+ public:
+ static scoped_ptr<GpuMemoryBufferServiceIPCTransport> Create();
+
+ ~ChromeGpuMemoryBufferServiceIPCTransport() override;
+
+ // TODO(fsamuel): It shouldn't be necessary to expose this MessageFilter.
+ IPC::MessageFilter* filter() { return message_filter_.get(); }
+
+ // TODO(fsamuel): Add a BindToService once we have a
+ // ChromeGpuChildThreadIPCTransport.
+ // void BindToService(ChromeGpuChildThreadIPCTransport* channel_transport);
+ private:
+ friend class GpuMemoryBufferServiceMessageFilter;
+
+ ChromeGpuMemoryBufferServiceIPCTransport();
+
+ void CloseConnection();
+
+ // GpuMemoryBufferServiceIPCTrnasport implementation:
+ bool GpuMemoryBufferCreated(
+ const gfx::GpuMemoryBufferHandle& handle) override;
+ void SetClient(GpuMemoryBufferServiceIPCTransport::Client* client) override;
+
+ bool OnMessageReceived(const IPC::Message& message);
+
+ // Message handlers.
+ void OnCreateGpuMemoryBuffer(const CreateGpuMemoryBufferParams& params);
+ void OnCreateGpuMemoryBufferFromHandle(
+ const CreateGpuMemoryBufferFromHandleParams& params);
+
+ GpuMemoryBufferServiceIPCTransport::Client* client_;
+ IPC::Sender* sender_;
+ scoped_refptr<IPC::MessageFilter> message_filter_;
+ base::WeakPtrFactory<ChromeGpuMemoryBufferServiceIPCTransport> factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeGpuMemoryBufferServiceIPCTransport);
+};
+
+} // namespace content
+
+#endif // CONTENT_GPU_CHROME_GPU_MEMORY_BUFFER_SERVICE_IPC_TRANSPORT_H_
« no previous file with comments | « content/gpu/BUILD.gn ('k') | content/gpu/chrome_gpu_memory_buffer_service_ipc_transport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698