Improve the ScopedHandle verifier.
commit86d7c90f6a309ecf7b499e8c2c30490d6e1f03ba
authorrvargas <rvargas@chromium.org>
Thu, 4 Sep 2014 22:58:09 +0000 (4 15:58 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 4 Sep 2014 23:00:29 +0000 (4 23:00 +0000)
treeb5a5ece797da7993b4e9be7c4ecf3084b581b9f0
parent65b063b53184d97bf17abeeeca8ff846bbe273cd
Improve the ScopedHandle verifier.

1. Automate the selection of the proper channel to enable the verifier.
   Now the code is enabled at runtime.

2. Switch to a hash_map to track handles.

3. Intercept CloseHandle to detect the code that is closing handles owned
   by ScopedHandles. The initial implementation only covers chrome.exe/dll,
   but the plan is to extend that in the future to all modules loaded in the
   process.

BUG=362176

See https://codereview.chromium.org/490043002/ for the initial review.

Review URL: https://codereview.chromium.org/510633002

Cr-Commit-Position: refs/heads/master@{#293365}
base/win/scoped_handle.cc
base/win/scoped_handle.h
chrome/BUILD.gn
chrome/app/chrome_main_delegate.cc
chrome/app/close_handle_hook_win.cc [new file with mode: 0644]
chrome/app/close_handle_hook_win.h [new file with mode: 0644]
chrome/chrome_dll.gypi
chrome/chrome_tests_unit.gypi