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