| 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 17 matching lines...) Expand all Loading... |
| 28 // Examples: | 28 // Examples: |
| 29 // - Updating the UI to reflect progress on a long task. | 29 // - Updating the UI to reflect progress on a long task. |
| 30 // - Loading data that might be shown in the UI after a future user | 30 // - Loading data that might be shown in the UI after a future user |
| 31 // interaction. | 31 // interaction. |
| 32 USER_VISIBLE, | 32 USER_VISIBLE, |
| 33 // This task affects UI immediately after a user interaction. | 33 // This task affects UI immediately after a user interaction. |
| 34 // Example: Generating data shown in the UI immediately after a click. | 34 // Example: Generating data shown in the UI immediately after a click. |
| 35 USER_BLOCKING, | 35 USER_BLOCKING, |
| 36 // This will always be equal to the highest priority available. | 36 // This will always be equal to the highest priority available. |
| 37 HIGHEST = USER_BLOCKING, | 37 HIGHEST = USER_BLOCKING, |
| 38 // Priority is inherited from the calling context. |
| 39 INHERITED, |
| 38 }; | 40 }; |
| 39 | 41 |
| 40 // Valid shutdown behaviors supported by the task scheduler. | 42 // Valid shutdown behaviors supported by the task scheduler. |
| 41 enum class TaskShutdownBehavior { | 43 enum class TaskShutdownBehavior { |
| 42 // Tasks posted with this mode which have not started executing before | 44 // Tasks posted with this mode which have not started executing before |
| 43 // shutdown is initiated will never run. Tasks with this mode running at | 45 // shutdown is initiated will never run. Tasks with this mode running at |
| 44 // shutdown will be ignored (the worker will not be joined). | 46 // shutdown will be ignored (the worker will not be joined). |
| 45 // | 47 // |
| 46 // This option provides a nice way to post stuff you don't want blocking | 48 // This option provides a nice way to post stuff you don't want blocking |
| 47 // shutdown. For example, you might be doing a slow DNS lookup and if it's | 49 // shutdown. For example, you might be doing a slow DNS lookup and if it's |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 // DCHECK and EXPECT statements. | 167 // DCHECK and EXPECT statements. |
| 166 BASE_EXPORT std::ostream& operator<<(std::ostream& os, | 168 BASE_EXPORT std::ostream& operator<<(std::ostream& os, |
| 167 const TaskPriority& shutdown_behavior); | 169 const TaskPriority& shutdown_behavior); |
| 168 BASE_EXPORT std::ostream& operator<<( | 170 BASE_EXPORT std::ostream& operator<<( |
| 169 std::ostream& os, | 171 std::ostream& os, |
| 170 const TaskShutdownBehavior& shutdown_behavior); | 172 const TaskShutdownBehavior& shutdown_behavior); |
| 171 | 173 |
| 172 } // namespace base | 174 } // namespace base |
| 173 | 175 |
| 174 #endif // BASE_TASK_SCHEDULER_TASK_TRAITS_H_ | 176 #endif // BASE_TASK_SCHEDULER_TASK_TRAITS_H_ |
| OLD | NEW |