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

Unified Diff: components/nacl/zygote/nacl_fork_delegate_linux.cc

Issue 22911027: Pass StatsTable shared memory via global descriptors on Posix rather than using named shared memory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add empty line Created 7 years, 2 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/nacl/common/nacl_helper_linux.h ('k') | content/browser/child_process_launcher.cc » ('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 2a7e0072355e7e403cce2f6efb4385d263255454..7bd2e9fdb4648d2537c0b302d7a0e85cf68e0ca9 100644
--- a/components/nacl/zygote/nacl_fork_delegate_linux.cc
+++ b/components/nacl/zygote/nacl_fork_delegate_linux.cc
@@ -19,6 +19,7 @@
#include "base/path_service.h"
#include "base/pickle.h"
#include "base/posix/eintr_wrapper.h"
+#include "base/posix/global_descriptors.h"
#include "base/posix/unix_domain_socket_linux.h"
#include "base/process/kill.h"
#include "base/process/launch.h"
@@ -26,6 +27,7 @@
#include "components/nacl/common/nacl_helper_linux.h"
#include "components/nacl/common/nacl_paths.h"
#include "components/nacl/common/nacl_switches.h"
+#include "content/public/common/content_descriptors.h"
#include "content/public/common/content_switches.h"
namespace {
@@ -110,14 +112,17 @@ void NaClForkDelegate::Init(const int sandboxdesc) {
VLOG(1) << "NaClForkDelegate::Init()";
int fds[2];
+ // For communications between the NaCl loader process and
+ // the SUID sandbox.
+ int nacl_sandbox_descriptor =
+ base::GlobalDescriptors::kBaseDescriptor + kSandboxIPCChannel;
// Confirm a hard-wired assumption.
- // The NaCl constant is from chrome/nacl/nacl_linux_helper.h
- DCHECK(kNaClSandboxDescriptor == sandboxdesc);
+ DCHECK_EQ(sandboxdesc, nacl_sandbox_descriptor);
CHECK(socketpair(PF_UNIX, SOCK_SEQPACKET, 0, fds) == 0);
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, kNaClSandboxDescriptor));
+ fds_to_map.push_back(std::make_pair(sandboxdesc, nacl_sandbox_descriptor));
// Using nacl_helper_bootstrap is not necessary on x86-64 because
// NaCl's x86-64 sandbox is not zero-address-based. Starting
« no previous file with comments | « components/nacl/common/nacl_helper_linux.h ('k') | content/browser/child_process_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698