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/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/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 base::Process process(handle); | 366 base::Process process(handle); |
367 process.SetProcessBackgrounded(background); | 367 process.SetProcessBackgrounded(background); |
368 } | 368 } |
369 | 369 |
370 static void TerminateInternal( | 370 static void TerminateInternal( |
371 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) | 371 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) |
372 bool zygote, | 372 bool zygote, |
373 #endif | 373 #endif |
374 base::ProcessHandle handle) { | 374 base::ProcessHandle handle) { |
375 #if defined(OS_ANDROID) | 375 #if defined(OS_ANDROID) |
376 LOG(INFO) << "ChromeProcess: Stopping process with handle " << handle; | 376 VLOG(0) << "ChromeProcess: Stopping process with handle " << handle; |
377 StopChildProcess(handle); | 377 StopChildProcess(handle); |
378 #else | 378 #else |
379 base::Process process(handle); | 379 base::Process process(handle); |
380 // Client has gone away, so just kill the process. Using exit code 0 | 380 // Client has gone away, so just kill the process. Using exit code 0 |
381 // means that UMA won't treat this as a crash. | 381 // means that UMA won't treat this as a crash. |
382 process.Terminate(RESULT_CODE_NORMAL_EXIT); | 382 process.Terminate(RESULT_CODE_NORMAL_EXIT); |
383 // On POSIX, we must additionally reap the child. | 383 // On POSIX, we must additionally reap the child. |
384 #if defined(OS_POSIX) | 384 #if defined(OS_POSIX) |
385 #if !defined(OS_MACOSX) | 385 #if !defined(OS_MACOSX) |
386 if (zygote) { | 386 if (zygote) { |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 GetHandle(), background)); | 509 GetHandle(), background)); |
510 } | 510 } |
511 | 511 |
512 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 512 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
513 bool terminate_on_shutdown) { | 513 bool terminate_on_shutdown) { |
514 if (context_.get()) | 514 if (context_.get()) |
515 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 515 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
516 } | 516 } |
517 | 517 |
518 } // namespace content | 518 } // namespace content |
OLD | NEW |