Chromium Code Reviews| Index: chrome/app/mash/mash_runner.cc |
| diff --git a/chrome/app/mash/mash_runner.cc b/chrome/app/mash/mash_runner.cc |
| index 940804f7e70b6e1db0e9078f6a678dbf9a06b768..36e023a170b0c5a1488417ba5161404f4e496f72 100644 |
| --- a/chrome/app/mash/mash_runner.cc |
| +++ b/chrome/app/mash/mash_runner.cc |
| @@ -15,6 +15,8 @@ |
| #include "base/message_loop/message_loop.h" |
| #include "base/process/launch.h" |
| #include "base/run_loop.h" |
| +#include "base/task_scheduler/task_scheduler.h" |
| +#include "base/threading/sequenced_worker_pool.h" |
| #include "base/trace_event/trace_event.h" |
| #include "components/tracing/common/trace_to_console.h" |
| #include "components/tracing/common/tracing_switches.h" |
| @@ -127,6 +129,10 @@ int MashRunner::Run() { |
| } |
| void MashRunner::RunMain() { |
| + constexpr int kNumThreads = 3; |
| + base::TaskScheduler::CreateAndSetSimpleTaskScheduler(kNumThreads); |
| + base::SequencedWorkerPool::EnableWithRedirectionToTaskSchedulerForProcess(); |
| + |
| // TODO(sky): refactor BackgroundServiceManager so can supply own context, we |
| // shouldn't we using context as it has a lot of stuff we don't really want |
| // in chrome. |
| @@ -169,9 +175,14 @@ void MashRunner::RunMain() { |
| // Ping mash_session to ensure an instance is brought up |
| context_->connector()->Connect("mash_session"); |
| base::RunLoop().Run(); |
| + |
| + base::TaskScheduler::GetInstance()->Shutdown(); |
| } |
| int MashRunner::RunChild() { |
| + // TODO(fdoray): Add TaskScheduler initialization code in |
| + // service_manager::ServiceRunner. https://crbug.com/664996 |
|
robliao
2016/11/23 21:02:20
Add why the scheduler shouldn't be initialized her
fdoray
2016/11/23 21:09:14
Done.
|
| + |
| base::FilePath path = |
| base::CommandLine::ForCurrentProcess()->GetSwitchValuePath( |
| switches::kChildProcess); |