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 26 matching lines...) Expand all Loading... |
37 union ValueState; | 37 union ValueState; |
38 namespace gles2 { | 38 namespace gles2 { |
39 class FramebufferCompletenessCache; | 39 class FramebufferCompletenessCache; |
40 class MailboxManager; | 40 class MailboxManager; |
41 class ProgramCache; | 41 class ProgramCache; |
42 class ShaderTranslatorCache; | 42 class ShaderTranslatorCache; |
43 } | 43 } |
44 } | 44 } |
45 | 45 |
46 namespace IPC { | 46 namespace IPC { |
47 class AttachmentBroker; | |
48 struct ChannelHandle; | 47 struct ChannelHandle; |
49 class SyncChannel; | 48 class SyncChannel; |
50 } | 49 } |
51 | 50 |
52 struct GPUCreateCommandBufferConfig; | 51 struct GPUCreateCommandBufferConfig; |
53 | 52 |
54 namespace content { | 53 namespace content { |
55 class GpuChannel; | 54 class GpuChannel; |
56 class GpuMemoryBufferFactory; | 55 class GpuMemoryBufferFactory; |
57 class GpuWatchdog; | 56 class GpuWatchdog; |
58 | 57 |
59 // A GpuChannelManager is a thread responsible for issuing rendering commands | 58 // A GpuChannelManager is a thread responsible for issuing rendering commands |
60 // managing the lifetimes of GPU channels and forwarding IPC requests from the | 59 // managing the lifetimes of GPU channels and forwarding IPC requests from the |
61 // browser process to them based on the corresponding renderer ID. | 60 // browser process to them based on the corresponding renderer ID. |
62 class CONTENT_EXPORT GpuChannelManager : public IPC::Listener, | 61 class CONTENT_EXPORT GpuChannelManager : public IPC::Listener, |
63 public IPC::Sender { | 62 public IPC::Sender { |
64 public: | 63 public: |
65 // |broker| must outlive GpuChannelManager and any channels it creates. | |
66 GpuChannelManager(IPC::SyncChannel* channel, | 64 GpuChannelManager(IPC::SyncChannel* channel, |
67 GpuWatchdog* watchdog, | 65 GpuWatchdog* watchdog, |
68 base::SingleThreadTaskRunner* task_runner, | 66 base::SingleThreadTaskRunner* task_runner, |
69 base::SingleThreadTaskRunner* io_task_runner, | 67 base::SingleThreadTaskRunner* io_task_runner, |
70 base::WaitableEvent* shutdown_event, | 68 base::WaitableEvent* shutdown_event, |
71 IPC::AttachmentBroker* broker, | |
72 gpu::SyncPointManager* sync_point_manager, | 69 gpu::SyncPointManager* sync_point_manager, |
73 GpuMemoryBufferFactory* gpu_memory_buffer_factory); | 70 GpuMemoryBufferFactory* gpu_memory_buffer_factory); |
74 ~GpuChannelManager() override; | 71 ~GpuChannelManager() override; |
75 | 72 |
76 // Remove the channel for a particular renderer. | 73 // Remove the channel for a particular renderer. |
77 void RemoveChannel(int client_id); | 74 void RemoveChannel(int client_id); |
78 | 75 |
79 // Listener overrides. | 76 // Listener overrides. |
80 bool OnMessageReceived(const IPC::Message& msg) override; | 77 bool OnMessageReceived(const IPC::Message& msg) override; |
81 | 78 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; | 164 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; |
168 GpuMemoryManager gpu_memory_manager_; | 165 GpuMemoryManager gpu_memory_manager_; |
169 // SyncPointManager guaranteed to outlive running MessageLoop. | 166 // SyncPointManager guaranteed to outlive running MessageLoop. |
170 gpu::SyncPointManager* sync_point_manager_; | 167 gpu::SyncPointManager* sync_point_manager_; |
171 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; | 168 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; |
172 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; | 169 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; |
173 scoped_refptr<gpu::gles2::FramebufferCompletenessCache> | 170 scoped_refptr<gpu::gles2::FramebufferCompletenessCache> |
174 framebuffer_completeness_cache_; | 171 framebuffer_completeness_cache_; |
175 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; | 172 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; |
176 GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; | 173 GpuMemoryBufferFactory* const gpu_memory_buffer_factory_; |
177 // Must outlive this instance of GpuChannelManager. | |
178 IPC::AttachmentBroker* attachment_broker_; | |
179 | 174 |
180 // Member variables should appear before the WeakPtrFactory, to ensure | 175 // Member variables should appear before the WeakPtrFactory, to ensure |
181 // that any WeakPtrs to Controller are invalidated before its members | 176 // that any WeakPtrs to Controller are invalidated before its members |
182 // variable's destructors are executed, rendering them invalid. | 177 // variable's destructors are executed, rendering them invalid. |
183 base::WeakPtrFactory<GpuChannelManager> weak_factory_; | 178 base::WeakPtrFactory<GpuChannelManager> weak_factory_; |
184 | 179 |
185 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); | 180 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); |
186 }; | 181 }; |
187 | 182 |
188 } // namespace content | 183 } // namespace content |
189 | 184 |
190 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ | 185 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ |
OLD | NEW |