| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/service/service_process.h" | 5 #include "chrome/service/service_process.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // Initialize TaskScheduler and redirect SequencedWorkerPool tasks to it. | 163 // Initialize TaskScheduler and redirect SequencedWorkerPool tasks to it. |
| 164 constexpr int kMaxTaskSchedulerThreads = 3; | 164 constexpr int kMaxTaskSchedulerThreads = 3; |
| 165 base::TaskScheduler::CreateAndSetSimpleTaskScheduler( | 165 base::TaskScheduler::CreateAndSetSimpleTaskScheduler( |
| 166 kMaxTaskSchedulerThreads); | 166 kMaxTaskSchedulerThreads); |
| 167 base::SequencedWorkerPool::EnableWithRedirectionToTaskSchedulerForProcess(); | 167 base::SequencedWorkerPool::EnableWithRedirectionToTaskSchedulerForProcess(); |
| 168 | 168 |
| 169 blocking_pool_ = new base::SequencedWorkerPool( | 169 blocking_pool_ = new base::SequencedWorkerPool( |
| 170 3, "ServiceBlocking", base::TaskPriority::USER_VISIBLE); | 170 3, "ServiceBlocking", base::TaskPriority::USER_VISIBLE); |
| 171 | 171 |
| 172 // Initialize Mojo early so things can use it. | 172 // Initialize Mojo early so things can use it. |
| 173 mojo::edk::Init(); | 173 // mojo::edk::Init() is called in InitializeMojo() via |
| 174 // ContentMainRunnerImpl::Initialize(), so do not call it here. |
| 174 mojo_ipc_support_.reset( | 175 mojo_ipc_support_.reset( |
| 175 new mojo::edk::ScopedIPCSupport(io_thread_->task_runner())); | 176 new mojo::edk::ScopedIPCSupport(io_thread_->task_runner())); |
| 176 | 177 |
| 177 request_context_getter_ = new ServiceURLRequestContextGetter(); | 178 request_context_getter_ = new ServiceURLRequestContextGetter(); |
| 178 | 179 |
| 179 base::FilePath user_data_dir; | 180 base::FilePath user_data_dir; |
| 180 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); | 181 PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); |
| 181 base::FilePath pref_path = | 182 base::FilePath pref_path = |
| 182 user_data_dir.Append(chrome::kServiceStateFileName); | 183 user_data_dir.Append(chrome::kServiceStateFileName); |
| 183 service_prefs_.reset(new ServiceProcessPrefs( | 184 service_prefs_.reset(new ServiceProcessPrefs( |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 } else { | 425 } else { |
| 425 Shutdown(); | 426 Shutdown(); |
| 426 } | 427 } |
| 427 } | 428 } |
| 428 } | 429 } |
| 429 | 430 |
| 430 ServiceProcess::~ServiceProcess() { | 431 ServiceProcess::~ServiceProcess() { |
| 431 Teardown(); | 432 Teardown(); |
| 432 g_service_process = NULL; | 433 g_service_process = NULL; |
| 433 } | 434 } |
| OLD | NEW |