| 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 <vector> | 14 #include <vector> |
| 14 | 15 |
| 15 #include "base/containers/scoped_ptr_hash_map.h" | |
| 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/constants.h" | 20 #include "gpu/command_buffer/common/constants.h" |
| 21 #include "gpu/command_buffer/service/gpu_preferences.h" | 21 #include "gpu/command_buffer/service/gpu_preferences.h" |
| 22 #include "gpu/config/gpu_driver_bug_workarounds.h" | 22 #include "gpu/config/gpu_driver_bug_workarounds.h" |
| 23 #include "gpu/gpu_export.h" | 23 #include "gpu/gpu_export.h" |
| 24 #include "gpu/ipc/service/gpu_memory_manager.h" | 24 #include "gpu/ipc/service/gpu_memory_manager.h" |
| 25 #include "ui/gfx/gpu_memory_buffer.h" | 25 #include "ui/gfx/gpu_memory_buffer.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 149 |
| 150 SyncPointManager* sync_point_manager() const { | 150 SyncPointManager* sync_point_manager() const { |
| 151 return sync_point_manager_; | 151 return sync_point_manager_; |
| 152 } | 152 } |
| 153 | 153 |
| 154 PreemptionFlag* preemption_flag() const { return preemption_flag_.get(); } | 154 PreemptionFlag* preemption_flag() const { return preemption_flag_.get(); } |
| 155 | 155 |
| 156 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 156 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 157 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 157 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| 158 | 158 |
| 159 // These objects manage channels to individual renderer processes there is | 159 // These objects manage channels to individual renderer processes. There is |
| 160 // one channel for each renderer process that has connected to this GPU | 160 // one channel for each renderer process that has connected to this GPU |
| 161 // process. | 161 // process. |
| 162 base::ScopedPtrHashMap<int32_t, std::unique_ptr<GpuChannel>> gpu_channels_; | 162 std::unordered_map<int32_t, std::unique_ptr<GpuChannel>> gpu_channels_; |
| 163 | 163 |
| 164 private: | 164 private: |
| 165 void InternalDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id); | 165 void InternalDestroyGpuMemoryBuffer(gfx::GpuMemoryBufferId id, int client_id); |
| 166 void InternalDestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id, | 166 void InternalDestroyGpuMemoryBufferOnIO(gfx::GpuMemoryBufferId id, |
| 167 int client_id); | 167 int client_id); |
| 168 #if defined(OS_ANDROID) | 168 #if defined(OS_ANDROID) |
| 169 void ScheduleWakeUpGpu(); | 169 void ScheduleWakeUpGpu(); |
| 170 void DoWakeUpGpu(); | 170 void DoWakeUpGpu(); |
| 171 #endif | 171 #endif |
| 172 | 172 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 // that any WeakPtrs to Controller are invalidated before its members | 206 // that any WeakPtrs to Controller are invalidated before its members |
| 207 // variable's destructors are executed, rendering them invalid. | 207 // variable's destructors are executed, rendering them invalid. |
| 208 base::WeakPtrFactory<GpuChannelManager> weak_factory_; | 208 base::WeakPtrFactory<GpuChannelManager> weak_factory_; |
| 209 | 209 |
| 210 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); | 210 DISALLOW_COPY_AND_ASSIGN(GpuChannelManager); |
| 211 }; | 211 }; |
| 212 | 212 |
| 213 } // namespace gpu | 213 } // namespace gpu |
| 214 | 214 |
| 215 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ | 215 #endif // GPU_IPC_SERVICE_GPU_CHANNEL_MANAGER_H_ |
| OLD | NEW |