Chromium Code Reviews| Index: content/common/gpu/gpu_channel_manager.cc |
| diff --git a/content/common/gpu/gpu_channel_manager.cc b/content/common/gpu/gpu_channel_manager.cc |
| index 1f027783eb02dc5b839f150f1181872dde49cfd8..9c37102d9ab6bc6bc75e0cfea4507dda83b8526c 100644 |
| --- a/content/common/gpu/gpu_channel_manager.cc |
| +++ b/content/common/gpu/gpu_channel_manager.cc |
| @@ -39,6 +39,7 @@ GpuChannelManager::GpuChannelManager( |
| : task_runner_(task_runner), |
| io_task_runner_(io_task_runner), |
| channel_(channel), |
| + global_order_counter_(0), |
| watchdog_(watchdog), |
| shutdown_event_(shutdown_event), |
| gpu_memory_manager_( |
| @@ -50,6 +51,7 @@ GpuChannelManager::GpuChannelManager( |
| weak_factory_(this) { |
| DCHECK(task_runner); |
| DCHECK(io_task_runner); |
| + io_thread_checker_.DetachFromThread(); |
| } |
| GpuChannelManager::~GpuChannelManager() { |
| @@ -105,6 +107,11 @@ void GpuChannelManager::RemoveRoute(int32 routing_id) { |
| router_.RemoveRoute(routing_id); |
| } |
| +uint32_t GpuChannelManager::GenerateGlobalOrderNumber() { |
| + DCHECK(io_thread_checker_.CalledOnValidThread()); |
| + return global_order_counter_++; |
| +} |
| + |
| GpuChannel* GpuChannelManager::LookupChannel(int32 client_id) { |
| const auto& it = gpu_channels_.find(client_id); |
| return it != gpu_channels_.end() ? it->second : nullptr; |
| @@ -255,11 +262,12 @@ bool GpuChannelManager::HandleMessagesScheduled() { |
| return false; |
| } |
| -uint64 GpuChannelManager::MessagesProcessed() { |
| - uint64 messages_processed = 0; |
| +uint32_t GpuChannelManager::ProcessedOrderNumber() { |
| + uint32_t processed_order_num = 0; |
| for (auto& kv : gpu_channels_) |
|
piman
2015/08/31 23:15:04
nit: needs brackets per style guide
David Yen
2015/09/01 02:01:52
Done, although I was following the style in the be
|
| - messages_processed += kv.second->messages_processed(); |
| - return messages_processed; |
| + processed_order_num = std::max(processed_order_num, |
| + kv.second->GetProcessedOrderNum()); |
| + return processed_order_num; |
| } |
| void GpuChannelManager::LoseAllContexts() { |