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

Unified Diff: chromeos/process_proxy/process_proxy.cc

Issue 2950153002: Improve process launch handle sharing API. (Closed)
Patch Set: Merge Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chromeos/process_proxy/process_proxy.cc
diff --git a/chromeos/process_proxy/process_proxy.cc b/chromeos/process_proxy/process_proxy.cc
index 16cbb760ef19c4c5bc90fd377efa5b1ec78b12b7..331ba5f1076cdbe1510003eb33cb0ff9f95abc4d 100644
--- a/chromeos/process_proxy/process_proxy.cc
+++ b/chromeos/process_proxy/process_proxy.cc
@@ -204,17 +204,16 @@ bool ProcessProxy::CreatePseudoTerminalPair(int *pt_pair) {
}
int ProcessProxy::LaunchProcess(const std::string& command, int slave_fd) {
- // Redirect crosh process' output and input so we can read it.
- base::FileHandleMappingVector fds_mapping;
- fds_mapping.push_back(std::make_pair(slave_fd, STDIN_FILENO));
- fds_mapping.push_back(std::make_pair(slave_fd, STDOUT_FILENO));
- fds_mapping.push_back(std::make_pair(slave_fd, STDERR_FILENO));
base::LaunchOptions options;
+
+ // Redirect crosh process' output and input so we can read it.
+ options.fds_to_remap.push_back(std::make_pair(slave_fd, STDIN_FILENO));
+ options.fds_to_remap.push_back(std::make_pair(slave_fd, STDOUT_FILENO));
+ options.fds_to_remap.push_back(std::make_pair(slave_fd, STDERR_FILENO));
// Do not set NO_NEW_PRIVS on processes if the system is in dev-mode. This
// permits sudo in the crosh shell when in developer mode.
options.allow_new_privs = base::CommandLine::ForCurrentProcess()->
HasSwitch(chromeos::switches::kSystemInDevMode);
- options.fds_to_remap = &fds_mapping;
options.ctrl_terminal_fd = slave_fd;
options.environ["TERM"] = "xterm";
« no previous file with comments | « chromecast/browser/cast_content_browser_client.cc ('k') | components/arc/crash_collector/arc_crash_collector_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698