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

Unified Diff: cc/raster/task_graph_work_queue.h

Issue 1666283002: Reland - Refactor signaling in RWP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build Created 4 years, 10 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 | « no previous file | cc/raster/task_graph_work_queue.cc » ('j') | cc/raster/task_graph_work_queue.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/raster/task_graph_work_queue.h
diff --git a/cc/raster/task_graph_work_queue.h b/cc/raster/task_graph_work_queue.h
index 95d3c772c24f22ea478757e2d1a81d40ab231b9e..93cadc8d789f1c9229ffe18792b397c55af08112 100644
--- a/cc/raster/task_graph_work_queue.h
+++ b/cc/raster/task_graph_work_queue.h
@@ -60,11 +60,11 @@ class CC_EXPORT TaskGraphWorkQueue {
// category.
std::map<uint16_t, PrioritizedTask::Vector> ready_to_run_tasks;
+ // This set contains all currently running tasks.
+ std::map<uint16_t, Task::Vector> running_tasks;
+
// Completed tasks not yet collected by origin thread.
Task::Vector completed_tasks;
-
- // This set contains all currently running tasks.
- Task::Vector running_tasks;
};
TaskGraphWorkQueue();
@@ -145,6 +145,18 @@ class CC_EXPORT TaskGraphWorkQueue {
return ready_to_run_namespaces_;
}
+ size_t NumRunningTasksForCategory(uint16_t category) const {
+ size_t count = 0;
+ for (const auto& task_namespace_entry : namespaces_) {
+ const auto& running_tasks = task_namespace_entry.second.running_tasks;
+ const auto& running_tasks_for_category = running_tasks.find(category);
+ if (running_tasks_for_category != running_tasks.cend()) {
+ count += running_tasks_for_category->second.size();
+ }
+ }
+ return count;
+ }
+
// Helper function which ensures that graph dependencies were correctly
// configured.
static bool DependencyMismatch(const TaskGraph* graph);
« no previous file with comments | « no previous file | cc/raster/task_graph_work_queue.cc » ('j') | cc/raster/task_graph_work_queue.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698