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

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

Issue 618523002: Remove ScopedHandle operator Handle() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 #ifndef BASE_WIN_SCOPED_HANDLE_H_ 5 #ifndef BASE_WIN_SCOPED_HANDLE_H_
6 #define BASE_WIN_SCOPED_HANDLE_H_ 6 #define BASE_WIN_SCOPED_HANDLE_H_
7 7
8 #include <windows.h> 8 #include <windows.h>
9 9
10 #include "base/base_export.h" 10 #include "base/base_export.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 Verifier::StartTracking(handle, this, BASE_WIN_GET_CALLER, 73 Verifier::StartTracking(handle, this, BASE_WIN_GET_CALLER,
74 tracked_objects::GetProgramCounter()); 74 tracked_objects::GetProgramCounter());
75 } 75 }
76 } 76 }
77 } 77 }
78 78
79 Handle Get() const { 79 Handle Get() const {
80 return handle_; 80 return handle_;
81 } 81 }
82 82
83 operator Handle() const {
84 return handle_;
85 }
86
87 // Transfers ownership away from this object. 83 // Transfers ownership away from this object.
88 Handle Take() { 84 Handle Take() {
89 Handle temp = handle_; 85 Handle temp = handle_;
90 handle_ = Traits::NullHandle(); 86 handle_ = Traits::NullHandle();
91 if (Traits::IsHandleValid(temp)) { 87 if (Traits::IsHandleValid(temp)) {
92 Verifier::StopTracking(temp, this, BASE_WIN_GET_CALLER, 88 Verifier::StopTracking(temp, this, BASE_WIN_GET_CALLER,
93 tracked_objects::GetProgramCounter()); 89 tracked_objects::GetProgramCounter());
94 } 90 }
95 return temp; 91 return temp;
96 } 92 }
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // This should be called whenever the OS is closing a handle, if extended 168 // This should be called whenever the OS is closing a handle, if extended
173 // verification of improper handle closing is desired. If |handle| is being 169 // verification of improper handle closing is desired. If |handle| is being
174 // tracked by the handle verifier and ScopedHandle is not the one closing it, 170 // tracked by the handle verifier and ScopedHandle is not the one closing it,
175 // a CHECK is generated. 171 // a CHECK is generated.
176 void BASE_EXPORT OnHandleBeingClosed(HANDLE handle); 172 void BASE_EXPORT OnHandleBeingClosed(HANDLE handle);
177 173
178 } // namespace win 174 } // namespace win
179 } // namespace base 175 } // namespace base
180 176
181 #endif // BASE_SCOPED_HANDLE_WIN_H_ 177 #endif // BASE_SCOPED_HANDLE_WIN_H_
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