| 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 // This file/namespace contains utility functions for enumerating, ending and | 5 // This file/namespace contains utility functions for enumerating, ending and |
| 6 // computing statistics of processes. | 6 // computing statistics of processes. |
| 7 | 7 |
| 8 #ifndef BASE_PROCESS_UTIL_H_ | 8 #ifndef BASE_PROCESS_UTIL_H_ |
| 9 #define BASE_PROCESS_UTIL_H_ | 9 #define BASE_PROCESS_UTIL_H_ |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #elif defined(OS_POSIX) | 25 #elif defined(OS_POSIX) |
| 26 typedef int ProcessEntry; | 26 typedef int ProcessEntry; |
| 27 typedef int IoCounters; //TODO(awalker): replace with struct when available | 27 typedef int IoCounters; //TODO(awalker): replace with struct when available |
| 28 #endif | 28 #endif |
| 29 | 29 |
| 30 namespace process_util { | 30 namespace process_util { |
| 31 | 31 |
| 32 // Returns the id of the current process. | 32 // Returns the id of the current process. |
| 33 int GetCurrentProcId(); | 33 int GetCurrentProcId(); |
| 34 | 34 |
| 35 // Returns the ProcessHandle of the current process. |
| 36 ProcessHandle GetCurrentProcessHandle(); |
| 37 |
| 35 // Returns the unique ID for the specified process. This is functionally the | 38 // Returns the unique ID for the specified process. This is functionally the |
| 36 // same as Windows' GetProcessId(), but works on versions of Windows before | 39 // same as Windows' GetProcessId(), but works on versions of Windows before |
| 37 // Win XP SP1 as well. | 40 // Win XP SP1 as well. |
| 38 int GetProcId(ProcessHandle process); | 41 int GetProcId(ProcessHandle process); |
| 39 | 42 |
| 40 // Runs the given application name with the given command line. Normally, the | 43 // Runs the given application name with the given command line. Normally, the |
| 41 // first command line argument should be the path to the process, and don't | 44 // first command line argument should be the path to the process, and don't |
| 42 // forget to quote it. | 45 // forget to quote it. |
| 43 // | 46 // |
| 44 // If wait is true, it will block and wait for the other process to finish, | 47 // If wait is true, it will block and wait for the other process to finish, |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 // Note: Returns true on Windows 2000 without doing anything. | 258 // Note: Returns true on Windows 2000 without doing anything. |
| 256 bool EnableLowFragmentationHeap(); | 259 bool EnableLowFragmentationHeap(); |
| 257 | 260 |
| 258 // If supported on the platform, and the user has sufficent rights, increase | 261 // If supported on the platform, and the user has sufficent rights, increase |
| 259 // the current process's scheduling priority to a high priority. | 262 // the current process's scheduling priority to a high priority. |
| 260 void RaiseProcessToHighPriority(); | 263 void RaiseProcessToHighPriority(); |
| 261 | 264 |
| 262 } // namespace process_util | 265 } // namespace process_util |
| 263 | 266 |
| 264 #endif // BASE_PROCESS_UTIL_H_ | 267 #endif // BASE_PROCESS_UTIL_H_ |
| OLD | NEW |