diff options
author | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-26 18:37:05 +0000 |
---|---|---|
committer | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-26 18:37:05 +0000 |
commit | f7667d7deb21b34ea63c93e393ec3f2795ef08ef (patch) | |
tree | 719cc9d65d00b4288dcb950f33ba24fc5360e870 /base/process_util_win.cc | |
parent | 1881f514b3d764da8c76861c5fc90d954675579c (diff) | |
download | chromium_src-f7667d7deb21b34ea63c93e393ec3f2795ef08ef.zip chromium_src-f7667d7deb21b34ea63c93e393ec3f2795ef08ef.tar.gz chromium_src-f7667d7deb21b34ea63c93e393ec3f2795ef08ef.tar.bz2 |
Remove false 'process crash' signal (again)
This is a redo of a previous CL that has been lgtm (by sky) that got hosed.
- Sometimes we kill a plugin or a renderer by calling exitprocess(.., HUNG)
we were counting that as a crash
- Check for the return code and make a dchek into a regular case.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1389 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util_win.cc')
-rw-r--r-- | base/process_util_win.cc | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/base/process_util_win.cc b/base/process_util_win.cc index 940ee77..f09228fb 100644 --- a/base/process_util_win.cc +++ b/base/process_util_win.cc @@ -164,15 +164,26 @@ bool KillProcess(int process_id, int exit_code, bool wait) { bool DidProcessCrash(ProcessHandle handle) { DWORD exitcode = 0; - BOOL success = ::GetExitCodeProcess(handle, &exitcode); - DCHECK(success); - DCHECK(exitcode != STILL_ACTIVE); - - if (exitcode == 0 || // Normal termination. - exitcode == 1 || // Killed by task manager. - exitcode == 0xC0000354 || // STATUS_DEBUGGER_INACTIVE - exitcode == 0xC000013A || // Control-C/end session. - exitcode == 0x40010004) { // Debugger terminated process/end session. + if (!::GetExitCodeProcess(handle, &exitcode)) { + NOTREACHED(); + return false; + } + if (exitcode == STILL_ACTIVE) { + // The process is likely not dead or it used 0x103 as exit code. + NOTREACHED(); + return false; + } + + // Warning, this is not generic code; it heavily depends on the way + // the rest of the code kills a process. + + if (exitcode == 0 || // Normal termination. + exitcode == 1 || // Killed by task manager. + exitcode == 14 || // Killed because of a bad message. + exitcode == 16 || // Killed by hung detector (see ResultCodes) + exitcode == 0xC0000354 || // STATUS_DEBUGGER_INACTIVE. + exitcode == 0xC000013A || // Control-C/end session. + exitcode == 0x40010004) { // Debugger terminated process/end session. return false; } |