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_ |