Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

Side by Side Diff: base/win/scoped_handle.cc

Issue 1127873002: Reverting change to disable active verifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698