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

Unified Diff: base/task_scheduler/task_scheduler_impl.cc

Issue 2399213005: TaskScheduler: Change Sequence::PeekTask to Sequence::TakeTask. (Closed)
Patch Set: CR robliao #5 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
« no previous file with comments | « base/task_scheduler/sequence_unittest.cc ('k') | base/task_scheduler/task_tracker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..af9639b28377a2b531cda549458931fc6de52654 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->PeekTaskTraits().WithPriority(sort_key.priority());
GetWorkerPoolForTraits(traits)->ReEnqueueSequence(std::move(sequence),
sort_key);
« no previous file with comments | « base/task_scheduler/sequence_unittest.cc ('k') | base/task_scheduler/task_tracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698