| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef BASE_PROCESS_H_ | 5 #ifndef BASE_PROCESS_H_ |
| 6 #define BASE_PROCESS_H_ | 6 #define BASE_PROCESS_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| 11 #include <sys/types.h> | 11 #include <sys/types.h> |
| 12 #ifdef OS_WIN | 12 #if defined(OS_WIN) |
| 13 #include <windows.h> | 13 #include <windows.h> |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 | 17 |
| 18 // ProcessHandle is a platform specific type which represents the underlying OS | 18 // ProcessHandle is a platform specific type which represents the underlying OS |
| 19 // handle to a process. | 19 // handle to a process. |
| 20 // ProcessId is a number which identifies the process in the OS. | 20 // ProcessId is a number which identifies the process in the OS. |
| 21 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
| 22 typedef HANDLE ProcessHandle; | 22 typedef HANDLE ProcessHandle; |
| 23 typedef DWORD ProcessId; | 23 typedef DWORD ProcessId; |
| 24 typedef HANDLE UserTokenHandle; | 24 typedef HANDLE UserTokenHandle; |
| 25 const ProcessHandle kNullProcessHandle = NULL; | 25 const ProcessHandle kNullProcessHandle = NULL; |
| 26 #elif defined(OS_POSIX) | 26 #elif defined(OS_POSIX) |
| 27 // On POSIX, our ProcessHandle will just be the PID. | 27 // On POSIX, our ProcessHandle will just be the PID. |
| 28 typedef pid_t ProcessHandle; | 28 typedef pid_t ProcessHandle; |
| 29 typedef pid_t ProcessId; | 29 typedef pid_t ProcessId; |
| 30 const ProcessHandle kNullProcessHandle = 0; | 30 const ProcessHandle kNullProcessHandle = 0; |
| 31 #endif | 31 #endif // defined(OS_WIN) |
| 32 | 32 |
| 33 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 33 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 34 // saved_priority_ will be set to this to indicate that it's not holding | 34 // saved_priority_ will be set to this to indicate that it's not holding |
| 35 // a valid value. -20 to 19 are valid process priorities. | 35 // a valid value. -20 to 19 are valid process priorities. |
| 36 const int kUnsetProcessPriority = 256; | 36 const int kUnsetProcessPriority = 256; |
| 37 #endif | 37 #endif |
| 38 | 38 |
| 39 class Process { | 39 class Process { |
| 40 public: | 40 public: |
| 41 Process() : process_(kNullProcessHandle) { | 41 Process() : process_(kNullProcessHandle) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 97 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 98 // Holds the priority that the process was set to when it was backgrounded. | 98 // Holds the priority that the process was set to when it was backgrounded. |
| 99 // If the process wasn't backgrounded it will be kUnsetProcessPriority. | 99 // If the process wasn't backgrounded it will be kUnsetProcessPriority. |
| 100 int saved_priority_; | 100 int saved_priority_; |
| 101 #endif | 101 #endif |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 } // namespace base | 104 } // namespace base |
| 105 | 105 |
| 106 #endif // BASE_PROCESS_H_ | 106 #endif // BASE_PROCESS_H_ |
| OLD | NEW |