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

Side by Side Diff: base/task_scheduler/task_scheduler_impl.h

Issue 2764603002: Add TaskScheduler::InitParams and accept it in TaskSchedulerImpl constructor. (Closed)
Patch Set: self-review Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ 5 #ifndef BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_
6 #define BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ 6 #define BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 17 matching lines...) Expand all
28 namespace internal { 28 namespace internal {
29 29
30 class DelayedTaskManager; 30 class DelayedTaskManager;
31 class SchedulerSingleThreadTaskRunnerManager; 31 class SchedulerSingleThreadTaskRunnerManager;
32 class TaskTracker; 32 class TaskTracker;
33 33
34 // Default TaskScheduler implementation. This class is thread-safe. 34 // Default TaskScheduler implementation. This class is thread-safe.
35 class BASE_EXPORT TaskSchedulerImpl : public TaskScheduler { 35 class BASE_EXPORT TaskSchedulerImpl : public TaskScheduler {
36 public: 36 public:
37 // Creates and returns an initialized TaskSchedulerImpl. CHECKs on failure. 37 // Creates and returns an initialized TaskSchedulerImpl. CHECKs on failure.
38 // |name| is used to label threads and histograms. It should identify the
39 // component that creates the TaskScheduler. |init_params| contains params to
40 // initialize worker pools.
41 //
42 // Note: The names and priority hints in |init_params| are ignored (ref. TODO
robliao 2017/03/23 18:00:52 Reference the bug instead?
fdoray 2017/03/24 14:00:39 Done.
43 // to remove them).
44 static std::unique_ptr<TaskSchedulerImpl> Create(
45 const std::string& name,
46 const TaskScheduler::InitParams& init_params);
47
48 // Creates and returns an initialized TaskSchedulerImpl. CHECKs on failure.
38 // |worker_pool_params_vector| describes the worker pools to create. 49 // |worker_pool_params_vector| describes the worker pools to create.
39 // |worker_pool_index_for_traits_callback| returns the index in |worker_pools| 50 // |worker_pool_index_for_traits_callback| returns the index in |worker_pools|
40 // of the worker pool in which a task with given traits should run. 51 // of the worker pool in which a task with given traits should run.
52 //
53 // Deprecated. https://crbug.com/690706
41 static std::unique_ptr<TaskSchedulerImpl> Create( 54 static std::unique_ptr<TaskSchedulerImpl> Create(
42 const std::vector<SchedulerWorkerPoolParams>& worker_pool_params_vector, 55 const std::vector<SchedulerWorkerPoolParams>& worker_pool_params_vector,
43 const WorkerPoolIndexForTraitsCallback& 56 const WorkerPoolIndexForTraitsCallback&
44 worker_pool_index_for_traits_callback); 57 worker_pool_index_for_traits_callback);
45 58
46 ~TaskSchedulerImpl() override; 59 ~TaskSchedulerImpl() override;
47 60
48 // TaskScheduler: 61 // TaskScheduler:
49 void PostDelayedTaskWithTraits(const tracked_objects::Location& from_here, 62 void PostDelayedTaskWithTraits(const tracked_objects::Location& from_here,
50 const TaskTraits& traits, 63 const TaskTraits& traits,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 AtomicFlag join_for_testing_returned_; 104 AtomicFlag join_for_testing_returned_;
92 #endif 105 #endif
93 106
94 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl); 107 DISALLOW_COPY_AND_ASSIGN(TaskSchedulerImpl);
95 }; 108 };
96 109
97 } // namespace internal 110 } // namespace internal
98 } // namespace base 111 } // namespace base
99 112
100 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_ 113 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698