@encharm/cws 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bindings/cws_linux_108.node +0 -0
- package/dist/bindings/cws_linux_64.node +0 -0
- package/dist/bindings/cws_linux_72.node +0 -0
- package/dist/bindings/cws_linux_79.node +0 -0
- package/dist/bindings/cws_linux_83.node +0 -0
- package/dist/bindings/cws_linux_93.node +0 -0
- package/dist/bindings/cws_win32_64.node +0 -0
- package/dist/bindings/cws_win32_72.node +0 -0
- package/dist/bindings/cws_win32_79.node +0 -0
- package/dist/bindings/cws_win32_83.node +0 -0
- package/dist/bindings/cws_win32_93.node +0 -0
- package/package.json +1 -1
- package/src/Addon.h +24 -2
- package/src/HTTPSocket.cpp +1 -1
- package/src/headers/{13 → 18}/aliased_buffer.h +61 -9
- package/src/headers/18/aliased_struct-inl.h +54 -0
- package/src/headers/18/aliased_struct.h +63 -0
- package/src/headers/{12 → 18}/async_wrap-inl.h +0 -0
- package/src/headers/{12 → 18}/async_wrap.h +26 -2
- package/src/headers/{12/base64.h → 18/base64-inl.h} +78 -86
- package/src/headers/18/base64.h +69 -0
- package/src/headers/{12 → 18}/base_object-inl.h +46 -25
- package/src/headers/{12 → 18}/base_object.h +82 -17
- package/src/headers/{12 → 18}/callback_queue-inl.h +9 -9
- package/src/headers/{12 → 18}/callback_queue.h +13 -5
- package/src/headers/18/cares_wrap.h +523 -0
- package/src/headers/{12 → 18}/connect_wrap.h +0 -0
- package/src/headers/{12 → 18}/connection_wrap.h +0 -0
- package/src/headers/18/crypto/crypto_aes.h +89 -0
- package/src/headers/{13/node_crypto_bio.h → 18/crypto/crypto_bio.h} +3 -4
- package/src/headers/18/crypto/crypto_cipher.h +291 -0
- package/src/headers/{13/node_crypto_clienthello-inl.h → 18/crypto/crypto_clienthello-inl.h} +4 -5
- package/src/headers/{13/node_crypto_clienthello.h → 18/crypto/crypto_clienthello.h} +3 -4
- package/src/headers/{12/node_crypto_common.h → 18/crypto/crypto_common.h} +49 -36
- package/src/headers/18/crypto/crypto_context.h +147 -0
- package/src/headers/18/crypto/crypto_dh.h +156 -0
- package/src/headers/18/crypto/crypto_dsa.h +77 -0
- package/src/headers/18/crypto/crypto_ec.h +170 -0
- package/src/headers/{12/node_crypto_groups.h → 18/crypto/crypto_groups.h} +3 -3
- package/src/headers/18/crypto/crypto_hash.h +89 -0
- package/src/headers/18/crypto/crypto_hkdf.h +65 -0
- package/src/headers/18/crypto/crypto_hmac.h +94 -0
- package/src/headers/18/crypto/crypto_keygen.h +305 -0
- package/src/headers/18/crypto/crypto_keys.h +420 -0
- package/src/headers/18/crypto/crypto_pbkdf2.h +76 -0
- package/src/headers/18/crypto/crypto_random.h +130 -0
- package/src/headers/18/crypto/crypto_rsa.h +141 -0
- package/src/headers/18/crypto/crypto_scrypt.h +87 -0
- package/src/headers/18/crypto/crypto_sig.h +168 -0
- package/src/headers/18/crypto/crypto_spkac.h +21 -0
- package/src/headers/18/crypto/crypto_timing.h +20 -0
- package/src/headers/{13/tls_wrap.h → 18/crypto/crypto_tls.h} +137 -66
- package/src/headers/18/crypto/crypto_util.h +791 -0
- package/src/headers/18/crypto/crypto_x509.h +143 -0
- package/src/headers/{12 → 18}/debug_utils-inl.h +0 -0
- package/src/headers/{13 → 18}/debug_utils.h +7 -4
- package/src/headers/{12 → 18}/diagnosticfilename-inl.h +0 -0
- package/src/headers/{12 → 18}/env-inl.h +397 -304
- package/src/headers/{12 → 18}/env.h +397 -172
- package/src/headers/{12 → 18}/handle_wrap.h +7 -3
- package/src/headers/18/histogram-inl.h +107 -0
- package/src/headers/18/histogram.h +239 -0
- package/src/headers/{13 → 18}/inspector_agent.h +4 -7
- package/src/headers/{12 → 18}/inspector_io.h +0 -0
- package/src/headers/{13 → 18}/inspector_profiler.h +17 -5
- package/src/headers/{12 → 18}/inspector_socket.h +0 -0
- package/src/headers/{12 → 18}/inspector_socket_server.h +0 -0
- package/src/headers/18/js_native_api.h +571 -0
- package/src/headers/{13 → 18}/js_native_api_types.h +30 -7
- package/src/headers/{12 → 18}/js_native_api_v8.h +220 -83
- package/src/headers/{12 → 18}/js_native_api_v8_internals.h +6 -5
- package/src/headers/{12 → 18}/js_stream.h +0 -0
- package/src/headers/{12 → 18}/json_utils.h +0 -0
- package/src/headers/{13 → 18}/memory_tracker-inl.h +6 -5
- package/src/headers/{13 → 18}/memory_tracker.h +0 -7
- package/src/headers/{13 → 18}/module_wrap.h +24 -7
- package/src/headers/{13 → 18}/node.h +329 -68
- package/src/headers/18/node_api.h +288 -0
- package/src/headers/18/node_api_internals.h +38 -0
- package/src/headers/{12 → 18}/node_api_types.h +12 -9
- package/src/headers/{12 → 18}/node_binding.h +0 -0
- package/src/headers/18/node_blob.h +191 -0
- package/src/headers/18/node_bob-inl.h +37 -0
- package/src/headers/18/node_bob.h +111 -0
- package/src/headers/{13 → 18}/node_buffer.h +0 -0
- package/src/headers/{13 → 18}/node_constants.h +5 -1
- package/src/headers/{12 → 18}/node_context_data.h +5 -0
- package/src/headers/{12 → 18}/node_contextify.h +37 -2
- package/src/headers/{10/node_win32_perfctr_provider.h → 18/node_crypto.h} +30 -31
- package/src/headers/{12 → 18}/node_dir.h +0 -0
- package/src/headers/{12 → 18}/node_dtrace.h +0 -0
- package/src/headers/{12 → 18}/node_errors.h +90 -24
- package/src/headers/18/node_external_reference.h +145 -0
- package/src/headers/{13 → 18}/node_file-inl.h +38 -21
- package/src/headers/{12 → 18}/node_file.h +74 -13
- package/src/headers/{13 → 18}/node_http2.h +365 -269
- package/src/headers/{12 → 18}/node_http2_state.h +40 -50
- package/src/headers/{13 → 18}/node_http_common-inl.h +25 -5
- package/src/headers/{13 → 18}/node_http_common.h +24 -20
- package/src/headers/{13 → 18}/node_i18n.h +2 -1
- package/src/headers/{12 → 18}/node_internals.h +39 -41
- package/src/headers/{13 → 18}/node_main_instance.h +15 -18
- package/src/headers/{12 → 18}/node_mem-inl.h +0 -0
- package/src/headers/{12 → 18}/node_mem.h +1 -1
- package/src/headers/{13 → 18}/node_messaging.h +170 -23
- package/src/headers/{12 → 18}/node_metadata.h +17 -4
- package/src/headers/{12 → 18}/node_mutex.h +77 -1
- package/src/headers/{12 → 18}/node_native_module.h +11 -1
- package/src/headers/{13 → 18}/node_native_module_env.h +14 -8
- package/src/headers/{12 → 18}/node_object_wrap.h +0 -0
- package/src/headers/{13 → 18}/node_options-inl.h +51 -21
- package/src/headers/{13 → 18}/node_options.h +46 -14
- package/src/headers/18/node_perf.h +168 -0
- package/src/headers/{12 → 18}/node_perf_common.h +16 -22
- package/src/headers/{12 → 18}/node_platform.h +21 -16
- package/src/headers/18/node_process-inl.h +26 -0
- package/src/headers/18/node_process.h +97 -0
- package/src/headers/{13 → 18}/node_report.h +2 -2
- package/src/headers/{13 → 18}/node_revert.h +10 -0
- package/src/headers/{12 → 18}/node_root_certs.h +439 -651
- package/src/headers/18/node_snapshot_builder.h +43 -0
- package/src/headers/18/node_snapshotable.h +130 -0
- package/src/headers/{12 → 18}/node_sockaddr-inl.h +100 -4
- package/src/headers/18/node_sockaddr.h +405 -0
- package/src/headers/{12 → 18}/node_stat_watcher.h +7 -1
- package/src/headers/{12 → 18}/node_union_bytes.h +0 -0
- package/src/headers/{13 → 18}/node_url.h +18 -1
- package/src/headers/18/node_v8.h +41 -0
- package/src/headers/{12 → 18}/node_v8_platform-inl.h +10 -0
- package/src/headers/{13 → 18}/node_version.h +7 -7
- package/src/headers/{12 → 18}/node_wasi.h +0 -0
- package/src/headers/18/node_wasm_web_api.h +55 -0
- package/src/headers/{13 → 18}/node_watchdog.h +0 -0
- package/src/headers/{10 → 18}/node_win32_etw_provider-inl.h +7 -6
- package/src/headers/{10 → 18}/node_win32_etw_provider.h +0 -0
- package/src/headers/{13 → 18}/node_worker.h +24 -17
- package/src/headers/{12 → 18}/pipe_wrap.h +2 -0
- package/src/headers/{12 → 18}/req_wrap-inl.h +0 -0
- package/src/headers/{12 → 18}/req_wrap.h +1 -1
- package/src/headers/{12 → 18}/spawn_sync.h +0 -0
- package/src/headers/{13 → 18}/stream_base-inl.h +58 -22
- package/src/headers/{13 → 18}/stream_base.h +29 -3
- package/src/headers/{13 → 18}/stream_pipe.h +8 -3
- package/src/headers/{12 → 18}/stream_wrap.h +4 -1
- package/src/headers/{13 → 18}/string_bytes.h +0 -7
- package/src/headers/{12 → 18}/string_decoder-inl.h +0 -0
- package/src/headers/{10 → 18}/string_decoder.h +0 -0
- package/src/headers/{13 → 18}/string_search.h +2 -2
- package/src/headers/{12 → 18}/tcp_wrap.h +4 -0
- package/src/headers/{12 → 18}/threadpoolwork-inl.h +0 -0
- package/src/headers/18/timer_wrap-inl.h +32 -0
- package/src/headers/18/timer_wrap.h +85 -0
- package/src/headers/{13 → 18}/tracing/agent.h +1 -1
- package/src/headers/{12 → 18}/tracing/node_trace_buffer.h +0 -0
- package/src/headers/{12 → 18}/tracing/node_trace_writer.h +0 -0
- package/src/headers/{13 → 18}/tracing/trace_event.h +23 -13
- package/src/headers/{12 → 18}/tracing/trace_event_common.h +0 -0
- package/src/headers/{12 → 18}/tracing/traced_value.h +0 -0
- package/src/headers/{13 → 18}/tty_wrap.h +2 -1
- package/src/headers/{13 → 18}/udp_wrap.h +5 -0
- package/src/headers/{13 → 18}/util-inl.h +69 -15
- package/src/headers/{13 → 18}/util.h +93 -31
- package/src/headers/18/v8-fast-api-calls.h +939 -0
- package/src/headers/{12 → 18}/v8abbr.h +2 -2
- package/src/headers/10/aliased_buffer.h +0 -241
- package/src/headers/10/async_wrap-inl.h +0 -106
- package/src/headers/10/async_wrap.h +0 -218
- package/src/headers/10/base64.h +0 -197
- package/src/headers/10/base_object-inl.h +0 -132
- package/src/headers/10/base_object.h +0 -115
- package/src/headers/10/connect_wrap.h +0 -28
- package/src/headers/10/connection_wrap.h +0 -30
- package/src/headers/10/debug_utils.h +0 -128
- package/src/headers/10/env-inl.h +0 -906
- package/src/headers/10/env.h +0 -1046
- package/src/headers/10/handle_wrap.h +0 -114
- package/src/headers/10/inspector_agent.h +0 -137
- package/src/headers/10/inspector_io.h +0 -97
- package/src/headers/10/inspector_socket.h +0 -59
- package/src/headers/10/inspector_socket_server.h +0 -104
- package/src/headers/10/js_stream.h +0 -57
- package/src/headers/10/memory_tracker-inl.h +0 -318
- package/src/headers/10/memory_tracker.h +0 -246
- package/src/headers/10/module_wrap.h +0 -100
- package/src/headers/10/node.h +0 -863
- package/src/headers/10/node_api.h +0 -752
- package/src/headers/10/node_api_types.h +0 -171
- package/src/headers/10/node_buffer.h +0 -90
- package/src/headers/10/node_code_cache.h +0 -17
- package/src/headers/10/node_constants.h +0 -74
- package/src/headers/10/node_context_data.h +0 -39
- package/src/headers/10/node_contextify.h +0 -141
- package/src/headers/10/node_counters.h +0 -59
- package/src/headers/10/node_crypto.h +0 -699
- package/src/headers/10/node_crypto_bio.h +0 -177
- package/src/headers/10/node_crypto_clienthello-inl.h +0 -92
- package/src/headers/10/node_crypto_clienthello.h +0 -131
- package/src/headers/10/node_crypto_groups.h +0 -416
- package/src/headers/10/node_dtrace.h +0 -84
- package/src/headers/10/node_errors.h +0 -118
- package/src/headers/10/node_file.h +0 -373
- package/src/headers/10/node_http2.h +0 -1304
- package/src/headers/10/node_http2_state.h +0 -158
- package/src/headers/10/node_i18n.h +0 -69
- package/src/headers/10/node_internals.h +0 -952
- package/src/headers/10/node_javascript.h +0 -41
- package/src/headers/10/node_messaging.h +0 -219
- package/src/headers/10/node_mutex.h +0 -191
- package/src/headers/10/node_object_wrap.h +0 -130
- package/src/headers/10/node_options-inl.h +0 -444
- package/src/headers/10/node_options.h +0 -397
- package/src/headers/10/node_perf.h +0 -134
- package/src/headers/10/node_perf_common.h +0 -96
- package/src/headers/10/node_persistent.h +0 -30
- package/src/headers/10/node_platform.h +0 -170
- package/src/headers/10/node_revert.h +0 -75
- package/src/headers/10/node_root_certs.h +0 -3393
- package/src/headers/10/node_stat_watcher.h +0 -65
- package/src/headers/10/node_url.h +0 -193
- package/src/headers/10/node_version.h +0 -120
- package/src/headers/10/node_watchdog.h +0 -114
- package/src/headers/10/node_worker.h +0 -94
- package/src/headers/10/pipe_wrap.h +0 -76
- package/src/headers/10/req_wrap-inl.h +0 -166
- package/src/headers/10/req_wrap.h +0 -61
- package/src/headers/10/sharedarraybuffer_metadata.h +0 -67
- package/src/headers/10/spawn_sync.h +0 -240
- package/src/headers/10/stream_base-inl.h +0 -458
- package/src/headers/10/stream_base.h +0 -378
- package/src/headers/10/stream_pipe.h +0 -72
- package/src/headers/10/stream_wrap.h +0 -130
- package/src/headers/10/string_bytes.h +0 -126
- package/src/headers/10/string_decoder-inl.h +0 -38
- package/src/headers/10/string_search.h +0 -620
- package/src/headers/10/tcp_wrap.h +0 -99
- package/src/headers/10/tls_wrap.h +0 -195
- package/src/headers/10/tracing/agent.h +0 -178
- package/src/headers/10/tracing/node_trace_buffer.h +0 -83
- package/src/headers/10/tracing/node_trace_writer.h +0 -75
- package/src/headers/10/tracing/trace_event.h +0 -706
- package/src/headers/10/tracing/trace_event_common.h +0 -1102
- package/src/headers/10/tracing/traced_value.h +0 -68
- package/src/headers/10/tty_wrap.h +0 -63
- package/src/headers/10/udp_wrap.h +0 -102
- package/src/headers/10/util-inl.h +0 -459
- package/src/headers/10/util.h +0 -508
- package/src/headers/10/v8abbr.h +0 -121
- package/src/headers/12/aliased_buffer.h +0 -263
- package/src/headers/12/debug_utils.h +0 -181
- package/src/headers/12/histogram-inl.h +0 -83
- package/src/headers/12/histogram.h +0 -98
- package/src/headers/12/http_parser_adaptor.h +0 -24
- package/src/headers/12/inspector_agent.h +0 -147
- package/src/headers/12/inspector_profiler.h +0 -137
- package/src/headers/12/js_native_api.h +0 -541
- package/src/headers/12/js_native_api_types.h +0 -139
- package/src/headers/12/memory_tracker-inl.h +0 -339
- package/src/headers/12/memory_tracker.h +0 -283
- package/src/headers/12/module_wrap.h +0 -99
- package/src/headers/12/node.h +0 -887
- package/src/headers/12/node_api.h +0 -239
- package/src/headers/12/node_buffer.h +0 -92
- package/src/headers/12/node_constants.h +0 -80
- package/src/headers/12/node_crypto.h +0 -800
- package/src/headers/12/node_crypto_bio.h +0 -195
- package/src/headers/12/node_crypto_clienthello-inl.h +0 -91
- package/src/headers/12/node_crypto_clienthello.h +0 -132
- package/src/headers/12/node_file-inl.h +0 -289
- package/src/headers/12/node_http2.h +0 -1311
- package/src/headers/12/node_http_parser_impl.h +0 -994
- package/src/headers/12/node_i18n.h +0 -144
- package/src/headers/12/node_main_instance.h +0 -97
- package/src/headers/12/node_messaging.h +0 -227
- package/src/headers/12/node_native_module_env.h +0 -65
- package/src/headers/12/node_options-inl.h +0 -447
- package/src/headers/12/node_options.h +0 -479
- package/src/headers/12/node_perf.h +0 -181
- package/src/headers/12/node_process.h +0 -41
- package/src/headers/12/node_report.h +0 -47
- package/src/headers/12/node_revert.h +0 -78
- package/src/headers/12/node_sockaddr.h +0 -123
- package/src/headers/12/node_url.h +0 -188
- package/src/headers/12/node_version.h +0 -98
- package/src/headers/12/node_watchdog.h +0 -152
- package/src/headers/12/node_win32_etw_provider-inl.h +0 -287
- package/src/headers/12/node_win32_etw_provider.h +0 -99
- package/src/headers/12/node_worker.h +0 -142
- package/src/headers/12/sharedarraybuffer_metadata.h +0 -72
- package/src/headers/12/stream_base-inl.h +0 -323
- package/src/headers/12/stream_base.h +0 -431
- package/src/headers/12/stream_pipe.h +0 -72
- package/src/headers/12/string_bytes.h +0 -142
- package/src/headers/12/string_decoder.h +0 -50
- package/src/headers/12/string_search.h +0 -638
- package/src/headers/12/tls_wrap.h +0 -221
- package/src/headers/12/tracing/agent.h +0 -195
- package/src/headers/12/tracing/trace_event.h +0 -710
- package/src/headers/12/tty_wrap.h +0 -64
- package/src/headers/12/udp_wrap.h +0 -222
- package/src/headers/12/util-inl.h +0 -529
- package/src/headers/12/util.h +0 -765
- package/src/headers/13/async_wrap-inl.h +0 -94
- package/src/headers/13/async_wrap.h +0 -224
- package/src/headers/13/base64.h +0 -197
- package/src/headers/13/base_object-inl.h +0 -353
- package/src/headers/13/base_object.h +0 -229
- package/src/headers/13/connect_wrap.h +0 -26
- package/src/headers/13/connection_wrap.h +0 -30
- package/src/headers/13/debug_utils-inl.h +0 -223
- package/src/headers/13/diagnosticfilename-inl.h +0 -33
- package/src/headers/13/env-inl.h +0 -1293
- package/src/headers/13/env.h +0 -1469
- package/src/headers/13/handle_wrap.h +0 -117
- package/src/headers/13/histogram-inl.h +0 -83
- package/src/headers/13/histogram.h +0 -98
- package/src/headers/13/inspector_io.h +0 -78
- package/src/headers/13/inspector_socket.h +0 -60
- package/src/headers/13/inspector_socket_server.h +0 -110
- package/src/headers/13/js_native_api.h +0 -541
- package/src/headers/13/js_native_api_v8.h +0 -303
- package/src/headers/13/js_native_api_v8_internals.h +0 -38
- package/src/headers/13/js_stream.h +0 -52
- package/src/headers/13/json_utils.h +0 -160
- package/src/headers/13/node_api.h +0 -239
- package/src/headers/13/node_api_types.h +0 -44
- package/src/headers/13/node_binding.h +0 -99
- package/src/headers/13/node_context_data.h +0 -39
- package/src/headers/13/node_contextify.h +0 -161
- package/src/headers/13/node_crypto.h +0 -800
- package/src/headers/13/node_crypto_common.h +0 -138
- package/src/headers/13/node_crypto_groups.h +0 -415
- package/src/headers/13/node_dir.h +0 -52
- package/src/headers/13/node_dtrace.h +0 -86
- package/src/headers/13/node_errors.h +0 -210
- package/src/headers/13/node_file.h +0 -364
- package/src/headers/13/node_http2_state.h +0 -144
- package/src/headers/13/node_internals.h +0 -405
- package/src/headers/13/node_mem-inl.h +0 -112
- package/src/headers/13/node_mem.h +0 -41
- package/src/headers/13/node_metadata.h +0 -109
- package/src/headers/13/node_mutex.h +0 -247
- package/src/headers/13/node_native_module.h +0 -99
- package/src/headers/13/node_object_wrap.h +0 -132
- package/src/headers/13/node_perf.h +0 -181
- package/src/headers/13/node_perf_common.h +0 -97
- package/src/headers/13/node_platform.h +0 -190
- package/src/headers/13/node_process.h +0 -41
- package/src/headers/13/node_root_certs.h +0 -3424
- package/src/headers/13/node_sockaddr-inl.h +0 -170
- package/src/headers/13/node_sockaddr.h +0 -123
- package/src/headers/13/node_stat_watcher.h +0 -66
- package/src/headers/13/node_union_bytes.h +0 -103
- package/src/headers/13/node_v8_platform-inl.h +0 -184
- package/src/headers/13/node_wasi.h +0 -108
- package/src/headers/13/node_win32_etw_provider-inl.h +0 -287
- package/src/headers/13/node_win32_etw_provider.h +0 -99
- package/src/headers/13/pipe_wrap.h +0 -78
- package/src/headers/13/req_wrap-inl.h +0 -170
- package/src/headers/13/req_wrap.h +0 -77
- package/src/headers/13/spawn_sync.h +0 -242
- package/src/headers/13/stream_wrap.h +0 -130
- package/src/headers/13/string_decoder-inl.h +0 -37
- package/src/headers/13/string_decoder.h +0 -50
- package/src/headers/13/tcp_wrap.h +0 -101
- package/src/headers/13/threadpoolwork-inl.h +0 -57
- package/src/headers/13/tracing/node_trace_buffer.h +0 -83
- package/src/headers/13/tracing/node_trace_writer.h +0 -75
- package/src/headers/13/tracing/trace_event_common.h +0 -1109
- package/src/headers/13/tracing/traced_value.h +0 -70
- package/src/headers/13/v8abbr.h +0 -124
|
@@ -41,7 +41,6 @@
|
|
|
41
41
|
#define V8_FT_OPTIMIZED V8DBG_FRAMETYPE_OPTIMIZEDFRAME
|
|
42
42
|
#define V8_FT_INTERNAL V8DBG_FRAMETYPE_INTERNALFRAME
|
|
43
43
|
#define V8_FT_CONSTRUCT V8DBG_FRAMETYPE_CONSTRUCTFRAME
|
|
44
|
-
#define V8_FT_ADAPTOR V8DBG_FRAMETYPE_ARGUMENTSADAPTORFRAME
|
|
45
44
|
#define V8_FT_STUB V8DBG_FRAMETYPE_STUBFRAME
|
|
46
45
|
|
|
47
46
|
/* Identification masks and tags */
|
|
@@ -91,7 +90,8 @@
|
|
|
91
90
|
V8_OFF_HEAP( \
|
|
92
91
|
V8DBG_CLASS_SHAREDFUNCTIONINFO__NAME_OR_SCOPE_INFO__OBJECT)
|
|
93
92
|
#define V8_OFF_SHARED_SCRIPT \
|
|
94
|
-
V8_OFF_HEAP(
|
|
93
|
+
V8_OFF_HEAP( \
|
|
94
|
+
V8DBG_CLASS_SHAREDFUNCTIONINFO__SCRIPT_OR_DEBUG_INFO__HEAPOBJECT)
|
|
95
95
|
#define V8_OFF_SHARED_FUNIDENT \
|
|
96
96
|
V8_OFF_HEAP( \
|
|
97
97
|
V8DBG_CLASS_SHAREDFUNCTIONINFO__NAME_OR_SCOPE_INFO__OBJECT)
|
|
@@ -1,241 +0,0 @@
|
|
|
1
|
-
#ifndef SRC_ALIASED_BUFFER_H_
|
|
2
|
-
#define SRC_ALIASED_BUFFER_H_
|
|
3
|
-
|
|
4
|
-
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
5
|
-
|
|
6
|
-
#include "v8.h"
|
|
7
|
-
#include "util-inl.h"
|
|
8
|
-
|
|
9
|
-
namespace node {
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* This class encapsulates the technique of having a native buffer mapped to
|
|
13
|
-
* a JS object. Writes to the native buffer can happen efficiently without
|
|
14
|
-
* going through JS, and the data is then available to user's via the exposed
|
|
15
|
-
* JS object.
|
|
16
|
-
*
|
|
17
|
-
* While this technique is computationally efficient, it is effectively a
|
|
18
|
-
* write to JS program state w/out going through the standard
|
|
19
|
-
* (monitored) API. Thus any VM capabilities to detect the modification are
|
|
20
|
-
* circumvented.
|
|
21
|
-
*
|
|
22
|
-
* The encapsulation herein provides a placeholder where such writes can be
|
|
23
|
-
* observed. Any notification APIs will be left as a future exercise.
|
|
24
|
-
*/
|
|
25
|
-
template <class NativeT, class V8T>
|
|
26
|
-
class AliasedBuffer {
|
|
27
|
-
public:
|
|
28
|
-
AliasedBuffer(v8::Isolate* isolate, const size_t count)
|
|
29
|
-
: isolate_(isolate),
|
|
30
|
-
count_(count),
|
|
31
|
-
byte_offset_(0),
|
|
32
|
-
free_buffer_(true) {
|
|
33
|
-
CHECK_GT(count, 0);
|
|
34
|
-
const v8::HandleScope handle_scope(isolate_);
|
|
35
|
-
|
|
36
|
-
const size_t sizeInBytes = sizeof(NativeT) * count;
|
|
37
|
-
|
|
38
|
-
// allocate native buffer
|
|
39
|
-
buffer_ = Calloc<NativeT>(count);
|
|
40
|
-
|
|
41
|
-
// allocate v8 ArrayBuffer
|
|
42
|
-
v8::Local<v8::ArrayBuffer> ab = v8::ArrayBuffer::New(
|
|
43
|
-
isolate_, buffer_, sizeInBytes);
|
|
44
|
-
|
|
45
|
-
// allocate v8 TypedArray
|
|
46
|
-
v8::Local<V8T> js_array = V8T::New(ab, byte_offset_, count);
|
|
47
|
-
js_array_ = v8::Global<V8T>(isolate, js_array);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Create an AliasedBuffer over a sub-region of another aliased buffer.
|
|
52
|
-
* The two will share a v8::ArrayBuffer instance &
|
|
53
|
-
* a native buffer, but will each read/write to different sections of the
|
|
54
|
-
* native buffer.
|
|
55
|
-
*
|
|
56
|
-
* Note that byte_offset must by aligned by sizeof(NativeT).
|
|
57
|
-
*/
|
|
58
|
-
AliasedBuffer(v8::Isolate* isolate,
|
|
59
|
-
const size_t byte_offset,
|
|
60
|
-
const size_t count,
|
|
61
|
-
const AliasedBuffer<uint8_t,
|
|
62
|
-
v8::Uint8Array>& backing_buffer)
|
|
63
|
-
: isolate_(isolate),
|
|
64
|
-
count_(count),
|
|
65
|
-
byte_offset_(byte_offset),
|
|
66
|
-
free_buffer_(false) {
|
|
67
|
-
const v8::HandleScope handle_scope(isolate_);
|
|
68
|
-
|
|
69
|
-
v8::Local<v8::ArrayBuffer> ab = backing_buffer.GetArrayBuffer();
|
|
70
|
-
|
|
71
|
-
// validate that the byte_offset is aligned with sizeof(NativeT)
|
|
72
|
-
CHECK_EQ(byte_offset & (sizeof(NativeT) - 1), 0);
|
|
73
|
-
// validate this fits inside the backing buffer
|
|
74
|
-
CHECK_LE(sizeof(NativeT) * count, ab->ByteLength() - byte_offset);
|
|
75
|
-
|
|
76
|
-
buffer_ = reinterpret_cast<NativeT*>(
|
|
77
|
-
const_cast<uint8_t*>(backing_buffer.GetNativeBuffer() + byte_offset));
|
|
78
|
-
|
|
79
|
-
v8::Local<V8T> js_array = V8T::New(ab, byte_offset, count);
|
|
80
|
-
js_array_ = v8::Global<V8T>(isolate, js_array);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
AliasedBuffer(const AliasedBuffer& that)
|
|
84
|
-
: isolate_(that.isolate_),
|
|
85
|
-
count_(that.count_),
|
|
86
|
-
byte_offset_(that.byte_offset_),
|
|
87
|
-
buffer_(that.buffer_),
|
|
88
|
-
free_buffer_(false) {
|
|
89
|
-
js_array_ = v8::Global<V8T>(that.isolate_, that.GetJSArray());
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
~AliasedBuffer() {
|
|
93
|
-
if (free_buffer_ && buffer_ != nullptr) {
|
|
94
|
-
free(buffer_);
|
|
95
|
-
}
|
|
96
|
-
js_array_.Reset();
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
AliasedBuffer& operator=(AliasedBuffer&& that) {
|
|
100
|
-
this->~AliasedBuffer();
|
|
101
|
-
isolate_ = that.isolate_;
|
|
102
|
-
count_ = that.count_;
|
|
103
|
-
byte_offset_ = that.byte_offset_;
|
|
104
|
-
buffer_ = that.buffer_;
|
|
105
|
-
free_buffer_ = that.free_buffer_;
|
|
106
|
-
|
|
107
|
-
js_array_.Reset(isolate_, that.js_array_.Get(isolate_));
|
|
108
|
-
|
|
109
|
-
that.buffer_ = nullptr;
|
|
110
|
-
that.js_array_.Reset();
|
|
111
|
-
return *this;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Helper class that is returned from operator[] to support assignment into
|
|
116
|
-
* a specified location.
|
|
117
|
-
*/
|
|
118
|
-
class Reference {
|
|
119
|
-
public:
|
|
120
|
-
Reference(AliasedBuffer<NativeT, V8T>* aliased_buffer, size_t index)
|
|
121
|
-
: aliased_buffer_(aliased_buffer),
|
|
122
|
-
index_(index) {
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
Reference(const Reference& that)
|
|
126
|
-
: aliased_buffer_(that.aliased_buffer_),
|
|
127
|
-
index_(that.index_) {
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
inline Reference& operator=(const NativeT& val) {
|
|
131
|
-
aliased_buffer_->SetValue(index_, val);
|
|
132
|
-
return *this;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
inline Reference& operator=(const Reference& val) {
|
|
136
|
-
return *this = static_cast<NativeT>(val);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
operator NativeT() const {
|
|
140
|
-
return aliased_buffer_->GetValue(index_);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
inline Reference& operator+=(const NativeT& val) {
|
|
144
|
-
const NativeT current = aliased_buffer_->GetValue(index_);
|
|
145
|
-
aliased_buffer_->SetValue(index_, current + val);
|
|
146
|
-
return *this;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
inline Reference& operator+=(const Reference& val) {
|
|
150
|
-
return this->operator+=(static_cast<NativeT>(val));
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
inline Reference& operator-=(const NativeT& val) {
|
|
154
|
-
const NativeT current = aliased_buffer_->GetValue(index_);
|
|
155
|
-
aliased_buffer_->SetValue(index_, current - val);
|
|
156
|
-
return *this;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
private:
|
|
160
|
-
AliasedBuffer<NativeT, V8T>* aliased_buffer_;
|
|
161
|
-
size_t index_;
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Get the underlying v8 TypedArray overlayed on top of the native buffer
|
|
166
|
-
*/
|
|
167
|
-
v8::Local<V8T> GetJSArray() const {
|
|
168
|
-
return js_array_.Get(isolate_);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Get the underlying v8::ArrayBuffer underlying the TypedArray and
|
|
173
|
-
* overlaying the native buffer
|
|
174
|
-
*/
|
|
175
|
-
v8::Local<v8::ArrayBuffer> GetArrayBuffer() const {
|
|
176
|
-
return GetJSArray()->Buffer();
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* Get the underlying native buffer. Note that all reads/writes should occur
|
|
181
|
-
* through the GetValue/SetValue/operator[] methods
|
|
182
|
-
*/
|
|
183
|
-
inline const NativeT* GetNativeBuffer() const {
|
|
184
|
-
return buffer_;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* Synonym for GetBuffer()
|
|
189
|
-
*/
|
|
190
|
-
inline const NativeT* operator * () const {
|
|
191
|
-
return GetNativeBuffer();
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Set position index to given value.
|
|
196
|
-
*/
|
|
197
|
-
inline void SetValue(const size_t index, NativeT value) {
|
|
198
|
-
#if defined(DEBUG) && DEBUG
|
|
199
|
-
CHECK_LT(index, count_);
|
|
200
|
-
#endif
|
|
201
|
-
buffer_[index] = value;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Get value at position index
|
|
206
|
-
*/
|
|
207
|
-
inline const NativeT GetValue(const size_t index) const {
|
|
208
|
-
#if defined(DEBUG) && DEBUG
|
|
209
|
-
CHECK_LT(index, count_);
|
|
210
|
-
#endif
|
|
211
|
-
return buffer_[index];
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* Effectively, a synonym for GetValue/SetValue
|
|
216
|
-
*/
|
|
217
|
-
Reference operator[](size_t index) {
|
|
218
|
-
return Reference(this, index);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
NativeT operator[](size_t index) const {
|
|
222
|
-
return GetValue(index);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
size_t Length() const {
|
|
226
|
-
return count_;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
private:
|
|
230
|
-
v8::Isolate* isolate_;
|
|
231
|
-
size_t count_;
|
|
232
|
-
size_t byte_offset_;
|
|
233
|
-
NativeT* buffer_;
|
|
234
|
-
v8::Global<V8T> js_array_;
|
|
235
|
-
bool free_buffer_;
|
|
236
|
-
};
|
|
237
|
-
} // namespace node
|
|
238
|
-
|
|
239
|
-
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
240
|
-
|
|
241
|
-
#endif // SRC_ALIASED_BUFFER_H_
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
// Copyright Joyent, Inc. and other Node contributors.
|
|
2
|
-
//
|
|
3
|
-
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
4
|
-
// copy of this software and associated documentation files (the
|
|
5
|
-
// "Software"), to deal in the Software without restriction, including
|
|
6
|
-
// without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
-
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
8
|
-
// persons to whom the Software is furnished to do so, subject to the
|
|
9
|
-
// following conditions:
|
|
10
|
-
//
|
|
11
|
-
// The above copyright notice and this permission notice shall be included
|
|
12
|
-
// in all copies or substantial portions of the Software.
|
|
13
|
-
//
|
|
14
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
15
|
-
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
-
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
17
|
-
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
18
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
19
|
-
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
20
|
-
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
21
|
-
|
|
22
|
-
#ifndef SRC_ASYNC_WRAP_INL_H_
|
|
23
|
-
#define SRC_ASYNC_WRAP_INL_H_
|
|
24
|
-
|
|
25
|
-
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
26
|
-
|
|
27
|
-
#include "async_wrap.h"
|
|
28
|
-
#include "base_object-inl.h"
|
|
29
|
-
#include "node_internals.h"
|
|
30
|
-
|
|
31
|
-
namespace node {
|
|
32
|
-
|
|
33
|
-
inline AsyncWrap::ProviderType AsyncWrap::provider_type() const {
|
|
34
|
-
return provider_type_;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
inline double AsyncWrap::get_async_id() const {
|
|
39
|
-
return async_id_;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
inline double AsyncWrap::get_trigger_async_id() const {
|
|
44
|
-
return trigger_async_id_;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
inline AsyncWrap::AsyncScope::AsyncScope(AsyncWrap* wrap)
|
|
49
|
-
: wrap_(wrap) {
|
|
50
|
-
Environment* env = wrap->env();
|
|
51
|
-
if (env->async_hooks()->fields()[Environment::AsyncHooks::kBefore] == 0)
|
|
52
|
-
return;
|
|
53
|
-
EmitBefore(env, wrap->get_async_id());
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
inline AsyncWrap::AsyncScope::~AsyncScope() {
|
|
57
|
-
Environment* env = wrap_->env();
|
|
58
|
-
if (env->async_hooks()->fields()[Environment::AsyncHooks::kAfter] == 0)
|
|
59
|
-
return;
|
|
60
|
-
EmitAfter(env, wrap_->get_async_id());
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
inline v8::MaybeLocal<v8::Value> AsyncWrap::MakeCallback(
|
|
65
|
-
const v8::Local<v8::String> symbol,
|
|
66
|
-
int argc,
|
|
67
|
-
v8::Local<v8::Value>* argv) {
|
|
68
|
-
return MakeCallback(symbol.As<v8::Name>(), argc, argv);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
inline v8::MaybeLocal<v8::Value> AsyncWrap::MakeCallback(
|
|
73
|
-
const v8::Local<v8::Symbol> symbol,
|
|
74
|
-
int argc,
|
|
75
|
-
v8::Local<v8::Value>* argv) {
|
|
76
|
-
return MakeCallback(symbol.As<v8::Name>(), argc, argv);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
inline v8::MaybeLocal<v8::Value> AsyncWrap::MakeCallback(
|
|
81
|
-
const v8::Local<v8::Name> symbol,
|
|
82
|
-
int argc,
|
|
83
|
-
v8::Local<v8::Value>* argv) {
|
|
84
|
-
v8::Local<v8::Value> cb_v;
|
|
85
|
-
if (!object()->Get(env()->context(), symbol).ToLocal(&cb_v))
|
|
86
|
-
return v8::MaybeLocal<v8::Value>();
|
|
87
|
-
if (!cb_v->IsFunction()) {
|
|
88
|
-
// TODO(addaleax): We should throw an error here to fulfill the
|
|
89
|
-
// `MaybeLocal<>` API contract.
|
|
90
|
-
return v8::MaybeLocal<v8::Value>();
|
|
91
|
-
}
|
|
92
|
-
return MakeCallback(cb_v.As<v8::Function>(), argc, argv);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
// Defined here to avoid a circular dependency with env-inl.h.
|
|
97
|
-
inline Environment::AsyncHooks::DefaultTriggerAsyncIdScope
|
|
98
|
-
::DefaultTriggerAsyncIdScope(AsyncWrap* async_wrap)
|
|
99
|
-
: DefaultTriggerAsyncIdScope(async_wrap->env(),
|
|
100
|
-
async_wrap->get_async_id()) {}
|
|
101
|
-
|
|
102
|
-
} // namespace node
|
|
103
|
-
|
|
104
|
-
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
105
|
-
|
|
106
|
-
#endif // SRC_ASYNC_WRAP_INL_H_
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
// Copyright Joyent, Inc. and other Node contributors.
|
|
2
|
-
//
|
|
3
|
-
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
4
|
-
// copy of this software and associated documentation files (the
|
|
5
|
-
// "Software"), to deal in the Software without restriction, including
|
|
6
|
-
// without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
-
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
8
|
-
// persons to whom the Software is furnished to do so, subject to the
|
|
9
|
-
// following conditions:
|
|
10
|
-
//
|
|
11
|
-
// The above copyright notice and this permission notice shall be included
|
|
12
|
-
// in all copies or substantial portions of the Software.
|
|
13
|
-
//
|
|
14
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
15
|
-
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
-
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
17
|
-
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
18
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
19
|
-
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
20
|
-
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
21
|
-
|
|
22
|
-
#ifndef SRC_ASYNC_WRAP_H_
|
|
23
|
-
#define SRC_ASYNC_WRAP_H_
|
|
24
|
-
|
|
25
|
-
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
26
|
-
|
|
27
|
-
#include "base_object.h"
|
|
28
|
-
#include "v8.h"
|
|
29
|
-
|
|
30
|
-
#include <stdint.h>
|
|
31
|
-
|
|
32
|
-
namespace node {
|
|
33
|
-
|
|
34
|
-
#define NODE_ASYNC_NON_CRYPTO_PROVIDER_TYPES(V) \
|
|
35
|
-
V(NONE) \
|
|
36
|
-
V(DNSCHANNEL) \
|
|
37
|
-
V(FILEHANDLE) \
|
|
38
|
-
V(FILEHANDLECLOSEREQ) \
|
|
39
|
-
V(FSEVENTWRAP) \
|
|
40
|
-
V(FSREQWRAP) \
|
|
41
|
-
V(FSREQPROMISE) \
|
|
42
|
-
V(GETADDRINFOREQWRAP) \
|
|
43
|
-
V(GETNAMEINFOREQWRAP) \
|
|
44
|
-
V(HTTP2SESSION) \
|
|
45
|
-
V(HTTP2STREAM) \
|
|
46
|
-
V(HTTP2PING) \
|
|
47
|
-
V(HTTP2SETTINGS) \
|
|
48
|
-
V(HTTPPARSER) \
|
|
49
|
-
V(JSSTREAM) \
|
|
50
|
-
V(MESSAGEPORT) \
|
|
51
|
-
V(PIPECONNECTWRAP) \
|
|
52
|
-
V(PIPESERVERWRAP) \
|
|
53
|
-
V(PIPEWRAP) \
|
|
54
|
-
V(PROCESSWRAP) \
|
|
55
|
-
V(PROMISE) \
|
|
56
|
-
V(QUERYWRAP) \
|
|
57
|
-
V(SHUTDOWNWRAP) \
|
|
58
|
-
V(SIGNALWRAP) \
|
|
59
|
-
V(STATWATCHER) \
|
|
60
|
-
V(STREAMPIPE) \
|
|
61
|
-
V(TCPCONNECTWRAP) \
|
|
62
|
-
V(TCPSERVERWRAP) \
|
|
63
|
-
V(TCPWRAP) \
|
|
64
|
-
V(TIMERWRAP) \
|
|
65
|
-
V(TTYWRAP) \
|
|
66
|
-
V(UDPSENDWRAP) \
|
|
67
|
-
V(UDPWRAP) \
|
|
68
|
-
V(WORKER) \
|
|
69
|
-
V(WRITEWRAP) \
|
|
70
|
-
V(ZLIB)
|
|
71
|
-
|
|
72
|
-
#if HAVE_OPENSSL
|
|
73
|
-
#define NODE_ASYNC_CRYPTO_PROVIDER_TYPES(V) \
|
|
74
|
-
V(PBKDF2REQUEST) \
|
|
75
|
-
V(KEYPAIRGENREQUEST) \
|
|
76
|
-
V(RANDOMBYTESREQUEST) \
|
|
77
|
-
V(SCRYPTREQUEST) \
|
|
78
|
-
V(TLSWRAP)
|
|
79
|
-
#else
|
|
80
|
-
#define NODE_ASYNC_CRYPTO_PROVIDER_TYPES(V)
|
|
81
|
-
#endif // HAVE_OPENSSL
|
|
82
|
-
|
|
83
|
-
#if HAVE_INSPECTOR
|
|
84
|
-
#define NODE_ASYNC_INSPECTOR_PROVIDER_TYPES(V) \
|
|
85
|
-
V(INSPECTORJSBINDING)
|
|
86
|
-
#else
|
|
87
|
-
#define NODE_ASYNC_INSPECTOR_PROVIDER_TYPES(V)
|
|
88
|
-
#endif // HAVE_INSPECTOR
|
|
89
|
-
|
|
90
|
-
#define NODE_ASYNC_PROVIDER_TYPES(V) \
|
|
91
|
-
NODE_ASYNC_NON_CRYPTO_PROVIDER_TYPES(V) \
|
|
92
|
-
NODE_ASYNC_CRYPTO_PROVIDER_TYPES(V) \
|
|
93
|
-
NODE_ASYNC_INSPECTOR_PROVIDER_TYPES(V)
|
|
94
|
-
|
|
95
|
-
class Environment;
|
|
96
|
-
class DestroyParam;
|
|
97
|
-
|
|
98
|
-
class AsyncWrap : public BaseObject {
|
|
99
|
-
public:
|
|
100
|
-
enum ProviderType {
|
|
101
|
-
#define V(PROVIDER) \
|
|
102
|
-
PROVIDER_ ## PROVIDER,
|
|
103
|
-
NODE_ASYNC_PROVIDER_TYPES(V)
|
|
104
|
-
#undef V
|
|
105
|
-
PROVIDERS_LENGTH,
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
AsyncWrap(Environment* env,
|
|
109
|
-
v8::Local<v8::Object> object,
|
|
110
|
-
ProviderType provider,
|
|
111
|
-
double execution_async_id = kInvalidAsyncId);
|
|
112
|
-
|
|
113
|
-
virtual ~AsyncWrap();
|
|
114
|
-
|
|
115
|
-
static constexpr double kInvalidAsyncId = -1;
|
|
116
|
-
|
|
117
|
-
static v8::Local<v8::FunctionTemplate> GetConstructorTemplate(
|
|
118
|
-
Environment* env);
|
|
119
|
-
|
|
120
|
-
static void Initialize(v8::Local<v8::Object> target,
|
|
121
|
-
v8::Local<v8::Value> unused,
|
|
122
|
-
v8::Local<v8::Context> context);
|
|
123
|
-
|
|
124
|
-
static void GetAsyncId(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
125
|
-
static void PushAsyncIds(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
126
|
-
static void PopAsyncIds(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
127
|
-
static void AsyncReset(const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
128
|
-
static void QueueDestroyAsyncId(
|
|
129
|
-
const v8::FunctionCallbackInfo<v8::Value>& args);
|
|
130
|
-
|
|
131
|
-
static void EmitAsyncInit(Environment* env,
|
|
132
|
-
v8::Local<v8::Object> object,
|
|
133
|
-
v8::Local<v8::String> type,
|
|
134
|
-
double async_id,
|
|
135
|
-
double trigger_async_id);
|
|
136
|
-
|
|
137
|
-
static void EmitDestroy(Environment* env, double async_id);
|
|
138
|
-
static void EmitBefore(Environment* env, double async_id);
|
|
139
|
-
static void EmitAfter(Environment* env, double async_id);
|
|
140
|
-
static void EmitPromiseResolve(Environment* env, double async_id);
|
|
141
|
-
|
|
142
|
-
void EmitDestroy();
|
|
143
|
-
|
|
144
|
-
void EmitTraceEventBefore();
|
|
145
|
-
static void EmitTraceEventAfter(ProviderType type, double async_id);
|
|
146
|
-
void EmitTraceEventDestroy();
|
|
147
|
-
|
|
148
|
-
static void DestroyAsyncIdsCallback(Environment* env, void* data);
|
|
149
|
-
|
|
150
|
-
inline ProviderType provider_type() const;
|
|
151
|
-
|
|
152
|
-
inline double get_async_id() const;
|
|
153
|
-
|
|
154
|
-
inline double get_trigger_async_id() const;
|
|
155
|
-
|
|
156
|
-
void AsyncReset(double execution_async_id = kInvalidAsyncId,
|
|
157
|
-
bool silent = false);
|
|
158
|
-
|
|
159
|
-
// Only call these within a valid HandleScope.
|
|
160
|
-
v8::MaybeLocal<v8::Value> MakeCallback(const v8::Local<v8::Function> cb,
|
|
161
|
-
int argc,
|
|
162
|
-
v8::Local<v8::Value>* argv);
|
|
163
|
-
inline v8::MaybeLocal<v8::Value> MakeCallback(
|
|
164
|
-
const v8::Local<v8::Symbol> symbol,
|
|
165
|
-
int argc,
|
|
166
|
-
v8::Local<v8::Value>* argv);
|
|
167
|
-
inline v8::MaybeLocal<v8::Value> MakeCallback(
|
|
168
|
-
const v8::Local<v8::String> symbol,
|
|
169
|
-
int argc,
|
|
170
|
-
v8::Local<v8::Value>* argv);
|
|
171
|
-
inline v8::MaybeLocal<v8::Value> MakeCallback(
|
|
172
|
-
const v8::Local<v8::Name> symbol,
|
|
173
|
-
int argc,
|
|
174
|
-
v8::Local<v8::Value>* argv);
|
|
175
|
-
|
|
176
|
-
virtual std::string diagnostic_name() const;
|
|
177
|
-
virtual std::string MemoryInfoName() const;
|
|
178
|
-
|
|
179
|
-
static void WeakCallback(const v8::WeakCallbackInfo<DestroyParam> &info);
|
|
180
|
-
|
|
181
|
-
// Returns the object that 'owns' an async wrap. For example, for a
|
|
182
|
-
// TCP connection handle, this is the corresponding net.Socket.
|
|
183
|
-
v8::Local<v8::Object> GetOwner();
|
|
184
|
-
static v8::Local<v8::Object> GetOwner(Environment* env,
|
|
185
|
-
v8::Local<v8::Object> obj);
|
|
186
|
-
|
|
187
|
-
// This is a simplified version of InternalCallbackScope that only runs
|
|
188
|
-
// the `before` and `after` hooks. Only use it when not actually calling
|
|
189
|
-
// back into JS; otherwise, use InternalCallbackScope.
|
|
190
|
-
class AsyncScope {
|
|
191
|
-
public:
|
|
192
|
-
explicit inline AsyncScope(AsyncWrap* wrap);
|
|
193
|
-
~AsyncScope();
|
|
194
|
-
|
|
195
|
-
private:
|
|
196
|
-
AsyncWrap* wrap_ = nullptr;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
private:
|
|
200
|
-
friend class PromiseWrap;
|
|
201
|
-
|
|
202
|
-
AsyncWrap(Environment* env,
|
|
203
|
-
v8::Local<v8::Object> promise,
|
|
204
|
-
ProviderType provider,
|
|
205
|
-
double execution_async_id,
|
|
206
|
-
bool silent);
|
|
207
|
-
inline AsyncWrap();
|
|
208
|
-
const ProviderType provider_type_;
|
|
209
|
-
// Because the values may be Reset(), cannot be made const.
|
|
210
|
-
double async_id_ = kInvalidAsyncId;
|
|
211
|
-
double trigger_async_id_;
|
|
212
|
-
};
|
|
213
|
-
|
|
214
|
-
} // namespace node
|
|
215
|
-
|
|
216
|
-
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
|
|
217
|
-
|
|
218
|
-
#endif // SRC_ASYNC_WRAP_H_
|