Lines Matching refs:handle
31 // - IsValid() method can tolerate multiple invalid handle values such as NULL
33 // - Receive() method allows to receive a handle value from a function that
34 // takes a raw handle pointer only.
40 typedef typename Traits::Handle Handle;
44 explicit GenericScopedHandle(Handle handle) : handle_(Traits::NullHandle()) {
45 Set(handle);
69 void Set(Handle handle) {
70 if (handle_ != handle) {
73 if (Traits::IsHandleValid(handle)) {
74 handle_ = handle;
75 Verifier::StartTracking(handle, this, BASE_WIN_GET_CALLER,
81 Handle Get() const {
85 operator Handle() const {
90 Handle Take() {
91 Handle temp = handle_;
100 // Explicitly closes the owned handle.
114 Handle handle_;
122 typedef HANDLE Handle;
124 // Closes the handle.
125 static bool CloseHandle(HANDLE handle) {
126 return ::CloseHandle(handle) != FALSE;
129 // Returns true if the handle value is valid.
130 static bool IsHandleValid(HANDLE handle) {
131 return handle != NULL && handle != INVALID_HANDLE_VALUE;
134 // Returns NULL handle value.
135 static HANDLE NullHandle() {
146 typedef HANDLE Handle;
148 static void StartTracking(HANDLE handle, const void* owner,
150 static void StopTracking(HANDLE handle, const void* owner,
160 typedef HANDLE Handle;
162 static void StartTracking(HANDLE handle, const void* owner,
164 static void StopTracking(HANDLE handle, const void* owner,