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

Unified Diff: base/task_scheduler/scheduler_thread_pool.h

Issue 1876363004: TaskScheduler [11] Support ExecutionMode::SINGLE_THREADED. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@8_delayed
Patch Set: add #include <algorithm> Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
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..9793162b62aab795563d6fe20805cde7b44c051f 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,26 @@ 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|. If |worker_thread| is
+ // non-null, |task| will be scheduled to run on it specifically (note:
+ // |worker_thread| must be owned by this SchedulerThreadPool); otherwise,
+ // |task| will be added to the pending shared work. Returns true if |task| is
+ // posted.
virtual bool PostTaskWithSequence(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|. 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;
+ // Posts |task| to be executed by this thread pool as part of |sequence|. If
+ // |worker_thread| is non-null, |task| will be scheduled to run on it
+ // specifically (note: |worker_thread| must be owned by this
+ // SchedulerThreadPool); otherwise, |task| will be added to the pending shared
+ // work. 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,
+ SchedulerWorkerThread* worker_thread) = 0;
};
} // namespace internal
« no previous file with comments | « base/task_scheduler/delayed_task_manager_unittest.cc ('k') | base/task_scheduler/scheduler_thread_pool_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698