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

Unified Diff: base/task_scheduler/post_task.cc

Issue 2873453002: Add base::TaskTraits::Override(). (Closed)
Patch Set: CR-gab Created 3 years, 7 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 | « no previous file | base/task_scheduler/task.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/post_task.cc
diff --git a/base/task_scheduler/post_task.cc b/base/task_scheduler/post_task.cc
index 6da11bd8dc15061bc6f0d23536b6df945c379adf..ec4bfb50f2dd8572f494e521a76ef3794daac9a5 100644
--- a/base/task_scheduler/post_task.cc
+++ b/base/task_scheduler/post_task.cc
@@ -34,10 +34,10 @@ class PostTaskAndReplyTaskRunner : public internal::PostTaskAndReplyImpl {
// explicitly in |traits|, the returned TaskTraits have the current
// TaskPriority.
TaskTraits GetTaskTraitsWithExplicitPriority(const TaskTraits& traits) {
- return traits.priority_set_explicitly()
- ? traits
- : TaskTraits(traits).WithPriority(
- internal::GetTaskPriorityForCurrentThread());
+ if (traits.priority_set_explicitly())
+ return traits;
+ return TaskTraits::Override(traits,
+ {internal::GetTaskPriorityForCurrentThread()});
}
} // namespace
« no previous file with comments | « no previous file | base/task_scheduler/task.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698