Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Unified Diff: base/process_util_win.cc

Issue 6794056: Revert 80472 - GTTF: Detect browser crashes on shutdown in UI tests.Previously the automation fra... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/process_util_posix.cc ('k') | chrome/browser/process_singleton_linux_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/process_util_win.cc
===================================================================
--- base/process_util_win.cc (revision 80485)
+++ base/process_util_win.cc (working copy)
@@ -464,7 +464,8 @@
bool WaitForExitCode(ProcessHandle handle, int* exit_code) {
bool success = WaitForExitCodeWithTimeout(handle, exit_code, INFINITE);
- CloseProcessHandle(handle);
+ if (!success)
+ CloseProcessHandle(handle);
return success;
}
@@ -476,6 +477,10 @@
if (!::GetExitCodeProcess(handle, &temp_code))
return false;
+ // Only close the handle on success, to give the caller a chance to forcefully
+ // terminate the process if he wants to.
+ CloseProcessHandle(handle);
+
*exit_code = temp_code;
return true;
}
@@ -539,6 +544,11 @@
return retval;
}
+bool CrashAwareSleep(ProcessHandle handle, int64 wait_milliseconds) {
+ bool retval = WaitForSingleObject(handle, wait_milliseconds) == WAIT_TIMEOUT;
+ return retval;
+}
+
bool CleanupProcesses(const std::wstring& executable_name,
int64 wait_milliseconds,
int exit_code,
« no previous file with comments | « base/process_util_posix.cc ('k') | chrome/browser/process_singleton_linux_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698