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

Side by Side Diff: chrome/service/cloud_print/print_system_win.cc

Issue 9700038: ScopedProcessInformation protects against process/thread handle leaks from CreateProcess calls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove changes from another CL. Created 8 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/service/cloud_print/print_system.h" 5 #include "chrome/service/cloud_print/print_system.h"
6 6
7 #include <objidl.h> 7 #include <objidl.h>
8 #include <winspool.h> 8 #include <winspool.h>
9 #include <xpsprint.h> 9 #include <xpsprint.h>
10 10
(...skipping 27 matching lines...) Expand all
38 typedef HANDLE Handle; 38 typedef HANDLE Handle;
39 39
40 static bool CloseHandle(HANDLE handle) { 40 static bool CloseHandle(HANDLE handle) {
41 return ::FindClosePrinterChangeNotification(handle) != FALSE; 41 return ::FindClosePrinterChangeNotification(handle) != FALSE;
42 } 42 }
43 43
44 static bool IsHandleValid(HANDLE handle) { 44 static bool IsHandleValid(HANDLE handle) {
45 return handle != NULL; 45 return handle != NULL;
46 } 46 }
47 47
48 static bool IsSame(HANDLE lhs, HANDLE rhs) {
49 return lhs == rhs;
50 }
51
48 static HANDLE NullHandle() { 52 static HANDLE NullHandle() {
49 return NULL; 53 return NULL;
50 } 54 }
51 55
52 private: 56 private:
53 DISALLOW_IMPLICIT_CONSTRUCTORS(PrinterChangeHandleTraits); 57 DISALLOW_IMPLICIT_CONSTRUCTORS(PrinterChangeHandleTraits);
54 }; 58 };
55 59
56 typedef base::win::GenericScopedHandle<PrinterChangeHandleTraits> 60 typedef base::win::GenericScopedHandle<PrinterChangeHandleTraits>
57 ScopedPrinterChangeHandle; 61 ScopedPrinterChangeHandle;
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
895 RpcStringFree(reinterpret_cast<RPC_WSTR *>(&proxy_id_as_string)); 899 RpcStringFree(reinterpret_cast<RPC_WSTR *>(&proxy_id_as_string));
896 return ret; 900 return ret;
897 } 901 }
898 902
899 scoped_refptr<PrintSystem> PrintSystem::CreateInstance( 903 scoped_refptr<PrintSystem> PrintSystem::CreateInstance(
900 const base::DictionaryValue* print_system_settings) { 904 const base::DictionaryValue* print_system_settings) {
901 return new PrintSystemWin; 905 return new PrintSystemWin;
902 } 906 }
903 907
904 } // namespace cloud_print 908 } // namespace cloud_print
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698