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

Unified Diff: cc/raster/single_thread_task_graph_runner.cc

Issue 1489233003: TaskGraphRunner Group support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor
Patch Set: feedback Created 5 years 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
Index: cc/raster/single_thread_task_graph_runner.cc
diff --git a/cc/raster/single_thread_task_graph_runner.cc b/cc/raster/single_thread_task_graph_runner.cc
index 24994c953df20d703063d369d128bfed03c1ac20..0f3a8b4e73367f16e897384fc63fc00b571b3843 100644
--- a/cc/raster/single_thread_task_graph_runner.cc
+++ b/cc/raster/single_thread_task_graph_runner.cc
@@ -9,6 +9,7 @@
#include "base/threading/simple_thread.h"
#include "base/threading/thread_restrictions.h"
#include "base/trace_event/trace_event.h"
+#include "cc/raster/task_category.h"
namespace cc {
@@ -132,7 +133,16 @@ void SingleThreadTaskGraphRunner::RunTaskWithLockAcquired() {
lock_.AssertAcquired();
- auto prioritized_task = work_queue_.GetNextTaskToRun();
+ // Find the first category with any tasks to run. Categories used by this task
+ // graph runner are ordered by priority.
+ uint16_t category;
+ for (category = 0u; category < kNumTaskCategories; ++category) {
+ if (work_queue_.HasReadyToRunTasksForCategory(category))
+ break;
+ }
+ DCHECK(category < kNumTaskCategories);
+
+ auto prioritized_task = work_queue_.GetNextTaskToRun(category);
Task* task = prioritized_task.task;
// Call WillRun() before releasing |lock_| and running task.

Powered by Google App Engine
This is Rietveld 408576698