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

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: x++ > ++x 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') | content/renderer/raster_worker_pool.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..7fbd19b714243b0a379197f675449583cc79e453 100644
--- a/cc/raster/task_graph_work_queue.h
+++ b/cc/raster/task_graph_work_queue.h
@@ -46,6 +46,8 @@ class CC_EXPORT TaskGraphWorkQueue {
uint16_t priority;
};
+ using CategorizedTask = std::pair<uint16_t, scoped_refptr<Task>>;
+
// Helper classes and static methods used by dependent classes.
struct TaskNamespace {
typedef std::vector<TaskNamespace*> Vector;
@@ -64,7 +66,7 @@ class CC_EXPORT TaskGraphWorkQueue {
Task::Vector completed_tasks;
// This set contains all currently running tasks.
- Task::Vector running_tasks;
+ std::vector<CategorizedTask> running_tasks;
};
TaskGraphWorkQueue();
@@ -145,6 +147,19 @@ 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_) {
+ for (const auto& categorized_task :
+ task_namespace_entry.second.running_tasks) {
+ if (categorized_task.first == category) {
+ ++count;
+ }
+ }
+ }
+ 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') | content/renderer/raster_worker_pool.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698