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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // cmdline = "c:\windows\explorer.exe" -foo "c:\bar\" | 84 // cmdline = "c:\windows\explorer.exe" -foo "c:\bar\" |
85 // | 85 // |
86 // If process_handle is non-NULL, the process handle of the launched app will be | 86 // If process_handle is non-NULL, the process handle of the launched app will be |
87 // stored there on a successful launch. | 87 // stored there on a successful launch. |
88 // NOTE: In this case, the caller is responsible for closing the handle so | 88 // NOTE: In this case, the caller is responsible for closing the handle so |
89 // that it doesn't leak! | 89 // that it doesn't leak! |
90 bool LaunchApp(const std::wstring& cmdline, | 90 bool LaunchApp(const std::wstring& cmdline, |
91 bool wait, bool start_hidden, ProcessHandle* process_handle); | 91 bool wait, bool start_hidden, ProcessHandle* process_handle); |
92 #elif defined(OS_POSIX) | 92 #elif defined(OS_POSIX) |
93 // Runs the application specified in argv[0] with the command line argv. | 93 // Runs the application specified in argv[0] with the command line argv. |
94 // Both the elements of argv and argv itself must be terminated with a null | |
95 // byte. | |
96 // Before launching all FDs open in the parent process will be marked as | 94 // Before launching all FDs open in the parent process will be marked as |
97 // close-on-exec. |fds_to_remap| defines a mapping of src fd->dest fd to | 95 // close-on-exec. |fds_to_remap| defines a mapping of src fd->dest fd to |
98 // propagate FDs into the child process. | 96 // propagate FDs into the child process. |
99 // | 97 // |
100 // As above, if wait is true, execute synchronously. The pid will be stored | 98 // As above, if wait is true, execute synchronously. The pid will be stored |
101 // in process_handle if that pointer is non-null. | 99 // in process_handle if that pointer is non-null. |
102 // | 100 // |
103 // Note that the first argument in argv must point to the filename, | 101 // Note that the first argument in argv must point to the filename, |
104 // and must be fully specified. | 102 // and must be fully specified. |
105 typedef std::vector<std::pair<int, int> > file_handle_mapping_vector; | 103 typedef std::vector<std::pair<int, int> > file_handle_mapping_vector; |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 // 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. |
336 void EnableTerminationOnHeapCorruption(); | 334 void EnableTerminationOnHeapCorruption(); |
337 | 335 |
338 // 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 |
339 // the current process's scheduling priority to a high priority. | 337 // the current process's scheduling priority to a high priority. |
340 void RaiseProcessToHighPriority(); | 338 void RaiseProcessToHighPriority(); |
341 | 339 |
342 } // namespace base | 340 } // namespace base |
343 | 341 |
344 #endif // BASE_PROCESS_UTIL_H_ | 342 #endif // BASE_PROCESS_UTIL_H_ |
OLD | NEW |