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

Unified Diff: base/task_scheduler/scheduler_worker_pool.h

Issue 2464963002: TaskScheduler: Remove base::ExecutionMode. (Closed)
Patch Set: CR danakj #17 Created 4 years, 1 month 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
« no previous file with comments | « base/task_scheduler/scheduler_worker.cc ('k') | base/task_scheduler/scheduler_worker_pool_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/scheduler_worker_pool.h
diff --git a/base/task_scheduler/scheduler_worker_pool.h b/base/task_scheduler/scheduler_worker_pool.h
index 43dce606c6285fa68fc5797eeaf715bea3b52e69..c742ac3c454283d88b782b852831e4e0a5103710 100644
--- a/base/task_scheduler/scheduler_worker_pool.h
+++ b/base/task_scheduler/scheduler_worker_pool.h
@@ -9,6 +9,8 @@
#include "base/base_export.h"
#include "base/memory/ref_counted.h"
+#include "base/sequenced_task_runner.h"
+#include "base/single_thread_task_runner.h"
#include "base/task_runner.h"
#include "base/task_scheduler/sequence.h"
#include "base/task_scheduler/task.h"
@@ -25,11 +27,23 @@ class BASE_EXPORT SchedulerWorkerPool {
public:
virtual ~SchedulerWorkerPool() = default;
- // Returns a TaskRunner whose PostTask invocations will result in scheduling
- // Tasks with |traits| and |execution_mode| in this SchedulerWorkerPool.
+ // Returns a TaskRunner whose PostTask invocations result in scheduling tasks
+ // in this SchedulerWorkerPool using |traits|. Tasks may run in any order and
+ // in parallel.
virtual scoped_refptr<TaskRunner> CreateTaskRunnerWithTraits(
- const TaskTraits& traits,
- ExecutionMode execution_mode) = 0;
+ const TaskTraits& traits) = 0;
+
+ // Returns a SequencedTaskRunner whose PostTask invocations result in
+ // scheduling tasks in this SchedulerWorkerPool using |traits|. Tasks run one
+ // at a time in posting order.
+ virtual scoped_refptr<SequencedTaskRunner>
+ CreateSequencedTaskRunnerWithTraits(const TaskTraits& traits) = 0;
+
+ // Returns a SingleThreadTaskRunner whose PostTask invocations result in
+ // scheduling tasks in this SchedulerWorkerPool using |traits|. Tasks run on a
+ // single thread in posting order.
+ virtual scoped_refptr<SingleThreadTaskRunner>
+ CreateSingleThreadTaskRunnerWithTraits(const TaskTraits& traits) = 0;
// Inserts |sequence| with |sequence_sort_key| into a queue of Sequences that
// can be processed by any worker owned by this SchedulerWorkerPool. Must only
« no previous file with comments | « base/task_scheduler/scheduler_worker.cc ('k') | base/task_scheduler/scheduler_worker_pool_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698