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

Side by Side Diff: base/process/process_handle_win.cc

Issue 874773002: Remove CloseProcessHandle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « base/process/process_handle_posix.cc ('k') | base/test/multiprocess_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "base/process/process_handle.h" 5 #include "base/process/process_handle.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/win/scoped_handle.h" 10 #include "base/win/scoped_handle.h"
11 #include "base/win/windows_version.h" 11 #include "base/win/windows_version.h"
12 12
13 namespace base { 13 namespace base {
14 14
15 ProcessId GetCurrentProcId() { 15 ProcessId GetCurrentProcId() {
16 return ::GetCurrentProcessId(); 16 return ::GetCurrentProcessId();
17 } 17 }
18 18
19 ProcessHandle GetCurrentProcessHandle() { 19 ProcessHandle GetCurrentProcessHandle() {
20 return ::GetCurrentProcess(); 20 return ::GetCurrentProcess();
21 } 21 }
22 22
23 void CloseProcessHandle(ProcessHandle process) {
24 CloseHandle(process);
25 }
26
27 ProcessId GetProcId(ProcessHandle process) { 23 ProcessId GetProcId(ProcessHandle process) {
28 // This returns 0 if we have insufficient rights to query the process handle. 24 // This returns 0 if we have insufficient rights to query the process handle.
29 return GetProcessId(process); 25 return GetProcessId(process);
30 } 26 }
31 27
32 bool GetProcessIntegrityLevel(ProcessHandle process, IntegrityLevel *level) { 28 bool GetProcessIntegrityLevel(ProcessHandle process, IntegrityLevel *level) {
33 if (!level) 29 if (!level)
34 return false; 30 return false;
35 31
36 if (win::GetVersion() < base::win::VERSION_VISTA) 32 if (win::GetVersion() < base::win::VERSION_VISTA)
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 *level = HIGH_INTEGRITY; 70 *level = HIGH_INTEGRITY;
75 } else { 71 } else {
76 NOTREACHED(); 72 NOTREACHED();
77 return false; 73 return false;
78 } 74 }
79 75
80 return true; 76 return true;
81 } 77 }
82 78
83 } // namespace base 79 } // namespace base
OLDNEW
« no previous file with comments | « base/process/process_handle_posix.cc ('k') | base/test/multiprocess_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698