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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_GPU_CHROME_GPU_MEMORY_BUFFER_SERVICE_IPC_TRANSPORT_H_
6 #define CONTENT_GPU_CHROME_GPU_MEMORY_BUFFER_SERVICE_IPC_TRANSPORT_H_
7
8 #include "content/gpu/gpu_memory_buffer_service_ipc_transport.h"
9
10 #include "base/memory/scoped_ptr.h"
11 #include "base/memory/weak_ptr.h"
12 #include "ipc/message_filter.h"
13
14 namespace IPC {
15 class Message;
16 class Sender;
17 }
18
19 namespace content {
20
21 namespace {
22 class GpuMemoryBufferServiceMessageFilter;
23 }
24
25 class ChromeGpuMemoryBufferServiceIPCTransport
26 : public GpuMemoryBufferServiceIPCTransport {
27 public:
28 static scoped_ptr<GpuMemoryBufferServiceIPCTransport> Create();
29
30 ~ChromeGpuMemoryBufferServiceIPCTransport() override;
31
32 // TODO(fsamuel): It shouldn't be necessary to expose this MessageFilter.
33 IPC::MessageFilter* filter() { return message_filter_.get(); }
34
35 // TODO(fsamuel): Add a BindToService once we have a
36 // ChromeGpuChildThreadIPCTransport.
37 // void BindToService(ChromeGpuChildThreadIPCTransport* channel_transport);
38 private:
39 friend class GpuMemoryBufferServiceMessageFilter;
40
41 ChromeGpuMemoryBufferServiceIPCTransport();
42
43 void CloseConnection();
44
45 // GpuMemoryBufferServiceIPCTrnasport implementation:
46 bool GpuMemoryBufferCreated(
47 const gfx::GpuMemoryBufferHandle& handle) override;
48 void SetClient(GpuMemoryBufferServiceIPCTransport::Client* client) override;
49
50 bool OnMessageReceived(const IPC::Message& message);
51
52 // Message handlers.
53 void OnCreateGpuMemoryBuffer(const CreateGpuMemoryBufferParams& params);
54 void OnCreateGpuMemoryBufferFromHandle(
55 const CreateGpuMemoryBufferFromHandleParams& params);
56
57 GpuMemoryBufferServiceIPCTransport::Client* client_;
58 IPC::Sender* sender_;
59 scoped_refptr<IPC::MessageFilter> message_filter_;
60 base::WeakPtrFactory<ChromeGpuMemoryBufferServiceIPCTransport> factory_;
61
62 DISALLOW_COPY_AND_ASSIGN(ChromeGpuMemoryBufferServiceIPCTransport);
63 };
64
65 } // namespace content
66
67 #endif // CONTENT_GPU_CHROME_GPU_MEMORY_BUFFER_SERVICE_IPC_TRANSPORT_H_
OLDNEW
« 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