Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_COMMON_NACL_HELPER_LINUX_H_ | 5 #ifndef CHROME_COMMON_NACL_HELPER_LINUX_H_ |
| 6 #define CHROME_COMMON_NACL_HELPER_LINUX_H_ | 6 #define CHROME_COMMON_NACL_HELPER_LINUX_H_ |
| 7 | 7 |
| 8 // A mini-zygote specifically for Native Client. This file defines | 8 // A mini-zygote specifically for Native Client. This file defines |
| 9 // constants used to implement communication between the nacl_helper | 9 // constants used to implement communication between the nacl_helper |
| 10 // process and the Chrome zygote. | 10 // process and the Chrome zygote. |
| 11 | 11 |
| 12 // Used by Helper to tell Zygote it has started successfully. | 12 // Used by Helper to tell Zygote it has started successfully. |
| 13 #define kNaClHelperStartupAck "NACLHELPER_OK" | 13 #define kNaClHelperStartupAck "NACLHELPER_OK" |
| 14 // Used by Zygote to ask Helper to fork a new NaCl loader. | 14 // Used by Zygote to ask Helper to fork a new NaCl loader. |
| 15 #define kNaClForkRequest "NACLFORK" | 15 #define kNaClForkRequest "NACLFORK" |
| 16 | 16 |
| 17 // The next set of constants define global Linux file descriptors. | 17 // The next set of constants define global Linux file descriptors. |
| 18 // For communications between NaCl loader and browser. | 18 // For communications between NaCl loader and browser. |
|
jam
2013/01/10 17:37:50
nit: should this be removed now?
Mark Seaborn
2013/01/10 17:43:19
No, this comment still applies. kNaClSandboxDescr
| |
| 19 // See also content/common/zygote_main_linux.cc and | 19 // See also content/common/zygote_main_linux.cc and |
| 20 // http://code.google.com/p/chromium/wiki/LinuxZygote | 20 // http://code.google.com/p/chromium/wiki/LinuxZygote |
| 21 #define kNaClBrowserDescriptor 3 | 21 |
| 22 // For communications between NaCl loader and zygote. | 22 // For communications between NaCl loader and zygote. |
| 23 // We put the kNaClZygoteDescriptor on 3 together with the | |
| 24 // kNaClBrowserDescriptor. They are never used at the same | |
| 25 // time, and this prevents /dev/urandom from using the fd. | |
| 26 #define kNaClZygoteDescriptor 3 | 23 #define kNaClZygoteDescriptor 3 |
| 27 // For communications between the NaCl loader process and | 24 // For communications between the NaCl loader process and |
| 28 // the SUID sandbox. | 25 // the SUID sandbox. |
| 29 #define kNaClSandboxDescriptor 5 | 26 #define kNaClSandboxDescriptor 5 |
| 30 // NOTE: kNaClBrowserDescriptor and kNaClSandboxDescriptor must match | 27 // NOTE: kNaClSandboxDescriptor must match |
| 31 // content/browser/zygote_main_linux.cc kBrowserDescriptor and | 28 // content/browser/zygote_main_linux.cc |
| 32 // kMagicSandboxIPCDescriptor. | 29 // kMagicSandboxIPCDescriptor. |
| 33 | 30 |
| 34 // A fork request from the Zygote to the helper includes an array | 31 // A fork request from the Zygote to the helper includes an array |
| 35 // of three file descriptors. These constants are used as indicies | 32 // of three file descriptors. These constants are used as indicies |
| 36 // into the array. | 33 // into the array. |
| 37 // Used to pass in the descriptor for talking to the Browser | 34 // Used to pass in the descriptor for talking to the Browser |
| 38 #define kNaClBrowserFDIndex 0 | 35 #define kNaClBrowserFDIndex 0 |
| 39 // The next two are used in the protocol for discovering the | 36 // The next two are used in the protocol for discovering the |
| 40 // child processes real PID from within the SUID sandbox. See | 37 // child processes real PID from within the SUID sandbox. See |
| 41 // http://code.google.com/p/chromium/wiki/LinuxZygote | 38 // http://code.google.com/p/chromium/wiki/LinuxZygote |
| 42 #define kNaClDummyFDIndex 1 | 39 #define kNaClDummyFDIndex 1 |
| 43 #define kNaClParentFDIndex 2 | 40 #define kNaClParentFDIndex 2 |
| 44 | 41 |
| 45 #endif // CHROME_COMMON_NACL_HELPER_LINUX_H_ | 42 #endif // CHROME_COMMON_NACL_HELPER_LINUX_H_ |
| OLD | NEW |