| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/browser/child_process_launcher.h" | 5 #include "chrome/browser/child_process_launcher.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "base/thread.h" | 10 #include "base/thread.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 // means that UMA won't treat this as a crash. | 221 // means that UMA won't treat this as a crash. |
| 222 process.Terminate(ResultCodes::NORMAL_EXIT); | 222 process.Terminate(ResultCodes::NORMAL_EXIT); |
| 223 // On POSIX, we must additionally reap the child. | 223 // On POSIX, we must additionally reap the child. |
| 224 #if defined(OS_POSIX) | 224 #if defined(OS_POSIX) |
| 225 #if defined(OS_LINUX) | 225 #if defined(OS_LINUX) |
| 226 if (zygote) { | 226 if (zygote) { |
| 227 // If the renderer was created via a zygote, we have to proxy the reaping | 227 // If the renderer was created via a zygote, we have to proxy the reaping |
| 228 // through the zygote process. | 228 // through the zygote process. |
| 229 Singleton<ZygoteHost>()->EnsureProcessTerminated(handle); | 229 Singleton<ZygoteHost>()->EnsureProcessTerminated(handle); |
| 230 } else | 230 } else |
| 231 #endif // defined(OS_LINUX) | 231 #endif // OS_LINUX |
| 232 { | 232 { |
| 233 ProcessWatcher::EnsureProcessTerminated(handle); | 233 ProcessWatcher::EnsureProcessTerminated(handle); |
| 234 } | 234 } |
| 235 #endif | 235 #endif // OS_POSIX |
| 236 process.Close(); | 236 process.Close(); |
| 237 } | 237 } |
| 238 | 238 |
| 239 Client* client_; | 239 Client* client_; |
| 240 ChromeThread::ID client_thread_id_; | 240 ChromeThread::ID client_thread_id_; |
| 241 base::Process process_; | 241 base::Process process_; |
| 242 bool starting_; | 242 bool starting_; |
| 243 | 243 |
| 244 #if defined(OS_LINUX) | 244 #if defined(OS_LINUX) |
| 245 bool zygote_; | 245 bool zygote_; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 if (child_exited) | 303 if (child_exited) |
| 304 context_->process_.Close(); | 304 context_->process_.Close(); |
| 305 | 305 |
| 306 return did_crash; | 306 return did_crash; |
| 307 } | 307 } |
| 308 | 308 |
| 309 void ChildProcessLauncher::SetProcessBackgrounded(bool background) { | 309 void ChildProcessLauncher::SetProcessBackgrounded(bool background) { |
| 310 DCHECK(!context_->starting_); | 310 DCHECK(!context_->starting_); |
| 311 context_->process_.SetProcessBackgrounded(background); | 311 context_->process_.SetProcessBackgrounded(background); |
| 312 } | 312 } |
| OLD | NEW |