| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 // | 125 // |
| 126 // As above, if wait is true, execute synchronously. The pid will be stored | 126 // As above, if wait is true, execute synchronously. The pid will be stored |
| 127 // in process_handle if that pointer is non-null. | 127 // in process_handle if that pointer is non-null. |
| 128 // | 128 // |
| 129 // Note that the first argument in argv must point to the filename, | 129 // Note that the first argument in argv must point to the filename, |
| 130 // and must be fully specified. | 130 // and must be fully specified. |
| 131 typedef std::vector<std::pair<int, int> > file_handle_mapping_vector; | 131 typedef std::vector<std::pair<int, int> > file_handle_mapping_vector; |
| 132 bool LaunchApp(const std::vector<std::string>& argv, | 132 bool LaunchApp(const std::vector<std::string>& argv, |
| 133 const file_handle_mapping_vector& fds_to_remap, | 133 const file_handle_mapping_vector& fds_to_remap, |
| 134 bool wait, ProcessHandle* process_handle); | 134 bool wait, ProcessHandle* process_handle); |
| 135 |
| 136 #if defined(OS_LINUX) |
| 137 // Like LaunchApp, but if zygote manager is enabled, |
| 138 // forks the zygote instead of forking and exec'ing. |
| 139 bool ForkApp(const std::vector<std::string>& argv, |
| 140 const file_handle_mapping_vector& fds_to_remap, |
| 141 ProcessHandle* process_handle); |
| 142 #endif |
| 135 #endif | 143 #endif |
| 136 | 144 |
| 137 // Executes the application specified by cl. This function delegates to one | 145 // Executes the application specified by cl. This function delegates to one |
| 138 // of the above two platform-specific functions. | 146 // of the above two platform-specific functions. |
| 139 bool LaunchApp(const CommandLine& cl, | 147 bool LaunchApp(const CommandLine& cl, |
| 140 bool wait, bool start_hidden, ProcessHandle* process_handle); | 148 bool wait, bool start_hidden, ProcessHandle* process_handle); |
| 141 | 149 |
| 142 #if defined(OS_WIN) | 150 #if defined(OS_WIN) |
| 143 // Executes the application specified by |cmd_line| and copies the contents | 151 // Executes the application specified by |cmd_line| and copies the contents |
| 144 // printed to the standard output to |output|, which should be non NULL. | 152 // printed to the standard output to |output|, which should be non NULL. |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 // overflow. Has no effect if the OS doesn't provide the necessary facility. | 399 // overflow. Has no effect if the OS doesn't provide the necessary facility. |
| 392 void EnableTerminationOnHeapCorruption(); | 400 void EnableTerminationOnHeapCorruption(); |
| 393 | 401 |
| 394 // If supported on the platform, and the user has sufficent rights, increase | 402 // If supported on the platform, and the user has sufficent rights, increase |
| 395 // the current process's scheduling priority to a high priority. | 403 // the current process's scheduling priority to a high priority. |
| 396 void RaiseProcessToHighPriority(); | 404 void RaiseProcessToHighPriority(); |
| 397 | 405 |
| 398 } // namespace base | 406 } // namespace base |
| 399 | 407 |
| 400 #endif // BASE_PROCESS_UTIL_H_ | 408 #endif // BASE_PROCESS_UTIL_H_ |
| OLD | NEW |