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

Unified Diff: base/task_scheduler/task_scheduler_impl.h

Issue 2834063002: Separate the create and start phases in TaskSchedulerImpl. (Closed)
Patch Set: self-review Created 3 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/task_scheduler_impl.h
diff --git a/base/task_scheduler/task_scheduler_impl.h b/base/task_scheduler/task_scheduler_impl.h
index 7460cb1a5bcc5227d21711cc0b90f5caea6d9b5d..9072b755a57213c6eb04f6fd9a9691e769b24e9e 100644
--- a/base/task_scheduler/task_scheduler_impl.h
+++ b/base/task_scheduler/task_scheduler_impl.h
@@ -38,17 +38,11 @@ namespace internal {
// Default TaskScheduler implementation. This class is thread-safe.
class BASE_EXPORT TaskSchedulerImpl : public TaskScheduler {
public:
- // Creates and returns an initialized TaskSchedulerImpl. CHECKs on failure.
- // |name| is used to label threads and histograms. It should identify the
- // component that creates the TaskScheduler. |init_params| contains params to
- // initialize worker pools.
- static std::unique_ptr<TaskSchedulerImpl> Create(
- StringPiece name,
- const TaskScheduler::InitParams& init_params);
-
+ explicit TaskSchedulerImpl(StringPiece name);
robliao 2017/04/24 22:32:19 Readd the comment for |name| for public consistenc
gab 2017/04/25 15:16:15 Also mention explicitly that it now must be starte
fdoray 2017/04/25 18:43:34 Done.
~TaskSchedulerImpl() override;
// TaskScheduler:
+ void Start(const TaskScheduler::InitParams& init_params) override;
void PostDelayedTaskWithTraits(const tracked_objects::Location& from_here,
const TaskTraits& traits,
OnceClosure task,
@@ -71,10 +65,6 @@ class BASE_EXPORT TaskSchedulerImpl : public TaskScheduler {
void JoinForTesting() override;
private:
- explicit TaskSchedulerImpl(StringPiece name);
-
- void Initialize(const TaskScheduler::InitParams& init_params);
-
// Returns the worker pool that runs Tasks with |traits|.
SchedulerWorkerPoolImpl* GetWorkerPoolForTraits(
const TaskTraits& traits) const;

Powered by Google App Engine
This is Rietveld 408576698