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

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

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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') | base/process/launch_win.cc » ('j') | 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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « base/process/launch.h ('k') | base/process/launch_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698