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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 PARALLEL, | 119 PARALLEL, |
120 | 120 |
121 // Executes one task at a time in posting order. The sequence’s priority is | 121 // Executes one task at a time in posting order. The sequence’s priority is |
122 // equivalent to the highest priority pending task in the sequence. | 122 // equivalent to the highest priority pending task in the sequence. |
123 SEQUENCED, | 123 SEQUENCED, |
124 | 124 |
125 // Executes one task at a time on a single thread in posting order. | 125 // Executes one task at a time on a single thread in posting order. |
126 SINGLE_THREADED, | 126 SINGLE_THREADED, |
127 }; | 127 }; |
128 | 128 |
129 // Stream operators so TaskPriority and TaskShutdownBehavior can be used in | 129 // Returns string literals for the enums defined in this file. These methods |
130 // DCHECK statements. | 130 // should only be used for tracing and debugging. |
| 131 BASE_EXPORT const char* TaskPriorityToString(TaskPriority task_priority); |
| 132 BASE_EXPORT const char* TaskShutdownBehaviorToString( |
| 133 TaskShutdownBehavior task_priority); |
| 134 BASE_EXPORT const char* ExecutionModeToString(ExecutionMode task_priority); |
| 135 |
| 136 // Stream operators so that the enums defined in this file can be used in |
| 137 // DCHECK and EXPECT statements. |
131 BASE_EXPORT std::ostream& operator<<(std::ostream& os, | 138 BASE_EXPORT std::ostream& operator<<(std::ostream& os, |
132 const TaskPriority& shutdown_behavior); | 139 const TaskPriority& shutdown_behavior); |
133 | |
134 BASE_EXPORT std::ostream& operator<<( | 140 BASE_EXPORT std::ostream& operator<<( |
135 std::ostream& os, | 141 std::ostream& os, |
136 const TaskShutdownBehavior& shutdown_behavior); | 142 const TaskShutdownBehavior& shutdown_behavior); |
| 143 BASE_EXPORT std::ostream& operator<<(std::ostream& os, |
| 144 const ExecutionMode& execution_mode); |
137 | 145 |
138 } // namespace base | 146 } // namespace base |
139 | 147 |
140 #endif // BASE_TASK_SCHEDULER_TASK_TRAITS_H_ | 148 #endif // BASE_TASK_SCHEDULER_TASK_TRAITS_H_ |
OLD | NEW |