| 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/time.h> | 8 #include <sys/time.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 | 10 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 return process_; | 68 return process_; |
| 69 } | 69 } |
| 70 | 70 |
| 71 Process Process::Duplicate() const { | 71 Process Process::Duplicate() const { |
| 72 if (is_current()) | 72 if (is_current()) |
| 73 return Current(); | 73 return Current(); |
| 74 | 74 |
| 75 return Process(process_); | 75 return Process(process_); |
| 76 } | 76 } |
| 77 | 77 |
| 78 ProcessId Process::pid() const { | 78 ProcessId Process::Pid() const { |
| 79 DCHECK(IsValid()); | 79 DCHECK(IsValid()); |
| 80 return GetProcId(process_); | 80 return GetProcId(process_); |
| 81 } | 81 } |
| 82 | 82 |
| 83 bool Process::is_current() const { | 83 bool Process::is_current() const { |
| 84 return process_ == GetCurrentProcessHandle(); | 84 return process_ == GetCurrentProcessHandle(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void Process::Close() { | 87 void Process::Close() { |
| 88 process_ = kNullProcessHandle; | 88 process_ = kNullProcessHandle; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 return false; | 126 return false; |
| 127 } | 127 } |
| 128 #endif // !defined(OS_LINUX) | 128 #endif // !defined(OS_LINUX) |
| 129 | 129 |
| 130 int Process::GetPriority() const { | 130 int Process::GetPriority() const { |
| 131 DCHECK(IsValid()); | 131 DCHECK(IsValid()); |
| 132 return getpriority(PRIO_PROCESS, process_); | 132 return getpriority(PRIO_PROCESS, process_); |
| 133 } | 133 } |
| 134 | 134 |
| 135 } // namspace base | 135 } // namspace base |
| OLD | NEW |