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

Unified Diff: components/nacl/common/nacl_helper_linux.h

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: Created 7 years, 3 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/nacl/nacl_helper_linux.cc ('k') | components/nacl/zygote/nacl_fork_delegate_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/nacl/common/nacl_helper_linux.h
diff --git a/components/nacl/common/nacl_helper_linux.h b/components/nacl/common/nacl_helper_linux.h
index a9324b3fa1d786a2cd705bcad2d33cd36b9747ca..9b3b0659b39d55fd68deabd179f7ee541831df5f 100644
--- a/components/nacl/common/nacl_helper_linux.h
+++ b/components/nacl/common/nacl_helper_linux.h
@@ -25,23 +25,25 @@ enum NaClZygoteIPCCommand {
// http://code.google.com/p/chromium/wiki/LinuxZygote
// For communications between NaCl loader and zygote.
-#define kNaClZygoteDescriptor 3
+#define kNaClZygoteDescriptor 4
// For communications between the NaCl loader process and
// the SUID sandbox.
-#define kNaClSandboxDescriptor 5
+#define kNaClSandboxDescriptor 6
// NOTE: kNaClSandboxDescriptor must match
-// content/browser/zygote_main_linux.cc
-// kMagicSandboxIPCDescriptor.
+// content/public/common/content_descriptors.h
+// kSandboxIPCChannel + base::GlobalDescriptors::kBaseDescriptor
// A fork request from the Zygote to the helper includes an array
-// of three file descriptors. These constants are used as indicies
+// of three or four file descriptors. These constants are used as indicies
// into the array.
// Used to pass in the descriptor for talking to the Browser
#define kNaClBrowserFDIndex 0
// The next two are used in the protocol for discovering the
// child processes real PID from within the SUID sandbox. See
// http://code.google.com/p/chromium/wiki/LinuxZygote
-#define kNaClDummyFDIndex 1
-#define kNaClParentFDIndex 2
+// These indices depend on the size of the array, as kStatsTableSharedMemFd
+// could be inserted between kNaClBrowserFDIndex and kNaClDummyFDIndex.
+#define kNaClDummyFDIndex(fd_array_size) (fd_array_size == 3 ? 1 : 2)
Mark Seaborn 2013/09/12 00:00:28 This should be an inline function rather than a ma
rmcilroy 2013/09/12 17:04:56 Done.
+#define kNaClParentFDIndex(fd_array_size) (fd_array_size == 3 ? 2 : 3)
#endif // COMPONENTS_NACL_COMMON_NACL_HELPER_LINUX_H_
« no previous file with comments | « chrome/nacl/nacl_helper_linux.cc ('k') | components/nacl/zygote/nacl_fork_delegate_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698