OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "base/process/launch.h" | 5 #include "base/process/launch.h" |
6 | 6 |
7 #include <dirent.h> | 7 #include <dirent.h> |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <signal.h> | 10 #include <signal.h> |
(...skipping 455 matching lines...) Loading... |
466 DPCHECK(ret > 0); | 466 DPCHECK(ret > 0); |
467 } | 467 } |
468 | 468 |
469 if (process_handle) | 469 if (process_handle) |
470 *process_handle = pid; | 470 *process_handle = pid; |
471 } | 471 } |
472 | 472 |
473 return true; | 473 return true; |
474 } | 474 } |
475 | 475 |
| 476 Process LaunchProcess(const std::vector<std::string>& argv, |
| 477 const LaunchOptions& options) { |
| 478 ProcessHandle process_handle; |
| 479 if (LaunchProcess(argv, options, &process_handle)) |
| 480 return Process(process_handle); |
| 481 |
| 482 return Process(); |
| 483 } |
| 484 |
476 | 485 |
477 bool LaunchProcess(const CommandLine& cmdline, | 486 bool LaunchProcess(const CommandLine& cmdline, |
478 const LaunchOptions& options, | 487 const LaunchOptions& options, |
479 ProcessHandle* process_handle) { | 488 ProcessHandle* process_handle) { |
480 return LaunchProcess(cmdline.argv(), options, process_handle); | 489 return LaunchProcess(cmdline.argv(), options, process_handle); |
481 } | 490 } |
482 | 491 |
483 Process LaunchProcess(const CommandLine& cmdline, | 492 Process LaunchProcess(const CommandLine& cmdline, |
484 const LaunchOptions& options) { | 493 const LaunchOptions& options) { |
485 ProcessHandle process_handle; | 494 ProcessHandle process_handle; |
(...skipping 178 matching lines...) Loading... |
664 std::string* output, | 673 std::string* output, |
665 int* exit_code) { | 674 int* exit_code) { |
666 // Run |execve()| with the current environment and store "unlimited" data. | 675 // Run |execve()| with the current environment and store "unlimited" data. |
667 GetAppOutputInternalResult result = GetAppOutputInternal( | 676 GetAppOutputInternalResult result = GetAppOutputInternal( |
668 cl.argv(), NULL, output, std::numeric_limits<std::size_t>::max(), true, | 677 cl.argv(), NULL, output, std::numeric_limits<std::size_t>::max(), true, |
669 exit_code); | 678 exit_code); |
670 return result == EXECUTE_SUCCESS; | 679 return result == EXECUTE_SUCCESS; |
671 } | 680 } |
672 | 681 |
673 } // namespace base | 682 } // namespace base |
OLD | NEW |