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

Unified Diff: printing/backend/win_helper.h

Issue 9480026: Added ScopedPrinterHandle (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/win/scoped_handle.h ('k') | remoting/host/wts_session_process_launcher_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: printing/backend/win_helper.h
diff --git a/printing/backend/win_helper.h b/printing/backend/win_helper.h
index a08e69ac068557011ed4ef76205a992f5935a4f7..8e65aca4add8ae9e85acb8b57c727275f79c60e4 100644
--- a/printing/backend/win_helper.h
+++ b/printing/backend/win_helper.h
@@ -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
« no previous file with comments | « base/win/scoped_handle.h ('k') | remoting/host/wts_session_process_launcher_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698