The C and C++ Include Header Files
/usr/include/nodejs/src/module_wrap.h
$ cat -n /usr/include/nodejs/src/module_wrap.h 1 #ifndef SRC_MODULE_WRAP_H_ 2 #define SRC_MODULE_WRAP_H_ 3 4 #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 5 6 #include
7 #include
8 #include
9 #include "base_object.h" 10 11 namespace node { 12 13 class Environment; 14 class ExternalReferenceRegistry; 15 16 namespace contextify { 17 class ContextifyContext; 18 } 19 20 namespace loader { 21 22 enum ScriptType : int { 23 kScript, 24 kModule, 25 kFunction, 26 }; 27 28 enum HostDefinedOptions : int { 29 kType = 8, 30 kID = 9, 31 kLength = 10, 32 }; 33 34 class ModuleWrap : public BaseObject { 35 public: 36 enum InternalFields { 37 kModuleWrapBaseField = BaseObject::kInternalFieldCount, 38 kURLSlot, 39 kSyntheticEvaluationStepsSlot, 40 kContextObjectSlot, // Object whose creation context is the target Context 41 kInternalFieldCount 42 }; 43 44 static void Initialize(v8::Local
target, 45 v8::Local
unused, 46 v8::Local
context, 47 void* priv); 48 static void RegisterExternalReferences(ExternalReferenceRegistry* registry); 49 static void HostInitializeImportMetaObjectCallback( 50 v8::Local
context, 51 v8::Local
module, 52 v8::Local
meta); 53 54 void MemoryInfo(MemoryTracker* tracker) const override { 55 tracker->TrackField("resolve_cache", resolve_cache_); 56 } 57 58 inline uint32_t id() { return id_; } 59 v8::Local
context() const; 60 static ModuleWrap* GetFromID(node::Environment*, uint32_t id); 61 62 SET_MEMORY_INFO_NAME(ModuleWrap) 63 SET_SELF_SIZE(ModuleWrap) 64 65 bool IsNotIndicativeOfMemoryLeakAtExit() const override { 66 // XXX: The garbage collection rules for ModuleWrap are *super* unclear. 67 // Do these objects ever get GC'd? Are we just okay with leaking them? 68 return true; 69 } 70 71 private: 72 ModuleWrap(Environment* env, 73 v8::Local
object, 74 v8::Local
module, 75 v8::Local
url); 76 ~ModuleWrap() override; 77 78 static void New(const v8::FunctionCallbackInfo
& args); 79 static void Link(const v8::FunctionCallbackInfo
& args); 80 static void Instantiate(const v8::FunctionCallbackInfo
& args); 81 static void Evaluate(const v8::FunctionCallbackInfo
& args); 82 static void GetNamespace(const v8::FunctionCallbackInfo
& args); 83 static void GetStatus(const v8::FunctionCallbackInfo
& args); 84 static void GetError(const v8::FunctionCallbackInfo
& args); 85 static void GetStaticDependencySpecifiers( 86 const v8::FunctionCallbackInfo
& args); 87 88 static void SetImportModuleDynamicallyCallback( 89 const v8::FunctionCallbackInfo
& args); 90 static void SetInitializeImportMetaObjectCallback( 91 const v8::FunctionCallbackInfo
& args); 92 static v8::MaybeLocal
SyntheticModuleEvaluationStepsCallback( 93 v8::Local
context, v8::Local
module); 94 static void SetSyntheticExport( 95 const v8::FunctionCallbackInfo
& args); 96 static void CreateCachedData(const v8::FunctionCallbackInfo
& args); 97 98 static v8::MaybeLocal
ResolveModuleCallback( 99 v8::Local
context, 100 v8::Local
specifier, 101 v8::Local
import_attributes, 102 v8::Local
referrer); 103 static ModuleWrap* GetFromModule(node::Environment*, v8::Local
); 104 105 v8::Global
module_; 106 std::unordered_map
> resolve_cache_; 107 contextify::ContextifyContext* contextify_context_ = nullptr; 108 bool synthetic_ = false; 109 bool linked_ = false; 110 uint32_t id_; 111 }; 112 113 } // namespace loader 114 } // namespace node 115 116 #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 117 118 #endif // SRC_MODULE_WRAP_H_
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2024 MyWebUniversity.com ™