summaryrefslogtreecommitdiffstats
path: root/base/process
diff options
context:
space:
mode:
authorbrucedawson <brucedawson@chromium.org>2015-09-16 19:49:03 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-17 02:50:14 +0000
commit9ae49a753d07f5a9266a63a89e7336d774f3fe37 (patch)
tree66893ba8e23c6fdf8cb37a5e726808880994f90b /base/process
parent35b19f7d5d7b7b68878d6c766e93e148f8b06998 (diff)
downloadchromium_src-9ae49a753d07f5a9266a63a89e7336d774f3fe37.zip
chromium_src-9ae49a753d07f5a9266a63a89e7336d774f3fe37.tar.gz
chromium_src-9ae49a753d07f5a9266a63a89e7336d774f3fe37.tar.bz2
Check for CloseHandle failures even when not debugging
Bug 524267 was a handle closing failure that only showed up when running renderer processes under a debugger at startup, so it was not discovered for a while. Similarly, bug 520305 is a long-standing base_unittests bug that only shows up under a debugger. This change fixes 520305 and checks for many handle closing failures always so that subsequent bugs of this type will be detected immediately. Most of the CloseHandle calls in base are now checked. This replaces the uncommitted https://codereview.chromium.org/1343873002/ R=grt@chromium.org,rvargas@chromium.org,dalecurtis@chromium.org BUG=524267,520305 Review URL: https://codereview.chromium.org/1350493002 Cr-Commit-Position: refs/heads/master@{#349333}
Diffstat (limited to 'base/process')
-rw-r--r--base/process/kill_win.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/base/process/kill_win.cc b/base/process/kill_win.cc
index 0da3a26..b35dd63 100644
--- a/base/process/kill_win.cc
+++ b/base/process/kill_win.cc
@@ -159,11 +159,8 @@ bool WaitForProcessesToExit(const FilePath::StringType& executable_name,
DWORD remaining_wait = static_cast<DWORD>(std::max(
static_cast<int64>(0),
wait.InMilliseconds() - (GetTickCount() - start_time)));
- HANDLE process = OpenProcess(SYNCHRONIZE,
- FALSE,
- entry->th32ProcessID);
- DWORD wait_result = WaitForSingleObject(process, remaining_wait);
- CloseHandle(process);
+ Process process(Process::OpenWithAccess(entry->th32ProcessID, SYNCHRONIZE));
+ DWORD wait_result = WaitForSingleObject(process.Handle(), remaining_wait);
result &= (wait_result == WAIT_OBJECT_0);
}