Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BASE_TASK_SCHEDULER_TASK_TRAITS_H_ | 5 #ifndef BASE_TASK_SCHEDULER_TASK_TRAITS_H_ |
| 6 #define BASE_TASK_SCHEDULER_TASK_TRAITS_H_ | 6 #define BASE_TASK_SCHEDULER_TASK_TRAITS_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <iosfwd> | 10 #include <iosfwd> |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 public: | 80 public: |
| 81 // Constructs a default TaskTraits for tasks with | 81 // Constructs a default TaskTraits for tasks with |
| 82 // (1) no I/O, | 82 // (1) no I/O, |
| 83 // (2) low priority, and | 83 // (2) low priority, and |
| 84 // (3) may block shutdown or be skipped on shutdown. | 84 // (3) may block shutdown or be skipped on shutdown. |
| 85 // Tasks that require stricter guarantees should highlight those by requesting | 85 // Tasks that require stricter guarantees should highlight those by requesting |
| 86 // explicit traits below. | 86 // explicit traits below. |
| 87 TaskTraits(); | 87 TaskTraits(); |
| 88 TaskTraits(const TaskTraits& other) = default; | 88 TaskTraits(const TaskTraits& other) = default; |
| 89 TaskTraits& operator=(const TaskTraits& other) = default; | 89 TaskTraits& operator=(const TaskTraits& other) = default; |
| 90 ~TaskTraits(); | 90 ~TaskTraits() = default; |
|
robliao
2016/04/07 17:43:18
The Chromium guidance is
"Define them in the impl
gab
2016/04/08 21:00:04
Hmm, interesting, do we expect TaskTraits to be fw
gab
2016/04/08 21:01:48
Actually that destructor is private so virtual dis
| |
| 91 | 91 |
| 92 // Allows tasks with these traits to do file I/O. | 92 // Allows tasks with these traits to do file I/O. |
| 93 TaskTraits& WithFileIO(); | 93 TaskTraits& WithFileIO(); |
| 94 | 94 |
| 95 // Applies |priority| to tasks with these traits. | 95 // Applies |priority| to tasks with these traits. |
| 96 TaskTraits& WithPriority(TaskPriority priority); | 96 TaskTraits& WithPriority(TaskPriority priority); |
| 97 | 97 |
| 98 // Applies |shutdown_behavior| to tasks with these traits. | 98 // Applies |shutdown_behavior| to tasks with these traits. |
| 99 TaskTraits& WithShutdownBehavior(TaskShutdownBehavior shutdown_behavior); | 99 TaskTraits& WithShutdownBehavior(TaskShutdownBehavior shutdown_behavior); |
| 100 | 100 |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 131 BASE_EXPORT std::ostream& operator<<(std::ostream& os, | 131 BASE_EXPORT std::ostream& operator<<(std::ostream& os, |
| 132 const TaskPriority& shutdown_behavior); | 132 const TaskPriority& shutdown_behavior); |
| 133 | 133 |
| 134 BASE_EXPORT std::ostream& operator<<( | 134 BASE_EXPORT std::ostream& operator<<( |
| 135 std::ostream& os, | 135 std::ostream& os, |
| 136 const TaskShutdownBehavior& shutdown_behavior); | 136 const TaskShutdownBehavior& shutdown_behavior); |
| 137 | 137 |
| 138 } // namespace base | 138 } // namespace base |
| 139 | 139 |
| 140 #endif // BASE_TASK_SCHEDULER_TASK_TRAITS_H_ | 140 #endif // BASE_TASK_SCHEDULER_TASK_TRAITS_H_ |
| OLD | NEW |