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

Unified Diff: base/task_scheduler/scheduler_thread_pool_interface.h

Issue 1876363004: TaskScheduler [11] Support ExecutionMode::SINGLE_THREADED. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@8_delayed
Patch Set: all post tasks go through SchedulerThreadPool 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_interface.h
diff --git a/base/task_scheduler/scheduler_thread_pool_interface.h b/base/task_scheduler/scheduler_thread_pool_interface.h
index 3339849e00a88bd5234088cb9bc63f931d998776..adbb0d79270dbec1a4038e8e47e93845bc5fbaf9 100644
--- a/base/task_scheduler/scheduler_thread_pool_interface.h
+++ b/base/task_scheduler/scheduler_thread_pool_interface.h
@@ -15,16 +15,22 @@
namespace base {
namespace internal {
+class SchedulerWorkerThread;
+
// Interface for a thread pool.
class BASE_EXPORT SchedulerThreadPoolInterface {
public:
virtual ~SchedulerThreadPoolInterface() = default;
- // 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 as part of |sequence|. |task| will run on
+ // |worker_thread| if specified; otherwise it can run on a any thread owned by
+ // this pool. 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

Powered by Google App Engine
This is Rietveld 408576698