Chromium Code Reviews| 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/browser_child_process_host_impl.h" | 5 #include "content/browser/browser_child_process_host_impl.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 258 } | 258 } |
| 259 base::KillProcess(GetHandle(), RESULT_CODE_KILLED_BAD_MESSAGE, false); | 259 base::KillProcess(GetHandle(), RESULT_CODE_KILLED_BAD_MESSAGE, false); |
| 260 } | 260 } |
| 261 | 261 |
| 262 bool BrowserChildProcessHostImpl::CanShutdown() { | 262 bool BrowserChildProcessHostImpl::CanShutdown() { |
| 263 return delegate_->CanShutdown(); | 263 return delegate_->CanShutdown(); |
| 264 } | 264 } |
| 265 | 265 |
| 266 void BrowserChildProcessHostImpl::OnChildDisconnected() { | 266 void BrowserChildProcessHostImpl::OnChildDisconnected() { |
| 267 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 267 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 268 #if defined(OS_WIN) | |
|
sky
2014/10/20 16:27:34
Document why this is needed.
| |
| 269 early_exit_watcher_.StopWatching(); | |
| 270 #endif | |
| 268 if (child_process_.get() || data_.handle) { | 271 if (child_process_.get() || data_.handle) { |
| 269 DCHECK(data_.handle != base::kNullProcessHandle); | 272 DCHECK(data_.handle != base::kNullProcessHandle); |
| 270 int exit_code; | 273 int exit_code; |
| 271 base::TerminationStatus status = GetTerminationStatus( | 274 base::TerminationStatus status = GetTerminationStatus( |
| 272 true /* known_dead */, &exit_code); | 275 true /* known_dead */, &exit_code); |
| 273 switch (status) { | 276 switch (status) { |
| 274 case base::TERMINATION_STATUS_PROCESS_CRASHED: | 277 case base::TERMINATION_STATUS_PROCESS_CRASHED: |
| 275 case base::TERMINATION_STATUS_ABNORMAL_TERMINATION: { | 278 case base::TERMINATION_STATUS_ABNORMAL_TERMINATION: { |
| 276 delegate_->OnProcessCrashed(exit_code); | 279 delegate_->OnProcessCrashed(exit_code); |
| 277 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 280 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 335 | 338 |
| 336 #if defined(OS_WIN) | 339 #if defined(OS_WIN) |
| 337 | 340 |
| 338 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { | 341 void BrowserChildProcessHostImpl::OnObjectSignaled(HANDLE object) { |
| 339 OnChildDisconnected(); | 342 OnChildDisconnected(); |
| 340 } | 343 } |
| 341 | 344 |
| 342 #endif | 345 #endif |
| 343 | 346 |
| 344 } // namespace content | 347 } // namespace content |
| OLD | NEW |