Commit 1d7a9128 authored by Francois Doray's avatar Francois Doray Committed by Commit Bot

Initialize NetworkChangeNotifier after TaskScheduler in service process.

The NetworkChangeNotifier must be created after TaskScheduler because it
posts tasks to it.

Bug: 789442
Change-Id: Ie6066064a5f840666160bac76d95ad16d3363708
Reviewed-on: https://chromium-review.googlesource.com/810925Reviewed-by: default avatarVitaly Buka <vitalybuka@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522262}
parent 0e01fe57
......@@ -154,7 +154,6 @@ bool ServiceProcess::Initialize(base::MessageLoopForUI* message_loop,
#endif // defined(OS_LINUX) || defined(OS_OPENBSD)
main_message_loop_ = message_loop;
service_process_state_.reset(state);
network_change_notifier_.reset(net::NetworkChangeNotifier::Create());
// Initialize TaskScheduler and redirect SequencedWorkerPool tasks to it.
constexpr int kMaxBackgroundThreads = 1;
......@@ -174,6 +173,10 @@ bool ServiceProcess::Initialize(base::MessageLoopForUI* message_loop,
base::SequencedWorkerPool::EnableWithRedirectionToTaskSchedulerForProcess();
// The NetworkChangeNotifier must be created after TaskScheduler because it
// posts tasks to it.
network_change_notifier_.reset(net::NetworkChangeNotifier::Create());
// Initialize the IO and FILE threads.
base::Thread::Options options;
options.message_loop_type = base::MessageLoop::TYPE_IO;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment