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 <sys/resource.h> | 7 #include <sys/resource.h> |
8 #include <sys/wait.h> | 8 #include <sys/wait.h> |
9 | 9 |
10 #include "base/files/scoped_file.h" | 10 #include "base/files/scoped_file.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 // static | 231 // static |
232 Process Process::Open(ProcessId pid) { | 232 Process Process::Open(ProcessId pid) { |
233 if (pid == GetCurrentProcId()) | 233 if (pid == GetCurrentProcId()) |
234 return Current(); | 234 return Current(); |
235 | 235 |
236 // On POSIX process handles are the same as PIDs. | 236 // On POSIX process handles are the same as PIDs. |
237 return Process(pid); | 237 return Process(pid); |
238 } | 238 } |
239 | 239 |
240 // static | 240 // static |
241 Process Process::OpenWithExtraPriviles(ProcessId pid) { | 241 Process Process::OpenWithExtraPrivileges(ProcessId pid) { |
242 // On POSIX there are no privileges to set. | 242 // On POSIX there are no privileges to set. |
243 return Open(pid); | 243 return Open(pid); |
244 } | 244 } |
245 | 245 |
246 // static | 246 // static |
247 Process Process::DeprecatedGetProcessFromHandle(ProcessHandle handle) { | 247 Process Process::DeprecatedGetProcessFromHandle(ProcessHandle handle) { |
248 DCHECK_NE(handle, GetCurrentProcessHandle()); | 248 DCHECK_NE(handle, GetCurrentProcessHandle()); |
249 return Process(handle); | 249 return Process(handle); |
250 } | 250 } |
251 | 251 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 return false; | 319 return false; |
320 } | 320 } |
321 #endif // !defined(OS_LINUX) | 321 #endif // !defined(OS_LINUX) |
322 | 322 |
323 int Process::GetPriority() const { | 323 int Process::GetPriority() const { |
324 DCHECK(IsValid()); | 324 DCHECK(IsValid()); |
325 return getpriority(PRIO_PROCESS, process_); | 325 return getpriority(PRIO_PROCESS, process_); |
326 } | 326 } |
327 | 327 |
328 } // namespace base | 328 } // namespace base |
OLD | NEW |