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

Side by Side Diff: content/browser/utility_process_host_impl.cc

Issue 1138823003: Simulate process launch for in-process utility thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | no next file » | 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 "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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698