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 "base/base_switches.h" | 7 #include "base/base_switches.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 | 215 |
216 if (RenderProcessHost::run_renderer_in_process()) { | 216 if (RenderProcessHost::run_renderer_in_process()) { |
217 DCHECK(g_utility_main_thread_factory); | 217 DCHECK(g_utility_main_thread_factory); |
218 // See comment in RenderProcessHostImpl::Init() for the background on why we | 218 // See comment in RenderProcessHostImpl::Init() for the background on why we |
219 // support single process mode this way. | 219 // support single process mode this way. |
220 in_process_thread_.reset( | 220 in_process_thread_.reset( |
221 g_utility_main_thread_factory(InProcessChildThreadParams( | 221 g_utility_main_thread_factory(InProcessChildThreadParams( |
222 channel_id, BrowserThread::UnsafeGetMessageLoopForThread( | 222 channel_id, BrowserThread::UnsafeGetMessageLoopForThread( |
223 BrowserThread::IO)->task_runner()))); | 223 BrowserThread::IO)->task_runner()))); |
224 in_process_thread_->Start(); | 224 in_process_thread_->Start(); |
| 225 OnProcessLaunched(); |
225 } else { | 226 } else { |
226 const base::CommandLine& browser_command_line = | 227 const base::CommandLine& browser_command_line = |
227 *base::CommandLine::ForCurrentProcess(); | 228 *base::CommandLine::ForCurrentProcess(); |
228 int child_flags = child_flags_; | 229 int child_flags = child_flags_; |
229 | 230 |
230 bool has_cmd_prefix = browser_command_line.HasSwitch( | 231 bool has_cmd_prefix = browser_command_line.HasSwitch( |
231 switches::kUtilityCmdPrefix); | 232 switches::kUtilityCmdPrefix); |
232 | 233 |
233 // When running under gdb, forking /proc/self/exe ends up forking the gdb | 234 // When running under gdb, forking /proc/self/exe ends up forking the gdb |
234 // executable instead of Chromium. It is almost safe to assume that no | 235 // executable instead of Chromium. It is almost safe to assume that no |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 if (RenderProcessHost::run_renderer_in_process()) | 340 if (RenderProcessHost::run_renderer_in_process()) |
340 handle = base::GetCurrentProcessHandle(); | 341 handle = base::GetCurrentProcessHandle(); |
341 else | 342 else |
342 handle = process_->GetData().handle; | 343 handle = process_->GetData().handle; |
343 | 344 |
344 mojo_application_host_->Activate(this, handle); | 345 mojo_application_host_->Activate(this, handle); |
345 } | 346 } |
346 } | 347 } |
347 | 348 |
348 } // namespace content | 349 } // namespace content |
OLD | NEW |