| 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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 // it'll reap the process. However, if GetTerminationStatus didn't | 503 // it'll reap the process. However, if GetTerminationStatus didn't |
| 504 // reap the child (because it was still running), we'll need to | 504 // reap the child (because it was still running), we'll need to |
| 505 // Terminate via ProcessWatcher. So we can't close the handle here. | 505 // Terminate via ProcessWatcher. So we can't close the handle here. |
| 506 if (context_->termination_status_ != base::TERMINATION_STATUS_STILL_RUNNING) | 506 if (context_->termination_status_ != base::TERMINATION_STATUS_STILL_RUNNING) |
| 507 context_->process_.Close(); | 507 context_->process_.Close(); |
| 508 | 508 |
| 509 return context_->termination_status_; | 509 return context_->termination_status_; |
| 510 } | 510 } |
| 511 | 511 |
| 512 void ChildProcessLauncher::SetProcessBackgrounded(bool background) { | 512 void ChildProcessLauncher::SetProcessBackgrounded(bool background) { |
| 513 BrowserThread::PostTask( | 513 // TODO(wfh): re-enable this after testing if dropping the priority of |
| 514 BrowserThread::PROCESS_LAUNCHER, FROM_HERE, | 514 // backgrounded tabs is the root cause of http://crbug.com/381820. |
| 515 base::Bind( | 515 // BrowserThread::PostTask( |
| 516 &ChildProcessLauncher::Context::SetProcessBackgrounded, | 516 // BrowserThread::PROCESS_LAUNCHER, FROM_HERE, |
| 517 GetHandle(), background)); | 517 // base::Bind( |
| 518 // &ChildProcessLauncher::Context::SetProcessBackgrounded, |
| 519 // GetHandle(), background)); |
| 518 } | 520 } |
| 519 | 521 |
| 520 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 522 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
| 521 bool terminate_on_shutdown) { | 523 bool terminate_on_shutdown) { |
| 522 if (context_.get()) | 524 if (context_.get()) |
| 523 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 525 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
| 524 } | 526 } |
| 525 | 527 |
| 526 } // namespace content | 528 } // namespace content |
| OLD | NEW |