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

Unified Diff: base/task_scheduler/task_scheduler_impl.cc

Issue 2399213005: TaskScheduler: Change Sequence::PeekTask to Sequence::TakeTask. (Closed)
Patch Set: self-review Created 4 years, 2 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
Index: base/task_scheduler/task_scheduler_impl.cc
diff --git a/base/task_scheduler/task_scheduler_impl.cc b/base/task_scheduler/task_scheduler_impl.cc
index 70a71baf7ce45d9ab1ce3632071b863f9cc40b11..66a6625f942d53fce0dbf2b7c8d71f71e966e338 100644
--- a/base/task_scheduler/task_scheduler_impl.cc
+++ b/base/task_scheduler/task_scheduler_impl.cc
@@ -118,12 +118,12 @@ void TaskSchedulerImpl::ReEnqueueSequenceCallback(
DCHECK(sequence);
const SequenceSortKey sort_key = sequence->GetSortKey();
- TaskTraits traits(sequence->PeekTask()->traits);
- // Update the priority of |traits| so that the next task in |sequence| runs
- // with the highest priority in |sequence| as opposed to the next task's
- // specific priority.
- traits.WithPriority(sort_key.priority());
+ // The next task in |sequence| should run in a worker pool suited for its
+ // traits, except for the priority which is adjusted to the highest priority
+ // in |sequence|.
+ const TaskTraits traits =
+ sequence->GetFrontTaskTraits().WithPriority(sort_key.priority());
GetWorkerPoolForTraits(traits)->ReEnqueueSequence(std::move(sequence),
sort_key);

Powered by Google App Engine
This is Rietveld 408576698