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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 // Returns true if file I/O is allowed by these traits. | 101 // Returns true if file I/O is allowed by these traits. |
102 bool with_file_io() const { return with_file_io_; } | 102 bool with_file_io() const { return with_file_io_; } |
103 | 103 |
104 // Returns the priority of tasks with these traits. | 104 // Returns the priority of tasks with these traits. |
105 TaskPriority priority() const { return priority_; } | 105 TaskPriority priority() const { return priority_; } |
106 | 106 |
107 // Returns the shutdown behavior of tasks with these traits. | 107 // Returns the shutdown behavior of tasks with these traits. |
108 TaskShutdownBehavior shutdown_behavior() const { return shutdown_behavior_; } | 108 TaskShutdownBehavior shutdown_behavior() const { return shutdown_behavior_; } |
109 | 109 |
| 110 bool operator==(const TaskTraits& other) const; |
| 111 |
110 private: | 112 private: |
111 bool with_file_io_; | 113 bool with_file_io_; |
112 TaskPriority priority_; | 114 TaskPriority priority_; |
113 TaskShutdownBehavior shutdown_behavior_; | 115 TaskShutdownBehavior shutdown_behavior_; |
114 }; | 116 }; |
115 | 117 |
116 // Describes how tasks are executed by a task runner. | 118 // Describes how tasks are executed by a task runner. |
117 enum class ExecutionMode { | 119 enum class ExecutionMode { |
118 // Can execute multiple tasks at a time in any order. | 120 // Can execute multiple tasks at a time in any order. |
119 PARALLEL, | 121 PARALLEL, |
(...skipping 11 matching lines...) Expand all Loading... |
131 BASE_EXPORT std::ostream& operator<<(std::ostream& os, | 133 BASE_EXPORT std::ostream& operator<<(std::ostream& os, |
132 const TaskPriority& shutdown_behavior); | 134 const TaskPriority& shutdown_behavior); |
133 | 135 |
134 BASE_EXPORT std::ostream& operator<<( | 136 BASE_EXPORT std::ostream& operator<<( |
135 std::ostream& os, | 137 std::ostream& os, |
136 const TaskShutdownBehavior& shutdown_behavior); | 138 const TaskShutdownBehavior& shutdown_behavior); |
137 | 139 |
138 } // namespace base | 140 } // namespace base |
139 | 141 |
140 #endif // BASE_TASK_SCHEDULER_TASK_TRAITS_H_ | 142 #endif // BASE_TASK_SCHEDULER_TASK_TRAITS_H_ |
OLD | NEW |