Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(403)

Unified Diff: content/common/gpu/gpu_channel_manager.cc

Issue 1308913004: GPU Channel's now maintain a global order number for each processed IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix merge error Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/gpu_channel_manager.h ('k') | content/common/gpu/gpu_command_buffer_stub.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..fa702b8161bfd6feb31a715bad648bccced65546 100644
--- a/content/common/gpu/gpu_channel_manager.cc
+++ b/content/common/gpu/gpu_channel_manager.cc
@@ -4,6 +4,8 @@
#include "content/common/gpu/gpu_channel_manager.h"
+#include <algorithm>
+
#include "base/bind.h"
#include "base/command_line.h"
#include "base/location.h"
@@ -247,24 +249,28 @@ void GpuChannelManager::OnLoadedShader(std::string program_proto) {
program_cache()->LoadProgram(program_proto);
}
-bool GpuChannelManager::HandleMessagesScheduled() {
+uint32_t GpuChannelManager::ProcessedOrderNumber() {
+ uint32_t processed_order_num = 0;
for (auto& kv : gpu_channels_) {
- if (kv.second->handle_messages_scheduled())
- return true;
+ processed_order_num =
+ std::max(processed_order_num, kv.second->GetProcessedOrderNum());
}
- return false;
+ return processed_order_num;
}
-uint64 GpuChannelManager::MessagesProcessed() {
- uint64 messages_processed = 0;
- for (auto& kv : gpu_channels_)
- messages_processed += kv.second->messages_processed();
- return messages_processed;
+uint32_t GpuChannelManager::UnprocessedOrderNumber() {
+ uint32_t unprocessed_order_num = 0;
+ for (auto& kv : gpu_channels_) {
+ unprocessed_order_num =
+ std::max(unprocessed_order_num, kv.second->GetUnprocessedOrderNum());
+ }
+ return unprocessed_order_num;
}
void GpuChannelManager::LoseAllContexts() {
- for (auto& kv : gpu_channels_)
+ for (auto& kv : gpu_channels_) {
kv.second->MarkAllContextsLost();
+ }
task_runner_->PostTask(FROM_HERE,
base::Bind(&GpuChannelManager::OnLoseAllContexts,
weak_factory_.GetWeakPtr()));
« no previous file with comments | « content/common/gpu/gpu_channel_manager.h ('k') | content/common/gpu/gpu_command_buffer_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698