Commit 51f44b8e authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

[base] Tweak name of variable in TaskTracker::RunAndPopNextTask()

|task_is_worker_task| was hard to read as it identified what
|task| would become but that variable doesn't exist when
BeforeRunTask() is invoked. The answer from BeforeRunTask() is more
accurately "should_run_tasks".

R=etiennep@chromium.org

Change-Id: I9c581c5d4b477dbe06d8c2ecab9f844f649674ea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2105958
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: default avatarEtienne Pierre-Doray <etiennep@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753450}
parent bdc0a7dc
......@@ -487,16 +487,15 @@ RegisteredTaskSource TaskTracker::RunAndPopNextTask(
RegisteredTaskSource task_source) {
DCHECK(task_source);
const bool task_is_worker_task =
BeforeRunTask(task_source->shutdown_behavior());
const bool should_run_tasks = BeforeRunTask(task_source->shutdown_behavior());
// Run the next task in |task_source|.
Optional<Task> task;
TaskTraits traits;
{
auto transaction = task_source->BeginTransaction();
task = task_is_worker_task ? task_source.TakeTask(&transaction)
: task_source.Clear(&transaction);
task = should_run_tasks ? task_source.TakeTask(&transaction)
: task_source.Clear(&transaction);
traits = transaction.traits();
}
......@@ -504,7 +503,7 @@ RegisteredTaskSource TaskTracker::RunAndPopNextTask(
// Run the |task| (whether it's a worker task or the Clear() closure).
RunTask(std::move(task.value()), task_source.get(), traits);
}
if (task_is_worker_task)
if (should_run_tasks)
AfterRunTask(task_source->shutdown_behavior());
const bool task_source_must_be_queued = task_source.DidProcessTask();
// |task_source| should be reenqueued iff requested by DidProcessTask().
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment