summaryrefslogtreecommitdiffstats
path: root/printing
diff options
context:
space:
mode:
authorvitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-02 15:00:57 +0000
committervitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-02 15:00:57 +0000
commitf571a71873b7eb223c8e4405f649cde86c776de5 (patch)
tree44a589fb194402fe5ce2111885db040327c25108 /printing
parent747e4e29fbe097e0969a6578d6a6d2bf5e3acc84 (diff)
downloadchromium_src-f571a71873b7eb223c8e4405f649cde86c776de5.zip
chromium_src-f571a71873b7eb223c8e4405f649cde86c776de5.tar.gz
chromium_src-f571a71873b7eb223c8e4405f649cde86c776de5.tar.bz2
Added ScopedPrinterHandle
TEST=it compiles BUG=none Review URL: http://codereview.chromium.org/9480026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@124640 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing')
-rw-r--r--printing/backend/win_helper.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/printing/backend/win_helper.h b/printing/backend/win_helper.h
index a08e69a..11b34ee 100644
--- a/printing/backend/win_helper.h
+++ b/printing/backend/win_helper.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -12,11 +12,22 @@
#include <xpsprint.h>
#include "base/string16.h"
+#include "base/win/scoped_handle.h"
#include "printing/printing_export.h"
// These are helper functions for dealing with Windows Printing.
namespace printing {
+class PrinterHandleTraits {
+ public:
+ static bool CloseHandle(HANDLE handle) {
+ return ::ClosePrinter(handle) != FALSE;
+ }
+};
+
+typedef base::win::GenericScopedHandle<PrinterHandleTraits> ScopedPrinterHandle;
+
+
// Wrapper class to wrap the XPS APIs (PTxxx APIs). This is needed because these
// APIs are not available by default on XP. We could delayload prntvpt.dll but
// this would mean having to add that to every binary that links with