• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef SRC_NODE_CONTEXT_DATA_H_
2 #define SRC_NODE_CONTEXT_DATA_H_
3 
4 #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
5 
6 namespace node {
7 
8 // Pick an index that's hopefully out of the way when we're embedded inside
9 // another application. Performance-wise or memory-wise it doesn't matter:
10 // Context::SetAlignedPointerInEmbedderData() is backed by a FixedArray,
11 // worst case we pay a one-time penalty for resizing the array.
12 #ifndef NODE_CONTEXT_EMBEDDER_DATA_INDEX
13 #define NODE_CONTEXT_EMBEDDER_DATA_INDEX 32
14 #endif
15 
16 #ifndef NODE_CONTEXT_SANDBOX_OBJECT_INDEX
17 #define NODE_CONTEXT_SANDBOX_OBJECT_INDEX 33
18 #endif
19 
20 #ifndef NODE_CONTEXT_ALLOW_WASM_CODE_GENERATION_INDEX
21 #define NODE_CONTEXT_ALLOW_WASM_CODE_GENERATION_INDEX 34
22 #endif
23 
24 #ifndef NODE_CONTEXT_TAG
25 #define NODE_CONTEXT_TAG 35
26 #endif
27 
28 #ifndef NODE_BINDING_LIST
29 #define NODE_BINDING_LIST_INDEX 36
30 #endif
31 
32 enum ContextEmbedderIndex {
33   kEnvironment = NODE_CONTEXT_EMBEDDER_DATA_INDEX,
34   kSandboxObject = NODE_CONTEXT_SANDBOX_OBJECT_INDEX,
35   kAllowWasmCodeGeneration = NODE_CONTEXT_ALLOW_WASM_CODE_GENERATION_INDEX,
36   kContextTag = NODE_CONTEXT_TAG,
37   kBindingListIndex = NODE_BINDING_LIST_INDEX
38 };
39 
40 }  // namespace node
41 
42 #endif  // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
43 
44 #endif  // SRC_NODE_CONTEXT_DATA_H_
45