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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 // Note: Tasks with BACKGROUND priority that block shutdown will be promoted | 73 // Note: Tasks with BACKGROUND priority that block shutdown will be promoted |
| 74 // to USER_VISIBLE priority during shutdown. | 74 // to USER_VISIBLE priority during shutdown. |
| 75 BLOCK_SHUTDOWN, | 75 BLOCK_SHUTDOWN, |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 // Describes metadata for a single task or a group of tasks. | 78 // Describes metadata for a single task or a group of tasks. |
| 79 class BASE_EXPORT TaskTraits { | 79 class BASE_EXPORT TaskTraits { |
| 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) priority inherited from the calling context, 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 |
|
gab
2016/12/01 22:10:50
"guarantees and/or know the specific TaskPriority
robliao
2016/12/01 22:26:45
+1
fdoray
2016/12/02 13:41:53
Done.
| |
| 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(); |
| 91 | 91 |
| 92 // Allows tasks with these traits to wait on synchronous file I/O. | 92 // Allows tasks with these traits to wait on synchronous file I/O. |
| 93 TaskTraits& WithFileIO(); | 93 TaskTraits& WithFileIO(); |
| 94 | 94 |
| 95 // Allows tasks with these traits to wait on things other than file I/O. In | 95 // Allows tasks with these traits to wait on things other than file I/O. In |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 134 // DCHECK and EXPECT statements. | 134 // DCHECK and EXPECT statements. |
| 135 BASE_EXPORT std::ostream& operator<<(std::ostream& os, | 135 BASE_EXPORT std::ostream& operator<<(std::ostream& os, |
| 136 const TaskPriority& shutdown_behavior); | 136 const TaskPriority& shutdown_behavior); |
| 137 BASE_EXPORT std::ostream& operator<<( | 137 BASE_EXPORT std::ostream& operator<<( |
| 138 std::ostream& os, | 138 std::ostream& os, |
| 139 const TaskShutdownBehavior& shutdown_behavior); | 139 const TaskShutdownBehavior& shutdown_behavior); |
| 140 | 140 |
| 141 } // namespace base | 141 } // namespace base |
| 142 | 142 |
| 143 #endif // BASE_TASK_SCHEDULER_TASK_TRAITS_H_ | 143 #endif // BASE_TASK_SCHEDULER_TASK_TRAITS_H_ |
| OLD | NEW |