Index: content/child/child_process.cc |
diff --git a/content/child/child_process.cc b/content/child/child_process.cc |
index 380e3176b1c148e24cc9c3195287e852fbbec47d..e629ce5b5062336b697a726a93f594866d28e928 100644 |
--- a/content/child/child_process.cc |
+++ b/content/child/child_process.cc |
@@ -14,6 +14,7 @@ |
#include "base/single_thread_task_runner.h" |
#include "base/strings/string_number_conversions.h" |
#include "base/strings/utf_string_conversions.h" |
+#include "base/task_scheduler/task_scheduler.h" |
#include "base/threading/thread.h" |
#include "base/threading/thread_local.h" |
#include "build/build_config.h" |
@@ -37,9 +38,8 @@ base::LazyInstance<base::ThreadLocalPointer<ChildProcess>>::DestructorAtExit |
ChildProcess::ChildProcess( |
base::ThreadPriority io_thread_priority, |
- const std::vector<base::SchedulerWorkerPoolParams>& worker_pool_params, |
- base::TaskScheduler::WorkerPoolIndexForTraitsCallback |
- worker_pool_index_for_traits_callback) |
+ const std::string& task_scheduler_name, |
+ std::unique_ptr<base::TaskScheduler::InitParams> task_scheduler_init_params) |
: ref_count_(0), |
shutdown_event_(base::WaitableEvent::ResetPolicy::MANUAL, |
base::WaitableEvent::InitialState::NOT_SIGNALED), |
@@ -53,13 +53,11 @@ ChildProcess::ChildProcess( |
// exist when ChildProcess is instantiated in the browser process or in a |
// test process. |
if (!base::TaskScheduler::GetInstance()) { |
- if (worker_pool_params.empty()) { |
- DCHECK(!worker_pool_index_for_traits_callback); |
- base::TaskScheduler::CreateAndSetSimpleTaskScheduler("ContentChild"); |
- } else { |
- DCHECK(worker_pool_index_for_traits_callback); |
+ if (task_scheduler_init_params) { |
base::TaskScheduler::CreateAndSetDefaultTaskScheduler( |
- worker_pool_params, std::move(worker_pool_index_for_traits_callback)); |
+ task_scheduler_name, *task_scheduler_init_params.get()); |
+ } else { |
+ base::TaskScheduler::CreateAndSetSimpleTaskScheduler(task_scheduler_name); |
} |
DCHECK(base::TaskScheduler::GetInstance()); |