OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 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 <errno.h> | 7 #include <errno.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <sys/resource.h> | 9 #include <sys/resource.h> |
10 #include <sys/wait.h> | 10 #include <sys/wait.h> |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 return Process(handle); | 257 return Process(handle); |
258 } | 258 } |
259 | 259 |
260 #if !defined(OS_LINUX) && !defined(OS_MACOSX) | 260 #if !defined(OS_LINUX) && !defined(OS_MACOSX) |
261 // static | 261 // static |
262 bool Process::CanBackgroundProcesses() { | 262 bool Process::CanBackgroundProcesses() { |
263 return false; | 263 return false; |
264 } | 264 } |
265 #endif // !defined(OS_LINUX) && !defined(OS_MACOSX) | 265 #endif // !defined(OS_LINUX) && !defined(OS_MACOSX) |
266 | 266 |
| 267 // static |
| 268 void Process::TerminateCurrentProcessImmediately(int exit_code) { |
| 269 _exit(exit_code); |
| 270 } |
| 271 |
267 bool Process::IsValid() const { | 272 bool Process::IsValid() const { |
268 return process_ != kNullProcessHandle; | 273 return process_ != kNullProcessHandle; |
269 } | 274 } |
270 | 275 |
271 ProcessHandle Process::Handle() const { | 276 ProcessHandle Process::Handle() const { |
272 return process_; | 277 return process_; |
273 } | 278 } |
274 | 279 |
275 Process Process::Duplicate() const { | 280 Process Process::Duplicate() const { |
276 if (is_current()) | 281 if (is_current()) |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 return false; | 381 return false; |
377 } | 382 } |
378 #endif // !defined(OS_LINUX) && !defined(OS_MACOSX) | 383 #endif // !defined(OS_LINUX) && !defined(OS_MACOSX) |
379 | 384 |
380 int Process::GetPriority() const { | 385 int Process::GetPriority() const { |
381 DCHECK(IsValid()); | 386 DCHECK(IsValid()); |
382 return getpriority(PRIO_PROCESS, process_); | 387 return getpriority(PRIO_PROCESS, process_); |
383 } | 388 } |
384 | 389 |
385 } // namespace base | 390 } // namespace base |
OLD | NEW |