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

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 refcounting issue. 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 | « cc/raster/synchronous_task_graph_runner.cc ('k') | cc/raster/task_graph_work_queue.cc » ('j') | no next file with comments »
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..3ea984a458491aeda084118c8a5211b621890292 100644
--- a/cc/raster/task_graph_work_queue.h
+++ b/cc/raster/task_graph_work_queue.h
@@ -28,19 +28,16 @@ class CC_EXPORT TaskGraphWorkQueue {
public:
struct TaskNamespace;
- struct PrioritizedTask {
+ struct CC_EXPORT PrioritizedTask {
typedef std::vector<PrioritizedTask> Vector;
PrioritizedTask(Task* task,
TaskNamespace* task_namespace,
uint16_t category,
- uint16_t priority)
- : task(task),
- task_namespace(task_namespace),
- category(category),
- priority(priority) {}
+ uint16_t priority);
+ ~PrioritizedTask();
- Task* task;
+ scoped_refptr<Task> task;
reveman 2016/02/24 18:53:00 hm, not sure about this. I'm worried this will mak
ericrk 2016/02/24 19:30:43 Introduced a new type, CategorizedTask, which refc
TaskNamespace* task_namespace;
uint16_t category;
uint16_t priority;
@@ -64,7 +61,7 @@ class CC_EXPORT TaskGraphWorkQueue {
Task::Vector completed_tasks;
// This set contains all currently running tasks.
- Task::Vector running_tasks;
+ PrioritizedTask::Vector running_tasks;
};
TaskGraphWorkQueue();
@@ -145,6 +142,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& prioritized_task :
+ task_namespace_entry.second.running_tasks) {
+ if (prioritized_task.category == 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 | « cc/raster/synchronous_task_graph_runner.cc ('k') | cc/raster/task_graph_work_queue.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698