| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/child_process_launcher.h" | 5 #include "content/browser/child_process_launcher.h" |
| 6 | 6 |
| 7 #include <utility> // For std::pair. | 7 #include <utility> // For std::pair. |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 #endif | 262 #endif |
| 263 | 263 |
| 264 static void TerminateInternal( | 264 static void TerminateInternal( |
| 265 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 265 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 266 bool zygote, | 266 bool zygote, |
| 267 #endif | 267 #endif |
| 268 base::ProcessHandle handle) { | 268 base::ProcessHandle handle) { |
| 269 base::Process process(handle); | 269 base::Process process(handle); |
| 270 // Client has gone away, so just kill the process. Using exit code 0 | 270 // Client has gone away, so just kill the process. Using exit code 0 |
| 271 // means that UMA won't treat this as a crash. | 271 // means that UMA won't treat this as a crash. |
| 272 process.Terminate(ResultCodes::NORMAL_EXIT); | 272 process.Terminate(content::RESULT_CODE_NORMAL_EXIT); |
| 273 // On POSIX, we must additionally reap the child. | 273 // On POSIX, we must additionally reap the child. |
| 274 #if defined(OS_POSIX) | 274 #if defined(OS_POSIX) |
| 275 #if !defined(OS_MACOSX) | 275 #if !defined(OS_MACOSX) |
| 276 if (zygote) { | 276 if (zygote) { |
| 277 // If the renderer was created via a zygote, we have to proxy the reaping | 277 // If the renderer was created via a zygote, we have to proxy the reaping |
| 278 // through the zygote process. | 278 // through the zygote process. |
| 279 ZygoteHost::GetInstance()->EnsureProcessTerminated(handle); | 279 ZygoteHost::GetInstance()->EnsureProcessTerminated(handle); |
| 280 } else | 280 } else |
| 281 #endif // !OS_MACOSX | 281 #endif // !OS_MACOSX |
| 282 { | 282 { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 &ChildProcessLauncher::Context::SetProcessBackgrounded, | 373 &ChildProcessLauncher::Context::SetProcessBackgrounded, |
| 374 background)); | 374 background)); |
| 375 } | 375 } |
| 376 | 376 |
| 377 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 377 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
| 378 bool terminate_on_shutdown) { | 378 bool terminate_on_shutdown) { |
| 379 if (context_) | 379 if (context_) |
| 380 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 380 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
| 381 } | 381 } |
| 382 | 382 |
| OLD | NEW |