OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 contains functions for launching subprocesses. | 5 // This file contains functions for launching subprocesses. |
6 | 6 |
7 #ifndef BASE_PROCESS_LAUNCH_H_ | 7 #ifndef BASE_PROCESS_LAUNCH_H_ |
8 #define BASE_PROCESS_LAUNCH_H_ | 8 #define BASE_PROCESS_LAUNCH_H_ |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // and thus some common operations like OpenProcess will fail. Currently the | 182 // and thus some common operations like OpenProcess will fail. Currently the |
183 // only supported LaunchOptions are |start_hidden| and |wait|. | 183 // only supported LaunchOptions are |start_hidden| and |wait|. |
184 BASE_EXPORT Process LaunchElevatedProcess(const CommandLine& cmdline, | 184 BASE_EXPORT Process LaunchElevatedProcess(const CommandLine& cmdline, |
185 const LaunchOptions& options); | 185 const LaunchOptions& options); |
186 | 186 |
187 #elif defined(OS_POSIX) | 187 #elif defined(OS_POSIX) |
188 // A POSIX-specific version of LaunchProcess that takes an argv array | 188 // A POSIX-specific version of LaunchProcess that takes an argv array |
189 // instead of a CommandLine. Useful for situations where you need to | 189 // instead of a CommandLine. Useful for situations where you need to |
190 // control the command line arguments directly, but prefer the | 190 // control the command line arguments directly, but prefer the |
191 // CommandLine version if launching Chrome itself. | 191 // CommandLine version if launching Chrome itself. |
| 192 BASE_EXPORT Process LaunchProcess(const std::vector<std::string>& argv, |
| 193 const LaunchOptions& options); |
| 194 |
| 195 // Deprecated version. |
| 196 // TODO(rvargas) crbug.com/417532: Remove this after migrating all consumers. |
192 BASE_EXPORT bool LaunchProcess(const std::vector<std::string>& argv, | 197 BASE_EXPORT bool LaunchProcess(const std::vector<std::string>& argv, |
193 const LaunchOptions& options, | 198 const LaunchOptions& options, |
194 ProcessHandle* process_handle); | 199 ProcessHandle* process_handle); |
195 | 200 |
196 // Close all file descriptors, except those which are a destination in the | 201 // Close all file descriptors, except those which are a destination in the |
197 // given multimap. Only call this function in a child process where you know | 202 // given multimap. Only call this function in a child process where you know |
198 // that there aren't any other threads. | 203 // that there aren't any other threads. |
199 BASE_EXPORT void CloseSuperfluousFds(const InjectiveMultimap& saved_map); | 204 BASE_EXPORT void CloseSuperfluousFds(const InjectiveMultimap& saved_map); |
200 #endif // defined(OS_POSIX) | 205 #endif // defined(OS_POSIX) |
201 | 206 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 void ReplaceBootstrapPort(const std::string& replacement_bootstrap_name); | 268 void ReplaceBootstrapPort(const std::string& replacement_bootstrap_name); |
264 #endif // defined(OS_MACOSX) | 269 #endif // defined(OS_MACOSX) |
265 | 270 |
266 // Creates a LaunchOptions object suitable for launching processes in a test | 271 // Creates a LaunchOptions object suitable for launching processes in a test |
267 // binary. This should not be called in production/released code. | 272 // binary. This should not be called in production/released code. |
268 BASE_EXPORT LaunchOptions LaunchOptionsForTest(); | 273 BASE_EXPORT LaunchOptions LaunchOptionsForTest(); |
269 | 274 |
270 } // namespace base | 275 } // namespace base |
271 | 276 |
272 #endif // BASE_PROCESS_LAUNCH_H_ | 277 #endif // BASE_PROCESS_LAUNCH_H_ |
OLD | NEW |