Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Side by Side Diff: base/process/launch_posix.cc

Issue 827493004: Add the new version for the POSIX-specific version of LaunchProcess. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/process/launch.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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...) Expand 10 before | Expand all | Expand 10 after
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...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « base/process/launch.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698