| Index: content/browser/browser_child_process_host_impl.cc
|
| diff --git a/content/browser/browser_child_process_host_impl.cc b/content/browser/browser_child_process_host_impl.cc
|
| index 23f4c05c188a419299b921f272fb2a03e42042ab..a57e1fd6a564dfe05422f2c6c1e26490f3aa9a1f 100644
|
| --- a/content/browser/browser_child_process_host_impl.cc
|
| +++ b/content/browser/browser_child_process_host_impl.cc
|
| @@ -395,6 +395,17 @@ void BrowserChildProcessHostImpl::OnChildDisconnected() {
|
| case base::TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM:
|
| #endif
|
| case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: {
|
| + // If the IPC channel was disconnected after a shutdown request, we
|
| + // expect the process to be dead. However, if the IPC channel uses
|
| + // ChannelMojo, it is not true that the process is dead when the
|
| + // disconnection event comes in. This is because Mojo does an orderly
|
| + // shutdown in the child process and so the child may not be dead by the
|
| + // time we get here. If the child isn't dead, the call to
|
| + // GetTerminationStatus() above may cause the child to be killed because
|
| + // GetTerminationStatus(known_dead=true) SIGKILLs the process before
|
| + // waiting for it.
|
| + if (child_process_host_->IsShuttingDown())
|
| + break;
|
| delegate_->OnProcessCrashed(exit_code);
|
| BrowserThread::PostTask(
|
| BrowserThread::UI, FROM_HERE,
|
| @@ -417,7 +428,8 @@ void BrowserChildProcessHostImpl::OnChildDisconnected() {
|
| data_.process_type,
|
| PROCESS_TYPE_MAX);
|
| #if defined(OS_CHROMEOS)
|
| - if (status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM) {
|
| + if (status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED_BY_OOM &&
|
| + !child_process_host_->IsShuttingDown()) {
|
| UMA_HISTOGRAM_ENUMERATION("ChildProcess.Killed2.OOM",
|
| data_.process_type,
|
| PROCESS_TYPE_MAX);
|
|
|