Chromium Code Reviews| 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_POST_TASK_H_ | 5 #ifndef BASE_TASK_SCHEDULER_POST_TASK_H_ |
| 6 #define BASE_TASK_SCHEDULER_POST_TASK_H_ | 6 #define BASE_TASK_SCHEDULER_POST_TASK_H_ |
| 7 | 7 |
| 8 #include "base/base_export.h" | 8 #include "base/base_export.h" |
| 9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/sequenced_task_runner.h" | 12 #include "base/sequenced_task_runner.h" |
| 13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
| 14 #include "base/task_runner.h" | 14 #include "base/task_runner.h" |
| 15 #include "base/task_scheduler/task_traits.h" | 15 #include "base/task_scheduler/task_traits.h" |
| 16 | 16 |
| 17 // To avoid redundant includes: users may omit including the following headers | |
| 18 // if they are using their provided data types solely in direct interactions | |
| 19 // with this API: location.h, task_traits.h, and *task_runner.h. | |
|
robliao
2016/11/02 20:13:55
Is the asterisk in task_runner.h intentional?
gab
2016/11/02 20:25:21
Yes, it applies to all 3 TaskRunner headers.
danakj
2016/11/02 22:58:01
I think this comment is overprescribing things, ju
| |
| 20 | |
| 17 namespace base { | 21 namespace base { |
| 18 | 22 |
| 19 // This is the preferred interface to post tasks to the TaskScheduler. | 23 // This is the preferred interface to post tasks to the TaskScheduler. |
| 20 // | 24 // |
| 21 // Note: The TaskScheduler is still in an experimental phase in Chrome. Please | 25 // Note: The TaskScheduler is still in an experimental phase in Chrome. Please |
| 22 // refrain from using this API unless you know what you are doing. | 26 // refrain from using this API unless you know what you are doing. |
| 23 // | 27 // |
| 24 // TaskScheduler must have been registered for the current process via | 28 // TaskScheduler must have been registered for the current process via |
| 25 // TaskScheduler::SetInstance() before the functions below are valid. | 29 // TaskScheduler::SetInstance() before the functions below are valid. |
| 26 // | 30 // |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 // CreateSequencedTaskRunnerWithTraits(). Only use this if you rely on a thread- | 109 // CreateSequencedTaskRunnerWithTraits(). Only use this if you rely on a thread- |
| 106 // affine API (it might be safer to assume thread-affinity when dealing with | 110 // affine API (it might be safer to assume thread-affinity when dealing with |
| 107 // under-documented third-party APIs, e.g. other OS') or share data across tasks | 111 // under-documented third-party APIs, e.g. other OS') or share data across tasks |
| 108 // using thread-local storage. | 112 // using thread-local storage. |
| 109 BASE_EXPORT scoped_refptr<SingleThreadTaskRunner> | 113 BASE_EXPORT scoped_refptr<SingleThreadTaskRunner> |
| 110 CreateSingleThreadTaskRunnerWithTraits(const TaskTraits& traits); | 114 CreateSingleThreadTaskRunnerWithTraits(const TaskTraits& traits); |
| 111 | 115 |
| 112 } // namespace base | 116 } // namespace base |
| 113 | 117 |
| 114 #endif // BASE_TASK_SCHEDULER_POST_TASK_H_ | 118 #endif // BASE_TASK_SCHEDULER_POST_TASK_H_ |
| OLD | NEW |