Index: chrome/app/close_handle_hook_win.cc |
diff --git a/chrome/app/close_handle_hook_win.cc b/chrome/app/close_handle_hook_win.cc |
index 02dfce513d13f9c0ba084cdc6bf0ec77ed2f6fd4..cde247eee44f1acf6ef08124cb97c0f957e04b64 100644 |
--- a/chrome/app/close_handle_hook_win.cc |
+++ b/chrome/app/close_handle_hook_win.cc |
@@ -37,7 +37,13 @@ DuplicateHandleType g_duplicate_function = NULL; |
// function. |
BOOL WINAPI CloseHandleHook(HANDLE handle) { |
base::win::OnHandleBeingClosed(handle); |
- return g_close_function(handle); |
+ BOOL result = g_close_function(handle); |
+ // Check for CloseHandle failures. |
+ // urlmon closes a handle that is NULL so we can't fail on that. |
+ // Also CloseHandle() under a debugger only throws an exception on handles |
+ // that are neither NULL nor INVALID_HANDLE_VALUE. |
+ DPCHECK(result || handle == NULL || handle == INVALID_HANDLE_VALUE); |
rvargas (doing something else)
2015/09/15 18:08:04
This seems like a weird place to looks for close f
|
+ return result; |
} |
BOOL WINAPI DuplicateHandleHook(HANDLE source_process, |