Index: base/task_scheduler/task.cc |
diff --git a/base/task_scheduler/task.cc b/base/task_scheduler/task.cc |
index baac443b2d9f20023d2adc7af72e2b52137960c5..5a17b7f2093ee2668a4de8b6bc85f681e27823f7 100644 |
--- a/base/task_scheduler/task.cc |
+++ b/base/task_scheduler/task.cc |
@@ -9,20 +9,20 @@ namespace internal { |
Task::Task(const tracked_objects::Location& posted_from, |
const Closure& task, |
- const TaskTraits& traits_in, |
+ const TaskTraits& traits, |
const TimeDelta& delay) |
: PendingTask(posted_from, |
task, |
delay.is_zero() ? TimeTicks() : TimeTicks::Now() + delay, |
false), // Not nestable. |
- traits(traits_in) { |
- // Prevent a delayed BLOCK_SHUTDOWN task from blocking shutdown before being |
- // scheduled by changing its shutdown behavior to SKIP_ON_SHUTDOWN. |
- if (!delay.is_zero() && |
- traits.shutdown_behavior() == TaskShutdownBehavior::BLOCK_SHUTDOWN) { |
- traits.WithShutdownBehavior(TaskShutdownBehavior::SKIP_ON_SHUTDOWN); |
- } |
-} |
+ // Prevent a delayed BLOCK_SHUTDOWN task from blocking shutdown before |
+ // being scheduled by changing its shutdown behavior to SKIP_ON_SHUTDOWN. |
+ traits(!delay.is_zero() && |
+ traits.shutdown_behavior() == |
+ TaskShutdownBehavior::BLOCK_SHUTDOWN |
+ ? TaskTraits(traits).WithShutdownBehavior( |
+ TaskShutdownBehavior::SKIP_ON_SHUTDOWN) |
+ : traits) {} |
Task::~Task() = default; |