| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/win/scoped_handle.h" | 5 #include "base/win/scoped_handle.h" |
| 6 | 6 |
| 7 #include <unordered_map> | 7 #include <unordered_map> |
| 8 | 8 |
| 9 #include "base/debug/alias.h" | 9 #include "base/debug/alias.h" |
| 10 #include "base/hash.h" | 10 #include "base/hash.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 g_active_verifier = new ActiveVerifier(false); | 125 g_active_verifier = new ActiveVerifier(false); |
| 126 return; | 126 return; |
| 127 } | 127 } |
| 128 | 128 |
| 129 ActiveVerifier* verifier = | 129 ActiveVerifier* verifier = |
| 130 reinterpret_cast<ActiveVerifier*>(get_handle_verifier()); | 130 reinterpret_cast<ActiveVerifier*>(get_handle_verifier()); |
| 131 | 131 |
| 132 // This lock only protects against races in this module, which is fine. | 132 // This lock only protects against races in this module, which is fine. |
| 133 AutoNativeLock lock(g_lock.Get()); | 133 AutoNativeLock lock(g_lock.Get()); |
| 134 g_active_verifier = verifier ? verifier : new ActiveVerifier(true); | 134 g_active_verifier = verifier ? verifier : new ActiveVerifier(true); |
| 135 | |
| 136 // TODO(shrikant): Enable handle verifier after figuring out | |
| 137 // AppContainer/DuplicateHandle error. | |
| 138 g_active_verifier->Disable(); | |
| 139 #endif | 135 #endif |
| 140 } | 136 } |
| 141 | 137 |
| 142 bool ActiveVerifier::CloseHandle(HANDLE handle) { | 138 bool ActiveVerifier::CloseHandle(HANDLE handle) { |
| 143 if (!enabled_) | 139 if (!enabled_) |
| 144 return CloseHandleWrapper(handle); | 140 return CloseHandleWrapper(handle); |
| 145 | 141 |
| 146 AutoNativeLock lock(*lock_); | 142 AutoNativeLock lock(*lock_); |
| 147 closing_ = true; | 143 closing_ = true; |
| 148 CloseHandleWrapper(handle); | 144 CloseHandleWrapper(handle); |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 void DisableHandleVerifier() { | 233 void DisableHandleVerifier() { |
| 238 return ActiveVerifier::Get()->Disable(); | 234 return ActiveVerifier::Get()->Disable(); |
| 239 } | 235 } |
| 240 | 236 |
| 241 void OnHandleBeingClosed(HANDLE handle) { | 237 void OnHandleBeingClosed(HANDLE handle) { |
| 242 return ActiveVerifier::Get()->OnHandleBeingClosed(handle); | 238 return ActiveVerifier::Get()->OnHandleBeingClosed(handle); |
| 243 } | 239 } |
| 244 | 240 |
| 245 } // namespace win | 241 } // namespace win |
| 246 } // namespace base | 242 } // namespace base |
| OLD | NEW |