OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/task_scheduler/task_traits.h" |
| 6 |
| 7 namespace base { |
| 8 |
| 9 // Do not rely on defaults hard-coded below beyond the guarantees described in |
| 10 // the header; anything else is subject to change. Tasks should explicitly |
| 11 // request defaults if the behavior is critical to the task. |
| 12 TaskTraits::TaskTraits() |
| 13 : with_file_io_(false), |
| 14 priority_(TaskPriority::BACKGROUND), |
| 15 shutdown_behavior_(TaskShutdownBehavior::BLOCK_SHUTDOWN) {} |
| 16 |
| 17 TaskTraits::~TaskTraits() = default; |
| 18 |
| 19 TaskTraits& TaskTraits::WithFileIO() { |
| 20 with_file_io_ = true; |
| 21 return *this; |
| 22 } |
| 23 |
| 24 TaskTraits& TaskTraits::WithPriority(TaskPriority priority) { |
| 25 priority_ = priority; |
| 26 return *this; |
| 27 } |
| 28 |
| 29 TaskTraits& TaskTraits::WithShutdownBehavior( |
| 30 TaskShutdownBehavior shutdown_behavior) { |
| 31 shutdown_behavior_ = shutdown_behavior; |
| 32 return *this; |
| 33 } |
| 34 |
| 35 } // namespace base |
OLD | NEW |