diff options
author | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-05 20:07:11 +0000 |
---|---|---|
committer | alexeypa@chromium.org <alexeypa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-05 20:07:11 +0000 |
commit | 5f29c1d65b7eae25a84ce75b4147ebe5bbe4a45b (patch) | |
tree | 3ee118ee70d9a83166c5c74b149d0c83fab080a2 /printing | |
parent | 930792991d819c4c14c62778731ff0dbde5ea159 (diff) | |
download | chromium_src-5f29c1d65b7eae25a84ce75b4147ebe5bbe4a45b.zip chromium_src-5f29c1d65b7eae25a84ce75b4147ebe5bbe4a45b.tar.gz chromium_src-5f29c1d65b7eae25a84ce75b4147ebe5bbe4a45b.tar.bz2 |
Making GenericScopedHandle capable of handling handle types other than HANDLE.
Review URL: http://codereview.chromium.org/9582045
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124980 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing')
-rw-r--r-- | printing/backend/win_helper.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/printing/backend/win_helper.h b/printing/backend/win_helper.h index 11b34ee..667609d 100644 --- a/printing/backend/win_helper.h +++ b/printing/backend/win_helper.h @@ -20,9 +20,22 @@ namespace printing { class PrinterHandleTraits { public: + typedef HANDLE Handle; + static bool CloseHandle(HANDLE handle) { return ::ClosePrinter(handle) != FALSE; } + + static bool IsHandleValid(HANDLE handle) { + return handle != NULL; + } + + static HANDLE NullHandle() { + return NULL; + } + + private: + DISALLOW_IMPLICIT_CONSTRUCTORS(PrinterHandleTraits); }; typedef base::win::GenericScopedHandle<PrinterHandleTraits> ScopedPrinterHandle; |