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 "content/browser/utility_process_host_impl.h" | 5 #include "content/browser/utility_process_host_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 | 256 |
257 process_->SetName(name_); | 257 process_->SetName(name_); |
258 process_->GetHost()->CreateChannelMojo(); | 258 process_->GetHost()->CreateChannelMojo(); |
259 | 259 |
260 if (RenderProcessHost::run_renderer_in_process()) { | 260 if (RenderProcessHost::run_renderer_in_process()) { |
261 DCHECK(g_utility_main_thread_factory); | 261 DCHECK(g_utility_main_thread_factory); |
262 // See comment in RenderProcessHostImpl::Init() for the background on why we | 262 // See comment in RenderProcessHostImpl::Init() for the background on why we |
263 // support single process mode this way. | 263 // support single process mode this way. |
264 in_process_thread_.reset( | 264 in_process_thread_.reset( |
265 g_utility_main_thread_factory(InProcessChildThreadParams( | 265 g_utility_main_thread_factory(InProcessChildThreadParams( |
266 BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::IO) | 266 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), |
267 ->task_runner(), | |
268 process_->child_connection()->service_token()))); | 267 process_->child_connection()->service_token()))); |
269 in_process_thread_->Start(); | 268 in_process_thread_->Start(); |
270 } else { | 269 } else { |
271 const base::CommandLine& browser_command_line = | 270 const base::CommandLine& browser_command_line = |
272 *base::CommandLine::ForCurrentProcess(); | 271 *base::CommandLine::ForCurrentProcess(); |
273 | 272 |
274 bool has_cmd_prefix = browser_command_line.HasSwitch( | 273 bool has_cmd_prefix = browser_command_line.HasSwitch( |
275 switches::kUtilityCmdPrefix); | 274 switches::kUtilityCmdPrefix); |
276 | 275 |
277 #if defined(OS_ANDROID) | 276 #if defined(OS_ANDROID) |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 base::WeakPtr<UtilityProcessHostImpl> host, | 397 base::WeakPtr<UtilityProcessHostImpl> host, |
399 int error_code) { | 398 int error_code) { |
400 if (!host) | 399 if (!host) |
401 return; | 400 return; |
402 | 401 |
403 host->OnProcessLaunchFailed(error_code); | 402 host->OnProcessLaunchFailed(error_code); |
404 delete host.get(); | 403 delete host.get(); |
405 } | 404 } |
406 | 405 |
407 } // namespace content | 406 } // namespace content |
OLD | NEW |