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

Unified Diff: chrome/browser/extensions/api/messaging/native_process_launcher_posix.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
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/mac/relauncher.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc
diff --git a/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc b/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc
index c2176436493d18e0ac5b929711fb43b76b3fa720..0a5d0166333980dd335ba3ecab98ae332ede7a75 100644
--- a/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc
+++ b/chrome/browser/extensions/api/messaging/native_process_launcher_posix.cc
@@ -55,7 +55,7 @@ bool NativeProcessLauncher::LaunchNativeProcess(
base::Process* process,
base::File* read_file,
base::File* write_file) {
- base::FileHandleMappingVector fd_map;
+ base::LaunchOptions options;
int read_pipe_fds[2] = {0};
if (HANDLE_EINTR(pipe(read_pipe_fds)) != 0) {
@@ -64,7 +64,8 @@ bool NativeProcessLauncher::LaunchNativeProcess(
}
base::ScopedFD read_pipe_read_fd(read_pipe_fds[0]);
base::ScopedFD read_pipe_write_fd(read_pipe_fds[1]);
- fd_map.push_back(std::make_pair(read_pipe_write_fd.get(), STDOUT_FILENO));
+ options.fds_to_remap.push_back(
+ std::make_pair(read_pipe_write_fd.get(), STDOUT_FILENO));
int write_pipe_fds[2] = {0};
if (HANDLE_EINTR(pipe(write_pipe_fds)) != 0) {
@@ -73,11 +74,10 @@ bool NativeProcessLauncher::LaunchNativeProcess(
}
base::ScopedFD write_pipe_read_fd(write_pipe_fds[0]);
base::ScopedFD write_pipe_write_fd(write_pipe_fds[1]);
- fd_map.push_back(std::make_pair(write_pipe_read_fd.get(), STDIN_FILENO));
+ options.fds_to_remap.push_back(
+ std::make_pair(write_pipe_read_fd.get(), STDIN_FILENO));
- base::LaunchOptions options;
options.current_directory = command_line.GetProgram().DirName();
- options.fds_to_remap = &fd_map;
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
// Don't use no_new_privs mode, e.g. in case the host needs to use sudo.
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/mac/relauncher.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698