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

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: Created 5 years, 8 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 DCHECK(false);
grt (UTC plus 2) 2015/04/28 01:54:03 return false in this case. how about: if (::Clos
Shrikant Kelkar 2015/04/28 17:59:10 Done.
45 }
45 return true; 46 return true;
46 } 47 }
47 48
48 // Simple automatic locking using a native critical section so it supports 49 // Simple automatic locking using a native critical section so it supports
49 // recursive locking. 50 // recursive locking.
50 class AutoNativeLock { 51 class AutoNativeLock {
51 public: 52 public:
52 explicit AutoNativeLock(NativeLock& lock) : lock_(lock) { 53 explicit AutoNativeLock(NativeLock& lock) : lock_(lock) {
53 lock_.Lock(); 54 lock_.Lock();
54 } 55 }
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 void DisableHandleVerifier() { 238 void DisableHandleVerifier() {
238 return ActiveVerifier::Get()->Disable(); 239 return ActiveVerifier::Get()->Disable();
239 } 240 }
240 241
241 void OnHandleBeingClosed(HANDLE handle) { 242 void OnHandleBeingClosed(HANDLE handle) {
242 return ActiveVerifier::Get()->OnHandleBeingClosed(handle); 243 return ActiveVerifier::Get()->OnHandleBeingClosed(handle);
243 } 244 }
244 245
245 } // namespace win 246 } // namespace win
246 } // namespace base 247 } // 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