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

Unified Diff: cc/raster/synchronous_task_graph_runner.cc

Issue 1521423003: Revert of TaskGraphRunner Group support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor
Patch Set: 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
« no previous file with comments | « cc/raster/synchronous_task_graph_runner.h ('k') | cc/raster/task_graph_runner.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/raster/synchronous_task_graph_runner.cc
diff --git a/cc/raster/synchronous_task_graph_runner.cc b/cc/raster/synchronous_task_graph_runner.cc
index ea7b15bff065dc238c9d78d772da4bab317a8c0f..ed05cfb5823127277020491b4b5fbb0d6e3abbd2 100644
--- a/cc/raster/synchronous_task_graph_runner.cc
+++ b/cc/raster/synchronous_task_graph_runner.cc
@@ -3,9 +3,6 @@
// found in the LICENSE file.
#include "cc/raster/synchronous_task_graph_runner.h"
-
-#include <algorithm>
-#include <utility>
#include "base/threading/simple_thread.h"
#include "base/threading/thread_restrictions.h"
@@ -46,7 +43,7 @@
while (
!TaskGraphWorkQueue::HasFinishedRunningTasksInNamespace(task_namespace)) {
- DCHECK(RunTask());
+ RunTask();
}
}
@@ -60,27 +57,14 @@
}
void SynchronousTaskGraphRunner::RunUntilIdle() {
- while (RunTask()) {
- }
+ while (work_queue_.HasReadyToRunTasks())
+ RunTask();
}
-bool SynchronousTaskGraphRunner::RunTask() {
+void SynchronousTaskGraphRunner::RunTask() {
TRACE_EVENT0("toplevel", "SynchronousTaskGraphRunner::RunTask");
- // Find the first category with any tasks to run. This task graph runner
- // treats categories as an additional priority.
- const auto& ready_to_run_namespaces = work_queue_.ready_to_run_namespaces();
- auto found = std::find_if(
- ready_to_run_namespaces.cbegin(), ready_to_run_namespaces.cend(),
- [](const std::pair<uint16_t, TaskGraphWorkQueue::TaskNamespace::Vector>&
- pair) { return !pair.second.empty(); });
-
- if (found == ready_to_run_namespaces.cend()) {
- return false;
- }
-
- const uint16_t category = found->first;
- auto prioritized_task = work_queue_.GetNextTaskToRun(category);
+ auto prioritized_task = work_queue_.GetNextTaskToRun();
Task* task = prioritized_task.task;
task->WillRun();
@@ -88,8 +72,6 @@
task->DidRun();
work_queue_.CompleteTask(prioritized_task);
-
- return true;
}
} // namespace cc
« no previous file with comments | « cc/raster/synchronous_task_graph_runner.h ('k') | cc/raster/task_graph_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698