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

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

Issue 1108953003: Conv CHECK->DCHECK in CloseHandle (top crasher & data enough to debug) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review. 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 22 matching lines...) Expand all
33 const void* pc2; 33 const void* pc2;
34 DWORD thread_id; 34 DWORD thread_id;
35 }; 35 };
36 typedef std::unordered_map<HANDLE, Info, HandleHash> HandleMap; 36 typedef std::unordered_map<HANDLE, Info, HandleHash> HandleMap;
37 37
38 // g_lock protects the handle map and setting g_active_verifier. 38 // g_lock protects the handle map and setting g_active_verifier.
39 typedef base::internal::LockImpl NativeLock; 39 typedef base::internal::LockImpl NativeLock;
40 base::LazyInstance<NativeLock>::Leaky g_lock = LAZY_INSTANCE_INITIALIZER; 40 base::LazyInstance<NativeLock>::Leaky g_lock = LAZY_INSTANCE_INITIALIZER;
41 41
42 bool CloseHandleWrapper(HANDLE handle) { 42 bool CloseHandleWrapper(HANDLE handle) {
43 if (!::CloseHandle(handle)) 43 if (::CloseHandle(handle))
44 CHECK(false); 44 return true;
45 return true; 45
46 NOTREACHED();
47 return false;
46 } 48 }
47 49
48 // Simple automatic locking using a native critical section so it supports 50 // Simple automatic locking using a native critical section so it supports
49 // recursive locking. 51 // recursive locking.
50 class AutoNativeLock { 52 class AutoNativeLock {
51 public: 53 public:
52 explicit AutoNativeLock(NativeLock& lock) : lock_(lock) { 54 explicit AutoNativeLock(NativeLock& lock) : lock_(lock) {
53 lock_.Lock(); 55 lock_.Lock();
54 } 56 }
55 57
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 void DisableHandleVerifier() { 239 void DisableHandleVerifier() {
238 return ActiveVerifier::Get()->Disable(); 240 return ActiveVerifier::Get()->Disable();
239 } 241 }
240 242
241 void OnHandleBeingClosed(HANDLE handle) { 243 void OnHandleBeingClosed(HANDLE handle) {
242 return ActiveVerifier::Get()->OnHandleBeingClosed(handle); 244 return ActiveVerifier::Get()->OnHandleBeingClosed(handle);
243 } 245 }
244 246
245 } // namespace win 247 } // namespace win
246 } // namespace base 248 } // 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