Chromium Code Reviews| 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_CLIENT_GPU_CHANNEL_HOST_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
| 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 154 // closed. Returns an invalid handle on failure. | 154 // closed. Returns an invalid handle on failure. |
| 155 gfx::GpuMemoryBufferHandle ShareGpuMemoryBufferToGpuProcess( | 155 gfx::GpuMemoryBufferHandle ShareGpuMemoryBufferToGpuProcess( |
| 156 gfx::GpuMemoryBufferHandle source_handle); | 156 gfx::GpuMemoryBufferHandle source_handle); |
| 157 | 157 |
| 158 // Reserve one unused image ID. | 158 // Reserve one unused image ID. |
| 159 int32 ReserveImageId(); | 159 int32 ReserveImageId(); |
| 160 | 160 |
| 161 // Generate a route ID guaranteed to be unique for this channel. | 161 // Generate a route ID guaranteed to be unique for this channel. |
| 162 int32 GenerateRouteID(); | 162 int32 GenerateRouteID(); |
| 163 | 163 |
| 164 // To be called on IO thread. | |
|
reveman
2014/10/21 20:27:58
I assume it's more appropriate to do the thread ho
alexst (slow to review)
2014/10/22 14:47:08
I was initially thinking that since the browser si
| |
| 165 void WaitForPendingGpuMemoryBufferUsageToComplete( | |
| 166 const base::Closure& callback); | |
| 167 | |
| 164 private: | 168 private: |
| 165 friend class base::RefCountedThreadSafe<GpuChannelHost>; | 169 friend class base::RefCountedThreadSafe<GpuChannelHost>; |
| 166 GpuChannelHost(GpuChannelHostFactory* factory, | 170 GpuChannelHost(GpuChannelHostFactory* factory, |
| 167 const gpu::GPUInfo& gpu_info, | 171 const gpu::GPUInfo& gpu_info, |
| 168 cc::GpuMemoryBufferManager* gpu_memory_buffer_manager); | 172 cc::GpuMemoryBufferManager* gpu_memory_buffer_manager); |
| 169 virtual ~GpuChannelHost(); | 173 virtual ~GpuChannelHost(); |
| 170 void Connect(const IPC::ChannelHandle& channel_handle, | 174 void Connect(const IPC::ChannelHandle& channel_handle, |
| 171 base::WaitableEvent* shutdown_event); | 175 base::WaitableEvent* shutdown_event); |
| 172 | 176 |
| 173 // A filter used internally to route incoming messages from the IO thread | 177 // A filter used internally to route incoming messages from the IO thread |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 235 | 239 |
| 236 // Route IDs are allocated in sequence. | 240 // Route IDs are allocated in sequence. |
| 237 base::AtomicSequenceNumber next_route_id_; | 241 base::AtomicSequenceNumber next_route_id_; |
| 238 | 242 |
| 239 // Protects proxies_. | 243 // Protects proxies_. |
| 240 mutable base::Lock context_lock_; | 244 mutable base::Lock context_lock_; |
| 241 // Used to look up a proxy from its routing id. | 245 // Used to look up a proxy from its routing id. |
| 242 typedef base::hash_map<int, CommandBufferProxyImpl*> ProxyMap; | 246 typedef base::hash_map<int, CommandBufferProxyImpl*> ProxyMap; |
| 243 ProxyMap proxies_; | 247 ProxyMap proxies_; |
| 244 | 248 |
| 249 void WaitForPendingGpuMemoryBufferUsageToCompleteOnMain(uint32 id); | |
| 250 void OnSignalSyncPoint(uint32 id); | |
| 251 void ProcessSignalCounterOnIO(uint32 id); | |
| 252 | |
| 253 typedef base::hash_map<uint32, base::Closure> SignalTaskMap; | |
| 254 typedef base::hash_map<uint32, int> SignalCounterMap; | |
| 255 uint32 next_signal_id_; | |
| 256 SignalTaskMap signal_tasks_; | |
| 257 SignalCounterMap signal_counters_; | |
| 258 | |
| 245 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); | 259 DISALLOW_COPY_AND_ASSIGN(GpuChannelHost); |
| 246 }; | 260 }; |
| 247 | 261 |
| 248 } // namespace content | 262 } // namespace content |
| 249 | 263 |
| 250 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ | 264 #endif // CONTENT_COMMON_GPU_CLIENT_GPU_CHANNEL_HOST_H_ |
| OLD | NEW |