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

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

Issue 10834068: On Posix, make all child processes quit when the browser dies, not just the renderers. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/test/functional/test_clean_exit.py ('k') | content/browser/child_process_launcher.cc » ('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 "content/browser/browser_child_process_host_impl.h" 5 #include "content/browser/browser_child_process_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 #elif defined(OS_POSIX) 114 #elif defined(OS_POSIX)
115 bool use_zygote, 115 bool use_zygote,
116 const base::EnvironmentVector& environ, 116 const base::EnvironmentVector& environ,
117 #endif 117 #endif
118 CommandLine* cmd_line) { 118 CommandLine* cmd_line) {
119 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 119 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
120 120
121 content::GetContentClient()->browser()->AppendExtraCommandLineSwitches( 121 content::GetContentClient()->browser()->AppendExtraCommandLineSwitches(
122 cmd_line, data_.id); 122 cmd_line, data_.id);
123 123
124 #if defined(OS_POSIX)
125 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kChildCleanExit))
126 cmd_line->AppendSwitch(switches::kChildCleanExit);
127 #endif
128
124 child_process_.reset(new ChildProcessLauncher( 129 child_process_.reset(new ChildProcessLauncher(
125 #if defined(OS_WIN) 130 #if defined(OS_WIN)
126 exposed_dir, 131 exposed_dir,
127 #elif defined(OS_POSIX) 132 #elif defined(OS_POSIX)
128 use_zygote, 133 use_zygote,
129 environ, 134 environ,
130 child_process_host_->TakeClientFileDescriptor(), 135 child_process_host_->TakeClientFileDescriptor(),
131 #endif 136 #endif
132 cmd_line, 137 cmd_line,
133 this)); 138 this));
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 } 256 }
252 257
253 void BrowserChildProcessHostImpl::OnProcessLaunched() { 258 void BrowserChildProcessHostImpl::OnProcessLaunched() {
254 if (!child_process_->GetHandle()) { 259 if (!child_process_->GetHandle()) {
255 delete delegate_; // Will delete us 260 delete delegate_; // Will delete us
256 return; 261 return;
257 } 262 }
258 data_.handle = child_process_->GetHandle(); 263 data_.handle = child_process_->GetHandle();
259 delegate_->OnProcessLaunched(); 264 delegate_->OnProcessLaunched();
260 } 265 }
OLDNEW
« no previous file with comments | « chrome/test/functional/test_clean_exit.py ('k') | content/browser/child_process_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698