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

Unified Diff: components/nacl/zygote/nacl_fork_delegate_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 | « components/crash/content/browser/crash_dump_observer_android.cc ('k') | content/browser/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/zygote/nacl_fork_delegate_linux.cc
diff --git a/components/nacl/zygote/nacl_fork_delegate_linux.cc b/components/nacl/zygote/nacl_fork_delegate_linux.cc
index 2eb3f83b65b3a18d26a73c57a701fa5ba271010d..b42e4d4037313cf57f35c9e1bfb97515d135ec7a 100644
--- a/components/nacl/zygote/nacl_fork_delegate_linux.cc
+++ b/components/nacl/zygote/nacl_fork_delegate_linux.cc
@@ -174,9 +174,6 @@ void NaClForkDelegate::Init(const int sandboxdesc,
int fds[2];
PCHECK(0 == socketpair(PF_UNIX, SOCK_SEQPACKET, 0, fds));
- base::FileHandleMappingVector fds_to_map;
- fds_to_map.push_back(std::make_pair(fds[1], kNaClZygoteDescriptor));
- fds_to_map.push_back(std::make_pair(sandboxdesc, nacl_sandbox_descriptor));
bool use_nacl_bootstrap = false;
// For non-SFI mode, we do not use fixed address space.
@@ -254,6 +251,10 @@ void NaClForkDelegate::Init(const int sandboxdesc,
}
base::LaunchOptions options;
+ options.fds_to_remap.push_back(
+ std::make_pair(fds[1], kNaClZygoteDescriptor));
+ options.fds_to_remap.push_back(
+ std::make_pair(sandboxdesc, nacl_sandbox_descriptor));
base::ScopedFD dummy_fd;
if (using_setuid_sandbox) {
@@ -261,12 +262,10 @@ void NaClForkDelegate::Init(const int sandboxdesc,
// setuid sandbox wrapper manually.
base::FilePath sandbox_path = setuid_sandbox_host->GetSandboxBinaryPath();
argv_to_launch.insert(argv_to_launch.begin(), sandbox_path.value());
- setuid_sandbox_host->SetupLaunchOptions(&options, &fds_to_map, &dummy_fd);
+ setuid_sandbox_host->SetupLaunchOptions(&options, &dummy_fd);
setuid_sandbox_host->SetupLaunchEnvironment();
}
- options.fds_to_remap = &fds_to_map;
-
// The NaCl processes spawned may need to exceed the ambient soft limit
// on RLIMIT_AS to allocate the untrusted address space and its guard
// regions. The nacl_helper itself cannot just raise its own limit,
« no previous file with comments | « components/crash/content/browser/crash_dump_observer_android.cc ('k') | content/browser/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698