| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 int32 sync_point); | 134 int32 sync_point); |
| 135 | 135 |
| 136 void OnRelinquishResources(); | 136 void OnRelinquishResources(); |
| 137 void OnResourcesRelinquished(); | 137 void OnResourcesRelinquished(); |
| 138 | 138 |
| 139 void OnUpdateValueState(int client_id, | 139 void OnUpdateValueState(int client_id, |
| 140 unsigned int target, | 140 unsigned int target, |
| 141 const gpu::ValueState& state); | 141 const gpu::ValueState& state); |
| 142 | 142 |
| 143 void OnLoseAllContexts(); | 143 void OnLoseAllContexts(); |
| 144 void CheckRelinquishGpuResources(); |
| 144 | 145 |
| 145 scoped_refptr<base::MessageLoopProxy> io_message_loop_; | 146 scoped_refptr<base::MessageLoopProxy> io_message_loop_; |
| 146 base::WaitableEvent* shutdown_event_; | 147 base::WaitableEvent* shutdown_event_; |
| 147 | 148 |
| 148 // Used to send and receive IPC messages from the browser process. | 149 // Used to send and receive IPC messages from the browser process. |
| 149 MessageRouter* const router_; | 150 MessageRouter* const router_; |
| 150 | 151 |
| 151 // These objects manage channels to individual renderer processes there is | 152 // These objects manage channels to individual renderer processes there is |
| 152 // one channel for each renderer process that has connected to this GPU | 153 // one channel for each renderer process that has connected to this GPU |
| 153 // process. | 154 // process. |
| 154 GpuChannelMap gpu_channels_; | 155 GpuChannelMap gpu_channels_; |
| 155 scoped_refptr<gfx::GLShareGroup> share_group_; | 156 scoped_refptr<gfx::GLShareGroup> share_group_; |
| 156 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; | 157 scoped_refptr<gpu::gles2::MailboxManager> mailbox_manager_; |
| 157 GpuMemoryManager gpu_memory_manager_; | 158 GpuMemoryManager gpu_memory_manager_; |
| 158 GpuEventsDispatcher gpu_devtools_events_dispatcher_; | 159 GpuEventsDispatcher gpu_devtools_events_dispatcher_; |
| 159 GpuWatchdog* watchdog_; | 160 GpuWatchdog* watchdog_; |
| 160 scoped_refptr<gpu::SyncPointManager> sync_point_manager_; | 161 scoped_refptr<gpu::SyncPointManager> sync_point_manager_; |
| 161 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; | 162 scoped_ptr<gpu::gles2::ProgramCache> program_cache_; |
| 162 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; | 163 scoped_refptr<gpu::gles2::ShaderTranslatorCache> shader_translator_cache_; |
| 163 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; | 164 scoped_refptr<gfx::GLSurface> default_offscreen_surface_; |
| 164 scoped_ptr<GpuMemoryBufferFactory> gpu_memory_buffer_factory_; | 165 scoped_ptr<GpuMemoryBufferFactory> gpu_memory_buffer_factory_; |
| 165 IPC::SyncChannel* channel_; | 166 IPC::SyncChannel* channel_; |
| 166 scoped_refptr<IPC::MessageFilter> filter_; | 167 scoped_refptr<IPC::MessageFilter> filter_; |
| 168 bool relinquish_resources_pending_; |
| 167 | 169 |
| 168 // Member variables should appear before the WeakPtrFactory, to ensure | 170 // Member variables should appear before the WeakPtrFactory, to ensure |
| 169 // that any WeakPtrs to Controller are invalidated before its members | 171 // that any WeakPtrs to Controller are invalidated before its members |
| 170 // variable's destructors are executed, rendering them invalid. | 172 // variable's destructors are executed, rendering them invalid. |
| 171 base::WeakPtrFactory<GpuChannelManager> weak_factory_; | 173 base::WeakPtrFactory<GpuChannelManager> weak_factory_; |
| 172 | 174 |
| 173 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); | 175 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); |
| 174 }; | 176 }; |
| 175 | 177 |
| 176 } // namespace content | 178 } // namespace content |
| 177 | 179 |
| 178 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ | 180 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_MANAGER_H_ |
| OLD | NEW |