OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 10 #pragma once |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
279 // Similar to the above two methods, but starts the child process in a process | 279 // Similar to the above two methods, but starts the child process in a process |
280 // group of its own, instead of allowing it to inherit the parent's process | 280 // group of its own, instead of allowing it to inherit the parent's process |
281 // group. The pgid of the child process will be the same as its pid. | 281 // group. The pgid of the child process will be the same as its pid. |
282 BASE_API bool LaunchAppInNewProcessGroup( | 282 BASE_API bool LaunchAppInNewProcessGroup( |
283 const std::vector<std::string>& argv, | 283 const std::vector<std::string>& argv, |
284 const environment_vector& environ, | 284 const environment_vector& environ, |
285 const file_handle_mapping_vector& fds_to_remap, | 285 const file_handle_mapping_vector& fds_to_remap, |
286 bool wait, | 286 bool wait, |
287 ProcessHandle* process_handle); | 287 ProcessHandle* process_handle); |
288 | 288 |
289 #if defined(OS_LINUX) | |
290 // Similar to LaunchApp variants above except uses clone(.. clone_flags ..) | |
291 // rather than fork(). This is useful for work inside the setuid sandbox. | |
292 BASE_API bool LaunchAppWithClone(const std::vector<std::string>& argv, | |
293 const file_handle_mapping_vector& fds_to_remap, | |
darin (slow to review)
2011/06/24 16:32:19
not your bug to fix, but "file_handle_mapping_vect
Brad Chen
2011/06/24 16:52:12
Will fix on a separate CL.
On 2011/06/24 16:32:19,
| |
294 bool wait, ProcessHandle* process_handle, | |
295 int clone_flags); | |
296 #endif | |
297 | |
289 // AlterEnvironment returns a modified environment vector, constructed from the | 298 // AlterEnvironment returns a modified environment vector, constructed from the |
290 // given environment and the list of changes given in |changes|. Each key in | 299 // given environment and the list of changes given in |changes|. Each key in |
291 // the environment is matched against the first element of the pairs. In the | 300 // the environment is matched against the first element of the pairs. In the |
292 // event of a match, the value is replaced by the second of the pair, unless | 301 // event of a match, the value is replaced by the second of the pair, unless |
293 // the second is empty, in which case the key-value is removed. | 302 // the second is empty, in which case the key-value is removed. |
294 // | 303 // |
295 // The returned array is allocated using new[] and must be freed by the caller. | 304 // The returned array is allocated using new[] and must be freed by the caller. |
296 BASE_API char** AlterEnvironment(const environment_vector& changes, | 305 BASE_API char** AlterEnvironment(const environment_vector& changes, |
297 const char* const* const env); | 306 const char* const* const env); |
298 #endif // defined(OS_POSIX) | 307 #endif // defined(OS_POSIX) |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
675 // instance running inside the parent. The parent's Breakpad instance should | 684 // instance running inside the parent. The parent's Breakpad instance should |
676 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler | 685 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler |
677 // in the child after forking will restore the standard exception handler. | 686 // in the child after forking will restore the standard exception handler. |
678 // See http://crbug.com/20371/ for more details. | 687 // See http://crbug.com/20371/ for more details. |
679 void RestoreDefaultExceptionHandler(); | 688 void RestoreDefaultExceptionHandler(); |
680 #endif // defined(OS_MACOSX) | 689 #endif // defined(OS_MACOSX) |
681 | 690 |
682 } // namespace base | 691 } // namespace base |
683 | 692 |
684 #endif // BASE_PROCESS_UTIL_H_ | 693 #endif // BASE_PROCESS_UTIL_H_ |
OLD | NEW |