| 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 GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ | 5 #ifndef GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ |
| 6 #define GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ | 6 #define GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| 11 #include <memory> | 11 #include <memory> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <unordered_map> | 13 #include <unordered_map> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
| 20 #include "gpu/command_buffer/common/activity_flags.h" |
| 20 #include "gpu/command_buffer/common/constants.h" | 21 #include "gpu/command_buffer/common/constants.h" |
| 21 #include "gpu/command_buffer/service/gpu_preferences.h" | 22 #include "gpu/command_buffer/service/gpu_preferences.h" |
| 22 #include "gpu/config/gpu_driver_bug_workarounds.h" | 23 #include "gpu/config/gpu_driver_bug_workarounds.h" |
| 23 #include "gpu/config/gpu_feature_info.h" | 24 #include "gpu/config/gpu_feature_info.h" |
| 24 #include "gpu/gpu_export.h" | 25 #include "gpu/gpu_export.h" |
| 25 #include "gpu/ipc/service/gpu_memory_manager.h" | 26 #include "gpu/ipc/service/gpu_memory_manager.h" |
| 26 #include "ui/gfx/gpu_memory_buffer.h" | 27 #include "ui/gfx/gpu_memory_buffer.h" |
| 27 #include "ui/gfx/native_widget_types.h" | 28 #include "ui/gfx/native_widget_types.h" |
| 28 #include "ui/gl/gl_surface.h" | 29 #include "ui/gl/gl_surface.h" |
| 29 #include "url/gurl.h" | 30 #include "url/gurl.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 class GPU_EXPORT GpuChannelManager { | 66 class GPU_EXPORT GpuChannelManager { |
| 66 public: | 67 public: |
| 67 GpuChannelManager(const GpuPreferences& gpu_preferences, | 68 GpuChannelManager(const GpuPreferences& gpu_preferences, |
| 68 GpuChannelManagerDelegate* delegate, | 69 GpuChannelManagerDelegate* delegate, |
| 69 GpuWatchdogThread* watchdog, | 70 GpuWatchdogThread* watchdog, |
| 70 base::SingleThreadTaskRunner* task_runner, | 71 base::SingleThreadTaskRunner* task_runner, |
| 71 base::SingleThreadTaskRunner* io_task_runner, | 72 base::SingleThreadTaskRunner* io_task_runner, |
| 72 base::WaitableEvent* shutdown_event, | 73 base::WaitableEvent* shutdown_event, |
| 73 SyncPointManager* sync_point_manager, | 74 SyncPointManager* sync_point_manager, |
| 74 GpuMemoryBufferFactory* gpu_memory_buffer_factory, | 75 GpuMemoryBufferFactory* gpu_memory_buffer_factory, |
| 75 const GpuFeatureInfo& gpu_feature_info); | 76 const GpuFeatureInfo& gpu_feature_info, |
| 77 GpuProcessActivityFlags activity_flags); |
| 76 virtual ~GpuChannelManager(); | 78 virtual ~GpuChannelManager(); |
| 77 | 79 |
| 78 GpuChannelManagerDelegate* delegate() const { return delegate_; } | 80 GpuChannelManagerDelegate* delegate() const { return delegate_; } |
| 79 | 81 |
| 80 IPC::ChannelHandle EstablishChannel(int client_id, | 82 IPC::ChannelHandle EstablishChannel(int client_id, |
| 81 uint64_t client_tracing_id, | 83 uint64_t client_tracing_id, |
| 82 bool preempts, | 84 bool preempts, |
| 83 bool allow_view_command_buffers, | 85 bool allow_view_command_buffers, |
| 84 bool allow_real_time_streams); | 86 bool allow_real_time_streams); |
| 85 | 87 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 #if defined(OS_ANDROID) | 199 #if defined(OS_ANDROID) |
| 198 // Last time we know the GPU was powered on. Global for tracking across all | 200 // Last time we know the GPU was powered on. Global for tracking across all |
| 199 // transport surfaces. | 201 // transport surfaces. |
| 200 base::TimeTicks last_gpu_access_time_; | 202 base::TimeTicks last_gpu_access_time_; |
| 201 base::TimeTicks begin_wake_up_time_; | 203 base::TimeTicks begin_wake_up_time_; |
| 202 #endif | 204 #endif |
| 203 | 205 |
| 204 // Set during intentional GPU process shutdown. | 206 // Set during intentional GPU process shutdown. |
| 205 bool exiting_for_lost_context_; | 207 bool exiting_for_lost_context_; |
| 206 | 208 |
| 209 // Flags which indicate GPU process activity. Read by the browser process |
| 210 // on GPU process crash. |
| 211 GpuProcessActivityFlags activity_flags_; |
| 212 |
| 207 // Member variables should appear before the WeakPtrFactory, to ensure | 213 // Member variables should appear before the WeakPtrFactory, to ensure |
| 208 // that any WeakPtrs to Controller are invalidated before its members | 214 // that any WeakPtrs to Controller are invalidated before its members |
| 209 // variable's destructors are executed, rendering them invalid. | 215 // variable's destructors are executed, rendering them invalid. |
| 210 base::WeakPtrFactory<GpuChannelManager> weak_factory_; | 216 base::WeakPtrFactory<GpuChannelManager> weak_factory_; |
| 211 | 217 |
| 212 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); | 218 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); |
| 213 }; | 219 }; |
| 214 | 220 |
| 215 } // namespace gpu | 221 } // namespace gpu |
| 216 | 222 |
| 217 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ | 223 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ |
| OLD | NEW |