Chromium Code Reviews| Index: base/task_scheduler/scheduler_thread_pool.h |
| diff --git a/base/task_scheduler/scheduler_thread_pool.h b/base/task_scheduler/scheduler_thread_pool.h |
| index 2451474d297209912dfae6a491731871a7e59e49..65d80351b10ff3cb39bee78a59fd03824da72fcd 100644 |
| --- a/base/task_scheduler/scheduler_thread_pool.h |
| +++ b/base/task_scheduler/scheduler_thread_pool.h |
| @@ -17,6 +17,7 @@ |
| namespace base { |
| namespace internal { |
| +class SchedulerWorkerThread; |
| struct SequenceSortKey; |
| // Interface for a thread pool. |
| @@ -37,16 +38,20 @@ class BASE_EXPORT SchedulerThreadPool { |
| virtual void ReEnqueueSequence(scoped_refptr<Sequence> sequence, |
| const SequenceSortKey& sequence_sort_key) = 0; |
| - // Posts |task| to be executed as part of |sequence|. Returns true if |task| |
| - // is posted. |
| + // Posts |task| to be executed as part of |sequence|. |task| will run on |
| + // |worker_thread| if specified. Returns true if |task| is posted. |
| virtual bool PostTaskWithSequence(std::unique_ptr<Task> task, |
|
robliao
2016/04/25 21:42:38
Similarly, should we instead have PostSingleThread
fdoray
2016/04/25 22:34:44
danakj@: What is your take on this? I think that y
gab
2016/04/26 11:46:27
+1 to single post task flow.
|
| - scoped_refptr<Sequence> sequence) = 0; |
| - |
| - // Posts |task| to be executed by this thread pool as part of |sequence|. The |
| - // scheduler's TaskTracker must have allowed |task| to be posted before this |
| - // is called. This must only be called after |task|'s delayed run time. |
| - virtual void PostTaskWithSequenceNow(std::unique_ptr<Task> task, |
| - scoped_refptr<Sequence> sequence) = 0; |
| + scoped_refptr<Sequence> sequence, |
| + SchedulerWorkerThread* worker_thread) = 0; |
| + |
| + // Posts |task| to be executed by this thread pool as part of |sequence|. |
| + // |task| will run on |worker_thread| if specified. The scheduler's |
|
gab
2016/04/25 21:00:20
Add a note that SchedulerThreadPool has to be the
fdoray
2016/04/25 22:34:44
Done.
|
| + // TaskTracker must have allowed |task| to be posted before this is called. |
| + // This must only be called after |task|'s delayed run time. |
| + virtual void PostTaskWithSequenceNow( |
| + std::unique_ptr<Task> task, |
| + scoped_refptr<Sequence> sequence, |
| + SchedulerWorkerThread* worker_thread) = 0; |
| }; |
| } // namespace internal |