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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 return true; | 473 return true; |
474 } | 474 } |
475 | 475 |
476 | 476 |
477 bool LaunchProcess(const CommandLine& cmdline, | 477 bool LaunchProcess(const CommandLine& cmdline, |
478 const LaunchOptions& options, | 478 const LaunchOptions& options, |
479 ProcessHandle* process_handle) { | 479 ProcessHandle* process_handle) { |
480 return LaunchProcess(cmdline.argv(), options, process_handle); | 480 return LaunchProcess(cmdline.argv(), options, process_handle); |
481 } | 481 } |
482 | 482 |
| 483 Process LaunchProcess(const CommandLine& cmdline, |
| 484 const LaunchOptions& options) { |
| 485 ProcessHandle process_handle; |
| 486 if (LaunchProcess(cmdline, options, &process_handle)) |
| 487 return Process(process_handle); |
| 488 |
| 489 return Process(); |
| 490 } |
| 491 |
483 void RaiseProcessToHighPriority() { | 492 void RaiseProcessToHighPriority() { |
484 // On POSIX, we don't actually do anything here. We could try to nice() or | 493 // On POSIX, we don't actually do anything here. We could try to nice() or |
485 // setpriority() or sched_getscheduler, but these all require extra rights. | 494 // setpriority() or sched_getscheduler, but these all require extra rights. |
486 } | 495 } |
487 | 496 |
488 // Return value used by GetAppOutputInternal to encapsulate the various exit | 497 // Return value used by GetAppOutputInternal to encapsulate the various exit |
489 // scenarios from the function. | 498 // scenarios from the function. |
490 enum GetAppOutputInternalResult { | 499 enum GetAppOutputInternalResult { |
491 EXECUTE_FAILURE, | 500 EXECUTE_FAILURE, |
492 EXECUTE_SUCCESS, | 501 EXECUTE_SUCCESS, |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 std::string* output, | 664 std::string* output, |
656 int* exit_code) { | 665 int* exit_code) { |
657 // Run |execve()| with the current environment and store "unlimited" data. | 666 // Run |execve()| with the current environment and store "unlimited" data. |
658 GetAppOutputInternalResult result = GetAppOutputInternal( | 667 GetAppOutputInternalResult result = GetAppOutputInternal( |
659 cl.argv(), NULL, output, std::numeric_limits<std::size_t>::max(), true, | 668 cl.argv(), NULL, output, std::numeric_limits<std::size_t>::max(), true, |
660 exit_code); | 669 exit_code); |
661 return result == EXECUTE_SUCCESS; | 670 return result == EXECUTE_SUCCESS; |
662 } | 671 } |
663 | 672 |
664 } // namespace base | 673 } // namespace base |
OLD | NEW |