Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(528)

Side by Side Diff: chrome/service/service_process.cc

Issue 2617713002: [WIP] Add DCHECK for mojo::edk::Init().
Patch Set: test Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chromecast/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chromecast/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698