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

Unified Diff: content/browser/zygote_host/zygote_host_impl_linux.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 | « content/browser/zygote_host/zygote_communication_linux.cc ('k') | content/common/sandbox_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/zygote_host/zygote_host_impl_linux.cc
diff --git a/content/browser/zygote_host/zygote_host_impl_linux.cc b/content/browser/zygote_host/zygote_host_impl_linux.cc
index 73ad92f8c2b67e8164af5c1832db7e27580878ab..f38dc27551f7952778ab74d4847d39d879cbb154 100644
--- a/content/browser/zygote_host/zygote_host_impl_linux.cc
+++ b/content/browser/zygote_host/zygote_host_impl_linux.cc
@@ -139,25 +139,23 @@ pid_t ZygoteHostImpl::LaunchZygote(base::CommandLine* cmd_line,
CHECK_EQ(0, socketpair(AF_UNIX, SOCK_SEQPACKET, 0, fds));
CHECK(base::UnixDomainSocket::EnableReceiveProcessId(fds[0]));
- base::FileHandleMappingVector fds_to_map;
- fds_to_map.push_back(std::make_pair(fds[1], kZygoteSocketPairFd));
+ base::LaunchOptions options;
+ options.fds_to_remap.push_back(std::make_pair(fds[1], kZygoteSocketPairFd));
// Start up the sandbox host process and get the file descriptor for the
// renderers to talk to it.
const int sfd = RenderSandboxHostLinux::GetInstance()->GetRendererSocket();
- fds_to_map.push_back(std::make_pair(sfd, GetSandboxFD()));
+ options.fds_to_remap.push_back(std::make_pair(sfd, GetSandboxFD()));
- base::LaunchOptions options;
base::ScopedFD dummy_fd;
if (use_suid_sandbox_) {
std::unique_ptr<sandbox::SetuidSandboxHost> sandbox_host(
sandbox::SetuidSandboxHost::Create());
sandbox_host->PrependWrapper(cmd_line);
- sandbox_host->SetupLaunchOptions(&options, &fds_to_map, &dummy_fd);
+ sandbox_host->SetupLaunchOptions(&options, &dummy_fd);
sandbox_host->SetupLaunchEnvironment();
}
- options.fds_to_remap = &fds_to_map;
base::Process process =
use_namespace_sandbox_
? sandbox::NamespaceSandbox::LaunchProcess(*cmd_line, options)
« no previous file with comments | « content/browser/zygote_host/zygote_communication_linux.cc ('k') | content/common/sandbox_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698