| Index: base/win/scoped_handle.cc
|
| diff --git a/base/win/scoped_handle.cc b/base/win/scoped_handle.cc
|
| index f358c99b6f011073f19706c1643a8529e7c54b75..8739ea7887ba0b39339f504d5f54600f4961a085 100644
|
| --- a/base/win/scoped_handle.cc
|
| +++ b/base/win/scoped_handle.cc
|
| @@ -95,6 +95,7 @@ class ActiveVerifier {
|
|
|
| static void InstallVerifier();
|
|
|
| + base::debug::StackTrace creation_stack_;
|
| bool enabled_;
|
| bool closing_;
|
| NativeLock* lock_;
|
| @@ -168,6 +169,7 @@ void ActiveVerifier::StartTracking(HANDLE handle, const void* owner,
|
| if (!result.second) {
|
| Info other = result.first->second;
|
| base::debug::Alias(&other);
|
| + base::debug::Alias(&creation_stack_);
|
| CHECK(false); // Attempt to start tracking already tracked handle.
|
| }
|
| }
|
| @@ -179,12 +181,15 @@ void ActiveVerifier::StopTracking(HANDLE handle, const void* owner,
|
|
|
| AutoNativeLock lock(*lock_);
|
| HandleMap::iterator i = map_.find(handle);
|
| - if (i == map_.end())
|
| + if (i == map_.end()) {
|
| + base::debug::Alias(&creation_stack_);
|
| CHECK(false); // Attempting to close an untracked handle.
|
| + }
|
|
|
| Info other = i->second;
|
| if (other.owner != owner) {
|
| base::debug::Alias(&other);
|
| + base::debug::Alias(&creation_stack_);
|
| CHECK(false); // Attempting to close a handle not owned by opener.
|
| }
|
|
|
| @@ -209,6 +214,7 @@ void ActiveVerifier::OnHandleBeingClosed(HANDLE handle) {
|
|
|
| Info other = i->second;
|
| base::debug::Alias(&other);
|
| + base::debug::Alias(&creation_stack_);
|
| CHECK(false); // CloseHandle called on tracked handle.
|
| }
|
|
|
|
|