GeezerVison is showing github.com — src: snapshot node · fredericp/node@7a447bc
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: src/async_wrap.cc +22Lines changed: 22 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 23 | 23 | #include "async_wrap-inl.h" | 24 | 24 | #include "env-inl.h" | 25 | 25 | #include "node_errors.h" | | 26 | +#include "node_external_reference.h" | 26 | 27 | #include "tracing/traced_value.h" | 27 | 28 | #include "util-inl.h" | 28 | 29 |
| @@ -695,6 +696,25 @@ void AsyncWrap::Initialize(Local<Object> target, | 695 | 696 | PromiseWrap::Initialize(env); | 696 | 697 | } | 697 | 698 |
| | 699 | +void AsyncWrap::RegisterExternalReferences( | | 700 | + ExternalReferenceRegistry* registry) { | | 701 | + registry->Register(SetupHooks); | | 702 | + registry->Register(SetCallbackTrampoline); | | 703 | + registry->Register(PushAsyncContext); | | 704 | + registry->Register(PopAsyncContext); | | 705 | + registry->Register(ExecutionAsyncResource); | | 706 | + registry->Register(ClearAsyncIdStack); | | 707 | + registry->Register(QueueDestroyAsyncId); | | 708 | + registry->Register(EnablePromiseHook); | | 709 | + registry->Register(DisablePromiseHook); | | 710 | + registry->Register(RegisterDestroyHook); | | 711 | + registry->Register(AsyncWrapObject::New); | | 712 | + registry->Register(AsyncWrap::GetAsyncId); | | 713 | + registry->Register(AsyncWrap::AsyncReset); | | 714 | + registry->Register(AsyncWrap::GetProviderType); | | 715 | + registry->Register(PromiseWrap::GetAsyncId); | | 716 | + registry->Register(PromiseWrap::GetTriggerAsyncId); | | 717 | +} | 698 | 718 |
| 699 | 719 | AsyncWrap::AsyncWrap(Environment* env, | 700 | 720 | Local<Object> object, | @@ -924,3 +944,5 @@ Local<Object> AsyncWrap::GetOwner(Environment* env, Local<Object> obj) { | 924 | 944 | } // namespace node | 925 | 945 |
| 926 | 946 | NODE_MODULE_CONTEXT_AWARE_INTERNAL(async_wrap, node::AsyncWrap::Initialize) | | 947 | +NODE_MODULE_EXTERNAL_REFERENCE(async_wrap, | | 948 | + node::AsyncWrap::RegisterExternalReferences) |
Collapse file Copy file name to clipboardExpand all lines: src/async_wrap.h +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -106,6 +106,7 @@ namespace node { | 106 | 106 |
| 107 | 107 | class Environment; | 108 | 108 | class DestroyParam; | | 109 | +class ExternalReferenceRegistry; | 109 | 110 |
| 110 | 111 | class AsyncWrap : public BaseObject { | 111 | 112 | public: | @@ -135,6 +136,7 @@ class AsyncWrap : public BaseObject { | 135 | 136 | static v8::Local<v8::FunctionTemplate> GetConstructorTemplate( | 136 | 137 | Environment* env); | 137 | 138 |
| | 139 | + static void RegisterExternalReferences(ExternalReferenceRegistry* registry); | 138 | 140 | static void Initialize(v8::Local<v8::Object> target, | 139 | 141 | v8::Local<v8::Value> unused, | 140 | 142 | v8::Local<v8::Context> context, | |
Collapse file Copy file name to clipboardExpand all lines: src/handle_wrap.cc +11Lines changed: 11 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 22 | 22 | #include "handle_wrap.h" | 23 | 23 | #include "async_wrap-inl.h" | 24 | 24 | #include "env-inl.h" | | 25 | +#include "node_external_reference.h" | 25 | 26 | #include "util-inl.h" | 26 | 27 |
| 27 | 28 | namespace node { | @@ -152,5 +153,15 @@ Local<FunctionTemplate> HandleWrap::GetConstructorTemplate(Environment* env) { | 152 | 153 | return tmpl; | 153 | 154 | } | 154 | 155 |
| | 156 | +void HandleWrap::RegisterExternalReferences( | | 157 | + ExternalReferenceRegistry* registry) { | | 158 | + registry->Register(HandleWrap::Close); | | 159 | + registry->Register(HandleWrap::HasRef); | | 160 | + registry->Register(HandleWrap::Ref); | | 161 | + registry->Register(HandleWrap::Unref); | | 162 | +} | 155 | 163 |
| 156 | 164 | } // namespace node | | 165 | + | | 166 | +NODE_MODULE_EXTERNAL_REFERENCE(handle_wrap, | | 167 | + node::HandleWrap::RegisterExternalReferences) |
Collapse file Copy file name to clipboardExpand all lines: src/handle_wrap.h +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 32 | 32 | namespace node { | 33 | 33 |
| 34 | 34 | class Environment; | | 35 | +class ExternalReferenceRegistry; | 35 | 36 |
| 36 | 37 | // Rules: | 37 | 38 | // | @@ -77,6 +78,7 @@ class HandleWrap : public AsyncWrap { | 77 | 78 |
| 78 | 79 | static v8::Local<v8::FunctionTemplate> GetConstructorTemplate( | 79 | 80 | Environment* env); | | 81 | + static void RegisterExternalReferences(ExternalReferenceRegistry* registry); | 80 | 82 |
| 81 | 83 | protected: | 82 | 84 | HandleWrap(Environment* env, | |
Collapse file Copy file name to clipboardExpand all lines: src/inspector_js_api.cc +29-1Lines changed: 29 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 2 | 2 | #include "inspector_agent.h" | 3 | 3 | #include "inspector_io.h" | 4 | 4 | #include "memory_tracker-inl.h" | | 5 | +#include "node_external_reference.h" | 5 | 6 | #include "util-inl.h" | 6 | | -#include "v8.h" | 7 | 7 | #include "v8-inspector.h" | | 8 | +#include "v8.h" | 8 | 9 |
| 9 | 10 | #include <memory> | 10 | 11 |
| @@ -345,8 +346,35 @@ void Initialize(Local<Object> target, Local<Value> unused, | 345 | 346 | } | 346 | 347 |
| 347 | 348 | } // namespace | | 349 | + | | 350 | +void RegisterExternalReferences(ExternalReferenceRegistry* registry) { | | 351 | + registry->Register(InspectorConsoleCall); | | 352 | + registry->Register(SetConsoleExtensionInstaller); | | 353 | + registry->Register(CallAndPauseOnStart); | | 354 | + registry->Register(Open); | | 355 | + registry->Register(Url); | | 356 | + registry->Register(WaitForDebugger); | | 357 | + | | 358 | + registry->Register(AsyncTaskScheduledWrapper); | | 359 | + registry->Register(InvokeAsyncTaskFnWithId<&Agent::AsyncTaskCanceled>); | | 360 | + registry->Register(InvokeAsyncTaskFnWithId<&Agent::AsyncTaskStarted>); | | 361 | + registry->Register(InvokeAsyncTaskFnWithId<&Agent::AsyncTaskFinished>); | | 362 | + | | 363 | + registry->Register(RegisterAsyncHookWrapper); | | 364 | + registry->Register(IsEnabled); | | 365 | + | | 366 | + registry->Register(JSBindingsConnection<LocalConnection>::New); | | 367 | + registry->Register(JSBindingsConnection<LocalConnection>::Dispatch); | | 368 | + registry->Register(JSBindingsConnection<LocalConnection>::Disconnect); | | 369 | + registry->Register(JSBindingsConnection<MainThreadConnection>::New); | | 370 | + registry->Register(JSBindingsConnection<MainThreadConnection>::Dispatch); | | 371 | + registry->Register(JSBindingsConnection<MainThreadConnection>::Disconnect); | | 372 | +} | | 373 | + | 348 | 374 | } // namespace inspector | 349 | 375 | } // namespace node | 350 | 376 |
| 351 | 377 | NODE_MODULE_CONTEXT_AWARE_INTERNAL(inspector, | 352 | 378 | node::inspector::Initialize) | | 379 | +NODE_MODULE_EXTERNAL_REFERENCE(inspector, | | 380 | + node::inspector::RegisterExternalReferences) |
Collapse file Copy file name to clipboardExpand all lines: src/node_buffer.cc +39Lines changed: 39 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 23 | 23 | #include "allocated_buffer-inl.h" | 24 | 24 | #include "node.h" | 25 | 25 | #include "node_errors.h" | | 26 | +#include "node_external_reference.h" | 26 | 27 | #include "node_internals.h" | 27 | 28 |
| 28 | 29 | #include "env-inl.h" | @@ -1197,7 +1198,45 @@ void Initialize(Local<Object> target, | 1197 | 1198 | } | 1198 | 1199 |
| 1199 | 1200 | } // anonymous namespace | | 1201 | + | | 1202 | +void RegisterExternalReferences(ExternalReferenceRegistry* registry) { | | 1203 | + registry->Register(SetBufferPrototype); | | 1204 | + registry->Register(CreateFromString); | | 1205 | + | | 1206 | + registry->Register(ByteLengthUtf8); | | 1207 | + registry->Register(Copy); | | 1208 | + registry->Register(Compare); | | 1209 | + registry->Register(CompareOffset); | | 1210 | + registry->Register(Fill); | | 1211 | + registry->Register(IndexOfBuffer); | | 1212 | + registry->Register(IndexOfNumber); | | 1213 | + registry->Register(IndexOfString); | | 1214 | + | | 1215 | + registry->Register(Swap16); | | 1216 | + registry->Register(Swap32); | | 1217 | + registry->Register(Swap64); | | 1218 | + | | 1219 | + registry->Register(EncodeInto); | | 1220 | + registry->Register(EncodeUtf8String); | | 1221 | + | | 1222 | + registry->Register(StringSlice<ASCII>); | | 1223 | + registry->Register(StringSlice<BASE64>); | | 1224 | + registry->Register(StringSlice<LATIN1>); | | 1225 | + registry->Register(StringSlice<HEX>); | | 1226 | + registry->Register(StringSlice<UCS2>); | | 1227 | + registry->Register(StringSlice<UTF8>); | | 1228 | + | | 1229 | + registry->Register(StringWrite<ASCII>); | | 1230 | + registry->Register(StringWrite<BASE64>); | | 1231 | + registry->Register(StringWrite<LATIN1>); | | 1232 | + registry->Register(StringWrite<HEX>); | | 1233 | + registry->Register(StringWrite<UCS2>); | | 1234 | + registry->Register(StringWrite<UTF8>); | | 1235 | + registry->Register(GetZeroFillToggle); | | 1236 | +} | | 1237 | + | 1200 | 1238 | } // namespace Buffer | 1201 | 1239 | } // namespace node | 1202 | 1240 |
| 1203 | 1241 | NODE_MODULE_CONTEXT_AWARE_INTERNAL(buffer, node::Buffer::Initialize) | | 1242 | +NODE_MODULE_EXTERNAL_REFERENCE(buffer, node::Buffer::RegisterExternalReferences) |
Collapse file Copy file name to clipboardExpand all lines: src/node_credentials.cc +22Lines changed: 22 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | #include "env-inl.h" | | 2 | +#include "node_external_reference.h" | 2 | 3 | #include "node_internals.h" | 3 | 4 | #include "util-inl.h" | 4 | 5 |
| @@ -371,6 +372,25 @@ static void InitGroups(const FunctionCallbackInfo<Value>& args) { | 371 | 372 |
| 372 | 373 | #endif // NODE_IMPLEMENTS_POSIX_CREDENTIALS | 373 | 374 |
| | 375 | +void RegisterExternalReferences(ExternalReferenceRegistry* registry) { | | 376 | + registry->Register(SafeGetenv); | | 377 | + | | 378 | +#ifdef NODE_IMPLEMENTS_POSIX_CREDENTIALS | | 379 | + registry->Register(GetUid); | | 380 | + registry->Register(GetEUid); | | 381 | + registry->Register(GetGid); | | 382 | + registry->Register(GetEGid); | | 383 | + registry->Register(GetGroups); | | 384 | + | | 385 | + registry->Register(InitGroups); | | 386 | + registry->Register(SetEGid); | | 387 | + registry->Register(SetEUid); | | 388 | + registry->Register(SetGid); | | 389 | + registry->Register(SetUid); | | 390 | + registry->Register(SetGroups); | | 391 | +#endif // NODE_IMPLEMENTS_POSIX_CREDENTIALS | | 392 | +} | | 393 | + | 374 | 394 | static void Initialize(Local<Object> target, | 375 | 395 | Local<Value> unused, | 376 | 396 | Local<Context> context, | @@ -403,3 +423,5 @@ static void Initialize(Local<Object> target, | 403 | 423 | } // namespace node | 404 | 424 |
| 405 | 425 | NODE_MODULE_CONTEXT_AWARE_INTERNAL(credentials, node::credentials::Initialize) | | 426 | +NODE_MODULE_EXTERNAL_REFERENCE(credentials, | | 427 | + node::credentials::RegisterExternalReferences) |
Collapse file Copy file name to clipboardExpand all lines: src/node_env_var.cc +11Lines changed: 11 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | #include "debug_utils-inl.h" | 2 | 2 | #include "env-inl.h" | 3 | 3 | #include "node_errors.h" | | 4 | +#include "node_external_reference.h" | 4 | 5 | #include "node_process.h" | 5 | 6 |
| 6 | 7 | #include <time.h> // tzset(), _tzset() | @@ -384,4 +385,14 @@ MaybeLocal<Object> CreateEnvVarProxy(Local<Context> context, Isolate* isolate) { | 384 | 385 | PropertyHandlerFlags::kHasNoSideEffect)); | 385 | 386 | return scope.EscapeMaybe(env_proxy_template->NewInstance(context)); | 386 | 387 | } | | 388 | + | | 389 | +void RegisterEnvVarExternalReferences(ExternalReferenceRegistry* registry) { | | 390 | + registry->Register(EnvGetter); | | 391 | + registry->Register(EnvSetter); | | 392 | + registry->Register(EnvQuery); | | 393 | + registry->Register(EnvDeleter); | | 394 | + registry->Register(EnvEnumerator); | | 395 | +} | 387 | 396 | } // namespace node | | 397 | + | | 398 | +NODE_MODULE_EXTERNAL_REFERENCE(env_var, node::RegisterEnvVarExternalReferences) |
Collapse file Copy file name to clipboardExpand all lines: src/node_errors.cc +11-1Lines changed: 11 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 3 | 3 |
| 4 | 4 | #include "debug_utils-inl.h" | 5 | 5 | #include "node_errors.h" | | 6 | +#include "node_external_reference.h" | 6 | 7 | #include "node_internals.h" | 7 | | -#include "node_report.h" | 8 | 8 | #include "node_process.h" | | 9 | +#include "node_report.h" | 9 | 10 | #include "node_v8_platform-inl.h" | 10 | 11 | #include "util-inl.h" | 11 | 12 |
| @@ -852,6 +853,14 @@ static void TriggerUncaughtException(const FunctionCallbackInfo<Value>& args) { | 852 | 853 | errors::TriggerUncaughtException(isolate, exception, message, from_promise); | 853 | 854 | } | 854 | 855 |
| | 856 | +void RegisterExternalReferences(ExternalReferenceRegistry* registry) { | | 857 | + registry->Register(SetPrepareStackTraceCallback); | | 858 | + registry->Register(EnableSourceMaps); | | 859 | + registry->Register(SetEnhanceStackForFatalException); | | 860 | + registry->Register(NoSideEffectsToString); | | 861 | + registry->Register(TriggerUncaughtException); | | 862 | +} | | 863 | + | 855 | 864 | void Initialize(Local<Object> target, | 856 | 865 | Local<Value> unused, | 857 | 866 | Local<Context> context, | @@ -1023,3 +1032,4 @@ void TriggerUncaughtException(Isolate* isolate, const v8::TryCatch& try_catch) { | 1023 | 1032 | } // namespace node | 1024 | 1033 |
| 1025 | 1034 | NODE_MODULE_CONTEXT_AWARE_INTERNAL(errors, node::errors::Initialize) | | 1035 | +NODE_MODULE_EXTERNAL_REFERENCE(errors, node::errors::RegisterExternalReferences) |
Collapse file Copy file name to clipboardExpand all lines: src/node_external_reference.h +31-2Lines changed: 31 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -47,12 +47,41 @@ class ExternalReferenceRegistry { | 47 | 47 | }; | 48 | 48 |
| 49 | 49 | #define EXTERNAL_REFERENCE_BINDING_LIST_BASE(V) \ | | 50 | + V(async_wrap) \ | 50 | 51 | V(binding) \ | | 52 | + V(buffer) \ | | 53 | + V(credentials) \ | | 54 | + V(env_var) \ | | 55 | + V(errors) \ | | 56 | + V(handle_wrap) \ | | 57 | + V(messaging) \ | 51 | 58 | V(native_module) \ | 52 | | - V(process_object) | | 59 | + V(process_methods) \ | | 60 | + V(process_object) \ | | 61 | + V(task_queue) \ | | 62 | + V(url) \ | | 63 | + V(util) \ | | 64 | + V(string_decoder) \ | | 65 | + V(trace_events) \ | | 66 | + V(timers) \ | | 67 | + V(types) | | 68 | + | | 69 | +#if NODE_HAVE_I18N_SUPPORT | | 70 | +#define EXTERNAL_REFERENCE_BINDING_LIST_I18N(V) V(icu) | | 71 | +#else | | 72 | +#define EXTERNAL_REFERENCE_BINDING_LIST_I18N(V) | | 73 | +#endif // NODE_HAVE_I18N_SUPPORT | | 74 | + | | 75 | +#if HAVE_INSPECTOR | | 76 | +#define EXTERNAL_REFERENCE_BINDING_LIST_INSPECTOR(V) V(inspector) | | 77 | +#else | | 78 | +#define EXTERNAL_REFERENCE_BINDING_LIST_INSPECTOR(V) | | 79 | +#endif // HAVE_INSPECTOR | 53 | 80 |
| 54 | 81 | #define EXTERNAL_REFERENCE_BINDING_LIST(V) \ | 55 | | - EXTERNAL_REFERENCE_BINDING_LIST_BASE(V) | | 82 | + EXTERNAL_REFERENCE_BINDING_LIST_BASE(V) \ | | 83 | + EXTERNAL_REFERENCE_BINDING_LIST_INSPECTOR(V) \ | | 84 | + EXTERNAL_REFERENCE_BINDING_LIST_I18N(V) | 56 | 85 |
| 57 | 86 | } // namespace node | 58 | 87 |
| |
|