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

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

Issue 868543002: Move OpenProcessHandle to Process::Open. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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_posix.cc ('k') | chrome/app/chrome_watcher_command_line_unittest_win.cc » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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.h" 5 #include "base/process/process.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/process/kill.h" 9 #include "base/process/kill.h"
10 #include "base/win/windows_version.h" 10 #include "base/win/windows_version.h"
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 41
42 // static 42 // static
43 Process Process::Current() { 43 Process Process::Current() {
44 Process process; 44 Process process;
45 process.is_current_process_ = true; 45 process.is_current_process_ = true;
46 return process.Pass(); 46 return process.Pass();
47 } 47 }
48 48
49 // static 49 // static
50 Process Process::Open(ProcessId pid) {
51 return Process(::OpenProcess(kBasicProcessAccess, FALSE, pid));
52 }
53
54 // static
50 Process Process::OpenWithExtraPriviles(ProcessId pid) { 55 Process Process::OpenWithExtraPriviles(ProcessId pid) {
51 DWORD access = kBasicProcessAccess | PROCESS_DUP_HANDLE | PROCESS_VM_READ; 56 DWORD access = kBasicProcessAccess | PROCESS_DUP_HANDLE | PROCESS_VM_READ;
52 ProcessHandle handle = ::OpenProcess(access, FALSE, pid); 57 return Process(::OpenProcess(access, FALSE, pid));
53 return Process(handle);
54 } 58 }
55 59
56 // static 60 // static
57 Process Process::OpenWithAccess(ProcessId pid, DWORD desired_access) { 61 Process Process::OpenWithAccess(ProcessId pid, DWORD desired_access) {
58 return Process(::OpenProcess(desired_access, FALSE, pid)); 62 return Process(::OpenProcess(desired_access, FALSE, pid));
59 } 63 }
60 64
61 // static 65 // static
62 Process Process::DeprecatedGetProcessFromHandle(ProcessHandle handle) { 66 Process Process::DeprecatedGetProcessFromHandle(ProcessHandle handle) {
63 DCHECK_NE(handle, ::GetCurrentProcess()); 67 DCHECK_NE(handle, ::GetCurrentProcess());
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 170
167 return (::SetPriorityClass(Handle(), priority) != 0); 171 return (::SetPriorityClass(Handle(), priority) != 0);
168 } 172 }
169 173
170 int Process::GetPriority() const { 174 int Process::GetPriority() const {
171 DCHECK(IsValid()); 175 DCHECK(IsValid());
172 return ::GetPriorityClass(Handle()); 176 return ::GetPriorityClass(Handle());
173 } 177 }
174 178
175 } // namespace base 179 } // namespace base
OLDNEW
« no previous file with comments | « base/process/process_posix.cc ('k') | chrome/app/chrome_watcher_command_line_unittest_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698