Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: base/task_scheduler/task_traits.h

Issue 2709163006: Update TaskScheduler docs to make it more obvious how a TaskScheduler should be put in place. (Closed)
Patch Set: review:fdoray Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/task_scheduler/task_scheduler.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « base/task_scheduler/task_scheduler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698