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

Side by Side Diff: third_party/lzma/v4_65/files/CPP/Windows/Handle.h

Issue 624713003: Keep only base/extractor.[cc|h]. (Closed) Base URL: https://chromium.googlesource.com/external/omaha.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
OLDNEW
(Empty)
1 // Windows/Handle.h
2
3 #ifndef __WINDOWS_HANDLE_H
4 #define __WINDOWS_HANDLE_H
5
6 namespace NWindows {
7
8 class CHandle
9 {
10 protected:
11 HANDLE _handle;
12 public:
13 operator HANDLE() { return _handle; }
14 CHandle(): _handle(NULL) {}
15 ~CHandle() { Close(); }
16 bool Close()
17 {
18 if (_handle == NULL)
19 return true;
20 if (!::CloseHandle(_handle))
21 return false;
22 _handle = NULL;
23 return true;
24 }
25 void Attach(HANDLE handle)
26 { _handle = handle; }
27 HANDLE Detach()
28 {
29 HANDLE handle = _handle;
30 _handle = NULL;
31 return handle;
32 }
33 };
34
35 }
36
37 #endif
OLDNEW
« no previous file with comments | « third_party/lzma/v4_65/files/CPP/Windows/FileName.cpp ('k') | third_party/lzma/v4_65/files/CPP/Windows/MemoryLock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698