| 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: |
| 66 // |broker| must outlive GpuChannelManager and any channels it creates. |
| 65 GpuChannelManager(MessageRouter* router, | 67 GpuChannelManager(MessageRouter* router, |
| 66 GpuWatchdog* watchdog, | 68 GpuWatchdog* watchdog, |
| 67 base::SingleThreadTaskRunner* io_task_runner, | 69 base::SingleThreadTaskRunner* io_task_runner, |
| 68 base::WaitableEvent* shutdown_event, | 70 base::WaitableEvent* shutdown_event, |
| 69 IPC::SyncChannel* channel); | 71 IPC::SyncChannel* channel, |
| 72 IPC::AttachmentBroker* broker); |
| 70 ~GpuChannelManager() override; | 73 ~GpuChannelManager() override; |
| 71 | 74 |
| 72 // Remove the channel for a particular renderer. | 75 // Remove the channel for a particular renderer. |
| 73 void RemoveChannel(int client_id); | 76 void RemoveChannel(int client_id); |
| 74 | 77 |
| 75 // Listener overrides. | 78 // Listener overrides. |
| 76 bool OnMessageReceived(const IPC::Message& msg) override; | 79 bool OnMessageReceived(const IPC::Message& msg) override; |
| 77 | 80 |
| 78 // Sender overrides. | 81 // Sender overrides. |
| 79 bool Send(IPC::Message* msg) override; | 82 bool Send(IPC::Message* msg) override; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 GpuMemoryManager gpu_memory_manager_; | 155 GpuMemoryManager gpu_memory_manager_; |
| 153 GpuWatchdog* watchdog_; | 156 GpuWatchdog* watchdog_; |
| 154 scoped_refptr<gpu::SyncPointManager> sync_point_manager_; | 157 scoped_refptr<gpu::SyncPointManager> sync_point_manager_; |
| 155 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; | 158 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; |
| 156 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; | 159 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; |
| 157 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; | 160 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; |
| 158 scoped_ptr<GpuMemoryBufferFactory> gpu_memory_buffer_factory_; | 161 scoped_ptr<GpuMemoryBufferFactory> gpu_memory_buffer_factory_; |
| 159 IPC::SyncChannel* channel_; | 162 IPC::SyncChannel* channel_; |
| 160 scoped_refptr<IPC::MessageFilter> filter_; | 163 scoped_refptr<IPC::MessageFilter> filter_; |
| 161 bool relinquish_resources_pending_; | 164 bool relinquish_resources_pending_; |
| 165 // Must outlive this instance of GpuChannelManager. |
| 166 IPC::AttachmentBroker* attachment_broker_; |
| 162 | 167 |
| 163 // Member variables should appear before the WeakPtrFactory, to ensure | 168 // Member variables should appear before the WeakPtrFactory, to ensure |
| 164 // that any WeakPtrs to Controller are invalidated before its members | 169 // that any WeakPtrs to Controller are invalidated before its members |
| 165 // variable's destructors are executed, rendering them invalid. | 170 // variable's destructors are executed, rendering them invalid. |
| 166 base::WeakPtrFactory<GpuChannelManager> weak_factory_; | 171 base::WeakPtrFactory<GpuChannelManager> weak_factory_; |
| 167 | 172 |
| 168 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); | 173 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); |
| 169 }; | 174 }; |
| 170 | 175 |
| 171 } // namespace content | 176 } // namespace content |
| 172 | 177 |
| 173 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ | 178 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ |
| OLD | NEW |