| Index: chrome/service/service_process.cc
|
| diff --git a/chrome/service/service_process.cc b/chrome/service/service_process.cc
|
| index 241af3f9066275ae62ce74d2098fe9464ee7eddc..3e3b8d81b826301b5791eb7901b8f31b4c6b33a0 100644
|
| --- a/chrome/service/service_process.cc
|
| +++ b/chrome/service/service_process.cc
|
| @@ -21,8 +21,10 @@
|
| #include "base/strings/string16.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "base/synchronization/waitable_event.h"
|
| +#include "base/task_scheduler/task_scheduler.h"
|
| #include "base/threading/sequenced_worker_pool.h"
|
| #include "base/threading/thread_task_runner_handle.h"
|
| +#include "base/time/time.h"
|
| #include "base/values.h"
|
| #include "build/build_config.h"
|
| #include "chrome/common/chrome_constants.h"
|
| @@ -158,10 +160,11 @@ bool ServiceProcess::Initialize(base::MessageLoopForUI* message_loop,
|
| return false;
|
| }
|
|
|
| - // Enable SequencedWorkerPool in the service process.
|
| - // TODO(fdoray): Remove this once the SequencedWorkerPool to TaskScheduler
|
| - // redirection experiment concludes https://crbug.com/622400.
|
| - base::SequencedWorkerPool::EnableForProcess();
|
| + // Initialize TaskScheduler and redirect SequencedWorkerPool tasks to it.
|
| + constexpr int kMaxTaskSchedulerThreads = 3;
|
| + base::TaskScheduler::CreateAndSetSimpleTaskScheduler(
|
| + kMaxTaskSchedulerThreads);
|
| + base::SequencedWorkerPool::EnableWithRedirectionToTaskSchedulerForProcess();
|
|
|
| blocking_pool_ = new base::SequencedWorkerPool(
|
| 3, "ServiceBlocking", base::TaskPriority::USER_VISIBLE);
|
| @@ -264,6 +267,9 @@ bool ServiceProcess::Teardown() {
|
| blocking_pool_ = NULL;
|
| }
|
|
|
| + if (base::TaskScheduler::GetInstance())
|
| + base::TaskScheduler::GetInstance()->Shutdown();
|
| +
|
| // The NetworkChangeNotifier must be destroyed after all other threads that
|
| // might use it have been shut down.
|
| network_change_notifier_.reset();
|
|
|