Chromium Code Reviews| Index: base/task_scheduler/post_task.h |
| diff --git a/base/task_scheduler/post_task.h b/base/task_scheduler/post_task.h |
| index 8b3e7dfa05b56a7757625f3cec75486ba4401f97..caa100a2605dec1948065f697e64d7b9b15d088a 100644 |
| --- a/base/task_scheduler/post_task.h |
| +++ b/base/task_scheduler/post_task.h |
| @@ -23,9 +23,6 @@ namespace base { |
| // This is the preferred interface to post tasks to the TaskScheduler. |
| // |
| -// TaskScheduler must have been registered for the current process via |
| -// TaskScheduler::SetInstance() before the functions below are valid. |
| -// |
| // To post a simple one-off task with default traits: |
| // PostTask(FROM_HERE, Bind(...)); |
| // |
| @@ -62,6 +59,14 @@ namespace base { |
| // registered TaskScheduler (i.e. not on the main thread). Tasks posted through |
| // functions below with a delay may be coalesced (i.e. delays may be adjusted to |
| // reduce the number of wakeups and hence power consumption). |
| +// |
| +// Prerequisite: A TaskScheduler must have been registered for the current |
| +// process via TaskScheduler::SetInstance() before the functions below are |
| +// valid. Note: this is typically done in the main of each process and you most |
|
robliao
2017/02/23 23:00:33
Omit "Note:"
Maybe
This is typically done during
gab
2017/02/23 23:39:57
Done and also documented GetInstance() further to
|
| +// likely don't have to worry about this if you're not in charge of the main for |
| +// your process (the failure mode isn't subtle either -- DCHECK or nullptr |
| +// crash -- so you'll find out quickly if this isn't the case). For tests, |
| +// prefer base::test::ScopedTaskScheduler. |
| // Posts |task| to the TaskScheduler. Calling this is equivalent to calling |
| // PostTaskWithTraits with plain TaskTraits. |