| 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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 #elif defined(OS_POSIX) | 342 #elif defined(OS_POSIX) |
| 343 // A POSIX-specific version of LaunchProcess that takes an argv array | 343 // A POSIX-specific version of LaunchProcess that takes an argv array |
| 344 // instead of a CommandLine. Useful for situations where you need to | 344 // instead of a CommandLine. Useful for situations where you need to |
| 345 // control the command line arguments directly, but prefer the | 345 // control the command line arguments directly, but prefer the |
| 346 // CommandLine version if launching Chrome itself. | 346 // CommandLine version if launching Chrome itself. |
| 347 BASE_API bool LaunchProcess(const std::vector<std::string>& argv, | 347 BASE_API bool LaunchProcess(const std::vector<std::string>& argv, |
| 348 const LaunchOptions& options); | 348 const LaunchOptions& options); |
| 349 | 349 |
| 350 // TODO(evan): deprecated; change callers to use LaunchProcess, remove. | 350 // TODO(evan): deprecated; change callers to use LaunchProcess, remove. |
| 351 inline bool LaunchApp(const std::vector<std::string>& argv, | 351 inline bool LaunchApp(const std::vector<std::string>& argv, |
| 352 const file_handle_mapping_vector& fds_to_remap, | |
| 353 bool wait, ProcessHandle* process_handle) { | |
| 354 LaunchOptions options; | |
| 355 options.fds_to_remap = &fds_to_remap; | |
| 356 options.wait = wait; | |
| 357 options.process_handle = process_handle; | |
| 358 return LaunchProcess(argv, options); | |
| 359 } | |
| 360 | |
| 361 // TODO(evan): deprecated; change callers to use LaunchProcess, remove. | |
| 362 inline bool LaunchApp(const std::vector<std::string>& argv, | |
| 363 const environment_vector& environ, | 352 const environment_vector& environ, |
| 364 const file_handle_mapping_vector& fds_to_remap, | 353 const file_handle_mapping_vector& fds_to_remap, |
| 365 bool wait, ProcessHandle* process_handle) { | 354 bool wait, ProcessHandle* process_handle) { |
| 366 LaunchOptions options; | 355 LaunchOptions options; |
| 367 options.environ = &environ; | 356 options.environ = &environ; |
| 368 options.fds_to_remap = &fds_to_remap; | 357 options.fds_to_remap = &fds_to_remap; |
| 369 options.wait = wait; | 358 options.wait = wait; |
| 370 options.process_handle = process_handle; | 359 options.process_handle = process_handle; |
| 371 return LaunchProcess(argv, options); | 360 return LaunchProcess(argv, options); |
| 372 } | 361 } |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 // instance running inside the parent. The parent's Breakpad instance should | 763 // instance running inside the parent. The parent's Breakpad instance should |
| 775 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler | 764 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler |
| 776 // in the child after forking will restore the standard exception handler. | 765 // in the child after forking will restore the standard exception handler. |
| 777 // See http://crbug.com/20371/ for more details. | 766 // See http://crbug.com/20371/ for more details. |
| 778 void RestoreDefaultExceptionHandler(); | 767 void RestoreDefaultExceptionHandler(); |
| 779 #endif // defined(OS_MACOSX) | 768 #endif // defined(OS_MACOSX) |
| 780 | 769 |
| 781 } // namespace base | 770 } // namespace base |
| 782 | 771 |
| 783 #endif // BASE_PROCESS_UTIL_H_ | 772 #endif // BASE_PROCESS_UTIL_H_ |
| OLD | NEW |