| 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 // Returns false if all processes were able to be killed off, false if at least | 132 // Returns false if all processes were able to be killed off, false if at least |
| 133 // one couldn't be killed. | 133 // one couldn't be killed. |
| 134 bool KillProcesses(const std::wstring& executable_name, int exit_code, | 134 bool KillProcesses(const std::wstring& executable_name, int exit_code, |
| 135 const ProcessFilter* filter); | 135 const ProcessFilter* filter); |
| 136 | 136 |
| 137 // Attempts to kill the process identified by the given process | 137 // Attempts to kill the process identified by the given process |
| 138 // entry structure, giving it the specified exit code. If |wait| is true, wait | 138 // entry structure, giving it the specified exit code. If |wait| is true, wait |
| 139 // for the process to be actually terminated before returning. | 139 // for the process to be actually terminated before returning. |
| 140 // Returns true if this is successful, false otherwise. | 140 // Returns true if this is successful, false otherwise. |
| 141 bool KillProcess(int process_id, int exit_code, bool wait); | 141 bool KillProcess(int process_id, int exit_code, bool wait); |
| 142 #if defined(OS_WIN) | |
| 143 bool KillProcess(HANDLE process, int exit_code, bool wait); | |
| 144 #endif | |
| 145 | 142 |
| 146 // Get the termination status (exit code) of the process and return true if the | 143 // Get the termination status (exit code) of the process and return true if the |
| 147 // status indicates the process crashed. It is an error to call this if the | 144 // status indicates the process crashed. It is an error to call this if the |
| 148 // process hasn't terminated yet. | 145 // process hasn't terminated yet. |
| 149 bool DidProcessCrash(ProcessHandle handle); | 146 bool DidProcessCrash(ProcessHandle handle); |
| 150 | 147 |
| 151 // Waits for process to exit. In POSIX systems, if the process hasn't been | 148 // Waits for process to exit. In POSIX systems, if the process hasn't been |
| 152 // signaled then puts the exit code in |exit_code|; otherwise it's considered | 149 // signaled then puts the exit code in |exit_code|; otherwise it's considered |
| 153 // a failure. On Windows |exit_code| is always filled. Returns true on success, | 150 // a failure. On Windows |exit_code| is always filled. Returns true on success, |
| 154 // and closes |handle| in any case. | 151 // and closes |handle| in any case. |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 // overflow. Has no effect if the OS doesn't provide the necessary facility. | 333 // overflow. Has no effect if the OS doesn't provide the necessary facility. |
| 337 void EnableTerminationOnHeapCorruption(); | 334 void EnableTerminationOnHeapCorruption(); |
| 338 | 335 |
| 339 // If supported on the platform, and the user has sufficent rights, increase | 336 // If supported on the platform, and the user has sufficent rights, increase |
| 340 // the current process's scheduling priority to a high priority. | 337 // the current process's scheduling priority to a high priority. |
| 341 void RaiseProcessToHighPriority(); | 338 void RaiseProcessToHighPriority(); |
| 342 | 339 |
| 343 } // namespace base | 340 } // namespace base |
| 344 | 341 |
| 345 #endif // BASE_PROCESS_UTIL_H_ | 342 #endif // BASE_PROCESS_UTIL_H_ |
| OLD | NEW |