| 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 156ef9acda846f0d2ef840ecee922d2aa3e69869..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"
|
| @@ -44,9 +41,9 @@
|
| if (!task_namespace)
|
| return;
|
|
|
| - while (!work_queue_.HasFinishedRunningTasksInNamespace(task_namespace)) {
|
| - bool succeeded = RunTask();
|
| - DCHECK(succeeded);
|
| + while (
|
| + !TaskGraphWorkQueue::HasFinishedRunningTasksInNamespace(task_namespace)) {
|
| + 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
|
|
|