| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 // base::Create(Sequenced|SingleTreaded)TaskRunnerWithTraits(). If a thread is | 120 // base::Create(Sequenced|SingleTreaded)TaskRunnerWithTraits(). If a thread is |
| 121 // really needed, make it non-joinable and add cleanup work at the end of the | 121 // really needed, make it non-joinable and add cleanup work at the end of the |
| 122 // thread's main function (if using base::Thread, override Cleanup()). | 122 // thread's main function (if using base::Thread, override Cleanup()). |
| 123 // | 123 // |
| 124 // On Windows, join processes asynchronously using base::win::ObjectWatcher. | 124 // On Windows, join processes asynchronously using base::win::ObjectWatcher. |
| 125 // | 125 // |
| 126 // MayBlock() must be specified in conjunction with this trait if and only if | 126 // MayBlock() must be specified in conjunction with this trait if and only if |
| 127 // removing usage of methods listed above in the labeled tasks would still | 127 // removing usage of methods listed above in the labeled tasks would still |
| 128 // result in tasks that may block (per MayBlock()'s definition). | 128 // result in tasks that may block (per MayBlock()'s definition). |
| 129 // | 129 // |
| 130 // In doubt, consult with base/task_scheduler/OWNERS. | 130 // In doubt, consult with //base/task_scheduler/OWNERS. |
| 131 TaskTraits& WithBaseSyncPrimitives(); | 131 TaskTraits& WithBaseSyncPrimitives(); |
| 132 | 132 |
| 133 // Applies |priority| to tasks with these traits. | 133 // Applies |priority| to tasks with these traits. |
| 134 TaskTraits& WithPriority(TaskPriority priority); | 134 TaskTraits& WithPriority(TaskPriority priority); |
| 135 | 135 |
| 136 // Applies |shutdown_behavior| to tasks with these traits. | 136 // Applies |shutdown_behavior| to tasks with these traits. |
| 137 TaskTraits& WithShutdownBehavior(TaskShutdownBehavior shutdown_behavior); | 137 TaskTraits& WithShutdownBehavior(TaskShutdownBehavior shutdown_behavior); |
| 138 | 138 |
| 139 // Returns true if tasks with these traits may block. | 139 // Returns true if tasks with these traits may block. |
| 140 bool may_block() const { return may_block_; } | 140 bool may_block() const { return may_block_; } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 165 // DCHECK and EXPECT statements. | 165 // DCHECK and EXPECT statements. |
| 166 BASE_EXPORT std::ostream& operator<<(std::ostream& os, | 166 BASE_EXPORT std::ostream& operator<<(std::ostream& os, |
| 167 const TaskPriority& shutdown_behavior); | 167 const TaskPriority& shutdown_behavior); |
| 168 BASE_EXPORT std::ostream& operator<<( | 168 BASE_EXPORT std::ostream& operator<<( |
| 169 std::ostream& os, | 169 std::ostream& os, |
| 170 const TaskShutdownBehavior& shutdown_behavior); | 170 const TaskShutdownBehavior& shutdown_behavior); |
| 171 | 171 |
| 172 } // namespace base | 172 } // namespace base |
| 173 | 173 |
| 174 #endif // BASE_TASK_SCHEDULER_TASK_TRAITS_H_ | 174 #endif // BASE_TASK_SCHEDULER_TASK_TRAITS_H_ |
| OLD | NEW |