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

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

Issue 2845913004: Remove TaskScheduler::CreateAndSetDefaultTaskScheduler(). (Closed)
Patch Set: fix-build-error Created 3 years, 7 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
« no previous file with comments | « no previous file | base/task_scheduler/task_scheduler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_H_ 5 #ifndef BASE_TASK_SCHEDULER_TASK_SCHEDULER_H_
6 #define BASE_TASK_SCHEDULER_TASK_SCHEDULER_H_ 6 #define BASE_TASK_SCHEDULER_TASK_SCHEDULER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 #endif // !defined(OS_NACL) 160 #endif // !defined(OS_NACL)
161 161
162 // Creates a ready to start task scheduler. |name| is used to label threads 162 // Creates a ready to start task scheduler. |name| is used to label threads
163 // and histograms. It should identify the component that creates the 163 // and histograms. It should identify the component that creates the
164 // TaskScheduler. The task scheduler doesn't create threads until Start() is 164 // TaskScheduler. The task scheduler doesn't create threads until Start() is
165 // called. Tasks can be posted at any time but will not run until after 165 // called. Tasks can be posted at any time but will not run until after
166 // Start() is called. For tests, prefer base::test::ScopedTaskEnvironment 166 // Start() is called. For tests, prefer base::test::ScopedTaskEnvironment
167 // (ensures isolation). 167 // (ensures isolation).
168 static void Create(StringPiece name); 168 static void Create(StringPiece name);
169 169
170 // Deprecated. Use Create() and Start() instead.
171 // TODO(fdoray): Redirect callers to Create() and Start().
172 static void CreateAndSetDefaultTaskScheduler(StringPiece name,
173 const InitParams& init_params);
174
175 // Registers |task_scheduler| to handle tasks posted through the post_task.h 170 // Registers |task_scheduler| to handle tasks posted through the post_task.h
176 // API for this process. For tests, prefer base::test::ScopedTaskScheduler 171 // API for this process. For tests, prefer base::test::ScopedTaskScheduler
177 // (ensures isolation). 172 // (ensures isolation).
178 static void SetInstance(std::unique_ptr<TaskScheduler> task_scheduler); 173 static void SetInstance(std::unique_ptr<TaskScheduler> task_scheduler);
179 174
180 // Retrieve the TaskScheduler set via SetInstance() or 175 // Retrieve the TaskScheduler set via SetInstance() or
181 // CreateAndSet(Simple|Default)TaskScheduler(). This should be used very 176 // CreateAndSet(Simple|Default)TaskScheduler(). This should be used very
182 // rarely; most users of TaskScheduler should use the post_task.h API. In 177 // rarely; most users of TaskScheduler should use the post_task.h API. In
183 // particular, refrain from doing 178 // particular, refrain from doing
184 // if (!TaskScheduler::GetInstance()) { 179 // if (!TaskScheduler::GetInstance()) {
(...skipping 16 matching lines...) Expand all
201 // each process n/GetMaxConcurrentTasksWithTraitsDeprecated() items. 196 // each process n/GetMaxConcurrentTasksWithTraitsDeprecated() items.
202 // 197 //
203 // TODO(fdoray): Remove this method. https://crbug.com/687264 198 // TODO(fdoray): Remove this method. https://crbug.com/687264
204 virtual int GetMaxConcurrentTasksWithTraitsDeprecated( 199 virtual int GetMaxConcurrentTasksWithTraitsDeprecated(
205 const TaskTraits& traits) const = 0; 200 const TaskTraits& traits) const = 0;
206 }; 201 };
207 202
208 } // namespace base 203 } // namespace base
209 204
210 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_H_ 205 #endif // BASE_TASK_SCHEDULER_TASK_SCHEDULER_H_
OLDNEW
« no previous file with comments | « no previous file | base/task_scheduler/task_scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698