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

Unified Diff: base/task_scheduler/task_scheduler_impl.h

Issue 2064073003: TaskScheduler: Make the worker pools of TaskSchedulerImpl configurable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR robliao #3 (map argument first) Created 4 years, 6 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 f9d789ea4c550daec7c001f591ce2068f672e936..35565516d161a37ba53ee85a17a47e8873c3fcdf 100644
--- a/base/task_scheduler/task_scheduler_impl.h
+++ b/base/task_scheduler/task_scheduler_impl.h
@@ -5,7 +5,9 @@
#ifndef BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_
#define BASE_TASK_SCHEDULER_TASK_SCHEDULER_IMPL_H_
+#include <map>
#include <memory>
+#include <string>
#include "base/base_export.h"
#include "base/logging.h"
@@ -28,9 +30,11 @@ class SchedulerThreadPoolImpl;
// Default TaskScheduler implementation. This class is thread-safe.
class BASE_EXPORT TaskSchedulerImpl : public TaskScheduler {
public:
- // Creates and returns an initialized TaskSchedulerImpl. CHECKs on failure to
- // do so (never returns null).
- static std::unique_ptr<TaskSchedulerImpl> Create();
+ // Creates and returns an initialized TaskSchedulerImpl. CHECKs on failure
+ // (never returns null). |variation_params| is used to configure the scheduler
+ // (can be empty).
+ static std::unique_ptr<TaskSchedulerImpl> Create(
+ const std::map<std::string, std::string>& variation_params);
// Destroying a TaskSchedulerImpl is not allowed in production; it is always
// leaked. In tests, it can only be destroyed after JoinForTesting() has
@@ -53,7 +57,7 @@ class BASE_EXPORT TaskSchedulerImpl : public TaskScheduler {
private:
TaskSchedulerImpl();
- void Initialize();
+ void Initialize(const std::map<std::string, std::string>& variation_params);
// Returns the thread pool that runs Tasks with |traits|.
SchedulerThreadPool* GetThreadPoolForTraits(const TaskTraits& traits);

Powered by Google App Engine
This is Rietveld 408576698