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/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 Loading... |
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 Loading... |
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 } |
OLD | NEW |