OLD | NEW |
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/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 process.is_current_process_ = true; | 47 process.is_current_process_ = true; |
48 return process.Pass(); | 48 return process.Pass(); |
49 } | 49 } |
50 | 50 |
51 // static | 51 // static |
52 Process Process::Open(ProcessId pid) { | 52 Process Process::Open(ProcessId pid) { |
53 return Process(::OpenProcess(kBasicProcessAccess, FALSE, pid)); | 53 return Process(::OpenProcess(kBasicProcessAccess, FALSE, pid)); |
54 } | 54 } |
55 | 55 |
56 // static | 56 // static |
57 Process Process::OpenWithExtraPriviles(ProcessId pid) { | 57 Process Process::OpenWithExtraPrivileges(ProcessId pid) { |
58 DWORD access = kBasicProcessAccess | PROCESS_DUP_HANDLE | PROCESS_VM_READ; | 58 DWORD access = kBasicProcessAccess | PROCESS_DUP_HANDLE | PROCESS_VM_READ; |
59 return Process(::OpenProcess(access, FALSE, pid)); | 59 return Process(::OpenProcess(access, FALSE, pid)); |
60 } | 60 } |
61 | 61 |
62 // static | 62 // static |
63 Process Process::OpenWithAccess(ProcessId pid, DWORD desired_access) { | 63 Process Process::OpenWithAccess(ProcessId pid, DWORD desired_access) { |
64 return Process(::OpenProcess(desired_access, FALSE, pid)); | 64 return Process(::OpenProcess(desired_access, FALSE, pid)); |
65 } | 65 } |
66 | 66 |
67 // static | 67 // static |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 | 186 |
187 return (::SetPriorityClass(Handle(), priority) != 0); | 187 return (::SetPriorityClass(Handle(), priority) != 0); |
188 } | 188 } |
189 | 189 |
190 int Process::GetPriority() const { | 190 int Process::GetPriority() const { |
191 DCHECK(IsValid()); | 191 DCHECK(IsValid()); |
192 return ::GetPriorityClass(Handle()); | 192 return ::GetPriorityClass(Handle()); |
193 } | 193 } |
194 | 194 |
195 } // namespace base | 195 } // namespace base |
OLD | NEW |