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 |
142 | 145 |
143 // Get the termination status (exit code) of the process and return true if the | 146 // Get the termination status (exit code) of the process and return true if the |
144 // status indicates the process crashed. It is an error to call this if the | 147 // status indicates the process crashed. It is an error to call this if the |
145 // process hasn't terminated yet. | 148 // process hasn't terminated yet. |
146 bool DidProcessCrash(ProcessHandle handle); | 149 bool DidProcessCrash(ProcessHandle handle); |
147 | 150 |
148 // Waits for process to exit. In POSIX systems, if the process hasn't been | 151 // Waits for process to exit. In POSIX systems, if the process hasn't been |
149 // signaled then puts the exit code in |exit_code|; otherwise it's considered | 152 // signaled then puts the exit code in |exit_code|; otherwise it's considered |
150 // a failure. On Windows |exit_code| is always filled. Returns true on success, | 153 // a failure. On Windows |exit_code| is always filled. Returns true on success, |
151 // and closes |handle| in any case. | 154 // and closes |handle| in any case. |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 // overflow. Has no effect if the OS doesn't provide the necessary facility. | 336 // overflow. Has no effect if the OS doesn't provide the necessary facility. |
334 void EnableTerminationOnHeapCorruption(); | 337 void EnableTerminationOnHeapCorruption(); |
335 | 338 |
336 // If supported on the platform, and the user has sufficent rights, increase | 339 // If supported on the platform, and the user has sufficent rights, increase |
337 // the current process's scheduling priority to a high priority. | 340 // the current process's scheduling priority to a high priority. |
338 void RaiseProcessToHighPriority(); | 341 void RaiseProcessToHighPriority(); |
339 | 342 |
340 } // namespace base | 343 } // namespace base |
341 | 344 |
342 #endif // BASE_PROCESS_UTIL_H_ | 345 #endif // BASE_PROCESS_UTIL_H_ |
OLD | NEW |