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

Unified Diff: base/task_scheduler/task_scheduler_impl.h

Issue 2146223002: Refactor WorkerPoolCreationArgs to a Read-Only WorkerPoolParams (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WorkerPoolParams -> SchedulerWorkerPoolParams and Some Cleanup Created 4 years, 5 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/task_scheduler_impl.h
diff --git a/base/task_scheduler/task_scheduler_impl.h b/base/task_scheduler/task_scheduler_impl.h
index 02cbe3c6c51b29a0b08f89a9aa3f450ac0a128dc..1867eacc52ecdc78946a9a857923570a6eb448fb 100644
--- a/base/task_scheduler/task_scheduler_impl.h
+++ b/base/task_scheduler/task_scheduler_impl.h
@@ -30,24 +30,11 @@ namespace base {
namespace internal {
class SchedulerServiceThread;
+class SchedulerWorkerPoolParams;
// Default TaskScheduler implementation. This class is thread-safe.
class BASE_EXPORT TaskSchedulerImpl : public TaskScheduler {
public:
- struct WorkerPoolCreationArgs {
- // Name of the pool. Used to label the pool's threads.
- std::string name;
-
- // Priority of the pool's threads.
- ThreadPriority thread_priority;
-
- // Whether I/O is allowed in the pool.
- SchedulerWorkerPoolImpl::IORestriction io_restriction;
-
- // Maximum number of threads in the pool.
- size_t max_threads;
- };
-
// Returns the index of the worker pool in which a task with |traits| should
// run. This should be coded in a future-proof way: new traits should
// gracefully map to a default pool.
@@ -59,7 +46,7 @@ class BASE_EXPORT TaskSchedulerImpl : public TaskScheduler {
// |worker_pool_index_for_traits_callback| returns the index in |worker_pools|
// of the worker pool in which a task with given traits should run.
static std::unique_ptr<TaskSchedulerImpl> Create(
- const std::vector<WorkerPoolCreationArgs>& worker_pools,
+ const std::vector<SchedulerWorkerPoolParams>& worker_pools_params,
const WorkerPoolIndexForTraitsCallback&
worker_pool_index_for_traits_callback);
@@ -85,7 +72,8 @@ class BASE_EXPORT TaskSchedulerImpl : public TaskScheduler {
TaskSchedulerImpl(const WorkerPoolIndexForTraitsCallback&
worker_pool_index_for_traits_callback);
- void Initialize(const std::vector<WorkerPoolCreationArgs>& worker_pools);
+ void Initialize(
+ const std::vector<SchedulerWorkerPoolParams>& worker_pools_params);
// Returns the worker pool that runs Tasks with |traits|.
SchedulerWorkerPool* GetWorkerPoolForTraits(const TaskTraits& traits);

Powered by Google App Engine
This is Rietveld 408576698