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

Unified Diff: base/task_scheduler/task_scheduler.cc

Issue 2199943003: Add TaskScheduler::CreateAndSetDefaultTaskScheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@public
Patch Set: Update Comments Created 4 years, 4 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
« no previous file with comments | « base/task_scheduler/task_scheduler.h ('k') | base/task_scheduler/task_scheduler_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/task_scheduler/task_scheduler.cc
diff --git a/base/task_scheduler/task_scheduler.cc b/base/task_scheduler/task_scheduler.cc
index fd72c12ecd67d11cc3a5fe4aa9e8c40718c0ba43..4b7d0b7e85a822137bdfecd410b36d8f5feb0ba3 100644
--- a/base/task_scheduler/task_scheduler.cc
+++ b/base/task_scheduler/task_scheduler.cc
@@ -5,6 +5,7 @@
#include "base/task_scheduler/task_scheduler.h"
#include "base/logging.h"
+#include "base/task_scheduler/task_scheduler_impl.h"
namespace base {
@@ -16,6 +17,15 @@ TaskScheduler* g_task_scheduler = nullptr;
} // namespace
// static
+void TaskScheduler::CreateAndSetDefaultTaskScheduler(
+ const std::vector<SchedulerWorkerPoolParams>& worker_pool_params_vector,
+ const WorkerPoolIndexForTraitsCallback&
+ worker_pool_index_for_traits_callback) {
+ SetInstance(internal::TaskSchedulerImpl::Create(
+ worker_pool_params_vector, worker_pool_index_for_traits_callback));
+}
+
+// static
void TaskScheduler::SetInstance(std::unique_ptr<TaskScheduler> task_scheduler) {
delete g_task_scheduler;
g_task_scheduler = task_scheduler.release();
« no previous file with comments | « base/task_scheduler/task_scheduler.h ('k') | base/task_scheduler/task_scheduler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698