OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ |
6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ | 6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 25 matching lines...) Expand all Loading... |
36 class SyncPointManager; | 36 class SyncPointManager; |
37 union ValueState; | 37 union ValueState; |
38 namespace gles2 { | 38 namespace gles2 { |
39 class MailboxManager; | 39 class MailboxManager; |
40 class ProgramCache; | 40 class ProgramCache; |
41 class ShaderTranslatorCache; | 41 class ShaderTranslatorCache; |
42 } | 42 } |
43 } | 43 } |
44 | 44 |
45 namespace IPC { | 45 namespace IPC { |
| 46 class AttachmentBroker; |
46 struct ChannelHandle; | 47 struct ChannelHandle; |
47 class SyncChannel; | 48 class SyncChannel; |
48 class MessageFilter; | 49 class MessageFilter; |
49 } | 50 } |
50 | 51 |
51 struct GPUCreateCommandBufferConfig; | 52 struct GPUCreateCommandBufferConfig; |
52 | 53 |
53 namespace content { | 54 namespace content { |
54 class GpuChannel; | 55 class GpuChannel; |
55 class GpuMemoryBufferFactory; | 56 class GpuMemoryBufferFactory; |
56 class GpuWatchdog; | 57 class GpuWatchdog; |
57 class MessageRouter; | 58 class MessageRouter; |
58 | 59 |
59 // A GpuChannelManager is a thread responsible for issuing rendering commands | 60 // A GpuChannelManager is a thread responsible for issuing rendering commands |
60 // managing the lifetimes of GPU channels and forwarding IPC requests from the | 61 // managing the lifetimes of GPU channels and forwarding IPC requests from the |
61 // browser process to them based on the corresponding renderer ID. | 62 // browser process to them based on the corresponding renderer ID. |
62 class CONTENT_EXPORT GpuChannelManager : public IPC::Listener, | 63 class CONTENT_EXPORT GpuChannelManager : public IPC::Listener, |
63 public IPC::Sender { | 64 public IPC::Sender { |
64 public: | 65 public: |
65 GpuChannelManager(MessageRouter* router, | 66 GpuChannelManager(MessageRouter* router, |
66 GpuWatchdog* watchdog, | 67 GpuWatchdog* watchdog, |
67 base::SingleThreadTaskRunner* io_task_runner, | 68 base::SingleThreadTaskRunner* io_task_runner, |
68 base::WaitableEvent* shutdown_event, | 69 base::WaitableEvent* shutdown_event, |
69 IPC::SyncChannel* channel); | 70 IPC::SyncChannel* channel, |
| 71 IPC::AttachmentBroker* broker); |
70 ~GpuChannelManager() override; | 72 ~GpuChannelManager() override; |
71 | 73 |
72 // Remove the channel for a particular renderer. | 74 // Remove the channel for a particular renderer. |
73 void RemoveChannel(int client_id); | 75 void RemoveChannel(int client_id); |
74 | 76 |
75 // Listener overrides. | 77 // Listener overrides. |
76 bool OnMessageReceived(const IPC::Message& msg) override; | 78 bool OnMessageReceived(const IPC::Message& msg) override; |
77 | 79 |
78 // Sender overrides. | 80 // Sender overrides. |
79 bool Send(IPC::Message* msg) override; | 81 bool Send(IPC::Message* msg) override; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 GpuMemoryManager gpu_memory_manager_; | 154 GpuMemoryManager gpu_memory_manager_; |
153 GpuWatchdog* watchdog_; | 155 GpuWatchdog* watchdog_; |
154 scoped_refptr<gpu::SyncPointManager> sync_point_manager_; | 156 scoped_refptr<gpu::SyncPointManager> sync_point_manager_; |
155 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; | 157 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; |
156 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; | 158 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; |
157 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; | 159 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; |
158 scoped_ptr<GpuMemoryBufferFactory> gpu_memory_buffer_factory_; | 160 scoped_ptr<GpuMemoryBufferFactory> gpu_memory_buffer_factory_; |
159 IPC::SyncChannel* channel_; | 161 IPC::SyncChannel* channel_; |
160 scoped_refptr<IPC::MessageFilter> filter_; | 162 scoped_refptr<IPC::MessageFilter> filter_; |
161 bool relinquish_resources_pending_; | 163 bool relinquish_resources_pending_; |
| 164 // Must outlive this instance of GpuChannelManager. |
| 165 IPC::AttachmentBroker* attachment_broker_; |
162 | 166 |
163 // Member variables should appear before the WeakPtrFactory, to ensure | 167 // Member variables should appear before the WeakPtrFactory, to ensure |
164 // that any WeakPtrs to Controller are invalidated before its members | 168 // that any WeakPtrs to Controller are invalidated before its members |
165 // variable's destructors are executed, rendering them invalid. | 169 // variable's destructors are executed, rendering them invalid. |
166 base::WeakPtrFactory<GpuChannelManager> weak_factory_; | 170 base::WeakPtrFactory<GpuChannelManager> weak_factory_; |
167 | 171 |
168 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); | 172 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); |
169 }; | 173 }; |
170 | 174 |
171 } // namespace content | 175 } // namespace content |
172 | 176 |
173 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ | 177 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ |
OLD | NEW |