From 425befdd57c6e67de38ce504766d292170e18d44 Mon Sep 17 00:00:00 2001 From: gengjiawen Date: Wed, 6 Feb 2019 11:06:16 +0800 Subject: [PATCH] src: let's clang-format --- src/aliased_buffer.h | 65 +- src/api/callback.cc | 33 +- src/api/encoding.cc | 31 +- src/api/exceptions.cc | 39 +- src/api/hooks.cc | 17 +- src/async_wrap-inl.h | 26 +- src/async_wrap.cc | 243 +- src/async_wrap.h | 110 +- src/base64.h | 74 +- src/base_object-inl.h | 18 +- src/base_object.h | 17 +- src/cares_wrap.cc | 816 +-- src/connect_wrap.cc | 7 +- src/connect_wrap.h | 2 +- src/connection_wrap.cc | 38 +- src/debug_utils.cc | 133 +- src/debug_utils.h | 26 +- src/env-inl.h | 186 +- src/env.cc | 340 +- src/env.h | 111 +- src/fs_event_wrap.cc | 56 +- src/handle_wrap.cc | 36 +- src/handle_wrap.h | 1 - src/heap_utils.cc | 25 +- src/http_parser_adaptor.h | 10 +- src/inspector/main_thread_interface.cc | 93 +- src/inspector/main_thread_interface.h | 17 +- src/inspector/node_string.cc | 18 +- src/inspector/node_string.h | 3 +- src/inspector/tracing_agent.cc | 3 +- src/inspector/tracing_agent.h | 2 - src/inspector/worker_agent.cc | 41 +- src/inspector/worker_agent.h | 1 - src/inspector/worker_inspector.cc | 24 +- src/inspector/worker_inspector.h | 19 +- src/inspector_agent.cc | 199 +- src/inspector_agent.h | 15 +- src/inspector_io.cc | 86 +- src/inspector_io.h | 12 +- src/inspector_js_api.cc | 83 +- src/inspector_socket.cc | 142 +- src/inspector_socket.h | 1 - src/inspector_socket_server.cc | 155 +- src/inspector_socket_server.h | 13 +- src/js_native_api.h | 65 +- src/js_native_api_types.h | 5 +- src/js_native_api_v8.cc | 458 +- src/js_native_api_v8.h | 150 +- src/js_native_api_v8_internals.h | 11 +- src/js_stream.cc | 61 +- src/large_pages/node_large_page.cc | 64 +- src/large_pages/node_large_page.h | 1 - src/memory_tracker-inl.h | 8 +- src/memory_tracker.h | 11 +- src/module_wrap.cc | 178 +- src/module_wrap.h | 9 +- src/node.cc | 62 +- src/node.h | 466 +- src/node_api.cc | 313 +- src/node_api.h | 89 +- src/node_api_types.h | 3 +- src/node_buffer.cc | 282 +- src/node_buffer.h | 6 +- src/node_config.cc | 5 +- src/node_constants.cc | 311 +- src/node_constants.h | 43 +- src/node_contextify.cc | 376 +- src/node_contextify.h | 26 +- src/node_credentials.cc | 6 +- src/node_crypto.cc | 1970 +++-- src/node_crypto.h | 112 +- src/node_crypto_bio.cc | 118 +- src/node_crypto_bio.h | 33 +- src/node_crypto_clienthello-inl.h | 6 +- src/node_crypto_clienthello.cc | 96 +- src/node_crypto_clienthello.h | 20 +- src/node_crypto_groups.h | 641 +- src/node_domain.cc | 1 - src/node_dtrace.cc | 194 +- src/node_dtrace.h | 2 +- src/node_errors.cc | 6 +- src/node_errors.h | 174 +- src/node_file.cc | 1142 +-- src/node_file.h | 67 +- src/node_http2.cc | 1043 ++- src/node_http2.h | 704 +- src/node_http2_state.h | 212 +- src/node_http_parser_impl.h | 236 +- src/node_http_parser_llhttp.cc | 7 +- src/node_http_parser_traditional.cc | 7 +- src/node_i18n.cc | 245 +- src/node_internals.h | 43 +- src/node_main.cc | 34 +- src/node_messaging.cc | 148 +- src/node_messaging.h | 15 +- src/node_metadata.cc | 13 +- src/node_metadata.h | 4 +- src/node_mutex.h | 44 +- src/node_native_module.cc | 6 +- src/node_native_module.h | 2 +- src/node_object_wrap.h | 27 +- src/node_options-inl.h | 115 +- src/node_options.cc | 36 +- src/node_options.h | 41 +- src/node_os.cc | 112 +- src/node_perf.cc | 168 +- src/node_perf.h | 35 +- src/node_perf_common.h | 56 +- src/node_persistent.h | 6 +- src/node_platform.cc | 127 +- src/node_platform.h | 18 +- src/node_postmortem_metadata.cc | 70 +- src/node_process_methods.cc | 27 +- src/node_process_object.cc | 87 +- src/node_report.cc | 39 +- src/node_report.h | 2 +- src/node_report_module.cc | 3 +- src/node_report_utils.cc | 14 +- src/node_revert.h | 8 +- src/node_root_certs.h | 6776 +++++++++--------- src/node_serdes.cc | 130 +- src/node_stat_watcher.cc | 19 +- src/node_stat_watcher.h | 8 +- src/node_task_queue.cc | 41 +- src/node_trace_events.cc | 63 +- src/node_types.cc | 79 +- src/node_url.cc | 1023 ++- src/node_url.h | 135 +- src/node_util.cc | 90 +- src/node_v8.cc | 140 +- src/node_version.h | 41 +- src/node_watchdog.cc | 29 +- src/node_watchdog.h | 6 +- src/node_win32_etw_provider-inl.h | 207 +- src/node_win32_etw_provider.cc | 100 +- src/node_win32_etw_provider.h | 62 +- src/node_worker.cc | 107 +- src/node_worker.h | 3 +- src/node_zlib.cc | 330 +- src/pipe_wrap.cc | 45 +- src/pipe_wrap.h | 7 +- src/process_wrap.cc | 30 +- src/req_wrap-inl.h | 22 +- src/sharedarraybuffer_metadata.cc | 52 +- src/sharedarraybuffer_metadata.h | 11 +- src/signal_wrap.cc | 10 +- src/spawn_sync.cc | 206 +- src/spawn_sync.h | 11 +- src/stream_base-inl.h | 151 +- src/stream_base.cc | 93 +- src/stream_base.h | 38 +- src/stream_pipe.cc | 110 +- src/stream_wrap.cc | 109 +- src/stream_wrap.h | 14 +- src/string_bytes.cc | 218 +- src/string_bytes.h | 5 +- src/string_decoder-inl.h | 3 +- src/string_decoder.cc | 77 +- src/string_decoder.h | 2 +- src/string_search.h | 83 +- src/tcp_wrap.cc | 184 +- src/tcp_wrap.h | 14 +- src/timers.cc | 15 +- src/tls_wrap.cc | 314 +- src/tls_wrap.h | 11 +- src/tracing/agent.cc | 98 +- src/tracing/agent.h | 11 +- src/tracing/node_trace_buffer.cc | 65 +- src/tracing/node_trace_buffer.h | 18 +- src/tracing/node_trace_writer.cc | 49 +- src/tracing/node_trace_writer.h | 2 +- src/tracing/trace_event.h | 608 +- src/tracing/trace_event_common.h | 1622 +++-- src/tracing/traced_value.cc | 85 +- src/tty_wrap.cc | 56 +- src/tty_wrap.h | 2 +- src/udp_wrap.cc | 187 +- src/udp_wrap.h | 6 +- src/util-inl.h | 116 +- src/util.cc | 14 +- src/util.h | 168 +- src/uv.cc | 25 +- src/v8abbr.h | 162 +- test/cctest/node_test_fixture.h | 45 +- test/cctest/test_aliased_buffer.cc | 69 +- test/cctest/test_base64.cc | 14 +- test/cctest/test_environment.cc | 14 +- test/cctest/test_inspector_socket.cc | 273 +- test/cctest/test_inspector_socket_server.cc | 141 +- test/cctest/test_node_postmortem_metadata.cc | 40 +- test/cctest/test_platform.cc | 7 +- test/cctest/test_report_util.cc | 12 +- test/cctest/test_traced_value.cc | 11 +- test/cctest/test_url.cc | 2 +- test/cctest/test_util.cc | 31 +- test/js-native-api/common.h | 67 +- 196 files changed, 14443 insertions(+), 15533 deletions(-) diff --git a/src/aliased_buffer.h b/src/aliased_buffer.h index eae60f4d93a9c0..515961fe8ed690 100644 --- a/src/aliased_buffer.h +++ b/src/aliased_buffer.h @@ -3,8 +3,8 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "v8.h" #include "util-inl.h" +#include "v8.h" namespace node { @@ -22,16 +22,14 @@ namespace node { * The encapsulation herein provides a placeholder where such writes can be * observed. Any notification APIs will be left as a future exercise. */ -template ::value>> class AliasedBuffer { public: AliasedBuffer(v8::Isolate* isolate, const size_t count) - : isolate_(isolate), - count_(count), - byte_offset_(0), - free_buffer_(true) { + : isolate_(isolate), count_(count), byte_offset_(0), free_buffer_(true) { CHECK_GT(count, 0); const v8::HandleScope handle_scope(isolate_); @@ -41,8 +39,8 @@ class AliasedBuffer { buffer_ = Calloc(count); // allocate v8 ArrayBuffer - v8::Local ab = v8::ArrayBuffer::New( - isolate_, buffer_, size_in_bytes); + v8::Local ab = + v8::ArrayBuffer::New(isolate_, buffer_, size_in_bytes); // allocate v8 TypedArray v8::Local js_array = V8T::New(ab, byte_offset_, count); @@ -61,8 +59,7 @@ class AliasedBuffer { AliasedBuffer(v8::Isolate* isolate, const size_t byte_offset, const size_t count, - const AliasedBuffer& backing_buffer) + const AliasedBuffer& backing_buffer) : isolate_(isolate), count_(count), byte_offset_(byte_offset), @@ -74,7 +71,7 @@ class AliasedBuffer { // validate that the byte_offset is aligned with sizeof(NativeT) CHECK_EQ(byte_offset & (sizeof(NativeT) - 1), 0); // validate this fits inside the backing buffer - CHECK_LE(sizeof(NativeT) * count, ab->ByteLength() - byte_offset); + CHECK_LE(sizeof(NativeT) * count, ab->ByteLength() - byte_offset); buffer_ = reinterpret_cast( const_cast(backing_buffer.GetNativeBuffer() + byte_offset)); @@ -121,14 +118,10 @@ class AliasedBuffer { class Reference { public: Reference(AliasedBuffer* aliased_buffer, size_t index) - : aliased_buffer_(aliased_buffer), - index_(index) { - } + : aliased_buffer_(aliased_buffer), index_(index) {} Reference(const Reference& that) - : aliased_buffer_(that.aliased_buffer_), - index_(that.index_) { - } + : aliased_buffer_(that.aliased_buffer_), index_(that.index_) {} inline Reference& operator=(const NativeT& val) { aliased_buffer_->SetValue(index_, val); @@ -139,9 +132,7 @@ class AliasedBuffer { return *this = static_cast(val); } - operator NativeT() const { - return aliased_buffer_->GetValue(index_); - } + operator NativeT() const { return aliased_buffer_->GetValue(index_); } inline Reference& operator+=(const NativeT& val) { const NativeT current = aliased_buffer_->GetValue(index_); @@ -167,14 +158,12 @@ class AliasedBuffer { /** * Get the underlying v8 TypedArray overlayed on top of the native buffer */ - v8::Local GetJSArray() const { - return js_array_.Get(isolate_); - } + v8::Local GetJSArray() const { return js_array_.Get(isolate_); } /** - * Get the underlying v8::ArrayBuffer underlying the TypedArray and - * overlaying the native buffer - */ + * Get the underlying v8::ArrayBuffer underlying the TypedArray and + * overlaying the native buffer + */ v8::Local GetArrayBuffer() const { return GetJSArray()->Buffer(); } @@ -183,16 +172,12 @@ class AliasedBuffer { * Get the underlying native buffer. Note that all reads/writes should occur * through the GetValue/SetValue/operator[] methods */ - inline const NativeT* GetNativeBuffer() const { - return buffer_; - } + inline const NativeT* GetNativeBuffer() const { return buffer_; } /** * Synonym for GetBuffer() */ - inline const NativeT* operator * () const { - return GetNativeBuffer(); - } + inline const NativeT* operator*() const { return GetNativeBuffer(); } /** * Set position index to given value. @@ -213,17 +198,11 @@ class AliasedBuffer { /** * Effectively, a synonym for GetValue/SetValue */ - Reference operator[](size_t index) { - return Reference(this, index); - } + Reference operator[](size_t index) { return Reference(this, index); } - NativeT operator[](size_t index) const { - return GetValue(index); - } + NativeT operator[](size_t index) const { return GetValue(index); } - size_t Length() const { - return count_; - } + size_t Length() const { return count_; } // Should only be used to extend the array. // Should only be used on an owning array, not one created as a sub array of @@ -243,8 +222,8 @@ class AliasedBuffer { memcpy(new_buffer, buffer_, old_size_in_bytes); // allocate v8 new ArrayBuffer - v8::Local ab = v8::ArrayBuffer::New( - isolate_, new_buffer, new_size_in_bytes); + v8::Local ab = + v8::ArrayBuffer::New(isolate_, new_buffer, new_size_in_bytes); // allocate v8 TypedArray v8::Local js_array = V8T::New(ab, byte_offset_, new_capacity); diff --git a/src/api/callback.cc b/src/api/callback.cc index 885134799fe019..b7ff14ef433adb 100644 --- a/src/api/callback.cc +++ b/src/api/callback.cc @@ -1,6 +1,6 @@ -#include "node.h" #include "async_wrap-inl.h" #include "env-inl.h" +#include "node.h" #include "v8.h" namespace node { @@ -22,33 +22,31 @@ using AsyncHooks = Environment::AsyncHooks; CallbackScope::CallbackScope(Isolate* isolate, Local object, async_context asyncContext) - : private_(new InternalCallbackScope(Environment::GetCurrent(isolate), - object, - asyncContext)), - try_catch_(isolate) { + : private_(new InternalCallbackScope( + Environment::GetCurrent(isolate), object, asyncContext)), + try_catch_(isolate) { try_catch_.SetVerbose(true); } CallbackScope::~CallbackScope() { - if (try_catch_.HasCaught()) - private_->MarkAsFailed(); + if (try_catch_.HasCaught()) private_->MarkAsFailed(); delete private_; } InternalCallbackScope::InternalCallbackScope(AsyncWrap* async_wrap) - : InternalCallbackScope(async_wrap->env(), - async_wrap->object(), - { async_wrap->get_async_id(), - async_wrap->get_trigger_async_id() }) {} + : InternalCallbackScope( + async_wrap->env(), + async_wrap->object(), + {async_wrap->get_async_id(), async_wrap->get_trigger_async_id()}) {} InternalCallbackScope::InternalCallbackScope(Environment* env, Local object, const async_context& asyncContext, ResourceExpectation expect) - : env_(env), - async_context_(asyncContext), - object_(object), - callback_scope_(env) { + : env_(env), + async_context_(asyncContext), + object_(object), + callback_scope_(env) { CHECK_IMPLIES(expect == kRequireResource, !object.IsEmpty()); CHECK_NOT_NULL(env); @@ -68,7 +66,7 @@ InternalCallbackScope::InternalCallbackScope(Environment* env, } env->async_hooks()->push_async_ids(async_context_.async_id, - async_context_.trigger_async_id); + async_context_.trigger_async_id); pushed_ids_ = true; } @@ -86,8 +84,7 @@ void InternalCallbackScope::Close() { env_->async_hooks()->clear_async_id_stack(); } - if (pushed_ids_) - env_->async_hooks()->pop_async_id(async_context_.async_id); + if (pushed_ids_) env_->async_hooks()->pop_async_id(async_context_.async_id); if (failed_) return; diff --git a/src/api/encoding.cc b/src/api/encoding.cc index 21d327509727a2..ccd7f28ff81dcc 100644 --- a/src/api/encoding.cc +++ b/src/api/encoding.cc @@ -1,5 +1,5 @@ -#include "node.h" #include "env-inl.h" +#include "node.h" #include "string_bytes.h" #include "util-inl.h" #include "v8.h" @@ -19,35 +19,29 @@ enum encoding ParseEncoding(const char* encoding, if (encoding[1] == 't' && encoding[2] == 'f') { // Skip `-` encoding += encoding[3] == '-' ? 4 : 3; - if (encoding[0] == '8' && encoding[1] == '\0') - return UTF8; - if (strncmp(encoding, "16le", 4) == 0) - return UCS2; + if (encoding[0] == '8' && encoding[1] == '\0') return UTF8; + if (strncmp(encoding, "16le", 4) == 0) return UCS2; - // ucs2 + // ucs2 } else if (encoding[1] == 'c' && encoding[2] == 's') { encoding += encoding[3] == '-' ? 4 : 3; - if (encoding[0] == '2' && encoding[1] == '\0') - return UCS2; + if (encoding[0] == '2' && encoding[1] == '\0') return UCS2; } break; case 'l': // latin1 if (encoding[1] == 'a') { - if (strncmp(encoding + 2, "tin1", 4) == 0) - return LATIN1; + if (strncmp(encoding + 2, "tin1", 4) == 0) return LATIN1; } break; case 'b': // binary if (encoding[1] == 'i') { - if (strncmp(encoding + 2, "nary", 4) == 0) - return LATIN1; + if (strncmp(encoding + 2, "nary", 4) == 0) return LATIN1; - // buffer + // buffer } else if (encoding[1] == 'u') { - if (strncmp(encoding + 2, "ffer", 4) == 0) - return BUFFER; + if (strncmp(encoding + 2, "ffer", 4) == 0) return BUFFER; } break; case '\0': @@ -85,14 +79,12 @@ enum encoding ParseEncoding(const char* encoding, } } - enum encoding ParseEncoding(Isolate* isolate, Local encoding_v, enum encoding default_encoding) { CHECK(!encoding_v.IsEmpty()); - if (!encoding_v->IsString()) - return default_encoding; + if (!encoding_v->IsString()) return default_encoding; Utf8Value encoding(isolate, encoding_v); @@ -111,8 +103,7 @@ Local Encode(Isolate* isolate, Local Encode(Isolate* isolate, const uint16_t* buf, size_t len) { Local error; - return StringBytes::Encode(isolate, buf, len, &error) - .ToLocalChecked(); + return StringBytes::Encode(isolate, buf, len, &error).ToLocalChecked(); } // Returns -1 if the handle was not valid for decoding diff --git a/src/api/exceptions.cc b/src/api/exceptions.cc index 4d1cca8b6512b4..017d9e93bb3582 100644 --- a/src/api/exceptions.cc +++ b/src/api/exceptions.cc @@ -55,9 +55,8 @@ Local ErrnoException(Isolate* isolate, e = Exception::Error(cons); Local obj = e.As(); - obj->Set(env->context(), - env->errno_string(), - Integer::New(isolate, errorno)).FromJust(); + obj->Set(env->context(), env->errno_string(), Integer::New(isolate, errorno)) + .FromJust(); obj->Set(env->context(), env->code_string(), estring).FromJust(); if (path_string.IsEmpty() == false) { @@ -67,7 +66,8 @@ Local ErrnoException(Isolate* isolate, if (syscall != nullptr) { obj->Set(env->context(), env->syscall_string(), - OneByteString(isolate, syscall)).FromJust(); + OneByteString(isolate, syscall)) + .FromJust(); } return e; @@ -91,7 +91,6 @@ static Local StringFromPath(Isolate* isolate, const char* path) { .ToLocalChecked(); } - Local UVException(Isolate* isolate, int errorno, const char* syscall, @@ -100,8 +99,7 @@ Local UVException(Isolate* isolate, const char* dest) { Environment* env = Environment::GetCurrent(isolate); - if (!msg || !msg[0]) - msg = uv_strerror(errorno); + if (!msg || !msg[0]) msg = uv_strerror(errorno); Local js_code = OneByteString(isolate, uv_err_name(errorno)); Local js_syscall = OneByteString(isolate, syscall); @@ -136,13 +134,12 @@ Local UVException(Isolate* isolate, String::Concat(isolate, js_msg, FIXED_ONE_BYTE_STRING(isolate, "'")); } - Local e = - Exception::Error(js_msg)->ToObject(isolate->GetCurrentContext()) - .ToLocalChecked(); + Local e = Exception::Error(js_msg) + ->ToObject(isolate->GetCurrentContext()) + .ToLocalChecked(); - e->Set(env->context(), - env->errno_string(), - Integer::New(isolate, errorno)).FromJust(); + e->Set(env->context(), env->errno_string(), Integer::New(isolate, errorno)) + .FromJust(); e->Set(env->context(), env->code_string(), js_code).FromJust(); e->Set(env->context(), env->syscall_string(), js_syscall).FromJust(); if (!js_path.IsEmpty()) @@ -160,15 +157,21 @@ static const char* winapi_strerror(const int errorno, bool* must_free) { char* errmsg = nullptr; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, errorno, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&errmsg, 0, nullptr); + FORMAT_MESSAGE_IGNORE_INSERTS, + nullptr, + errorno, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR)&errmsg, + 0, + nullptr); if (errmsg) { *must_free = true; // Remove trailing newlines for (int i = strlen(errmsg) - 1; - i >= 0 && (errmsg[i] == '\n' || errmsg[i] == '\r'); i--) { + i >= 0 && (errmsg[i] == '\n' || errmsg[i] == '\r'); + i--) { errmsg[i] = '\0'; } @@ -180,7 +183,6 @@ static const char* winapi_strerror(const int errorno, bool* must_free) { } } - Local WinapiErrnoException(Isolate* isolate, int errorno, const char* syscall, @@ -222,8 +224,7 @@ Local WinapiErrnoException(Isolate* isolate, obj->Set(env->syscall_string(), OneByteString(isolate, syscall)); } - if (must_free) - LocalFree((HLOCAL)msg); + if (must_free) LocalFree((HLOCAL)msg); return e; } diff --git a/src/api/hooks.cc b/src/api/hooks.cc index b54292638ddf95..0633c8b7c8b095 100644 --- a/src/api/hooks.cc +++ b/src/api/hooks.cc @@ -1,7 +1,7 @@ +#include "async_wrap.h" #include "env-inl.h" #include "node.h" #include "node_process.h" -#include "async_wrap.h" namespace node { @@ -10,10 +10,10 @@ using v8::HandleScope; using v8::Integer; using v8::Isolate; using v8::Local; +using v8::NewStringType; using v8::Object; using v8::String; using v8::Value; -using v8::NewStringType; void RunAtExit(Environment* env) { env->RunAtExitCallbacks(); @@ -103,7 +103,6 @@ async_id AsyncHooksGetTriggerAsyncId(Isolate* isolate) { return env->trigger_async_id(); } - async_context EmitAsyncInit(Isolate* isolate, Local resource, const char* name, @@ -128,13 +127,13 @@ async_context EmitAsyncInit(Isolate* isolate, trigger_async_id = env->get_default_trigger_async_id(); async_context context = { - env->new_async_id(), // async_id_ - trigger_async_id // trigger_async_id_ + env->new_async_id(), // async_id_ + trigger_async_id // trigger_async_id_ }; // Run init hooks - AsyncWrap::EmitAsyncInit(env, resource, name, context.async_id, - context.trigger_async_id); + AsyncWrap::EmitAsyncInit( + env, resource, name, context.async_id, context.trigger_async_id); return context; } @@ -142,8 +141,8 @@ async_context EmitAsyncInit(Isolate* isolate, void EmitAsyncDestroy(Isolate* isolate, async_context asyncContext) { // Environment::GetCurrent() allocates a Local<> handle. HandleScope handle_scope(isolate); - AsyncWrap::EmitDestroy( - Environment::GetCurrent(isolate), asyncContext.async_id); + AsyncWrap::EmitDestroy(Environment::GetCurrent(isolate), + asyncContext.async_id); } } // namespace node diff --git a/src/async_wrap-inl.h b/src/async_wrap-inl.h index 4405bb3a9baa52..100b9351343faa 100644 --- a/src/async_wrap-inl.h +++ b/src/async_wrap-inl.h @@ -34,19 +34,15 @@ inline AsyncWrap::ProviderType AsyncWrap::provider_type() const { return provider_type_; } - inline double AsyncWrap::get_async_id() const { return async_id_; } - inline double AsyncWrap::get_trigger_async_id() const { return trigger_async_id_; } - -inline AsyncWrap::AsyncScope::AsyncScope(AsyncWrap* wrap) - : wrap_(wrap) { +inline AsyncWrap::AsyncScope::AsyncScope(AsyncWrap* wrap) : wrap_(wrap) { Environment* env = wrap->env(); if (env->async_hooks()->fields()[Environment::AsyncHooks::kBefore] == 0) return; @@ -60,27 +56,18 @@ inline AsyncWrap::AsyncScope::~AsyncScope() { EmitAfter(env, wrap_->get_async_id()); } - inline v8::MaybeLocal AsyncWrap::MakeCallback( - const v8::Local symbol, - int argc, - v8::Local* argv) { + const v8::Local symbol, int argc, v8::Local* argv) { return MakeCallback(symbol.As(), argc, argv); } - inline v8::MaybeLocal AsyncWrap::MakeCallback( - const v8::Local symbol, - int argc, - v8::Local* argv) { + const v8::Local symbol, int argc, v8::Local* argv) { return MakeCallback(symbol.As(), argc, argv); } - inline v8::MaybeLocal AsyncWrap::MakeCallback( - const v8::Local symbol, - int argc, - v8::Local* argv) { + const v8::Local symbol, int argc, v8::Local* argv) { v8::Local cb_v; if (!object()->Get(env()->context(), symbol).ToLocal(&cb_v)) return v8::MaybeLocal(); @@ -92,10 +79,9 @@ inline v8::MaybeLocal AsyncWrap::MakeCallback( return MakeCallback(cb_v.As(), argc, argv); } - // Defined here to avoid a circular dependency with env-inl.h. -inline Environment::AsyncHooks::DefaultTriggerAsyncIdScope - ::DefaultTriggerAsyncIdScope(AsyncWrap* async_wrap) +inline Environment::AsyncHooks::DefaultTriggerAsyncIdScope :: + DefaultTriggerAsyncIdScope(AsyncWrap* async_wrap) : DefaultTriggerAsyncIdScope(async_wrap->env(), async_wrap->get_async_id()) {} diff --git a/src/async_wrap.cc b/src/async_wrap.cc index 8f20d4f83705e3..7912c1317a4216 100644 --- a/src/async_wrap.cc +++ b/src/async_wrap.cc @@ -25,8 +25,8 @@ #include "tracing/traced_value.h" #include "util-inl.h" -#include "v8.h" #include "v8-profiler.h" +#include "v8.h" using v8::Context; using v8::DontDelete; @@ -61,13 +61,11 @@ using TryCatchScope = node::errors::TryCatchScope; namespace node { static const char* const provider_names[] = { -#define V(PROVIDER) \ - #PROVIDER, - NODE_ASYNC_PROVIDER_TYPES(V) +#define V(PROVIDER) #PROVIDER, + NODE_ASYNC_PROVIDER_TYPES(V) #undef V }; - struct AsyncWrapObject : public AsyncWrap { static inline void New(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -78,8 +76,10 @@ struct AsyncWrapObject : public AsyncWrap { new AsyncWrapObject(env, args.This(), type); } - inline AsyncWrapObject(Environment* env, Local object, - ProviderType type) : AsyncWrap(env, object, type) {} + inline AsyncWrapObject(Environment* env, + Local object, + ProviderType type) + : AsyncWrap(env, object, type) {} SET_NO_MEMORY_INFO() SET_MEMORY_INFO_NAME(AsyncWrapObject) @@ -103,18 +103,18 @@ void AsyncWrap::DestroyAsyncIdsCallback(Environment* env, void* data) { MaybeLocal ret = fn->Call( env->context(), Undefined(env->isolate()), 1, &async_id_value); - if (ret.IsEmpty()) - return; + if (ret.IsEmpty()) return; } } while (!env->destroy_async_id_list()->empty()); } -void Emit(Environment* env, double async_id, AsyncHooks::Fields type, +void Emit(Environment* env, + double async_id, + AsyncHooks::Fields type, Local fn) { AsyncHooks* async_hooks = env->async_hooks(); - if (async_hooks->fields()[type] == 0 || !env->can_call_into_js()) - return; + if (async_hooks->fields()[type] == 0 || !env->can_call_into_js()) return; HandleScope handle_scope(env->isolate()); Local async_id_value = Number::New(env->isolate(), async_id); @@ -122,21 +122,21 @@ void Emit(Environment* env, double async_id, AsyncHooks::Fields type, USE(fn->Call(env->context(), Undefined(env->isolate()), 1, &async_id_value)); } - void AsyncWrap::EmitPromiseResolve(Environment* env, double async_id) { - Emit(env, async_id, AsyncHooks::kPromiseResolve, + Emit(env, + async_id, + AsyncHooks::kPromiseResolve, env->async_hooks_promise_resolve_function()); } - void AsyncWrap::EmitTraceEventBefore() { switch (provider_type()) { -#define V(PROVIDER) \ - case PROVIDER_ ## PROVIDER: \ - TRACE_EVENT_NESTABLE_ASYNC_BEGIN0( \ - TRACING_CATEGORY_NODE1(async_hooks), \ - #PROVIDER "_CALLBACK", static_cast(get_async_id())); \ - break; +#define V(PROVIDER) \ + case PROVIDER_##PROVIDER: \ + TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(TRACING_CATEGORY_NODE1(async_hooks), \ + #PROVIDER "_CALLBACK", \ + static_cast(get_async_id())); \ + break; NODE_ASYNC_PROVIDER_TYPES(V) #undef V default: @@ -144,21 +144,18 @@ void AsyncWrap::EmitTraceEventBefore() { } } - void AsyncWrap::EmitBefore(Environment* env, double async_id) { - Emit(env, async_id, AsyncHooks::kBefore, - env->async_hooks_before_function()); + Emit(env, async_id, AsyncHooks::kBefore, env->async_hooks_before_function()); } - void AsyncWrap::EmitTraceEventAfter(ProviderType type, double async_id) { switch (type) { -#define V(PROVIDER) \ - case PROVIDER_ ## PROVIDER: \ - TRACE_EVENT_NESTABLE_ASYNC_END0( \ - TRACING_CATEGORY_NODE1(async_hooks), \ - #PROVIDER "_CALLBACK", static_cast(async_id)); \ - break; +#define V(PROVIDER) \ + case PROVIDER_##PROVIDER: \ + TRACE_EVENT_NESTABLE_ASYNC_END0(TRACING_CATEGORY_NODE1(async_hooks), \ + #PROVIDER "_CALLBACK", \ + static_cast(async_id)); \ + break; NODE_ASYNC_PROVIDER_TYPES(V) #undef V default: @@ -166,12 +163,10 @@ void AsyncWrap::EmitTraceEventAfter(ProviderType type, double async_id) { } } - void AsyncWrap::EmitAfter(Environment* env, double async_id) { // If the user's callback failed then the after() hooks will be called at the // end of _fatalException(). - Emit(env, async_id, AsyncHooks::kAfter, - env->async_hooks_after_function()); + Emit(env, async_id, AsyncHooks::kAfter, env->async_hooks_after_function()); } class PromiseWrap : public AsyncWrap { @@ -214,7 +209,7 @@ PromiseWrap* PromiseWrap::New(Environment* env, void PromiseWrap::getIsChainedPromise(Local property, const PropertyCallbackInfo& info) { info.GetReturnValue().Set( - info.Holder()->GetInternalField(kIsChainedPromiseField)); + info.Holder()->GetInternalField(kIsChainedPromiseField)); } static PromiseWrap* extractPromiseWrap(Local promise) { @@ -225,8 +220,10 @@ static PromiseWrap* extractPromiseWrap(Local promise) { return nullptr; } -static void PromiseHook(PromiseHookType type, Local promise, - Local parent, void* arg) { +static void PromiseHook(PromiseHookType type, + Local promise, + Local parent, + void* arg) { Environment* env = static_cast(arg); PromiseWrap* wrap = extractPromiseWrap(promise); if (type == PromiseHookType::kInit || wrap == nullptr) { @@ -254,8 +251,8 @@ static void PromiseHook(PromiseHookType type, Local promise, if (wrap == nullptr) return; if (type == PromiseHookType::kBefore) { - env->async_hooks()->push_async_ids( - wrap->get_async_id(), wrap->get_trigger_async_id()); + env->async_hooks()->push_async_ids(wrap->get_async_id(), + wrap->get_trigger_async_id()); wrap->EmitTraceEventBefore(); AsyncWrap::EmitBefore(wrap->env(), wrap->get_async_id()); } else if (type == PromiseHookType::kAfter) { @@ -274,7 +271,6 @@ static void PromiseHook(PromiseHookType type, Local promise, } } - static void SetupHooks(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -287,11 +283,12 @@ static void SetupHooks(const FunctionCallbackInfo& args) { Local fn_obj = args[0].As(); -#define SET_HOOK_FN(name) \ - Local name##_v = fn_obj->Get( \ - env->context(), \ - FIXED_ONE_BYTE_STRING(env->isolate(), #name)).ToLocalChecked(); \ - CHECK(name##_v->IsFunction()); \ +#define SET_HOOK_FN(name) \ + Local name##_v = \ + fn_obj \ + ->Get(env->context(), FIXED_ONE_BYTE_STRING(env->isolate(), #name)) \ + .ToLocalChecked(); \ + CHECK(name##_v->IsFunction()); \ env->set_async_hooks_##name##_function(name##_v.As()); SET_HOOK_FN(init); @@ -302,8 +299,7 @@ static void SetupHooks(const FunctionCallbackInfo& args) { #undef SET_HOOK_FN { - Local ctor = - FunctionTemplate::New(env->isolate()); + Local ctor = FunctionTemplate::New(env->isolate()); ctor->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "PromiseWrap")); Local promise_wrap_template = ctor->InstanceTemplate(); promise_wrap_template->SetInternalFieldCount( @@ -315,25 +311,24 @@ static void SetupHooks(const FunctionCallbackInfo& args) { } } - static void EnablePromiseHook(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); env->AddPromiseHook(PromiseHook, static_cast(env)); } - static void DisablePromiseHook(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); // Delay the call to `RemovePromiseHook` because we might currently be // between the `before` and `after` calls of a Promise. - env->isolate()->EnqueueMicrotask([](void* data) { - Environment* env = static_cast(data); - env->RemovePromiseHook(PromiseHook, data); - }, static_cast(env)); + env->isolate()->EnqueueMicrotask( + [](void* data) { + Environment* env = static_cast(data); + env->RemovePromiseHook(PromiseHook, data); + }, + static_cast(env)); } - class DestroyParam { public: double asyncId; @@ -346,12 +341,12 @@ void AsyncWrap::WeakCallback(const WeakCallbackInfo& info) { HandleScope scope(info.GetIsolate()); std::unique_ptr p{info.GetParameter()}; - Local prop_bag = PersistentToLocal::Default(info.GetIsolate(), - p->propBag); + Local prop_bag = + PersistentToLocal::Default(info.GetIsolate(), p->propBag); Local val; if (!prop_bag->Get(p->env->context(), p->env->destroyed_string()) - .ToLocal(&val)) { + .ToLocal(&val)) { return; } @@ -361,7 +356,6 @@ void AsyncWrap::WeakCallback(const WeakCallbackInfo& info) { // unique_ptr goes out of scope here and pointer is deleted. } - static void RegisterDestroyHook(const FunctionCallbackInfo& args) { CHECK(args[0]->IsObject()); CHECK(args[1]->IsNumber()); @@ -376,7 +370,6 @@ static void RegisterDestroyHook(const FunctionCallbackInfo& args) { p->target.SetWeak(p, AsyncWrap::WeakCallback, WeakCallbackType::kParameter); } - void AsyncWrap::GetAsyncId(const FunctionCallbackInfo& args) { AsyncWrap* wrap; args.GetReturnValue().Set(-1); @@ -384,7 +377,6 @@ void AsyncWrap::GetAsyncId(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(wrap->get_async_id()); } - void AsyncWrap::PushAsyncIds(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); // No need for CHECK(IsNumber()) on args because if FromJust() doesn't fail @@ -394,14 +386,12 @@ void AsyncWrap::PushAsyncIds(const FunctionCallbackInfo& args) { env->async_hooks()->push_async_ids(async_id, trigger_async_id); } - void AsyncWrap::PopAsyncIds(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); double async_id = args[0]->NumberValue(env->context()).FromJust(); args.GetReturnValue().Set(env->async_hooks()->pop_async_id(async_id)); } - void AsyncWrap::AsyncReset(const FunctionCallbackInfo& args) { AsyncWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); @@ -410,12 +400,10 @@ void AsyncWrap::AsyncReset(const FunctionCallbackInfo& args) { wrap->AsyncReset(execution_async_id); } - void AsyncWrap::QueueDestroyAsyncId(const FunctionCallbackInfo& args) { CHECK(args[0]->IsNumber()); - AsyncWrap::EmitDestroy( - Environment::GetCurrent(args), - args[0].As()->Value()); + AsyncWrap::EmitDestroy(Environment::GetCurrent(args), + args[0].As()->Value()); } Local AsyncWrap::GetConstructorTemplate(Environment* env) { @@ -449,19 +437,20 @@ void AsyncWrap::Initialize(Local target, PropertyAttribute ReadOnlyDontDelete = static_cast(ReadOnly | DontDelete); -#define FORCE_SET_TARGET_FIELD(obj, str, field) \ - (obj)->DefineOwnProperty(context, \ - FIXED_ONE_BYTE_STRING(isolate, str), \ - field, \ - ReadOnlyDontDelete).FromJust() +#define FORCE_SET_TARGET_FIELD(obj, str, field) \ + (obj) \ + ->DefineOwnProperty(context, \ + FIXED_ONE_BYTE_STRING(isolate, str), \ + field, \ + ReadOnlyDontDelete) \ + .FromJust() // Attach the uint32_t[] where each slot contains the count of the number of // callbacks waiting to be called on a particular event. It can then be // incremented/decremented from JS quickly to communicate to C++ if there are // any callbacks waiting to be called. - FORCE_SET_TARGET_FIELD(target, - "async_hook_fields", - env->async_hooks()->fields().GetJSArray()); + FORCE_SET_TARGET_FIELD( + target, "async_hook_fields", env->async_hooks()->fields().GetJSArray()); // The following v8::Float64Array has 5 fields. These fields are shared in // this way to allow JS and C++ to read/write each value as quickly as @@ -477,17 +466,21 @@ void AsyncWrap::Initialize(Local target, "async_id_fields", env->async_hooks()->async_id_fields().GetJSArray()); - target->Set(context, - env->async_ids_stack_string(), - env->async_hooks()->async_ids_stack().GetJSArray()).FromJust(); + target + ->Set(context, + env->async_ids_stack_string(), + env->async_hooks()->async_ids_stack().GetJSArray()) + .FromJust(); - target->Set(context, - FIXED_ONE_BYTE_STRING(env->isolate(), "owner_symbol"), - env->owner_symbol()).FromJust(); + target + ->Set(context, + FIXED_ONE_BYTE_STRING(env->isolate(), "owner_symbol"), + env->owner_symbol()) + .FromJust(); Local constants = Object::New(isolate); -#define SET_HOOKS_CONSTANT(name) \ - FORCE_SET_TARGET_FIELD( \ +#define SET_HOOKS_CONSTANT(name) \ + FORCE_SET_TARGET_FIELD( \ constants, #name, Integer::New(isolate, AsyncHooks::name)); SET_HOOKS_CONSTANT(kInit); @@ -506,9 +499,9 @@ void AsyncWrap::Initialize(Local target, FORCE_SET_TARGET_FIELD(target, "constants", constants); Local async_providers = Object::New(isolate); -#define V(p) \ - FORCE_SET_TARGET_FIELD( \ - async_providers, #p, Integer::New(isolate, AsyncWrap::PROVIDER_ ## p)); +#define V(p) \ + FORCE_SET_TARGET_FIELD( \ + async_providers, #p, Integer::New(isolate, AsyncWrap::PROVIDER_##p)); NODE_ASYNC_PROVIDER_TYPES(V) #undef V FORCE_SET_TARGET_FIELD(target, "Providers", async_providers); @@ -539,7 +532,6 @@ void AsyncWrap::Initialize(Local target, } } - AsyncWrap::AsyncWrap(Environment* env, Local object, ProviderType provider, @@ -551,8 +543,7 @@ AsyncWrap::AsyncWrap(Environment* env, ProviderType provider, double execution_async_id, bool silent) - : BaseObject(env, object), - provider_type_(provider) { + : BaseObject(env, object), provider_type_(provider) { CHECK_NE(provider, PROVIDER_NONE); CHECK_GE(object->InternalFieldCount(), 1); @@ -560,7 +551,6 @@ AsyncWrap::AsyncWrap(Environment* env, AsyncReset(execution_async_id, silent); } - AsyncWrap::~AsyncWrap() { EmitTraceEventDestroy(); EmitDestroy(env(), get_async_id()); @@ -568,14 +558,14 @@ AsyncWrap::~AsyncWrap() { void AsyncWrap::EmitTraceEventDestroy() { switch (provider_type()) { - #define V(PROVIDER) \ - case PROVIDER_ ## PROVIDER: \ - TRACE_EVENT_NESTABLE_ASYNC_END0( \ - TRACING_CATEGORY_NODE1(async_hooks), \ - #PROVIDER, static_cast(get_async_id())); \ - break; +#define V(PROVIDER) \ + case PROVIDER_##PROVIDER: \ + TRACE_EVENT_NESTABLE_ASYNC_END0(TRACING_CATEGORY_NODE1(async_hooks), \ + #PROVIDER, \ + static_cast(get_async_id())); \ + break; NODE_ASYNC_PROVIDER_TYPES(V) - #undef V +#undef V default: UNREACHABLE(); } @@ -594,7 +584,6 @@ void AsyncWrap::EmitDestroy(Environment* env, double async_id) { env->destroy_async_id_list()->push_back(async_id); } - // Generalized call for both the constructor and for handles that are pooled // and reused over their lifetime. This way a new uid can be assigned when // the resource is pulled out of the pool and put back into use. @@ -608,25 +597,26 @@ void AsyncWrap::AsyncReset(double execution_async_id, bool silent) { // Now we can assign a new async_id_ to this instance. async_id_ = - execution_async_id == -1 ? env()->new_async_id() : execution_async_id; + execution_async_id == -1 ? env()->new_async_id() : execution_async_id; trigger_async_id_ = env()->get_default_trigger_async_id(); switch (provider_type()) { -#define V(PROVIDER) \ - case PROVIDER_ ## PROVIDER: \ - if (*TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( \ - TRACING_CATEGORY_NODE1(async_hooks))) { \ - auto data = tracing::TracedValue::Create(); \ - data->SetInteger("executionAsyncId", \ - static_cast(env()->execution_async_id())); \ - data->SetInteger("triggerAsyncId", \ - static_cast(get_trigger_async_id())); \ - TRACE_EVENT_NESTABLE_ASYNC_BEGIN1( \ - TRACING_CATEGORY_NODE1(async_hooks), \ - #PROVIDER, static_cast(get_async_id()), \ - "data", std::move(data)); \ - } \ - break; +#define V(PROVIDER) \ + case PROVIDER_##PROVIDER: \ + if (*TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( \ + TRACING_CATEGORY_NODE1(async_hooks))) { \ + auto data = tracing::TracedValue::Create(); \ + data->SetInteger("executionAsyncId", \ + static_cast(env()->execution_async_id())); \ + data->SetInteger("triggerAsyncId", \ + static_cast(get_trigger_async_id())); \ + TRACE_EVENT_NESTABLE_ASYNC_BEGIN1(TRACING_CATEGORY_NODE1(async_hooks), \ + #PROVIDER, \ + static_cast(get_async_id()), \ + "data", \ + std::move(data)); \ + } \ + break; NODE_ASYNC_PROVIDER_TYPES(V) #undef V default: @@ -635,12 +625,13 @@ void AsyncWrap::AsyncReset(double execution_async_id, bool silent) { if (silent) return; - EmitAsyncInit(env(), object(), + EmitAsyncInit(env(), + object(), env()->async_hooks()->provider_string(provider_type()), - async_id_, trigger_async_id_); + async_id_, + trigger_async_id_); } - void AsyncWrap::EmitAsyncInit(Environment* env, Local object, Local type, @@ -659,26 +650,25 @@ void AsyncWrap::EmitAsyncInit(Environment* env, Local init_fn = env->async_hooks_init_function(); Local argv[] = { - Number::New(env->isolate(), async_id), - type, - Number::New(env->isolate(), trigger_async_id), - object, + Number::New(env->isolate(), async_id), + type, + Number::New(env->isolate(), trigger_async_id), + object, }; TryCatchScope try_catch(env, TryCatchScope::CatchMode::kFatal); USE(init_fn->Call(env->context(), object, arraysize(argv), argv)); } - MaybeLocal AsyncWrap::MakeCallback(const Local cb, int argc, Local* argv) { EmitTraceEventBefore(); ProviderType provider = provider_type(); - async_context context { get_async_id(), get_trigger_async_id() }; - MaybeLocal ret = InternalMakeCallback( - env(), object(), cb, argc, argv, context); + async_context context{get_async_id(), get_trigger_async_id()}; + MaybeLocal ret = + InternalMakeCallback(env(), object(), cb, argc, argv, context); // This is a static call with cached values because the `this` object may // no longer be alive at this point. @@ -693,7 +683,7 @@ std::string AsyncWrap::MemoryInfoName() const { std::string AsyncWrap::diagnostic_name() const { return MemoryInfoName() + " (" + std::to_string(env()->thread_id()) + ":" + - std::to_string(static_cast(async_id_)) + ")"; + std::to_string(static_cast(async_id_)) + ")"; } Local AsyncWrap::GetOwner() { @@ -707,8 +697,7 @@ Local AsyncWrap::GetOwner(Environment* env, Local obj) { TryCatchScope ignore_exceptions(env); while (true) { Local owner; - if (!obj->Get(env->context(), - env->owner_symbol()).ToLocal(&owner) || + if (!obj->Get(env->context(), env->owner_symbol()).ToLocal(&owner) || !owner->IsObject()) { return handle_scope.Escape(obj); } diff --git a/src/async_wrap.h b/src/async_wrap.h index f7fc149c941ef0..d2ec0b1195cb5e 100644 --- a/src/async_wrap.h +++ b/src/async_wrap.h @@ -31,64 +31,63 @@ namespace node { -#define NODE_ASYNC_NON_CRYPTO_PROVIDER_TYPES(V) \ - V(NONE) \ - V(DNSCHANNEL) \ - V(FILEHANDLE) \ - V(FILEHANDLECLOSEREQ) \ - V(FSEVENTWRAP) \ - V(FSREQCALLBACK) \ - V(FSREQPROMISE) \ - V(GETADDRINFOREQWRAP) \ - V(GETNAMEINFOREQWRAP) \ - V(HTTP2SESSION) \ - V(HTTP2STREAM) \ - V(HTTP2PING) \ - V(HTTP2SETTINGS) \ - V(HTTPPARSER) \ - V(JSSTREAM) \ - V(MESSAGEPORT) \ - V(PIPECONNECTWRAP) \ - V(PIPESERVERWRAP) \ - V(PIPEWRAP) \ - V(PROCESSWRAP) \ - V(PROMISE) \ - V(QUERYWRAP) \ - V(SHUTDOWNWRAP) \ - V(SIGNALWRAP) \ - V(STATWATCHER) \ - V(STREAMPIPE) \ - V(TCPCONNECTWRAP) \ - V(TCPSERVERWRAP) \ - V(TCPWRAP) \ - V(TTYWRAP) \ - V(UDPSENDWRAP) \ - V(UDPWRAP) \ - V(WORKER) \ - V(WRITEWRAP) \ +#define NODE_ASYNC_NON_CRYPTO_PROVIDER_TYPES(V) \ + V(NONE) \ + V(DNSCHANNEL) \ + V(FILEHANDLE) \ + V(FILEHANDLECLOSEREQ) \ + V(FSEVENTWRAP) \ + V(FSREQCALLBACK) \ + V(FSREQPROMISE) \ + V(GETADDRINFOREQWRAP) \ + V(GETNAMEINFOREQWRAP) \ + V(HTTP2SESSION) \ + V(HTTP2STREAM) \ + V(HTTP2PING) \ + V(HTTP2SETTINGS) \ + V(HTTPPARSER) \ + V(JSSTREAM) \ + V(MESSAGEPORT) \ + V(PIPECONNECTWRAP) \ + V(PIPESERVERWRAP) \ + V(PIPEWRAP) \ + V(PROCESSWRAP) \ + V(PROMISE) \ + V(QUERYWRAP) \ + V(SHUTDOWNWRAP) \ + V(SIGNALWRAP) \ + V(STATWATCHER) \ + V(STREAMPIPE) \ + V(TCPCONNECTWRAP) \ + V(TCPSERVERWRAP) \ + V(TCPWRAP) \ + V(TTYWRAP) \ + V(UDPSENDWRAP) \ + V(UDPWRAP) \ + V(WORKER) \ + V(WRITEWRAP) \ V(ZLIB) #if HAVE_OPENSSL -#define NODE_ASYNC_CRYPTO_PROVIDER_TYPES(V) \ - V(PBKDF2REQUEST) \ - V(KEYPAIRGENREQUEST) \ - V(RANDOMBYTESREQUEST) \ - V(SCRYPTREQUEST) \ +#define NODE_ASYNC_CRYPTO_PROVIDER_TYPES(V) \ + V(PBKDF2REQUEST) \ + V(KEYPAIRGENREQUEST) \ + V(RANDOMBYTESREQUEST) \ + V(SCRYPTREQUEST) \ V(TLSWRAP) #else #define NODE_ASYNC_CRYPTO_PROVIDER_TYPES(V) #endif // HAVE_OPENSSL #if HAVE_INSPECTOR -#define NODE_ASYNC_INSPECTOR_PROVIDER_TYPES(V) \ - V(INSPECTORJSBINDING) +#define NODE_ASYNC_INSPECTOR_PROVIDER_TYPES(V) V(INSPECTORJSBINDING) #else #define NODE_ASYNC_INSPECTOR_PROVIDER_TYPES(V) #endif // HAVE_INSPECTOR -#define NODE_ASYNC_PROVIDER_TYPES(V) \ - NODE_ASYNC_NON_CRYPTO_PROVIDER_TYPES(V) \ - NODE_ASYNC_CRYPTO_PROVIDER_TYPES(V) \ +#define NODE_ASYNC_PROVIDER_TYPES(V) \ + NODE_ASYNC_NON_CRYPTO_PROVIDER_TYPES(V) \ + NODE_ASYNC_CRYPTO_PROVIDER_TYPES(V) \ NODE_ASYNC_INSPECTOR_PROVIDER_TYPES(V) class Environment; @@ -97,11 +96,10 @@ class DestroyParam; class AsyncWrap : public BaseObject { public: enum ProviderType { -#define V(PROVIDER) \ - PROVIDER_ ## PROVIDER, +#define V(PROVIDER) PROVIDER_##PROVIDER, NODE_ASYNC_PROVIDER_TYPES(V) #undef V - PROVIDERS_LENGTH, + PROVIDERS_LENGTH, }; AsyncWrap(Environment* env, @@ -124,7 +122,7 @@ class AsyncWrap : public BaseObject { static void PopAsyncIds(const v8::FunctionCallbackInfo& args); static void AsyncReset(const v8::FunctionCallbackInfo& args); static void QueueDestroyAsyncId( - const v8::FunctionCallbackInfo& args); + const v8::FunctionCallbackInfo& args); static void EmitAsyncInit(Environment* env, v8::Local object, @@ -156,22 +154,16 @@ class AsyncWrap : public BaseObject { int argc, v8::Local* argv); inline v8::MaybeLocal MakeCallback( - const v8::Local symbol, - int argc, - v8::Local* argv); + const v8::Local symbol, int argc, v8::Local* argv); inline v8::MaybeLocal MakeCallback( - const v8::Local symbol, - int argc, - v8::Local* argv); + const v8::Local symbol, int argc, v8::Local* argv); inline v8::MaybeLocal MakeCallback( - const v8::Local symbol, - int argc, - v8::Local* argv); + const v8::Local symbol, int argc, v8::Local* argv); virtual std::string diagnostic_name() const; virtual std::string MemoryInfoName() const; - static void WeakCallback(const v8::WeakCallbackInfo &info); + static void WeakCallback(const v8::WeakCallbackInfo& info); // Returns the object that 'owns' an async wrap. For example, for a // TCP connection handle, this is the corresponding net.Socket. diff --git a/src/base64.h b/src/base64.h index aedec375eba550..a01045e4d536f3 100644 --- a/src/base64.h +++ b/src/base64.h @@ -34,47 +34,40 @@ static inline size_t base64_decoded_size_fast(size_t size) { template size_t base64_decoded_size(const TypeName* src, size_t size) { - if (size == 0) - return 0; + if (size == 0) return 0; - if (src[size - 1] == '=') - size--; - if (size > 0 && src[size - 1] == '=') - size--; + if (src[size - 1] == '=') size--; + if (size > 0 && src[size - 1] == '=') size--; return base64_decoded_size_fast(size); } - extern const int8_t unbase64_table[256]; - inline static int8_t unbase64(uint8_t x) { return unbase64_table[x]; } - template -bool base64_decode_group_slow(char* const dst, const size_t dstlen, - const TypeName* const src, const size_t srclen, - size_t* const i, size_t* const k) { +bool base64_decode_group_slow(char* const dst, + const size_t dstlen, + const TypeName* const src, + const size_t srclen, + size_t* const i, + size_t* const k) { uint8_t hi; uint8_t lo; -#define V(expr) \ - for (;;) { \ - const uint8_t c = src[*i]; \ - lo = unbase64(c); \ - *i += 1; \ - if (lo < 64) \ - break; /* Legal character. */ \ - if (c == '=' || *i >= srclen) \ - return false; /* Stop decoding. */ \ - } \ - expr; \ - if (*i >= srclen) \ - return false; \ - if (*k >= dstlen) \ - return false; \ +#define V(expr) \ + for (;;) { \ + const uint8_t c = src[*i]; \ + lo = unbase64(c); \ + *i += 1; \ + if (lo < 64) break; /* Legal character. */ \ + if (c == '=' || *i >= srclen) return false; /* Stop decoding. */ \ + } \ + expr; \ + if (*i >= srclen) return false; \ + if (*k >= dstlen) return false; \ hi = lo; V(/* Nothing. */); V(dst[(*k)++] = ((hi & 0x3F) << 2) | ((lo & 0x30) >> 4)); @@ -84,10 +77,11 @@ bool base64_decode_group_slow(char* const dst, const size_t dstlen, return true; // Continue decoding. } - template -size_t base64_decode_fast(char* const dst, const size_t dstlen, - const TypeName* const src, const size_t srclen, +size_t base64_decode_fast(char* const dst, + const size_t dstlen, + const TypeName* const src, + const size_t srclen, const size_t decoded_size) { const size_t available = dstlen < decoded_size ? dstlen : decoded_size; const size_t max_k = available / 3 * 3; @@ -95,20 +89,16 @@ size_t base64_decode_fast(char* const dst, const size_t dstlen, size_t i = 0; size_t k = 0; while (i < max_i && k < max_k) { - const uint32_t v = - unbase64(src[i + 0]) << 24 | - unbase64(src[i + 1]) << 16 | - unbase64(src[i + 2]) << 8 | - unbase64(src[i + 3]); + const uint32_t v = unbase64(src[i + 0]) << 24 | unbase64(src[i + 1]) << 16 | + unbase64(src[i + 2]) << 8 | unbase64(src[i + 3]); // If MSB is set, input contains whitespace or is not valid base64. if (v & 0x80808080) { - if (!base64_decode_group_slow(dst, dstlen, src, srclen, &i, &k)) - return k; + if (!base64_decode_group_slow(dst, dstlen, src, srclen, &i, &k)) return k; max_i = i + (srclen - i) / 4 * 4; // Align max_i again. } else { dst[k + 0] = ((v >> 22) & 0xFC) | ((v >> 20) & 0x03); dst[k + 1] = ((v >> 12) & 0xF0) | ((v >> 10) & 0x0F); - dst[k + 2] = ((v >> 2) & 0xC0) | ((v >> 0) & 0x3F); + dst[k + 2] = ((v >> 2) & 0xC0) | ((v >> 0) & 0x3F); i += 4; k += 3; } @@ -119,10 +109,11 @@ size_t base64_decode_fast(char* const dst, const size_t dstlen, return k; } - template -size_t base64_decode(char* const dst, const size_t dstlen, - const TypeName* const src, const size_t srclen) { +size_t base64_decode(char* const dst, + const size_t dstlen, + const TypeName* const src, + const size_t srclen) { const size_t decoded_size = base64_decoded_size(src, srclen); return base64_decode_fast(dst, dstlen, src, srclen, decoded_size); } @@ -191,7 +182,6 @@ static size_t base64_encode(const char* src, } } // namespace node - #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #endif // SRC_BASE64_H_ diff --git a/src/base_object-inl.h b/src/base_object-inl.h index f1f1498e6c6128..fdac976bcf7396 100644 --- a/src/base_object-inl.h +++ b/src/base_object-inl.h @@ -32,15 +32,13 @@ namespace node { BaseObject::BaseObject(Environment* env, v8::Local object) - : persistent_handle_(env->isolate(), object), - env_(env) { + : persistent_handle_(env->isolate(), object), env_(env) { CHECK_EQ(false, object.IsEmpty()); CHECK_GT(object->InternalFieldCount(), 0); object->SetAlignedPointerInInternalField(0, static_cast(this)); env_->AddCleanupHook(DeleteMe, static_cast(this)); } - BaseObject::~BaseObject() { env_->RemoveCleanupHook(DeleteMe, static_cast(this)); @@ -55,12 +53,10 @@ BaseObject::~BaseObject() { } } - Persistent& BaseObject::persistent() { return persistent_handle_; } - v8::Local BaseObject::object() const { return PersistentToLocal::Default(env_->isolate(), persistent_handle_); } @@ -78,19 +74,16 @@ Environment* BaseObject::env() const { return env_; } - BaseObject* BaseObject::FromJSObject(v8::Local obj) { CHECK_GT(obj->InternalFieldCount(), 0); return static_cast(obj->GetAlignedPointerFromInternalField(0)); } - template T* BaseObject::FromJSObject(v8::Local object) { return static_cast(FromJSObject(object)); } - void BaseObject::MakeWeak() { persistent_handle_.SetWeak( this, @@ -101,17 +94,16 @@ void BaseObject::MakeWeak() { // transitioned into an invalid state. // Refs: https://github.com/nodejs/node/issues/18897 obj->persistent_handle_.Reset(); - }, v8::WeakCallbackType::kParameter); + }, + v8::WeakCallbackType::kParameter); } - void BaseObject::ClearWeak() { persistent_handle_.ClearWeak(); } - -v8::Local -BaseObject::MakeLazilyInitializedJSTemplate(Environment* env) { +v8::Local BaseObject::MakeLazilyInitializedJSTemplate( + Environment* env) { auto constructor = [](const v8::FunctionCallbackInfo& args) { DCHECK(args.IsConstructCall()); DCHECK_GT(args.This()->InternalFieldCount(), 0); diff --git a/src/base_object.h b/src/base_object.h index e0f3f27950e7d0..86da5dbe2b98fb 100644 --- a/src/base_object.h +++ b/src/base_object.h @@ -24,10 +24,10 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "node_persistent.h" +#include // std::remove_reference #include "memory_tracker-inl.h" +#include "node_persistent.h" #include "v8.h" -#include // std::remove_reference namespace node { @@ -92,20 +92,17 @@ class BaseObject : public MemoryRetainer { Environment* env_; }; - // Global alias for FromJSObject() to avoid churn. template inline T* Unwrap(v8::Local obj) { return BaseObject::FromJSObject(obj); } - -#define ASSIGN_OR_RETURN_UNWRAP(ptr, obj, ...) \ - do { \ - *ptr = static_cast::type>( \ - BaseObject::FromJSObject(obj)); \ - if (*ptr == nullptr) \ - return __VA_ARGS__; \ +#define ASSIGN_OR_RETURN_UNWRAP(ptr, obj, ...) \ + do { \ + *ptr = static_cast::type>( \ + BaseObject::FromJSObject(obj)); \ + if (*ptr == nullptr) return __VA_ARGS__; \ } while (0) } // namespace node diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index 57c02fb32653e5..ece4913a602d3c 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -30,25 +30,23 @@ #include #include -#include #include +#include #ifdef __POSIX__ -# include +#include #endif // __POSIX__ -#if defined(__ANDROID__) || \ - defined(__MINGW32__) || \ - defined(__OpenBSD__) || \ +#if defined(__ANDROID__) || defined(__MINGW32__) || defined(__OpenBSD__) || \ defined(_MSC_VER) -# include +#include #else -# include +#include #endif #if defined(__OpenBSD__) -# define AI_V4MAPPED 0 +#define AI_V4MAPPED 0 #endif namespace node { @@ -79,8 +77,7 @@ inline uint16_t cares_get_16bit(const unsigned char* p) { inline uint32_t cares_get_32bit(const unsigned char* p) { return static_cast(p[0] << 24U) | static_cast(p[1] << 16U) | - static_cast(p[2] << 8U) | - static_cast(p[3]); + static_cast(p[2] << 8U) | static_cast(p[3]); } const int ns_t_cname_or_a = -1; @@ -88,7 +85,9 @@ const int ns_t_cname_or_a = -1; #define DNS_ESETSRVPENDING -1000 inline const char* ToErrorCodeString(int status) { switch (status) { -#define V(code) case ARES_##code: return #code; +#define V(code) \ + case ARES_##code: \ + return #code; V(EADDRGETNETWORKPARAMS) V(EBADFAMILY) V(EBADFLAGS) @@ -192,15 +191,14 @@ class ChannelWrap : public AsyncWrap { node_ares_task_list task_list_; }; -ChannelWrap::ChannelWrap(Environment* env, - Local object) - : AsyncWrap(env, object, PROVIDER_DNSCHANNEL), - timer_handle_(nullptr), - channel_(nullptr), - query_last_ok_(true), - is_servers_default_(true), - library_inited_(false), - active_query_count_(0) { +ChannelWrap::ChannelWrap(Environment* env, Local object) + : AsyncWrap(env, object, PROVIDER_DNSCHANNEL), + timer_handle_(nullptr), + channel_(nullptr), + query_last_ok_(true), + is_servers_default_(true), + library_inited_(false), + active_query_count_(0) { MakeWeak(); Setup(); @@ -233,10 +231,8 @@ class GetAddrInfoReqWrap : public ReqWrap { GetAddrInfoReqWrap::GetAddrInfoReqWrap(Environment* env, Local req_wrap_obj, bool verbatim) - : ReqWrap(env, req_wrap_obj, AsyncWrap::PROVIDER_GETADDRINFOREQWRAP) - , verbatim_(verbatim) { -} - + : ReqWrap(env, req_wrap_obj, AsyncWrap::PROVIDER_GETADDRINFOREQWRAP), + verbatim_(verbatim) {} class GetNameInfoReqWrap : public ReqWrap { public: @@ -249,9 +245,7 @@ class GetNameInfoReqWrap : public ReqWrap { GetNameInfoReqWrap::GetNameInfoReqWrap(Environment* env, Local req_wrap_obj) - : ReqWrap(env, req_wrap_obj, AsyncWrap::PROVIDER_GETNAMEINFOREQWRAP) { -} - + : ReqWrap(env, req_wrap_obj, AsyncWrap::PROVIDER_GETNAMEINFOREQWRAP) {} /* This is called once per second by loop->timer. It is used to constantly */ /* call back into c-ares for possibly processing timeouts. */ @@ -262,7 +256,6 @@ void ChannelWrap::AresTimeout(uv_timer_t* handle) { ares_process_fd(channel->cares_channel(), ARES_SOCKET_BAD, ARES_SOCKET_BAD); } - void ares_poll_cb(uv_poll_t* watcher, int status, int events) { node_ares_task* task = ContainerOf(&node_ares_task::poll_watcher, watcher); ChannelWrap* channel = task->channel; @@ -283,7 +276,6 @@ void ares_poll_cb(uv_poll_t* watcher, int status, int events) { events & UV_WRITABLE ? task->sock : ARES_SOCKET_BAD); } - void ares_poll_close_cb(uv_poll_t* watcher) { node_ares_task* task = ContainerOf(&node_ares_task::poll_watcher, watcher); delete task; @@ -305,8 +297,8 @@ node_ares_task* ares_task_create(ChannelWrap* channel, ares_socket_t sock) { task->channel = channel; task->sock = sock; - if (uv_poll_init_socket(channel->env()->event_loop(), - &task->poll_watcher, sock) < 0) { + if (uv_poll_init_socket( + channel->env()->event_loop(), &task->poll_watcher, sock) < 0) { /* This should never happen. */ free(task); return nullptr; @@ -315,12 +307,8 @@ node_ares_task* ares_task_create(ChannelWrap* channel, ares_socket_t sock) { return task; } - /* Callback from ares when socket operation is started */ -void ares_sockstate_cb(void* data, - ares_socket_t sock, - int read, - int write) { +void ares_sockstate_cb(void* data, ares_socket_t sock, int read, int write) { ChannelWrap* channel = static_cast(data); node_ares_task* task; @@ -368,7 +356,6 @@ void ares_sockstate_cb(void* data, } } - Local HostentToNames(Environment* env, struct hostent* host, Local append_to = Local()) { @@ -428,9 +415,7 @@ void cares_wrap_hostent_cpy(struct hostent* dest, struct hostent* src) { /* copy `h_aliases` */ size_t alias_count; - for (alias_count = 0; - src->h_aliases[alias_count] != nullptr; - alias_count++) { + for (alias_count = 0; src->h_aliases[alias_count] != nullptr; alias_count++) { } dest->h_aliases = node::Malloc(alias_count + 1); @@ -443,9 +428,7 @@ void cares_wrap_hostent_cpy(struct hostent* dest, struct hostent* src) { /* copy `h_addr_list` */ size_t list_count; - for (list_count = 0; - src->h_addr_list[list_count] != nullptr; - list_count++) { + for (list_count = 0; src->h_addr_list[list_count] != nullptr; list_count++) { } dest->h_addr_list = node::Malloc(list_count + 1); @@ -487,14 +470,12 @@ void ChannelWrap::Setup() { // Multiple calls to ares_library_init() increase a reference counter, // so this is a no-op except for the first call to it. r = ares_library_init(ARES_LIB_INIT_ALL); - if (r != ARES_SUCCESS) - return env()->ThrowError(ToErrorCodeString(r)); + if (r != ARES_SUCCESS) return env()->ThrowError(ToErrorCodeString(r)); } /* We do the call to ares_init_option for caller. */ - r = ares_init_options(&channel_, - &options, - ARES_OPT_FLAGS | ARES_OPT_SOCK_STATE_CB); + r = ares_init_options( + &channel_, &options, ARES_OPT_FLAGS | ARES_OPT_SOCK_STATE_CB); if (r != ARES_SUCCESS) { Mutex::ScopedLock lock(ares_library_mutex); @@ -517,8 +498,7 @@ void ChannelWrap::StartTimer() { } void ChannelWrap::CloseTimer() { - if (timer_handle_ == nullptr) - return; + if (timer_handle_ == nullptr) return; env()->CloseHandle(timer_handle_, [](uv_timer_t* handle) { delete handle; }); timer_handle_ = nullptr; @@ -535,13 +515,11 @@ ChannelWrap::~ChannelWrap() { CloseTimer(); } - void ChannelWrap::ModifyActivityQueryCount(int count) { active_query_count_ += count; if (active_query_count_ < 0) active_query_count_ = 0; } - /** * This function is to check whether current servers are fallback servers * when cares initialized. @@ -570,8 +548,7 @@ void ChannelWrap::EnsureServers() { /* if the only server is not 127.0.0.1, ignore */ if (servers[0].family != AF_INET || servers[0].addr.addr4.s_addr != htonl(INADDR_LOOPBACK) || - servers[0].tcp_port != 0 || - servers[0].udp_port != 0) { + servers[0].tcp_port != 0 || servers[0].udp_port != 0) { ares_free_data(servers); is_servers_default_ = false; return; @@ -587,7 +564,6 @@ void ChannelWrap::EnsureServers() { Setup(); } - class QueryWrap : public AsyncWrap { public: QueryWrap(ChannelWrap* channel, Local req_wrap_obj, const char* name) @@ -595,14 +571,12 @@ class QueryWrap : public AsyncWrap { channel_(channel), trace_name_(name) { // Make sure the channel object stays alive during the query lifetime. - req_wrap_obj->Set(env()->context(), - env()->channel_string(), - channel->object()).FromJust(); + req_wrap_obj + ->Set(env()->context(), env()->channel_string(), channel->object()) + .FromJust(); } - ~QueryWrap() override { - CHECK_EQ(false, persistent().IsEmpty()); - } + ~QueryWrap() override { CHECK_EQ(false, persistent().IsEmpty()); } // Subclasses should implement the appropriate Send method. virtual int Send(const char* name) { @@ -616,14 +590,18 @@ class QueryWrap : public AsyncWrap { } protected: - void AresQuery(const char* name, - int dnsclass, - int type) { + void AresQuery(const char* name, int dnsclass, int type) { channel_->EnsureServers(); - TRACE_EVENT_NESTABLE_ASYNC_BEGIN1( - TRACING_CATEGORY_NODE2(dns, native), trace_name_, this, - "name", TRACE_STR_COPY(name)); - ares_query(channel_->cares_channel(), name, dnsclass, type, Callback, + TRACE_EVENT_NESTABLE_ASYNC_BEGIN1(TRACING_CATEGORY_NODE2(dns, native), + trace_name_, + this, + "name", + TRACE_STR_COPY(name)); + ares_query(channel_->cares_channel(), + name, + dnsclass, + type, + Callback, static_cast(this)); } @@ -655,8 +633,11 @@ class QueryWrap : public AsyncWrap { wrap->env()->CloseHandle(handle, CaresAsyncClose); } - static void Callback(void* arg, int status, int timeouts, - unsigned char* answer_buf, int answer_len) { + static void Callback(void* arg, + int status, + int timeouts, + unsigned char* answer_buf, + int answer_len) { QueryWrap* wrap = static_cast(arg); unsigned char* buf_copy = nullptr; @@ -673,9 +654,9 @@ class QueryWrap : public AsyncWrap { data->len = answer_len; uv_async_t* async_handle = &data->async_handle; - CHECK_EQ(0, uv_async_init(wrap->env()->event_loop(), - async_handle, - CaresAsyncCb)); + CHECK_EQ( + 0, + uv_async_init(wrap->env()->event_loop(), async_handle, CaresAsyncCb)); wrap->channel_->set_query_last_ok(status != ARES_ECONNREFUSED); wrap->channel_->ModifyActivityQueryCount(-1); @@ -683,7 +664,9 @@ class QueryWrap : public AsyncWrap { uv_async_send(async_handle); } - static void Callback(void* arg, int status, int timeouts, + static void Callback(void* arg, + int status, + int timeouts, struct hostent* host) { QueryWrap* wrap = static_cast(arg); @@ -700,9 +683,9 @@ class QueryWrap : public AsyncWrap { data->is_host = true; uv_async_t* async_handle = &data->async_handle; - CHECK_EQ(0, uv_async_init(wrap->env()->event_loop(), - async_handle, - CaresAsyncCb)); + CHECK_EQ( + 0, + uv_async_init(wrap->env()->event_loop(), async_handle, CaresAsyncCb)); wrap->channel_->set_query_last_ok(status != ARES_ECONNREFUSED); async_handle->data = data; @@ -713,11 +696,7 @@ class QueryWrap : public AsyncWrap { Local extra = Local()) { HandleScope handle_scope(env()->isolate()); Context::Scope context_scope(env()->context()); - Local argv[] = { - Integer::New(env()->isolate(), 0), - answer, - extra - }; + Local argv[] = {Integer::New(env()->isolate(), 0), answer, extra}; const int argc = arraysize(argv) - extra.IsEmpty(); TRACE_EVENT_NESTABLE_ASYNC_END0( TRACING_CATEGORY_NODE2(dns, native), trace_name_, this); @@ -731,20 +710,18 @@ class QueryWrap : public AsyncWrap { Context::Scope context_scope(env()->context()); const char* code = ToErrorCodeString(status); Local arg = OneByteString(env()->isolate(), code); - TRACE_EVENT_NESTABLE_ASYNC_END1( - TRACING_CATEGORY_NODE2(dns, native), trace_name_, this, - "error", status); + TRACE_EVENT_NESTABLE_ASYNC_END1(TRACING_CATEGORY_NODE2(dns, native), + trace_name_, + this, + "error", + status); MakeCallback(env()->oncomplete_string(), 1, &arg); } // Subclasses should implement the appropriate Parse method. - virtual void Parse(unsigned char* buf, int len) { - UNREACHABLE(); - } + virtual void Parse(unsigned char* buf, int len) { UNREACHABLE(); } - virtual void Parse(struct hostent* host) { - UNREACHABLE(); - } + virtual void Parse(struct hostent* host) { UNREACHABLE(); } ChannelWrap* channel_; @@ -752,7 +729,6 @@ class QueryWrap : public AsyncWrap { const char* trace_name_; }; - template Local AddrTTLToArray(Environment* env, const T* addrttls, @@ -770,7 +746,6 @@ Local AddrTTLToArray(Environment* env, return escapable_handle_scope.Escape(ttls); } - int ParseGeneralReply(Environment* env, const unsigned char* buf, int len, @@ -787,18 +762,12 @@ int ParseGeneralReply(Environment* env, case ns_t_a: case ns_t_cname: case ns_t_cname_or_a: - status = ares_parse_a_reply(buf, - len, - &host, - static_cast(addrttls), - naddrttls); + status = ares_parse_a_reply( + buf, len, &host, static_cast(addrttls), naddrttls); break; case ns_t_aaaa: - status = ares_parse_aaaa_reply(buf, - len, - &host, - static_cast(addrttls), - naddrttls); + status = ares_parse_aaaa_reply( + buf, len, &host, static_cast(addrttls), naddrttls); break; case ns_t_ns: status = ares_parse_ns_reply(buf, len, &host); @@ -811,8 +780,7 @@ int ParseGeneralReply(Environment* env, break; } - if (status != ARES_SUCCESS) - return status; + if (status != ARES_SUCCESS) return status; /* If it's `CNAME`, return the CNAME value; * And if it's `CNAME_OR_A` and it has value in `h_name` and `h_aliases[0]`, @@ -822,15 +790,14 @@ int ParseGeneralReply(Environment* env, // A cname lookup always returns a single record but we follow the // common API here. *type = ns_t_cname; - ret->Set(context, - ret->Length(), - OneByteString(env->isolate(), host->h_name)).FromJust(); + ret->Set( + context, ret->Length(), OneByteString(env->isolate(), host->h_name)) + .FromJust(); ares_free_hostent(host); return ARES_SUCCESS; } - if (*type == ns_t_cname_or_a) - *type = ns_t_a; + if (*type == ns_t_cname_or_a) *type = ns_t_a; if (*type == ns_t_ns) { HostentToNames(env, host, ret); @@ -855,7 +822,6 @@ int ParseGeneralReply(Environment* env, return ARES_SUCCESS; } - int ParseMxReply(Environment* env, const unsigned char* buf, int len, @@ -874,16 +840,19 @@ int ParseMxReply(Environment* env, ares_mx_reply* current = mx_start; for (uint32_t i = 0; current != nullptr; ++i, current = current->next) { Local mx_record = Object::New(env->isolate()); - mx_record->Set(context, - env->exchange_string(), - OneByteString(env->isolate(), current->host)).FromJust(); - mx_record->Set(context, - env->priority_string(), - Integer::New(env->isolate(), current->priority)).FromJust(); + mx_record + ->Set(context, + env->exchange_string(), + OneByteString(env->isolate(), current->host)) + .FromJust(); + mx_record + ->Set(context, + env->priority_string(), + Integer::New(env->isolate(), current->priority)) + .FromJust(); if (need_type) - mx_record->Set(context, - env->type_string(), - env->dns_mx_string()).FromJust(); + mx_record->Set(context, env->type_string(), env->dns_mx_string()) + .FromJust(); ret->Set(context, i + offset, mx_record).FromJust(); } @@ -921,9 +890,8 @@ int ParseTxtReply(Environment* env, if (need_type) { Local elem = Object::New(env->isolate()); elem->Set(context, env->entries_string(), txt_chunk).FromJust(); - elem->Set(context, - env->type_string(), - env->dns_txt_string()).FromJust(); + elem->Set(context, env->type_string(), env->dns_txt_string()) + .FromJust(); ret->Set(context, offset + i++, elem).FromJust(); } else { ret->Set(context, offset + i++, txt_chunk).FromJust(); @@ -942,9 +910,7 @@ int ParseTxtReply(Environment* env, if (need_type) { Local elem = Object::New(env->isolate()); elem->Set(context, env->entries_string(), txt_chunk).FromJust(); - elem->Set(context, - env->type_string(), - env->dns_txt_string()).FromJust(); + elem->Set(context, env->type_string(), env->dns_txt_string()).FromJust(); ret->Set(context, offset + i, elem).FromJust(); } else { ret->Set(context, offset + i, txt_chunk).FromJust(); @@ -955,7 +921,6 @@ int ParseTxtReply(Environment* env, return ARES_SUCCESS; } - int ParseSrvReply(Environment* env, const unsigned char* buf, int len, @@ -974,22 +939,29 @@ int ParseSrvReply(Environment* env, int offset = ret->Length(); for (uint32_t i = 0; current != nullptr; ++i, current = current->next) { Local srv_record = Object::New(env->isolate()); - srv_record->Set(context, - env->name_string(), - OneByteString(env->isolate(), current->host)).FromJust(); - srv_record->Set(context, - env->port_string(), - Integer::New(env->isolate(), current->port)).FromJust(); - srv_record->Set(context, - env->priority_string(), - Integer::New(env->isolate(), current->priority)).FromJust(); - srv_record->Set(context, - env->weight_string(), - Integer::New(env->isolate(), current->weight)).FromJust(); + srv_record + ->Set(context, + env->name_string(), + OneByteString(env->isolate(), current->host)) + .FromJust(); + srv_record + ->Set(context, + env->port_string(), + Integer::New(env->isolate(), current->port)) + .FromJust(); + srv_record + ->Set(context, + env->priority_string(), + Integer::New(env->isolate(), current->priority)) + .FromJust(); + srv_record + ->Set(context, + env->weight_string(), + Integer::New(env->isolate(), current->weight)) + .FromJust(); if (need_type) - srv_record->Set(context, - env->type_string(), - env->dns_srv_string()).FromJust(); + srv_record->Set(context, env->type_string(), env->dns_srv_string()) + .FromJust(); ret->Set(context, i + offset, srv_record).FromJust(); } @@ -998,7 +970,6 @@ int ParseSrvReply(Environment* env, return ARES_SUCCESS; } - int ParseNaptrReply(Environment* env, const unsigned char* buf, int len, @@ -1018,32 +989,39 @@ int ParseNaptrReply(Environment* env, int offset = ret->Length(); for (uint32_t i = 0; current != nullptr; ++i, current = current->next) { Local naptr_record = Object::New(env->isolate()); - naptr_record->Set(context, - env->flags_string(), - OneByteString(env->isolate(), current->flags)).FromJust(); - naptr_record->Set(context, - env->service_string(), - OneByteString(env->isolate(), - current->service)).FromJust(); - naptr_record->Set(context, - env->regexp_string(), - OneByteString(env->isolate(), - current->regexp)).FromJust(); - naptr_record->Set(context, - env->replacement_string(), - OneByteString(env->isolate(), - current->replacement)).FromJust(); - naptr_record->Set(context, - env->order_string(), - Integer::New(env->isolate(), current->order)).FromJust(); - naptr_record->Set(context, - env->preference_string(), - Integer::New(env->isolate(), - current->preference)).FromJust(); + naptr_record + ->Set(context, + env->flags_string(), + OneByteString(env->isolate(), current->flags)) + .FromJust(); + naptr_record + ->Set(context, + env->service_string(), + OneByteString(env->isolate(), current->service)) + .FromJust(); + naptr_record + ->Set(context, + env->regexp_string(), + OneByteString(env->isolate(), current->regexp)) + .FromJust(); + naptr_record + ->Set(context, + env->replacement_string(), + OneByteString(env->isolate(), current->replacement)) + .FromJust(); + naptr_record + ->Set(context, + env->order_string(), + Integer::New(env->isolate(), current->order)) + .FromJust(); + naptr_record + ->Set(context, + env->preference_string(), + Integer::New(env->isolate(), current->preference)) + .FromJust(); if (need_type) - naptr_record->Set(context, - env->type_string(), - env->dns_naptr_string()).FromJust(); + naptr_record->Set(context, env->type_string(), env->dns_naptr_string()) + .FromJust(); ret->Set(context, i + offset, naptr_record).FromJust(); } @@ -1052,7 +1030,6 @@ int ParseNaptrReply(Environment* env, return ARES_SUCCESS; } - int ParseSoaReply(Environment* env, unsigned char* buf, int len, @@ -1106,9 +1083,8 @@ int ParseSoaReply(Environment* env, char* nsname_temp; long nsname_temp_len; // NOLINT(runtime/int) - int status3 = ares_expand_name(ptr, buf, len, - &nsname_temp, - &nsname_temp_len); + int status3 = + ares_expand_name(ptr, buf, len, &nsname_temp, &nsname_temp_len); const ares_unique_ptr nsname(nsname_temp); if (status3 != ARES_SUCCESS) { return status3 == ARES_EBADNAME ? ARES_EBADRESP : status3; @@ -1117,9 +1093,8 @@ int ParseSoaReply(Environment* env, char* hostmaster_temp; long hostmaster_temp_len; // NOLINT(runtime/int) - int status4 = ares_expand_name(ptr, buf, len, - &hostmaster_temp, - &hostmaster_temp_len); + int status4 = ares_expand_name( + ptr, buf, len, &hostmaster_temp, &hostmaster_temp_len); const ares_unique_ptr hostmaster(hostmaster_temp); if (status4 != ARES_SUCCESS) { return status4 == ARES_EBADNAME ? ARES_EBADRESP : status4; @@ -1137,32 +1112,42 @@ int ParseSoaReply(Environment* env, const unsigned int minttl = cares_get_32bit(ptr + 4 * 4); Local soa_record = Object::New(env->isolate()); - soa_record->Set(context, - env->nsname_string(), - OneByteString(env->isolate(), nsname.get())).FromJust(); - soa_record->Set(context, - env->hostmaster_string(), - OneByteString(env->isolate(), - hostmaster.get())).FromJust(); - soa_record->Set(context, - env->serial_string(), - Integer::New(env->isolate(), serial)).FromJust(); - soa_record->Set(context, - env->refresh_string(), - Integer::New(env->isolate(), refresh)).FromJust(); - soa_record->Set(context, - env->retry_string(), - Integer::New(env->isolate(), retry)).FromJust(); - soa_record->Set(context, - env->expire_string(), - Integer::New(env->isolate(), expire)).FromJust(); - soa_record->Set(context, - env->minttl_string(), - Integer::New(env->isolate(), minttl)).FromJust(); - soa_record->Set(context, - env->type_string(), - env->dns_soa_string()).FromJust(); - + soa_record + ->Set(context, + env->nsname_string(), + OneByteString(env->isolate(), nsname.get())) + .FromJust(); + soa_record + ->Set(context, + env->hostmaster_string(), + OneByteString(env->isolate(), hostmaster.get())) + .FromJust(); + soa_record + ->Set(context, + env->serial_string(), + Integer::New(env->isolate(), serial)) + .FromJust(); + soa_record + ->Set(context, + env->refresh_string(), + Integer::New(env->isolate(), refresh)) + .FromJust(); + soa_record + ->Set( + context, env->retry_string(), Integer::New(env->isolate(), retry)) + .FromJust(); + soa_record + ->Set(context, + env->expire_string(), + Integer::New(env->isolate(), expire)) + .FromJust(); + soa_record + ->Set(context, + env->minttl_string(), + Integer::New(env->isolate(), minttl)) + .FromJust(); + soa_record->Set(context, env->type_string(), env->dns_soa_string()) + .FromJust(); *ret = handle_scope.Escape(soa_record); break; @@ -1174,12 +1159,10 @@ int ParseSoaReply(Environment* env, return ARES_SUCCESS; } - -class QueryAnyWrap: public QueryWrap { +class QueryAnyWrap : public QueryWrap { public: QueryAnyWrap(ChannelWrap* channel, Local req_wrap_obj) - : QueryWrap(channel, req_wrap_obj, "resolveAny") { - } + : QueryWrap(channel, req_wrap_obj, "resolveAny") {} int Send(const char* name) override { AresQuery(name, ns_c_in, ns_t_any); @@ -1204,13 +1187,8 @@ class QueryAnyWrap: public QueryWrap { int naddrttls = arraysize(addrttls); type = ns_t_cname_or_a; - status = ParseGeneralReply(env(), - buf, - len, - &type, - ret, - addrttls, - &naddrttls); + status = + ParseGeneralReply(env(), buf, len, &type, ret, addrttls, &naddrttls); uint32_t a_count = ret->Length(); if (status != ARES_SUCCESS && status != ARES_ENODATA) { ParseError(status); @@ -1223,13 +1201,14 @@ class QueryAnyWrap: public QueryWrap { Local obj = Object::New(env()->isolate()); obj->Set(context, env()->address_string(), - ret->Get(context, i).ToLocalChecked()).FromJust(); + ret->Get(context, i).ToLocalChecked()) + .FromJust(); obj->Set(context, env()->ttl_string(), - Integer::New(env()->isolate(), addrttls[i].ttl)).FromJust(); - obj->Set(context, - env()->type_string(), - env()->dns_a_string()).FromJust(); + Integer::New(env()->isolate(), addrttls[i].ttl)) + .FromJust(); + obj->Set(context, env()->type_string(), env()->dns_a_string()) + .FromJust(); ret->Set(context, i, obj).FromJust(); } } else { @@ -1237,10 +1216,10 @@ class QueryAnyWrap: public QueryWrap { Local obj = Object::New(env()->isolate()); obj->Set(context, env()->value_string(), - ret->Get(context, i).ToLocalChecked()).FromJust(); - obj->Set(context, - env()->type_string(), - env()->dns_cname_string()).FromJust(); + ret->Get(context, i).ToLocalChecked()) + .FromJust(); + obj->Set(context, env()->type_string(), env()->dns_cname_string()) + .FromJust(); ret->Set(context, i, obj).FromJust(); } } @@ -1250,13 +1229,8 @@ class QueryAnyWrap: public QueryWrap { int naddr6ttls = arraysize(addr6ttls); type = ns_t_aaaa; - status = ParseGeneralReply(env(), - buf, - len, - &type, - ret, - addr6ttls, - &naddr6ttls); + status = + ParseGeneralReply(env(), buf, len, &type, ret, addr6ttls, &naddr6ttls); uint32_t aaaa_count = ret->Length() - a_count; if (status != ARES_SUCCESS && status != ARES_ENODATA) { ParseError(status); @@ -1269,14 +1243,14 @@ class QueryAnyWrap: public QueryWrap { Local obj = Object::New(env()->isolate()); obj->Set(context, env()->address_string(), - ret->Get(context, i).ToLocalChecked()).FromJust(); + ret->Get(context, i).ToLocalChecked()) + .FromJust(); obj->Set(context, env()->ttl_string(), Integer::New(env()->isolate(), addr6ttls[i - a_count].ttl)) .FromJust(); - obj->Set(context, - env()->type_string(), - env()->dns_aaaa_string()).FromJust(); + obj->Set(context, env()->type_string(), env()->dns_aaaa_string()) + .FromJust(); ret->Set(context, i, obj).FromJust(); } @@ -1299,10 +1273,10 @@ class QueryAnyWrap: public QueryWrap { Local obj = Object::New(env()->isolate()); obj->Set(context, env()->value_string(), - ret->Get(context, i).ToLocalChecked()).FromJust(); - obj->Set(context, - env()->type_string(), - env()->dns_ns_string()).FromJust(); + ret->Get(context, i).ToLocalChecked()) + .FromJust(); + obj->Set(context, env()->type_string(), env()->dns_ns_string()) + .FromJust(); ret->Set(context, i, obj).FromJust(); } @@ -1327,10 +1301,10 @@ class QueryAnyWrap: public QueryWrap { Local obj = Object::New(env()->isolate()); obj->Set(context, env()->value_string(), - ret->Get(context, i).ToLocalChecked()).FromJust(); - obj->Set(context, - env()->type_string(), - env()->dns_ptr_string()).FromJust(); + ret->Get(context, i).ToLocalChecked()) + .FromJust(); + obj->Set(context, env()->type_string(), env()->dns_ptr_string()) + .FromJust(); ret->Set(context, i, obj).FromJust(); } @@ -1355,12 +1329,10 @@ class QueryAnyWrap: public QueryWrap { } }; - -class QueryAWrap: public QueryWrap { +class QueryAWrap : public QueryWrap { public: QueryAWrap(ChannelWrap* channel, Local req_wrap_obj) - : QueryWrap(channel, req_wrap_obj, "resolve4") { - } + : QueryWrap(channel, req_wrap_obj, "resolve4") {} int Send(const char* name) override { AresQuery(name, ns_c_in, ns_t_a); @@ -1381,32 +1353,24 @@ class QueryAWrap: public QueryWrap { Local ret = Array::New(env()->isolate()); int type = ns_t_a; - status = ParseGeneralReply(env(), - buf, - len, - &type, - ret, - addrttls, - &naddrttls); + status = + ParseGeneralReply(env(), buf, len, &type, ret, addrttls, &naddrttls); if (status != ARES_SUCCESS) { ParseError(status); return; } - Local ttls = AddrTTLToArray(env(), - addrttls, - naddrttls); + Local ttls = + AddrTTLToArray(env(), addrttls, naddrttls); CallOnComplete(ret, ttls); } }; - -class QueryAaaaWrap: public QueryWrap { +class QueryAaaaWrap : public QueryWrap { public: QueryAaaaWrap(ChannelWrap* channel, Local req_wrap_obj) - : QueryWrap(channel, req_wrap_obj, "resolve6") { - } + : QueryWrap(channel, req_wrap_obj, "resolve6") {} int Send(const char* name) override { AresQuery(name, ns_c_in, ns_t_aaaa); @@ -1427,32 +1391,24 @@ class QueryAaaaWrap: public QueryWrap { Local ret = Array::New(env()->isolate()); int type = ns_t_aaaa; - status = ParseGeneralReply(env(), - buf, - len, - &type, - ret, - addrttls, - &naddrttls); + status = + ParseGeneralReply(env(), buf, len, &type, ret, addrttls, &naddrttls); if (status != ARES_SUCCESS) { ParseError(status); return; } - Local ttls = AddrTTLToArray(env(), - addrttls, - naddrttls); + Local ttls = + AddrTTLToArray(env(), addrttls, naddrttls); CallOnComplete(ret, ttls); } }; - -class QueryCnameWrap: public QueryWrap { +class QueryCnameWrap : public QueryWrap { public: QueryCnameWrap(ChannelWrap* channel, Local req_wrap_obj) - : QueryWrap(channel, req_wrap_obj, "resolveCname") { - } + : QueryWrap(channel, req_wrap_obj, "resolveCname") {} int Send(const char* name) override { AresQuery(name, ns_c_in, ns_t_cname); @@ -1480,12 +1436,10 @@ class QueryCnameWrap: public QueryWrap { } }; - -class QueryMxWrap: public QueryWrap { +class QueryMxWrap : public QueryWrap { public: QueryMxWrap(ChannelWrap* channel, Local req_wrap_obj) - : QueryWrap(channel, req_wrap_obj, "resolveMx") { - } + : QueryWrap(channel, req_wrap_obj, "resolveMx") {} int Send(const char* name) override { AresQuery(name, ns_c_in, ns_t_mx); @@ -1513,12 +1467,10 @@ class QueryMxWrap: public QueryWrap { } }; - -class QueryNsWrap: public QueryWrap { +class QueryNsWrap : public QueryWrap { public: QueryNsWrap(ChannelWrap* channel, Local req_wrap_obj) - : QueryWrap(channel, req_wrap_obj, "resolveNs") { - } + : QueryWrap(channel, req_wrap_obj, "resolveNs") {} int Send(const char* name) override { AresQuery(name, ns_c_in, ns_t_ns); @@ -1546,12 +1498,10 @@ class QueryNsWrap: public QueryWrap { } }; - -class QueryTxtWrap: public QueryWrap { +class QueryTxtWrap : public QueryWrap { public: QueryTxtWrap(ChannelWrap* channel, Local req_wrap_obj) - : QueryWrap(channel, req_wrap_obj, "resolveTxt") { - } + : QueryWrap(channel, req_wrap_obj, "resolveTxt") {} int Send(const char* name) override { AresQuery(name, ns_c_in, ns_t_txt); @@ -1578,12 +1528,10 @@ class QueryTxtWrap: public QueryWrap { } }; - -class QuerySrvWrap: public QueryWrap { +class QuerySrvWrap : public QueryWrap { public: explicit QuerySrvWrap(ChannelWrap* channel, Local req_wrap_obj) - : QueryWrap(channel, req_wrap_obj, "resolveSrv") { - } + : QueryWrap(channel, req_wrap_obj, "resolveSrv") {} int Send(const char* name) override { AresQuery(name, ns_c_in, ns_t_srv); @@ -1610,11 +1558,10 @@ class QuerySrvWrap: public QueryWrap { } }; -class QueryPtrWrap: public QueryWrap { +class QueryPtrWrap : public QueryWrap { public: explicit QueryPtrWrap(ChannelWrap* channel, Local req_wrap_obj) - : QueryWrap(channel, req_wrap_obj, "resolvePtr") { - } + : QueryWrap(channel, req_wrap_obj, "resolvePtr") {} int Send(const char* name) override { AresQuery(name, ns_c_in, ns_t_ptr); @@ -1643,11 +1590,10 @@ class QueryPtrWrap: public QueryWrap { } }; -class QueryNaptrWrap: public QueryWrap { +class QueryNaptrWrap : public QueryWrap { public: explicit QueryNaptrWrap(ChannelWrap* channel, Local req_wrap_obj) - : QueryWrap(channel, req_wrap_obj, "resolveNaptr") { - } + : QueryWrap(channel, req_wrap_obj, "resolveNaptr") {} int Send(const char* name) override { AresQuery(name, ns_c_in, ns_t_naptr); @@ -1674,12 +1620,10 @@ class QueryNaptrWrap: public QueryWrap { } }; - -class QuerySoaWrap: public QueryWrap { +class QuerySoaWrap : public QueryWrap { public: QuerySoaWrap(ChannelWrap* channel, Local req_wrap_obj) - : QueryWrap(channel, req_wrap_obj, "resolveSoa") { - } + : QueryWrap(channel, req_wrap_obj, "resolveSoa") {} int Send(const char* name) override { AresQuery(name, ns_c_in, ns_t_soa); @@ -1706,30 +1650,41 @@ class QuerySoaWrap: public QueryWrap { Local soa_record = Object::New(env()->isolate()); - soa_record->Set(context, - env()->nsname_string(), - OneByteString(env()->isolate(), - soa_out->nsname)).FromJust(); - soa_record->Set(context, - env()->hostmaster_string(), - OneByteString(env()->isolate(), - soa_out->hostmaster)).FromJust(); - soa_record->Set(context, - env()->serial_string(), - Integer::New(env()->isolate(), soa_out->serial)).FromJust(); - soa_record->Set(context, - env()->refresh_string(), - Integer::New(env()->isolate(), - soa_out->refresh)).FromJust(); - soa_record->Set(context, - env()->retry_string(), - Integer::New(env()->isolate(), soa_out->retry)).FromJust(); - soa_record->Set(context, - env()->expire_string(), - Integer::New(env()->isolate(), soa_out->expire)).FromJust(); - soa_record->Set(context, - env()->minttl_string(), - Integer::New(env()->isolate(), soa_out->minttl)).FromJust(); + soa_record + ->Set(context, + env()->nsname_string(), + OneByteString(env()->isolate(), soa_out->nsname)) + .FromJust(); + soa_record + ->Set(context, + env()->hostmaster_string(), + OneByteString(env()->isolate(), soa_out->hostmaster)) + .FromJust(); + soa_record + ->Set(context, + env()->serial_string(), + Integer::New(env()->isolate(), soa_out->serial)) + .FromJust(); + soa_record + ->Set(context, + env()->refresh_string(), + Integer::New(env()->isolate(), soa_out->refresh)) + .FromJust(); + soa_record + ->Set(context, + env()->retry_string(), + Integer::New(env()->isolate(), soa_out->retry)) + .FromJust(); + soa_record + ->Set(context, + env()->expire_string(), + Integer::New(env()->isolate(), soa_out->expire)) + .FromJust(); + soa_record + ->Set(context, + env()->minttl_string(), + Integer::New(env()->isolate(), soa_out->minttl)) + .FromJust(); ares_free_data(soa_out); @@ -1737,12 +1692,10 @@ class QuerySoaWrap: public QueryWrap { } }; - -class GetHostByAddrWrap: public QueryWrap { +class GetHostByAddrWrap : public QueryWrap { public: explicit GetHostByAddrWrap(ChannelWrap* channel, Local req_wrap_obj) - : QueryWrap(channel, req_wrap_obj, "reverse") { - } + : QueryWrap(channel, req_wrap_obj, "reverse") {} int Send(const char* name) override { int length, family; @@ -1758,10 +1711,13 @@ class GetHostByAddrWrap: public QueryWrap { return UV_EINVAL; // So errnoException() reports a proper error. } - TRACE_EVENT_NESTABLE_ASYNC_BEGIN2( - TRACING_CATEGORY_NODE2(dns, native), "reverse", this, - "name", TRACE_STR_COPY(name), - "family", family == AF_INET ? "ipv4" : "ipv6"); + TRACE_EVENT_NESTABLE_ASYNC_BEGIN2(TRACING_CATEGORY_NODE2(dns, native), + "reverse", + this, + "name", + TRACE_STR_COPY(name), + "family", + family == AF_INET ? "ipv4" : "ipv6"); ares_gethostbyaddr(channel_->cares_channel(), address_buffer, @@ -1784,7 +1740,6 @@ class GetHostByAddrWrap: public QueryWrap { } }; - template static void Query(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -1812,19 +1767,16 @@ static void Query(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(err); } - void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) { - std::unique_ptr req_wrap { + std::unique_ptr req_wrap{ static_cast(req->data)}; Environment* env = req_wrap->env(); HandleScope handle_scope(env->isolate()); Context::Scope context_scope(env->context()); - Local argv[] = { - Integer::New(env->isolate(), status), - Null(env->isolate()) - }; + Local argv[] = {Integer::New(env->isolate(), status), + Null(env->isolate())}; uint64_t n = 0; const bool verbatim = req_wrap->verbatim(); @@ -1832,7 +1784,7 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) { if (status == 0) { Local results = Array::New(env->isolate()); - auto add = [&] (bool want_ipv4, bool want_ipv6) { + auto add = [&](bool want_ipv4, bool want_ipv6) { for (auto p = res; p != nullptr; p = p->ai_next) { CHECK_EQ(p->ai_socktype, SOCK_STREAM); @@ -1848,8 +1800,7 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) { } char ip[INET6_ADDRSTRLEN]; - if (uv_inet_ntop(p->ai_family, addr, ip, sizeof(ip))) - continue; + if (uv_inet_ntop(p->ai_family, addr, ip, sizeof(ip))) continue; Local s = OneByteString(env->isolate(), ip); results->Set(env->context(), n, s).FromJust(); @@ -1858,8 +1809,7 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) { }; add(true, verbatim); - if (verbatim == false) - add(false, true); + if (verbatim == false) add(false, true); // No responses were found to return if (n == 0) { @@ -1871,31 +1821,32 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) { uv_freeaddrinfo(res); - TRACE_EVENT_NESTABLE_ASYNC_END2( - TRACING_CATEGORY_NODE2(dns, native), "lookup", req_wrap.get(), - "count", n, "verbatim", verbatim); + TRACE_EVENT_NESTABLE_ASYNC_END2(TRACING_CATEGORY_NODE2(dns, native), + "lookup", + req_wrap.get(), + "count", + n, + "verbatim", + verbatim); // Make the callback into JavaScript req_wrap->MakeCallback(env->oncomplete_string(), arraysize(argv), argv); } - void AfterGetNameInfo(uv_getnameinfo_t* req, int status, const char* hostname, const char* service) { - std::unique_ptr req_wrap { + std::unique_ptr req_wrap{ static_cast(req->data)}; Environment* env = req_wrap->env(); HandleScope handle_scope(env->isolate()); Context::Scope context_scope(env->context()); - Local argv[] = { - Integer::New(env->isolate(), status), - Null(env->isolate()), - Null(env->isolate()) - }; + Local argv[] = {Integer::New(env->isolate(), status), + Null(env->isolate()), + Null(env->isolate())}; if (status == 0) { // Success @@ -1905,10 +1856,13 @@ void AfterGetNameInfo(uv_getnameinfo_t* req, argv[2] = js_service; } - TRACE_EVENT_NESTABLE_ASYNC_END2( - TRACING_CATEGORY_NODE2(dns, native), "lookupService", req_wrap.get(), - "hostname", TRACE_STR_COPY(hostname), - "service", TRACE_STR_COPY(service)); + TRACE_EVENT_NESTABLE_ASYNC_END2(TRACING_CATEGORY_NODE2(dns, native), + "lookupService", + req_wrap.get(), + "hostname", + TRACE_STR_COPY(hostname), + "service", + TRACE_STR_COPY(service)); // Make the callback into JavaScript req_wrap->MakeCallback(env->oncomplete_string(), arraysize(argv), argv); @@ -1935,8 +1889,9 @@ void CanonicalizeIP(const FunctionCallbackInfo& args) { char canonical_ip[INET6_ADDRSTRLEN]; const int af = (rc == 4 ? AF_INET : AF_INET6); CHECK_EQ(0, uv_inet_ntop(af, &result, canonical_ip, sizeof(canonical_ip))); - v8::Local val = String::NewFromUtf8(isolate, canonical_ip, - v8::NewStringType::kNormal).ToLocalChecked(); + v8::Local val = + String::NewFromUtf8(isolate, canonical_ip, v8::NewStringType::kNormal) + .ToLocalChecked(); args.GetReturnValue().Set(val); } @@ -1971,9 +1926,8 @@ void GetAddrInfo(const FunctionCallbackInfo& args) { CHECK(0 && "bad address family"); } - auto req_wrap = std::make_unique(env, - req_wrap_obj, - args[4]->IsTrue()); + auto req_wrap = std::make_unique( + env, req_wrap_obj, args[4]->IsTrue()); struct addrinfo hints; memset(&hints, 0, sizeof(struct addrinfo)); @@ -1982,16 +1936,16 @@ void GetAddrInfo(const FunctionCallbackInfo& args) { hints.ai_flags = flags; TRACE_EVENT_NESTABLE_ASYNC_BEGIN2( - TRACING_CATEGORY_NODE2(dns, native), "lookup", req_wrap.get(), - "hostname", TRACE_STR_COPY(*hostname), + TRACING_CATEGORY_NODE2(dns, native), + "lookup", + req_wrap.get(), + "hostname", + TRACE_STR_COPY(*hostname), "family", family == AF_INET ? "ipv4" : family == AF_INET6 ? "ipv6" : "unspec"); - int err = req_wrap->Dispatch(uv_getaddrinfo, - AfterGetAddrInfo, - *hostname, - nullptr, - &hints); + int err = req_wrap->Dispatch( + uv_getaddrinfo, AfterGetAddrInfo, *hostname, nullptr, &hints); if (err == 0) // Release ownership of the pointer allowing the ownership to be transferred USE(req_wrap.release()); @@ -1999,7 +1953,6 @@ void GetAddrInfo(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(err); } - void GetNameInfo(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -2016,9 +1969,13 @@ void GetNameInfo(const FunctionCallbackInfo& args) { auto req_wrap = std::make_unique(env, req_wrap_obj); - TRACE_EVENT_NESTABLE_ASYNC_BEGIN2( - TRACING_CATEGORY_NODE2(dns, native), "lookupService", req_wrap.get(), - "ip", TRACE_STR_COPY(*ip), "port", port); + TRACE_EVENT_NESTABLE_ASYNC_BEGIN2(TRACING_CATEGORY_NODE2(dns, native), + "lookupService", + req_wrap.get(), + "ip", + TRACE_STR_COPY(*ip), + "port", + port); int err = req_wrap->Dispatch(uv_getnameinfo, AfterGetNameInfo, @@ -2031,7 +1988,6 @@ void GetNameInfo(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(err); } - void GetServers(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); ChannelWrap* channel; @@ -2055,9 +2011,8 @@ void GetServers(const FunctionCallbackInfo& args) { Local ret = Array::New(env->isolate(), 2); ret->Set(env->context(), 0, OneByteString(env->isolate(), ip)).FromJust(); - ret->Set(env->context(), - 1, - Integer::New(env->isolate(), cur->udp_port)).FromJust(); + ret->Set(env->context(), 1, Integer::New(env->isolate(), cur->udp_port)) + .FromJust(); server_array->Set(env->context(), i, ret).FromJust(); } @@ -2067,7 +2022,6 @@ void GetServers(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(server_array); } - void SetServers(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); ChannelWrap* channel; @@ -2099,18 +2053,26 @@ void SetServers(const FunctionCallbackInfo& args) { Local elm = Local::Cast(arr->Get(env->context(), i).ToLocalChecked()); - CHECK(elm->Get(env->context(), - 0).ToLocalChecked()->Int32Value(env->context()).FromJust()); + CHECK(elm->Get(env->context(), 0) + .ToLocalChecked() + ->Int32Value(env->context()) + .FromJust()); CHECK(elm->Get(env->context(), 1).ToLocalChecked()->IsString()); - CHECK(elm->Get(env->context(), - 2).ToLocalChecked()->Int32Value(env->context()).FromJust()); + CHECK(elm->Get(env->context(), 2) + .ToLocalChecked() + ->Int32Value(env->context()) + .FromJust()); int fam = elm->Get(env->context(), 0) - .ToLocalChecked()->Int32Value(env->context()).FromJust(); + .ToLocalChecked() + ->Int32Value(env->context()) + .FromJust(); node::Utf8Value ip(env->isolate(), elm->Get(env->context(), 1).ToLocalChecked()); int port = elm->Get(env->context(), 2) - .ToLocalChecked()->Int32Value(env->context()).FromJust(); + .ToLocalChecked() + ->Int32Value(env->context()) + .FromJust(); ares_addr_port_node* cur = &servers[i]; @@ -2128,13 +2090,11 @@ void SetServers(const FunctionCallbackInfo& args) { CHECK(0 && "Bad address family."); } - if (err) - break; + if (err) break; cur->next = nullptr; - if (last != nullptr) - last->next = cur; + if (last != nullptr) last->next = cur; last = cur; } @@ -2144,8 +2104,7 @@ void SetServers(const FunctionCallbackInfo& args) { else err = ARES_EBADSTR; - if (err == ARES_SUCCESS) - channel->set_is_servers_default(false); + if (err == ARES_SUCCESS) channel->set_is_servers_default(false); args.GetReturnValue().Set(err); } @@ -2154,8 +2113,8 @@ void Cancel(const FunctionCallbackInfo& args) { ChannelWrap* channel; ASSIGN_OR_RETURN_UNWRAP(&channel, args.Holder()); - TRACE_EVENT_INSTANT0(TRACING_CATEGORY_NODE2(dns, native), - "cancel", TRACE_EVENT_SCOPE_THREAD); + TRACE_EVENT_INSTANT0( + TRACING_CATEGORY_NODE2(dns, native), "cancel", TRACE_EVENT_SCOPE_THREAD); ares_cancel(channel->cares_channel()); } @@ -2164,13 +2123,11 @@ const char EMSG_ESETSRVPENDING[] = "There are pending queries."; void StrError(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); int code = args[0]->Int32Value(env->context()).FromJust(); - const char* errmsg = (code == DNS_ESETSRVPENDING) ? - EMSG_ESETSRVPENDING : - ares_strerror(code); + const char* errmsg = + (code == DNS_ESETSRVPENDING) ? EMSG_ESETSRVPENDING : ares_strerror(code); args.GetReturnValue().Set(OneByteString(env->isolate(), errmsg)); } - void Initialize(Local target, Local unused, Local context, @@ -2183,19 +2140,31 @@ void Initialize(Local target, env->SetMethod(target, "strerror", StrError); - target->Set(env->context(), FIXED_ONE_BYTE_STRING(env->isolate(), "AF_INET"), - Integer::New(env->isolate(), AF_INET)).FromJust(); - target->Set(env->context(), FIXED_ONE_BYTE_STRING(env->isolate(), "AF_INET6"), - Integer::New(env->isolate(), AF_INET6)).FromJust(); - target->Set(env->context(), FIXED_ONE_BYTE_STRING(env->isolate(), - "AF_UNSPEC"), - Integer::New(env->isolate(), AF_UNSPEC)).FromJust(); - target->Set(env->context(), FIXED_ONE_BYTE_STRING(env->isolate(), - "AI_ADDRCONFIG"), - Integer::New(env->isolate(), AI_ADDRCONFIG)).FromJust(); - target->Set(env->context(), FIXED_ONE_BYTE_STRING(env->isolate(), - "AI_V4MAPPED"), - Integer::New(env->isolate(), AI_V4MAPPED)).FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "AF_INET"), + Integer::New(env->isolate(), AF_INET)) + .FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "AF_INET6"), + Integer::New(env->isolate(), AF_INET6)) + .FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "AF_UNSPEC"), + Integer::New(env->isolate(), AF_UNSPEC)) + .FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "AI_ADDRCONFIG"), + Integer::New(env->isolate(), AI_ADDRCONFIG)) + .FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "AI_V4MAPPED"), + Integer::New(env->isolate(), AI_V4MAPPED)) + .FromJust(); Local aiw = BaseObject::MakeLazilyInitializedJSTemplate(env); @@ -2203,9 +2172,11 @@ void Initialize(Local target, Local addrInfoWrapString = FIXED_ONE_BYTE_STRING(env->isolate(), "GetAddrInfoReqWrap"); aiw->SetClassName(addrInfoWrapString); - target->Set(env->context(), - addrInfoWrapString, - aiw->GetFunction(context).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + addrInfoWrapString, + aiw->GetFunction(context).ToLocalChecked()) + .FromJust(); Local niw = BaseObject::MakeLazilyInitializedJSTemplate(env); @@ -2213,9 +2184,11 @@ void Initialize(Local target, Local nameInfoWrapString = FIXED_ONE_BYTE_STRING(env->isolate(), "GetNameInfoReqWrap"); niw->SetClassName(nameInfoWrapString); - target->Set(env->context(), - nameInfoWrapString, - niw->GetFunction(context).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + nameInfoWrapString, + niw->GetFunction(context).ToLocalChecked()) + .FromJust(); Local qrw = BaseObject::MakeLazilyInitializedJSTemplate(env); @@ -2223,9 +2196,11 @@ void Initialize(Local target, Local queryWrapString = FIXED_ONE_BYTE_STRING(env->isolate(), "QueryReqWrap"); qrw->SetClassName(queryWrapString); - target->Set(env->context(), - queryWrapString, - qrw->GetFunction(context).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + queryWrapString, + qrw->GetFunction(context).ToLocalChecked()) + .FromJust(); Local channel_wrap = env->NewFunctionTemplate(ChannelWrap::New); @@ -2252,8 +2227,11 @@ void Initialize(Local target, Local channelWrapString = FIXED_ONE_BYTE_STRING(env->isolate(), "ChannelWrap"); channel_wrap->SetClassName(channelWrapString); - target->Set(env->context(), channelWrapString, - channel_wrap->GetFunction(context).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + channelWrapString, + channel_wrap->GetFunction(context).ToLocalChecked()) + .FromJust(); } } // anonymous namespace diff --git a/src/connect_wrap.cc b/src/connect_wrap.cc index dacdf72da7c494..9e55fab6106d87 100644 --- a/src/connect_wrap.cc +++ b/src/connect_wrap.cc @@ -9,10 +9,9 @@ namespace node { using v8::Local; using v8::Object; - ConnectWrap::ConnectWrap(Environment* env, - Local req_wrap_obj, - AsyncWrap::ProviderType provider) : ReqWrap(env, req_wrap_obj, provider) { -} + Local req_wrap_obj, + AsyncWrap::ProviderType provider) + : ReqWrap(env, req_wrap_obj, provider) {} } // namespace node diff --git a/src/connect_wrap.h b/src/connect_wrap.h index 88221b77468631..8c028cafa72982 100644 --- a/src/connect_wrap.h +++ b/src/connect_wrap.h @@ -3,9 +3,9 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS +#include "async_wrap.h" #include "env.h" #include "req_wrap-inl.h" -#include "async_wrap.h" #include "v8.h" namespace node { diff --git a/src/connection_wrap.cc b/src/connection_wrap.cc index b894382c0370d5..d2137e781b17ca 100644 --- a/src/connection_wrap.cc +++ b/src/connection_wrap.cc @@ -18,16 +18,12 @@ using v8::Local; using v8::Object; using v8::Value; - template ConnectionWrap::ConnectionWrap(Environment* env, Local object, ProviderType provider) - : LibuvStreamWrap(env, - object, - reinterpret_cast(&handle_), - provider) {} - + : LibuvStreamWrap( + env, object, reinterpret_cast(&handle_), provider) {} template void ConnectionWrap::OnConnection(uv_stream_t* handle, @@ -60,8 +56,7 @@ void ConnectionWrap::OnConnection(uv_stream_t* handle, // uv_accept can fail if the new connection has already been closed, in // which case an EAGAIN (resource temporarily unavailable) will be // returned. - if (uv_accept(handle, client)) - return; + if (uv_accept(handle, client)) return; // Successful accept. Call the onconnection callback in JavaScript land. client_handle = client_obj; @@ -69,16 +64,14 @@ void ConnectionWrap::OnConnection(uv_stream_t* handle, client_handle = Undefined(env->isolate()); } - Local argv[] = { Integer::New(env->isolate(), status), client_handle }; + Local argv[] = {Integer::New(env->isolate(), status), client_handle}; wrap_data->MakeCallback(env->onconnection_string(), arraysize(argv), argv); } - template void ConnectionWrap::AfterConnect(uv_connect_t* req, int status) { - std::unique_ptr req_wrap - (static_cast(req->data)); + std::unique_ptr req_wrap(static_cast(req->data)); CHECK_NOT_NULL(req_wrap); WrapType* wrap = static_cast(req->handle->data); CHECK_EQ(req_wrap->env(), wrap->env()); @@ -100,26 +93,20 @@ void ConnectionWrap::AfterConnect(uv_connect_t* req, writable = uv_is_writable(req->handle) != 0; } - Local argv[5] = { - Integer::New(env->isolate(), status), - wrap->object(), - req_wrap->object(), - Boolean::New(env->isolate(), readable), - Boolean::New(env->isolate(), writable) - }; + Local argv[5] = {Integer::New(env->isolate(), status), + wrap->object(), + req_wrap->object(), + Boolean::New(env->isolate(), readable), + Boolean::New(env->isolate(), writable)}; req_wrap->MakeCallback(env->oncomplete_string(), arraysize(argv), argv); } template ConnectionWrap::ConnectionWrap( - Environment* env, - Local object, - ProviderType provider); + Environment* env, Local object, ProviderType provider); template ConnectionWrap::ConnectionWrap( - Environment* env, - Local object, - ProviderType provider); + Environment* env, Local object, ProviderType provider); template void ConnectionWrap::OnConnection( uv_stream_t* handle, int status); @@ -133,5 +120,4 @@ template void ConnectionWrap::AfterConnect( template void ConnectionWrap::AfterConnect( uv_connect_t* handle, int status); - } // namespace node diff --git a/src/debug_utils.cc b/src/debug_utils.cc index 434c9853c02a2e..d20ec3d2fc427f 100644 --- a/src/debug_utils.cc +++ b/src/debug_utils.cc @@ -5,8 +5,7 @@ #include #endif -#if defined(__linux__) && !defined(__GLIBC__) || \ - defined(__UCLIBC__) || \ +#if defined(__linux__) && !defined(__GLIBC__) || defined(__UCLIBC__) || \ defined(_AIX) #define HAVE_EXECINFO_H 0 #else @@ -17,15 +16,15 @@ #include #include #include -#include -#include #include +#include +#include #endif #else // __POSIX__ -#include #include +#include #endif // __POSIX__ @@ -56,14 +55,13 @@ namespace node { #if HAVE_EXECINFO_H class PosixSymbolDebuggingContext final : public NativeSymbolDebuggingContext { public: - PosixSymbolDebuggingContext() : pagesize_(getpagesize()) { } + PosixSymbolDebuggingContext() : pagesize_(getpagesize()) {} SymbolInfo LookupSymbol(void* address) override { Dl_info info; const bool have_info = dladdr(address, &info); SymbolInfo ret; - if (!have_info) - return ret; + if (!have_info) return ret; if (info.dli_sname != nullptr) { if (char* demangled = abi::__cxa_demangle(info.dli_sname, 0, 0, 0)) { @@ -120,13 +118,12 @@ class Win32SymbolDebuggingContext final : public NativeSymbolDebuggingContext { USE(SymInitialize(current_process_, nullptr, true)); } - ~Win32SymbolDebuggingContext() override { - USE(SymCleanup(current_process_)); - } + ~Win32SymbolDebuggingContext() override { USE(SymCleanup(current_process_)); } using NameAndDisplacement = std::pair; NameAndDisplacement WrappedSymFromAddr(DWORD64 dwAddress) const { - // Refs: https://docs.microsoft.com/en-us/windows/desktop/Debug/retrieving-symbol-information-by-address + // Refs: + // https://docs.microsoft.com/en-us/windows/desktop/Debug/retrieving-symbol-information-by-address // Patches: // Use `fprintf(stderr, ` instead of `printf` // `sym.filename = pSymbol->Name` on success @@ -158,7 +155,8 @@ class Win32SymbolDebuggingContext final : public NativeSymbolDebuggingContext { SymbolInfo WrappedGetLine(DWORD64 dwAddress) const { SymbolInfo sym{}; - // Refs: https://docs.microsoft.com/en-us/windows/desktop/Debug/retrieving-symbol-information-by-address + // Refs: + // https://docs.microsoft.com/en-us/windows/desktop/Debug/retrieving-symbol-information-by-address // Patches: // Use `fprintf(stderr, ` instead of `printf`. // Assign values to `sym` on success. @@ -173,8 +171,8 @@ class Win32SymbolDebuggingContext final : public NativeSymbolDebuggingContext { line.SizeOfStruct = sizeof(IMAGEHLP_LINE64); // Patch: made into arg - dwAddress = 0x1000000; - if (SymGetLineFromAddr64(current_process_, dwAddress, - &dwDisplacement, &line)) { + if (SymGetLineFromAddr64( + current_process_, dwAddress, &dwDisplacement, &line)) { // SymGetLineFromAddr64 returned success sym.filename = line.FileName; sym.line = line.LineNumber; @@ -192,13 +190,14 @@ class Win32SymbolDebuggingContext final : public NativeSymbolDebuggingContext { // Fills the SymbolInfo::name of the io/out argument `sym` std::string WrappedUnDecorateSymbolName(const char* name) const { - // Refs: https://docs.microsoft.com/en-us/windows/desktop/Debug/retrieving-undecorated-symbol-names + // Refs: + // https://docs.microsoft.com/en-us/windows/desktop/Debug/retrieving-undecorated-symbol-names // Patches: // Use `fprintf(stderr, ` instead of `printf`. // return `szUndName` instead of `printf` on success char szUndName[MAX_SYM_NAME]; - if (UnDecorateSymbolName(name, szUndName, sizeof(szUndName), - UNDNAME_COMPLETE)) { + if (UnDecorateSymbolName( + name, szUndName, sizeof(szUndName), UNDNAME_COMPLETE)) { // UnDecorateSymbolName returned success return szUndName; } else { @@ -236,10 +235,9 @@ class Win32SymbolDebuggingContext final : public NativeSymbolDebuggingContext { Win32SymbolDebuggingContext(const Win32SymbolDebuggingContext&) = delete; Win32SymbolDebuggingContext(Win32SymbolDebuggingContext&&) = delete; - Win32SymbolDebuggingContext operator=(const Win32SymbolDebuggingContext&) - = delete; - Win32SymbolDebuggingContext operator=(Win32SymbolDebuggingContext&&) - = delete; + Win32SymbolDebuggingContext operator=(const Win32SymbolDebuggingContext&) = + delete; + Win32SymbolDebuggingContext operator=(Win32SymbolDebuggingContext&&) = delete; private: HANDLE current_process_; @@ -295,40 +293,52 @@ void PrintLibuvHandleInformation(uv_loop_t* loop, FILE* stream) { FILE* stream; }; - Info info { NativeSymbolDebuggingContext::New(), stream }; - - fprintf(stream, "uv loop at [%p] has %d active handles\n", - loop, loop->active_handles); - - uv_walk(loop, [](uv_handle_t* handle, void* arg) { - Info* info = static_cast(arg); - NativeSymbolDebuggingContext* sym_ctx = info->ctx.get(); - FILE* stream = info->stream; - - fprintf(stream, "[%p] %s\n", handle, uv_handle_type_name(handle->type)); - - void* close_cb = reinterpret_cast(handle->close_cb); - fprintf(stream, "\tClose callback: %p %s\n", - close_cb, sym_ctx->LookupSymbol(close_cb).Display().c_str()); - - fprintf(stream, "\tData: %p %s\n", - handle->data, sym_ctx->LookupSymbol(handle->data).Display().c_str()); - - // We are also interested in the first field of what `handle->data` - // points to, because for C++ code that is usually the virtual table pointer - // and gives us information about the exact kind of object we're looking at. - void* first_field = nullptr; - // `handle->data` might be any value, including `nullptr`, or something - // cast from a completely different type; therefore, check that it’s - // dereferencable first. - if (sym_ctx->IsMapped(handle->data)) - first_field = *reinterpret_cast(handle->data); - - if (first_field != nullptr) { - fprintf(stream, "\t(First field): %p %s\n", - first_field, sym_ctx->LookupSymbol(first_field).Display().c_str()); - } - }, &info); + Info info{NativeSymbolDebuggingContext::New(), stream}; + + fprintf(stream, + "uv loop at [%p] has %d active handles\n", + loop, + loop->active_handles); + + uv_walk(loop, + [](uv_handle_t* handle, void* arg) { + Info* info = static_cast(arg); + NativeSymbolDebuggingContext* sym_ctx = info->ctx.get(); + FILE* stream = info->stream; + + fprintf( + stream, "[%p] %s\n", handle, uv_handle_type_name(handle->type)); + + void* close_cb = reinterpret_cast(handle->close_cb); + fprintf(stream, + "\tClose callback: %p %s\n", + close_cb, + sym_ctx->LookupSymbol(close_cb).Display().c_str()); + + fprintf(stream, + "\tData: %p %s\n", + handle->data, + sym_ctx->LookupSymbol(handle->data).Display().c_str()); + + // We are also interested in the first field of what `handle->data` + // points to, because for C++ code that is usually the virtual table + // pointer and gives us information about the exact kind of object + // we're looking at. + void* first_field = nullptr; + // `handle->data` might be any value, including `nullptr`, or + // something cast from a completely different type; therefore, check + // that it’s dereferencable first. + if (sym_ctx->IsMapped(handle->data)) + first_field = *reinterpret_cast(handle->data); + + if (first_field != nullptr) { + fprintf(stream, + "\t(First field): %p %s\n", + first_field, + sym_ctx->LookupSymbol(first_field).Display().c_str()); + } + }, + &info); } std::vector NativeSymbolDebuggingContext::GetLoadedLibraries() { @@ -368,8 +378,8 @@ std::vector NativeSymbolDebuggingContext::GetLoadedLibraries() { do { std::ostringstream str; cur_info = reinterpret_cast(buf); - char* member_name = cur_info->ldinfo_filename + - strlen(cur_info->ldinfo_filename) + 1; + char* member_name = + cur_info->ldinfo_filename + strlen(cur_info->ldinfo_filename) + 1; if (*member_name != '\0') { str << cur_info->ldinfo_filename << "(" << member_name << ")"; list.push_back(str.str()); @@ -391,8 +401,10 @@ std::vector NativeSymbolDebuggingContext::GetLoadedLibraries() { #elif _WIN32 // Windows implementation - get a handle to the process. - HANDLE process_handle = OpenProcess(PROCESS_QUERY_INFORMATION|PROCESS_VM_READ, - FALSE, GetCurrentProcessId()); + HANDLE process_handle = + OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, + FALSE, + GetCurrentProcessId()); if (process_handle == nullptr) { // Cannot proceed, return an empty list. return list; @@ -432,7 +444,6 @@ std::vector NativeSymbolDebuggingContext::GetLoadedLibraries() { return list; } - } // namespace node extern "C" void __DumpBacktrace(FILE* fp) { diff --git a/src/debug_utils.h b/src/debug_utils.h index 05a9370e562f82..32b077347c2d84 100644 --- a/src/debug_utils.h +++ b/src/debug_utils.h @@ -23,20 +23,16 @@ namespace node { template -inline void FORCE_INLINE Debug(Environment* env, - DebugCategory cat, - const char* format, - Args&&... args) { - if (!UNLIKELY(env->debug_enabled(cat))) - return; +inline void FORCE_INLINE +Debug(Environment* env, DebugCategory cat, const char* format, Args&&... args) { + if (!UNLIKELY(env->debug_enabled(cat))) return; fprintf(stderr, format, std::forward(args)...); } inline void FORCE_INLINE Debug(Environment* env, DebugCategory cat, const char* message) { - if (!UNLIKELY(env->debug_enabled(cat))) - return; + if (!UNLIKELY(env->debug_enabled(cat))) return; fprintf(stderr, "%s", message); } @@ -70,10 +66,8 @@ inline void FORCE_INLINE Debug(AsyncWrap* async_wrap, const char* format, Args&&... args) { DCHECK_NOT_NULL(async_wrap); - DebugCategory cat = - static_cast(async_wrap->provider_type()); - if (!UNLIKELY(async_wrap->env()->debug_enabled(cat))) - return; + DebugCategory cat = static_cast(async_wrap->provider_type()); + if (!UNLIKELY(async_wrap->env()->debug_enabled(cat))) return; UnconditionalAsyncWrapDebug(async_wrap, format, std::forward(args)...); } @@ -108,10 +102,10 @@ class NativeSymbolDebuggingContext { NativeSymbolDebuggingContext(const NativeSymbolDebuggingContext&) = delete; NativeSymbolDebuggingContext(NativeSymbolDebuggingContext&&) = delete; - NativeSymbolDebuggingContext operator=(NativeSymbolDebuggingContext&) - = delete; - NativeSymbolDebuggingContext operator=(NativeSymbolDebuggingContext&&) - = delete; + NativeSymbolDebuggingContext operator=(NativeSymbolDebuggingContext&) = + delete; + NativeSymbolDebuggingContext operator=(NativeSymbolDebuggingContext&&) = + delete; static std::vector GetLoadedLibraries(); }; diff --git a/src/env-inl.h b/src/env-inl.h index 748577a2545ee2..ac3edab4a18527 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -27,12 +27,12 @@ #include "aliased_buffer.h" #include "env.h" #include "node.h" +#include "node_context_data.h" +#include "node_perf_common.h" +#include "node_worker.h" #include "util-inl.h" #include "uv.h" #include "v8.h" -#include "node_perf_common.h" -#include "node_context_data.h" -#include "node_worker.h" #include #include @@ -81,14 +81,14 @@ inline Environment::AsyncHooks::AsyncHooks() // Create all the provider strings that will be passed to JS. Place them in // an array so the array index matches the PROVIDER id offset. This way the // strings can be retrieved quickly. -#define V(Provider) \ - providers_[AsyncWrap::PROVIDER_ ## Provider].Set( \ - env()->isolate(), \ - v8::String::NewFromOneByte( \ - env()->isolate(), \ - reinterpret_cast(#Provider), \ - v8::NewStringType::kInternalized, \ - sizeof(#Provider) - 1).ToLocalChecked()); +#define V(Provider) \ + providers_[AsyncWrap::PROVIDER_##Provider].Set( \ + env()->isolate(), \ + v8::String::NewFromOneByte(env()->isolate(), \ + reinterpret_cast(#Provider), \ + v8::NewStringType::kInternalized, \ + sizeof(#Provider) - 1) \ + .ToLocalChecked()); NODE_ASYNC_PROVIDER_TYPES(V) #undef V } @@ -131,8 +131,7 @@ inline void Environment::AsyncHooks::push_async_ids(double async_id, } uint32_t offset = fields_[kStackLength]; - if (offset * 2 >= async_ids_stack_.Length()) - grow_async_ids_stack(); + if (offset * 2 >= async_ids_stack_.Length()) grow_async_ids_stack(); async_ids_stack_[2 * offset] = async_id_fields_[kExecutionAsyncId]; async_ids_stack_[2 * offset + 1] = async_id_fields_[kTriggerAsyncId]; fields_[kStackLength] += 1; @@ -158,8 +157,7 @@ inline bool Environment::AsyncHooks::pop_async_id(double async_id) { async_id); DumpBacktrace(stderr); fflush(stderr); - if (!env()->abort_on_uncaught_exception()) - exit(1); + if (!env()->abort_on_uncaught_exception()) exit(1); fprintf(stderr, "\n"); fflush(stderr); ABORT_NO_BACKTRACE(); @@ -183,8 +181,8 @@ inline void Environment::AsyncHooks::clear_async_id_stack() { // The DefaultTriggerAsyncIdScope(AsyncWrap*) constructor is defined in // async_wrap-inl.h to avoid a circular dependency. -inline Environment::AsyncHooks::DefaultTriggerAsyncIdScope - ::DefaultTriggerAsyncIdScope(Environment* env, +inline Environment::AsyncHooks::DefaultTriggerAsyncIdScope :: + DefaultTriggerAsyncIdScope(Environment* env, double default_trigger_async_id) : async_hooks_(env->async_hooks()) { if (env->async_hooks()->fields()[AsyncHooks::kCheck] > 0) { @@ -192,23 +190,21 @@ inline Environment::AsyncHooks::DefaultTriggerAsyncIdScope } old_default_trigger_async_id_ = - async_hooks_->async_id_fields()[AsyncHooks::kDefaultTriggerAsyncId]; + async_hooks_->async_id_fields()[AsyncHooks::kDefaultTriggerAsyncId]; async_hooks_->async_id_fields()[AsyncHooks::kDefaultTriggerAsyncId] = - default_trigger_async_id; + default_trigger_async_id; } -inline Environment::AsyncHooks::DefaultTriggerAsyncIdScope - ::~DefaultTriggerAsyncIdScope() { +inline Environment::AsyncHooks::DefaultTriggerAsyncIdScope :: + ~DefaultTriggerAsyncIdScope() { async_hooks_->async_id_fields()[AsyncHooks::kDefaultTriggerAsyncId] = - old_default_trigger_async_id_; + old_default_trigger_async_id_; } - Environment* Environment::ForAsyncHooks(AsyncHooks* hooks) { return ContainerOf(&Environment::async_hooks_, hooks); } - inline Environment::AsyncCallbackScope::AsyncCallbackScope(Environment* env) : env_(env) { env_->makecallback_cntr_++; @@ -226,7 +222,7 @@ inline Environment::ImmediateInfo::ImmediateInfo(v8::Isolate* isolate) : fields_(isolate, kFieldsCount) {} inline AliasedBuffer& - Environment::ImmediateInfo::fields() { +Environment::ImmediateInfo::fields() { return fields_; } @@ -275,11 +271,11 @@ inline bool Environment::TickInfo::has_rejection_to_warn() const { inline void Environment::AssignToContext(v8::Local context, const ContextInfo& info) { - context->SetAlignedPointerInEmbedderData( - ContextEmbedderIndex::kEnvironment, this); + context->SetAlignedPointerInEmbedderData(ContextEmbedderIndex::kEnvironment, + this); // Used by EnvPromiseHook to know that we are on a node context. - context->SetAlignedPointerInEmbedderData( - ContextEmbedderIndex::kContextTag, Environment::kNodeContextTagPtr); + context->SetAlignedPointerInEmbedderData(ContextEmbedderIndex::kContextTag, + Environment::kNodeContextTagPtr); #if HAVE_INSPECTOR inspector_agent()->ContextCreated(context, info); #endif // HAVE_INSPECTOR @@ -291,17 +287,16 @@ inline Environment* Environment::GetCurrent(v8::Isolate* isolate) { inline Environment* Environment::GetCurrent(v8::Local context) { if (UNLIKELY(context.IsEmpty() || - context->GetNumberOfEmbedderDataFields() < - ContextEmbedderIndex::kContextTag || - context->GetAlignedPointerFromEmbedderData( - ContextEmbedderIndex::kContextTag) != - Environment::kNodeContextTagPtr)) { + context->GetNumberOfEmbedderDataFields() < + ContextEmbedderIndex::kContextTag || + context->GetAlignedPointerFromEmbedderData( + ContextEmbedderIndex::kContextTag) != + Environment::kNodeContextTagPtr)) { return nullptr; } - return static_cast( - context->GetAlignedPointerFromEmbedderData( - ContextEmbedderIndex::kEnvironment)); + return static_cast(context->GetAlignedPointerFromEmbedderData( + ContextEmbedderIndex::kEnvironment)); } inline Environment* Environment::GetCurrent( @@ -370,9 +365,9 @@ inline void Environment::CloseHandle(T* handle, OnCloseCallback callback) { OnCloseCallback callback; void* original_data; }; - handle->data = new CloseData { this, callback, handle->data }; + handle->data = new CloseData{this, callback, handle->data}; uv_close(reinterpret_cast(handle), [](uv_handle_t* handle) { - std::unique_ptr data { static_cast(handle->data) }; + std::unique_ptr data{static_cast(handle->data)}; data->env->handle_cleanup_waiting_--; handle->data = data->original_data; data->callback(reinterpret_cast(handle)); @@ -500,7 +495,7 @@ inline double Environment::trigger_async_id() { inline double Environment::get_default_trigger_async_id() { double default_trigger_async_id = - async_hooks()->async_id_fields()[AsyncHooks::kDefaultTriggerAsyncId]; + async_hooks()->async_id_fields()[AsyncHooks::kDefaultTriggerAsyncId]; // If defaultTriggerAsyncId isn't set, use the executionAsyncId if (default_trigger_async_id < 0) default_trigger_async_id = execution_async_id(); @@ -557,14 +552,14 @@ inline void Environment::set_http2_state( bool Environment::debug_enabled(DebugCategory category) const { DCHECK_GE(static_cast(category), 0); DCHECK_LT(static_cast(category), - static_cast(DebugCategory::CATEGORY_COUNT)); + static_cast(DebugCategory::CATEGORY_COUNT)); return debug_enabled_[static_cast(category)]; } void Environment::set_debug_enabled(DebugCategory category, bool enabled) { DCHECK_GE(static_cast(category), 0); DCHECK_LT(static_cast(category), - static_cast(DebugCategory::CATEGORY_COUNT)); + static_cast(DebugCategory::CATEGORY_COUNT)); debug_enabled_[static_cast(category)] = enabled; } @@ -604,13 +599,12 @@ void Environment::CreateImmediate(native_immediate_callback cb, void* data, v8::Local obj, bool ref) { - native_immediate_callbacks_.push_back({ - cb, - data, - std::unique_ptr>(obj.IsEmpty() ? - nullptr : new Persistent(isolate_, obj)), - ref - }); + native_immediate_callbacks_.push_back( + {cb, + data, + std::unique_ptr>( + obj.IsEmpty() ? nullptr : new Persistent(isolate_, obj)), + ref}); immediate_info()->count_inc(1); } @@ -619,8 +613,7 @@ void Environment::SetImmediate(native_immediate_callback cb, v8::Local obj) { CreateImmediate(cb, data, obj, true); - if (immediate_info()->ref_count() == 0) - ToggleImmediateRef(true); + if (immediate_info()->ref_count() == 0) ToggleImmediateRef(true); immediate_info()->ref_count_inc(1); } @@ -689,7 +682,7 @@ inline performance::performance_state* Environment::performance_state() { } inline std::unordered_map* - Environment::performance_marks() { +Environment::performance_marks() { return &performance_marks_; } @@ -710,8 +703,7 @@ inline void Environment::ThrowRangeError(const char* errmsg) { } inline void Environment::ThrowError( - v8::Local (*fun)(v8::Local), - const char* errmsg) { + v8::Local (*fun)(v8::Local), const char* errmsg) { v8::HandleScope handle_scope(isolate()); isolate()->ThrowException(fun(OneByteString(isolate(), errmsg))); } @@ -733,14 +725,14 @@ inline void Environment::ThrowUVException(int errorno, UVException(isolate(), errorno, syscall, message, path, dest)); } -inline v8::Local - Environment::NewFunctionTemplate(v8::FunctionCallback callback, - v8::Local signature, - v8::ConstructorBehavior behavior, - v8::SideEffectType side_effect_type) { +inline v8::Local Environment::NewFunctionTemplate( + v8::FunctionCallback callback, + v8::Local signature, + v8::ConstructorBehavior behavior, + v8::SideEffectType side_effect_type) { v8::Local external = as_external(); - return v8::FunctionTemplate::New(isolate(), callback, external, - signature, 0, behavior, side_effect_type); + return v8::FunctionTemplate::New( + isolate(), callback, external, signature, 0, behavior, side_effect_type); } inline void Environment::SetMethod(v8::Local that, @@ -748,7 +740,8 @@ inline void Environment::SetMethod(v8::Local that, v8::FunctionCallback callback) { v8::Local context = isolate()->GetCurrentContext(); v8::Local function = - NewFunctionTemplate(callback, v8::Local(), + NewFunctionTemplate(callback, + v8::Local(), // TODO(TimothyGu): Investigate if SetMethod is ever // used for constructors. v8::ConstructorBehavior::kAllow, @@ -768,7 +761,8 @@ inline void Environment::SetMethodNoSideEffect(v8::Local that, v8::FunctionCallback callback) { v8::Local context = isolate()->GetCurrentContext(); v8::Local function = - NewFunctionTemplate(callback, v8::Local(), + NewFunctionTemplate(callback, + v8::Local(), // TODO(TimothyGu): Investigate if SetMethod is ever // used for constructors. v8::ConstructorBehavior::kAllow, @@ -788,7 +782,9 @@ inline void Environment::SetProtoMethod(v8::Local that, v8::FunctionCallback callback) { v8::Local signature = v8::Signature::New(isolate(), that); v8::Local t = - NewFunctionTemplate(callback, signature, v8::ConstructorBehavior::kThrow, + NewFunctionTemplate(callback, + signature, + v8::ConstructorBehavior::kThrow, v8::SideEffectType::kHasSideEffect); // kInternalized strings are created in the old space. const v8::NewStringType type = v8::NewStringType::kInternalized; @@ -804,7 +800,9 @@ inline void Environment::SetProtoMethodNoSideEffect( v8::FunctionCallback callback) { v8::Local signature = v8::Signature::New(isolate(), that); v8::Local t = - NewFunctionTemplate(callback, signature, v8::ConstructorBehavior::kThrow, + NewFunctionTemplate(callback, + signature, + v8::ConstructorBehavior::kThrow, v8::SideEffectType::kHasNoSideEffect); // kInternalized strings are created in the old space. const v8::NewStringType type = v8::NewStringType::kInternalized; @@ -818,7 +816,8 @@ inline void Environment::SetTemplateMethod(v8::Local that, const char* name, v8::FunctionCallback callback) { v8::Local t = - NewFunctionTemplate(callback, v8::Local(), + NewFunctionTemplate(callback, + v8::Local(), v8::ConstructorBehavior::kAllow, v8::SideEffectType::kHasSideEffect); // kInternalized strings are created in the old space. @@ -834,7 +833,8 @@ inline void Environment::SetTemplateMethodNoSideEffect( const char* name, v8::FunctionCallback callback) { v8::Local t = - NewFunctionTemplate(callback, v8::Local(), + NewFunctionTemplate(callback, + v8::Local(), v8::ConstructorBehavior::kAllow, v8::SideEffectType::kHasNoSideEffect); // kInternalized strings are created in the old space. @@ -846,15 +846,14 @@ inline void Environment::SetTemplateMethodNoSideEffect( } void Environment::AddCleanupHook(void (*fn)(void*), void* arg) { - auto insertion_info = cleanup_hooks_.emplace(CleanupHookCallback { - fn, arg, cleanup_hook_counter_++ - }); + auto insertion_info = cleanup_hooks_.emplace( + CleanupHookCallback{fn, arg, cleanup_hook_counter_++}); // Make sure there was no existing element with these values. CHECK_EQ(insertion_info.second, true); } void Environment::RemoveCleanupHook(void (*fn)(void*), void* arg) { - CleanupHookCallback search { fn, arg, 0 }; + CleanupHookCallback search{fn, arg, 0}; cleanup_hooks_.erase(search); } @@ -879,23 +878,22 @@ template void Environment::ForEachBaseObject(T&& iterator) { for (const auto& hook : cleanup_hooks_) { BaseObject* obj = hook.GetBaseObject(); - if (obj != nullptr) - iterator(obj); + if (obj != nullptr) iterator(obj); } } #define VP(PropertyName, StringValue) V(v8::Private, PropertyName) #define VY(PropertyName, StringValue) V(v8::Symbol, PropertyName) #define VS(PropertyName, StringValue) V(v8::String, PropertyName) -#define V(TypeName, PropertyName) \ - inline \ - v8::Local IsolateData::PropertyName(v8::Isolate* isolate) const { \ - /* Strings are immutable so casting away const-ness here is okay. */ \ - return const_cast(this)->PropertyName ## _.Get(isolate); \ +#define V(TypeName, PropertyName) \ + inline v8::Local IsolateData::PropertyName(v8::Isolate* isolate) \ + const { \ + /* Strings are immutable so casting away const-ness here is okay. */ \ + return const_cast(this)->PropertyName##_.Get(isolate); \ } - PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(VP) - PER_ISOLATE_SYMBOL_PROPERTIES(VY) - PER_ISOLATE_STRING_PROPERTIES(VS) +PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(VP) +PER_ISOLATE_SYMBOL_PROPERTIES(VY) +PER_ISOLATE_STRING_PROPERTIES(VS) #undef V #undef VS #undef VY @@ -904,26 +902,26 @@ void Environment::ForEachBaseObject(T&& iterator) { #define VP(PropertyName, StringValue) V(v8::Private, PropertyName) #define VY(PropertyName, StringValue) V(v8::Symbol, PropertyName) #define VS(PropertyName, StringValue) V(v8::String, PropertyName) -#define V(TypeName, PropertyName) \ - inline v8::Local Environment::PropertyName() const { \ - return isolate_data()->PropertyName(isolate()); \ +#define V(TypeName, PropertyName) \ + inline v8::Local Environment::PropertyName() const { \ + return isolate_data()->PropertyName(isolate()); \ } - PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(VP) - PER_ISOLATE_SYMBOL_PROPERTIES(VY) - PER_ISOLATE_STRING_PROPERTIES(VS) +PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(VP) +PER_ISOLATE_SYMBOL_PROPERTIES(VY) +PER_ISOLATE_STRING_PROPERTIES(VS) #undef V #undef VS #undef VY #undef VP -#define V(PropertyName, TypeName) \ - inline v8::Local Environment::PropertyName() const { \ - return PersistentToLocal::Strong(PropertyName ## _); \ - } \ - inline void Environment::set_ ## PropertyName(v8::Local value) { \ - PropertyName ## _.Reset(isolate(), value); \ +#define V(PropertyName, TypeName) \ + inline v8::Local Environment::PropertyName() const { \ + return PersistentToLocal::Strong(PropertyName##_); \ + } \ + inline void Environment::set_##PropertyName(v8::Local value) { \ + PropertyName##_.Reset(isolate(), value); \ } - ENVIRONMENT_STRONG_PERSISTENT_PROPERTIES(V) +ENVIRONMENT_STRONG_PERSISTENT_PROPERTIES(V) #undef V } // namespace node diff --git a/src/env.cc b/src/env.cc index d099a9e62ad521..69b341f2ca14ae 100644 --- a/src/env.cc +++ b/src/env.cc @@ -51,14 +51,11 @@ using worker::Worker; // allow reuse. But since we're not reusing it yet... class TraceEventScope { public: - TraceEventScope(const char* category, - const char* name, - void* id) : category_(category), name_(name), id_(id) { + TraceEventScope(const char* category, const char* name, void* id) + : category_(category), name_(name), id_(id) { TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(category_, name_, id_); } - ~TraceEventScope() { - TRACE_EVENT_NESTABLE_ASYNC_END0(category_, name_, id_); - } + ~TraceEventScope() { TRACE_EVENT_NESTABLE_ASYNC_END0(category_, name_, id_); } private: const char* category_; @@ -67,19 +64,18 @@ class TraceEventScope { }; int const Environment::kNodeContextTag = 0x6e6f64; -void* const Environment::kNodeContextTagPtr = const_cast( - static_cast(&Environment::kNodeContextTag)); +void* const Environment::kNodeContextTagPtr = + const_cast(static_cast(&Environment::kNodeContextTag)); IsolateData::IsolateData(Isolate* isolate, uv_loop_t* event_loop, MultiIsolatePlatform* platform, - uint32_t* zero_fill_field) : - isolate_(isolate), - event_loop_(event_loop), - zero_fill_field_(zero_fill_field), - platform_(platform) { - if (platform_ != nullptr) - platform_->RegisterIsolate(isolate_, event_loop); + uint32_t* zero_fill_field) + : isolate_(isolate), + event_loop_(event_loop), + zero_fill_field_(zero_fill_field), + platform_(platform) { + if (platform_ != nullptr) platform_->RegisterIsolate(isolate_, event_loop); options_.reset( new PerIsolateOptions(*(per_process::cli_options->per_isolate))); @@ -95,48 +91,46 @@ IsolateData::IsolateData(Isolate* isolate, // One byte because our strings are ASCII and we can safely skip V8's UTF-8 // decoding step. -#define V(PropertyName, StringValue) \ - PropertyName ## _.Set( \ - isolate, \ - Private::New( \ - isolate, \ - String::NewFromOneByte( \ - isolate, \ - reinterpret_cast(StringValue), \ - NewStringType::kInternalized, \ - sizeof(StringValue) - 1).ToLocalChecked())); +#define V(PropertyName, StringValue) \ + PropertyName##_.Set( \ + isolate, \ + Private::New(isolate, \ + String::NewFromOneByte( \ + isolate, \ + reinterpret_cast(StringValue), \ + NewStringType::kInternalized, \ + sizeof(StringValue) - 1) \ + .ToLocalChecked())); PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(V) #undef V -#define V(PropertyName, StringValue) \ - PropertyName ## _.Set( \ - isolate, \ - Symbol::New( \ - isolate, \ - String::NewFromOneByte( \ - isolate, \ - reinterpret_cast(StringValue), \ - NewStringType::kInternalized, \ - sizeof(StringValue) - 1).ToLocalChecked())); +#define V(PropertyName, StringValue) \ + PropertyName##_.Set( \ + isolate, \ + Symbol::New(isolate, \ + String::NewFromOneByte( \ + isolate, \ + reinterpret_cast(StringValue), \ + NewStringType::kInternalized, \ + sizeof(StringValue) - 1) \ + .ToLocalChecked())); PER_ISOLATE_SYMBOL_PROPERTIES(V) #undef V -#define V(PropertyName, StringValue) \ - PropertyName ## _.Set( \ - isolate, \ - String::NewFromOneByte( \ - isolate, \ - reinterpret_cast(StringValue), \ - NewStringType::kInternalized, \ - sizeof(StringValue) - 1).ToLocalChecked()); +#define V(PropertyName, StringValue) \ + PropertyName##_.Set( \ + isolate, \ + String::NewFromOneByte(isolate, \ + reinterpret_cast(StringValue), \ + NewStringType::kInternalized, \ + sizeof(StringValue) - 1) \ + .ToLocalChecked()); PER_ISOLATE_STRING_PROPERTIES(V) #undef V } IsolateData::~IsolateData() { - if (platform_ != nullptr) - platform_->UnregisterIsolate(isolate_); + if (platform_ != nullptr) platform_->UnregisterIsolate(isolate_); } - void InitThreadLocalOnce() { CHECK_EQ(0, uv_key_create(&Environment::thread_local_env)); } @@ -152,19 +146,16 @@ void Environment::TrackingTraceStateObserver::UpdateTraceCategoryState() { return; } - env_->trace_category_state()[0] = - *TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( - TRACING_CATEGORY_NODE1(async_hooks)); + env_->trace_category_state()[0] = *TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( + TRACING_CATEGORY_NODE1(async_hooks)); Isolate* isolate = env_->isolate(); HandleScope handle_scope(isolate); Local cb = env_->trace_category_state_function(); - if (cb.IsEmpty()) - return; + if (cb.IsEmpty()) return; TryCatchScope try_catch(env_); try_catch.SetVerbose(true); - cb->Call(env_->context(), Undefined(isolate), - 0, nullptr).ToLocalChecked(); + cb->Call(env_->context(), Undefined(isolate), 0, nullptr).ToLocalChecked(); } static std::atomic next_thread_id{0}; @@ -222,14 +213,11 @@ Environment::Environment(IsolateData* isolate_data, this); performance_state_.reset(new performance::performance_state(isolate())); - performance_state_->Mark( - performance::NODE_PERFORMANCE_MILESTONE_ENVIRONMENT); - performance_state_->Mark( - performance::NODE_PERFORMANCE_MILESTONE_NODE_START, - performance::performance_node_start); - performance_state_->Mark( - performance::NODE_PERFORMANCE_MILESTONE_V8_START, - performance::performance_v8_start); + performance_state_->Mark(performance::NODE_PERFORMANCE_MILESTONE_ENVIRONMENT); + performance_state_->Mark(performance::NODE_PERFORMANCE_MILESTONE_NODE_START, + performance::performance_node_start); + performance_state_->Mark(performance::NODE_PERFORMANCE_MILESTONE_V8_START, + performance::performance_v8_start); // By default, always abort when --abort-on-uncaught-exception was passed. should_abort_on_uncaught_toggle_[0] = 1; @@ -265,8 +253,8 @@ Environment::~Environment() { inspector_agent_.reset(); #endif - context()->SetAlignedPointerInEmbedderData( - ContextEmbedderIndex::kEnvironment, nullptr); + context()->SetAlignedPointerInEmbedderData(ContextEmbedderIndex::kEnvironment, + nullptr); if (trace_state_observer_) { tracing::AgentWriterHandle* writer = GetTracingAgentWriter(); @@ -281,7 +269,7 @@ Environment::~Environment() { delete[] http_parser_buffer_; TRACE_EVENT_NESTABLE_ASYNC_END0( - TRACING_CATEGORY_NODE1(environment), "Environment", this); + TRACING_CATEGORY_NODE1(environment), "Environment", this); // Do not unload addons on the main thread. Some addons need to retain memory // beyond the Environment's lifetime, and unloading them early would break @@ -377,48 +365,41 @@ MaybeLocal Environment::ProcessCliArgs( } void Environment::RegisterHandleCleanups() { - HandleCleanupCb close_and_finish = [](Environment* env, uv_handle_t* handle, - void* arg) { - handle->data = env; + HandleCleanupCb close_and_finish = + [](Environment* env, uv_handle_t* handle, void* arg) { + handle->data = env; - env->CloseHandle(handle, [](uv_handle_t* handle) {}); - }; + env->CloseHandle(handle, [](uv_handle_t* handle) {}); + }; - RegisterHandleCleanup( - reinterpret_cast(timer_handle()), - close_and_finish, - nullptr); + RegisterHandleCleanup(reinterpret_cast(timer_handle()), + close_and_finish, + nullptr); RegisterHandleCleanup( reinterpret_cast(immediate_check_handle()), close_and_finish, nullptr); - RegisterHandleCleanup( - reinterpret_cast(immediate_idle_handle()), - close_and_finish, - nullptr); - RegisterHandleCleanup( - reinterpret_cast(&idle_prepare_handle_), - close_and_finish, - nullptr); - RegisterHandleCleanup( - reinterpret_cast(&idle_check_handle_), - close_and_finish, - nullptr); + RegisterHandleCleanup(reinterpret_cast(immediate_idle_handle()), + close_and_finish, + nullptr); + RegisterHandleCleanup(reinterpret_cast(&idle_prepare_handle_), + close_and_finish, + nullptr); + RegisterHandleCleanup(reinterpret_cast(&idle_check_handle_), + close_and_finish, + nullptr); } void Environment::CleanupHandles() { - for (ReqWrap* request : req_wrap_queue_) - request->Cancel(); + for (ReqWrap* request : req_wrap_queue_) request->Cancel(); - for (HandleWrap* handle : handle_wrap_queue_) - handle->Close(); + for (HandleWrap* handle : handle_wrap_queue_) handle->Close(); for (HandleCleanup& hc : handle_cleanup_queue_) hc.cb_(this, hc.handle_, hc.arg_); handle_cleanup_queue_.clear(); - while (handle_cleanup_waiting_ != 0 || - request_waiting_ != 0 || + while (handle_cleanup_waiting_ != 0 || request_waiting_ != 0 || !handle_wrap_queue_.IsEmpty()) { uv_run(event_loop(), UV_RUN_ONCE); } @@ -427,8 +408,7 @@ void Environment::CleanupHandles() { } void Environment::StartProfilerIdleNotifier() { - if (profiler_idle_notifier_started_) - return; + if (profiler_idle_notifier_started_) return; profiler_idle_notifier_started_ = true; @@ -450,15 +430,14 @@ void Environment::StopProfilerIdleNotifier() { } void Environment::PrintSyncTrace() const { - if (!options_->trace_sync_io) - return; + if (!options_->trace_sync_io) return; HandleScope handle_scope(isolate()); Local stack = StackTrace::CurrentStackTrace(isolate(), 10, StackTrace::kDetailed); - fprintf(stderr, "(node:%d) WARNING: Detected use of sync API\n", - uv_os_getpid()); + fprintf( + stderr, "(node:%d) WARNING: Detected use of sync API\n", uv_os_getpid()); for (int i = 0; i < stack->GetFrameCount() - 1; i++) { Local stack_frame = stack->GetFrame(isolate(), i); @@ -495,23 +474,24 @@ void Environment::PrintSyncTrace() const { } void Environment::RunCleanup() { - TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), - "RunCleanup", this); + TraceEventScope trace_scope( + TRACING_CATEGORY_NODE1(environment), "RunCleanup", this); CleanupHandles(); while (!cleanup_hooks_.empty()) { // Copy into a vector, since we can't sort an unordered_set in-place. - std::vector callbacks( - cleanup_hooks_.begin(), cleanup_hooks_.end()); + std::vector callbacks(cleanup_hooks_.begin(), + cleanup_hooks_.end()); // We can't erase the copied elements from `cleanup_hooks_` yet, because we // need to be able to check whether they were un-scheduled by another hook. - std::sort(callbacks.begin(), callbacks.end(), + std::sort(callbacks.begin(), + callbacks.end(), [](const CleanupHookCallback& a, const CleanupHookCallback& b) { - // Sort in descending order so that the most recently inserted callbacks - // are run first. - return a.insertion_order_counter_ > b.insertion_order_counter_; - }); + // Sort in descending order so that the most recently inserted + // callbacks are run first. + return a.insertion_order_counter_ > b.insertion_order_counter_; + }); for (const CleanupHookCallback& cb : callbacks) { if (cleanup_hooks_.count(cb) == 0) { @@ -528,8 +508,8 @@ void Environment::RunCleanup() { } void Environment::RunBeforeExitCallbacks() { - TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), - "BeforeExit", this); + TraceEventScope trace_scope( + TRACING_CATEGORY_NODE1(environment), "BeforeExit", this); for (ExitCallback before_exit : before_exit_functions_) { before_exit.cb_(before_exit.arg_); } @@ -541,8 +521,8 @@ void Environment::BeforeExit(void (*cb)(void* arg), void* arg) { } void Environment::RunAtExitCallbacks() { - TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), - "AtExit", this); + TraceEventScope trace_scope( + TRACING_CATEGORY_NODE1(environment), "AtExit", this); for (ExitCallback at_exit : at_exit_functions_) { at_exit.cb_(at_exit.arg_); } @@ -554,11 +534,11 @@ void Environment::AtExit(void (*cb)(void* arg), void* arg) { } void Environment::AddPromiseHook(promise_hook_func fn, void* arg) { - auto it = std::find_if( - promise_hooks_.begin(), promise_hooks_.end(), - [&](const PromiseHookCallback& hook) { - return hook.cb_ == fn && hook.arg_ == arg; - }); + auto it = std::find_if(promise_hooks_.begin(), + promise_hooks_.end(), + [&](const PromiseHookCallback& hook) { + return hook.cb_ == fn && hook.arg_ == arg; + }); if (it != promise_hooks_.end()) { it->enable_count_++; return; @@ -571,11 +551,11 @@ void Environment::AddPromiseHook(promise_hook_func fn, void* arg) { } bool Environment::RemovePromiseHook(promise_hook_func fn, void* arg) { - auto it = std::find_if( - promise_hooks_.begin(), promise_hooks_.end(), - [&](const PromiseHookCallback& hook) { - return hook.cb_ == fn && hook.arg_ == arg; - }); + auto it = std::find_if(promise_hooks_.begin(), + promise_hooks_.end(), + [&](const PromiseHookCallback& hook) { + return hook.cb_ == fn && hook.arg_ == arg; + }); if (it == promise_hooks_.end()) return false; @@ -596,16 +576,16 @@ void Environment::EnvPromiseHook(PromiseHookType type, Environment* env = Environment::GetCurrent(context); if (env == nullptr) return; - TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), - "EnvPromiseHook", env); + TraceEventScope trace_scope( + TRACING_CATEGORY_NODE1(environment), "EnvPromiseHook", env); for (const PromiseHookCallback& hook : env->promise_hooks_) { hook.cb_(type, promise, parent, hook.arg_); } } void Environment::RunAndClearNativeImmediates() { - TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), - "RunAndClearNativeImmediates", this); + TraceEventScope trace_scope( + TRACING_CATEGORY_NODE1(environment), "RunAndClearNativeImmediates", this); size_t count = native_immediate_callbacks_.size(); if (count > 0) { size_t ref_count = 0; @@ -618,11 +598,9 @@ void Environment::RunAndClearNativeImmediates() { v8::SealHandleScope seal_handle_scope(isolate()); #endif it->cb_(this, it->data_); - if (it->refed_) - ref_count++; + if (it->refed_) ref_count++; if (UNLIKELY(try_catch.HasCaught())) { - if (!try_catch.HasTerminated()) - FatalException(isolate(), try_catch); + if (!try_catch.HasTerminated()) FatalException(isolate(), try_catch); // Bail out, remove the already executed callbacks from list // and set up a new TryCatch for the other pending callbacks. @@ -633,7 +611,8 @@ void Environment::RunAndClearNativeImmediates() { } return false; }; - while (drain_list()) {} + while (drain_list()) { + } DCHECK_GE(immediate_info()->count(), count); immediate_info()->count_dec(count); @@ -641,7 +620,6 @@ void Environment::RunAndClearNativeImmediates() { } } - void Environment::ScheduleTimer(int64_t duration_ms) { uv_timer_start(timer_handle(), RunTimers, duration_ms, 0); } @@ -656,11 +634,10 @@ void Environment::ToggleTimerRef(bool ref) { void Environment::RunTimers(uv_timer_t* handle) { Environment* env = Environment::from_timer_handle(handle); - TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), - "RunTimers", env); + TraceEventScope trace_scope( + TRACING_CATEGORY_NODE1(environment), "RunTimers", env); - if (!env->can_call_into_js()) - return; + if (!env->can_call_into_js()) return; HandleScope handle_scope(env->isolate()); Context::Scope context_scope(env->context()); @@ -685,8 +662,7 @@ void Environment::RunTimers(uv_timer_t* handle) { // code becomes invalid and needs to be rewritten. Otherwise catastrophic // timers corruption will occur and all timers behaviour will become // entirely unpredictable. - if (ret.IsEmpty()) - return; + if (ret.IsEmpty()) return; // To allow for less JS-C++ boundary crossing, the value returned from JS // serves a few purposes: @@ -715,22 +691,19 @@ void Environment::RunTimers(uv_timer_t* handle) { } } - void Environment::CheckImmediate(uv_check_t* handle) { Environment* env = Environment::from_immediate_check_handle(handle); - TraceEventScope trace_scope(TRACING_CATEGORY_NODE1(environment), - "CheckImmediate", env); + TraceEventScope trace_scope( + TRACING_CATEGORY_NODE1(environment), "CheckImmediate", env); - if (env->immediate_info()->count() == 0) - return; + if (env->immediate_info()->count() == 0) return; HandleScope scope(env->isolate()); Context::Scope context_scope(env->context()); env->RunAndClearNativeImmediates(); - if (!env->can_call_into_js()) - return; + if (!env->can_call_into_js()) return; do { MakeCallback(env->isolate(), @@ -738,23 +711,22 @@ void Environment::CheckImmediate(uv_check_t* handle) { env->immediate_callback_function(), 0, nullptr, - {0, 0}).ToLocalChecked(); + {0, 0}) + .ToLocalChecked(); } while (env->immediate_info()->has_outstanding() && env->can_call_into_js()); - if (env->immediate_info()->ref_count() == 0) - env->ToggleImmediateRef(false); + if (env->immediate_info()->ref_count() == 0) env->ToggleImmediateRef(false); } void Environment::ToggleImmediateRef(bool ref) { if (ref) { // Idle handle is needed only to stop the event loop from blocking in poll. - uv_idle_start(immediate_idle_handle(), [](uv_idle_t*){ }); + uv_idle_start(immediate_idle_handle(), [](uv_idle_t*) {}); } else { uv_idle_stop(immediate_idle_handle()); } } - Local Environment::GetNow() { uv_update_time(event_loop()); uint64_t now = uv_now(event_loop()); @@ -766,24 +738,22 @@ Local Environment::GetNow() { return Number::New(isolate(), static_cast(now)); } - void Environment::set_debug_categories(const std::string& cats, bool enabled) { std::string debug_categories = cats; while (!debug_categories.empty()) { std::string::size_type comma_pos = debug_categories.find(','); std::string wanted = ToLower(debug_categories.substr(0, comma_pos)); -#define V(name) \ - { \ - static const std::string available_category = ToLower(#name); \ - if (available_category.find(wanted) != std::string::npos) \ - set_debug_enabled(DebugCategory::name, enabled); \ - } +#define V(name) \ + { \ + static const std::string available_category = ToLower(#name); \ + if (available_category.find(wanted) != std::string::npos) \ + set_debug_enabled(DebugCategory::name, enabled); \ + } DEBUG_CATEGORY_NAMES(V) - if (comma_pos == std::string::npos) - break; + if (comma_pos == std::string::npos) break; // Use everything after the `,` as the list for the next iteration. debug_categories = debug_categories.substr(comma_pos + 1); } @@ -799,33 +769,40 @@ void CollectExceptionInfo(Environment* env, const char* dest) { obj->Set(env->context(), env->errno_string(), - Integer::New(env->isolate(), errorno)).FromJust(); + Integer::New(env->isolate(), errorno)) + .FromJust(); - obj->Set(env->context(), env->code_string(), - OneByteString(env->isolate(), err_string)).FromJust(); + obj->Set(env->context(), + env->code_string(), + OneByteString(env->isolate(), err_string)) + .FromJust(); if (message != nullptr) { - obj->Set(env->context(), env->message_string(), - OneByteString(env->isolate(), message)).FromJust(); + obj->Set(env->context(), + env->message_string(), + OneByteString(env->isolate(), message)) + .FromJust(); } Local path_buffer; if (path != nullptr) { path_buffer = - Buffer::Copy(env->isolate(), path, strlen(path)).ToLocalChecked(); + Buffer::Copy(env->isolate(), path, strlen(path)).ToLocalChecked(); obj->Set(env->context(), env->path_string(), path_buffer).FromJust(); } Local dest_buffer; if (dest != nullptr) { dest_buffer = - Buffer::Copy(env->isolate(), dest, strlen(dest)).ToLocalChecked(); + Buffer::Copy(env->isolate(), dest, strlen(dest)).ToLocalChecked(); obj->Set(env->context(), env->dest_string(), dest_buffer).FromJust(); } if (syscall != nullptr) { - obj->Set(env->context(), env->syscall_string(), - OneByteString(env->isolate(), syscall)).FromJust(); + obj->Set(env->context(), + env->syscall_string(), + OneByteString(env->isolate(), syscall)) + .FromJust(); } } @@ -834,8 +811,7 @@ void Environment::CollectExceptionInfo(Local object, const char* syscall, const char* message, const char* path) { - if (!object->IsObject() || errorno == 0) - return; + if (!object->IsObject() || errorno == 0) return; Local obj = object.As(); const char* err_string = errors::errno_string(errorno); @@ -844,8 +820,8 @@ void Environment::CollectExceptionInfo(Local object, message = strerror(errorno); } - node::CollectExceptionInfo(this, obj, errorno, err_string, - syscall, message, path, nullptr); + node::CollectExceptionInfo( + this, obj, errorno, err_string, syscall, message, path, nullptr); } void Environment::CollectUVExceptionInfo(Local object, @@ -854,8 +830,7 @@ void Environment::CollectUVExceptionInfo(Local object, const char* message, const char* path, const char* dest) { - if (!object->IsObject() || errorno == 0) - return; + if (!object->IsObject() || errorno == 0) return; Local obj = object.As(); const char* err_string = uv_err_name(errorno); @@ -864,18 +839,19 @@ void Environment::CollectUVExceptionInfo(Local object, message = uv_strerror(errorno); } - node::CollectExceptionInfo(this, obj, errorno, err_string, - syscall, message, path, dest); + node::CollectExceptionInfo( + this, obj, errorno, err_string, syscall, message, path, dest); } - void Environment::AsyncHooks::grow_async_ids_stack() { async_ids_stack_.reserve(async_ids_stack_.Length() * 3); - env()->async_hooks_binding()->Set( - env()->context(), - env()->async_ids_stack_string(), - async_ids_stack_.GetJSArray()).FromJust(); + env() + ->async_hooks_binding() + ->Set(env()->context(), + env()->async_ids_stack_string(), + async_ids_stack_.GetJSArray()) + .FromJust(); } uv_key_t Environment::thread_local_env = {}; @@ -903,12 +879,10 @@ void Environment::BuildEmbedderGraph(Isolate* isolate, EmbedderGraph* graph, void* data) { MemoryTracker tracker(isolate, graph); - static_cast(data)->ForEachBaseObject([&](BaseObject* obj) { - tracker.Track(obj); - }); + static_cast(data)->ForEachBaseObject( + [&](BaseObject* obj) { tracker.Track(obj); }); } - // Not really any better place than env.cc at this moment. void BaseObject::DeleteMe(void* data) { BaseObject* self = static_cast(data); diff --git a/src/env.h b/src/env.h index 40bd0797a2ffd0..a7c01c7718f53b 100644 --- a/src/env.h +++ b/src/env.h @@ -103,22 +103,22 @@ constexpr size_t kFsStatsBufferLength = kFsStatsFieldsNumber * 2; // Private symbols are per-isolate primitives but Environment proxies them // for the sake of convenience. Strings should be ASCII-only and have a // "node:" prefix to avoid name clashes with third-party code. -#define PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(V) \ - V(alpn_buffer_private_symbol, "node:alpnBuffer") \ - V(arrow_message_private_symbol, "node:arrowMessage") \ - V(contextify_context_private_symbol, "node:contextify:context") \ - V(contextify_global_private_symbol, "node:contextify:global") \ - V(decorated_private_symbol, "node:decorated") \ - V(napi_env, "node:napi:env") \ - V(napi_wrapper, "node:napi:wrapper") \ - V(sab_lifetimepartner_symbol, "node:sharedArrayBufferLifetimePartner") \ +#define PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(V) \ + V(alpn_buffer_private_symbol, "node:alpnBuffer") \ + V(arrow_message_private_symbol, "node:arrowMessage") \ + V(contextify_context_private_symbol, "node:contextify:context") \ + V(contextify_global_private_symbol, "node:contextify:global") \ + V(decorated_private_symbol, "node:decorated") \ + V(napi_env, "node:napi:env") \ + V(napi_wrapper, "node:napi:wrapper") \ + V(sab_lifetimepartner_symbol, "node:sharedArrayBufferLifetimePartner") // Symbols are per-isolate primitives but Environment proxies them // for the sake of convenience. -#define PER_ISOLATE_SYMBOL_PROPERTIES(V) \ - V(handle_onclose_symbol, "handle_onclose") \ - V(oninit_symbol, "oninit") \ - V(owner_symbol, "owner") \ +#define PER_ISOLATE_SYMBOL_PROPERTIES(V) \ + V(handle_onclose_symbol, "handle_onclose") \ + V(oninit_symbol, "oninit") \ + V(owner_symbol, "owner") // Strings are per-isolate primitives but Environment proxies them // for the sake of convenience. Strings should be ASCII-only. @@ -389,7 +389,8 @@ class Environment; class IsolateData { public: - IsolateData(v8::Isolate* isolate, uv_loop_t* event_loop, + IsolateData(v8::Isolate* isolate, + uv_loop_t* event_loop, MultiIsolatePlatform* platform = nullptr, uint32_t* zero_fill_field = nullptr); ~IsolateData(); @@ -402,7 +403,7 @@ class IsolateData { #define VP(PropertyName, StringValue) V(v8::Private, PropertyName) #define VY(PropertyName, StringValue) V(v8::Symbol, PropertyName) #define VS(PropertyName, StringValue) V(v8::String, PropertyName) -#define V(TypeName, PropertyName) \ +#define V(TypeName, PropertyName) \ inline v8::Local PropertyName(v8::Isolate* isolate) const; PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(VP) PER_ISOLATE_SYMBOL_PROPERTIES(VY) @@ -419,8 +420,7 @@ class IsolateData { #define VP(PropertyName, StringValue) V(v8::Private, PropertyName) #define VY(PropertyName, StringValue) V(v8::Symbol, PropertyName) #define VS(PropertyName, StringValue) V(v8::String, PropertyName) -#define V(TypeName, PropertyName) \ - v8::Eternal PropertyName ## _; +#define V(TypeName, PropertyName) v8::Eternal PropertyName##_; PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(VP) PER_ISOLATE_SYMBOL_PROPERTIES(VY) PER_ISOLATE_STRING_PROPERTIES(VS) @@ -447,15 +447,15 @@ struct ContextInfo { // Listing the AsyncWrap provider types first enables us to cast directly // from a provider type to a debug category. -#define DEBUG_CATEGORY_NAMES(V) \ - NODE_ASYNC_PROVIDER_TYPES(V) \ - V(INSPECTOR_SERVER) +#define DEBUG_CATEGORY_NAMES(V) \ + NODE_ASYNC_PROVIDER_TYPES(V) \ + V(INSPECTOR_SERVER) enum class DebugCategory { #define V(name) name, DEBUG_CATEGORY_NAMES(V) #undef V - CATEGORY_COUNT + CATEGORY_COUNT }; class Environment { @@ -514,7 +514,6 @@ class Environment { DISALLOW_COPY_AND_ASSIGN(DefaultTriggerAsyncIdScope); }; - private: friend class Environment; // So we can call the constructor. inline AsyncHooks(); @@ -564,12 +563,7 @@ class Environment { friend class Environment; // So we can call the constructor. inline explicit ImmediateInfo(v8::Isolate* isolate); - enum Fields { - kCount, - kRefCount, - kHasOutstanding, - kFieldsCount - }; + enum Fields { kCount, kRefCount, kHasOutstanding, kFieldsCount }; AliasedBuffer fields_; @@ -586,11 +580,7 @@ class Environment { friend class Environment; // So we can call the constructor. inline explicit TickInfo(v8::Isolate* isolate); - enum Fields { - kHasTickScheduled = 0, - kHasRejectionToWarn, - kFieldsCount - }; + enum Fields { kHasTickScheduled = 0, kHasRejectionToWarn, kFieldsCount }; AliasedBuffer fields_; @@ -710,8 +700,7 @@ class Environment { std::unordered_multimap hash_to_module_map; std::unordered_map id_to_module_map; - std::unordered_map - id_to_script_map; + std::unordered_map id_to_script_map; inline uint32_t get_next_module_id(); inline uint32_t get_next_script_id(); @@ -739,10 +728,10 @@ class Environment { inline AliasedBuffer* fs_stats_field_array(); inline AliasedBuffer* - fs_stats_field_bigint_array(); + fs_stats_field_bigint_array(); inline std::vector>& - file_handle_read_wrap_freelist(); + file_handle_read_wrap_freelist(); inline performance::performance_state* performance_state(); inline std::unordered_map* performance_marks(); @@ -793,14 +782,11 @@ class Environment { const char* path = nullptr, const char* dest = nullptr); - inline v8::Local - NewFunctionTemplate(v8::FunctionCallback callback, - v8::Local signature = - v8::Local(), - v8::ConstructorBehavior behavior = - v8::ConstructorBehavior::kAllow, - v8::SideEffectType side_effect = - v8::SideEffectType::kHasSideEffect); + inline v8::Local NewFunctionTemplate( + v8::FunctionCallback callback, + v8::Local signature = v8::Local(), + v8::ConstructorBehavior behavior = v8::ConstructorBehavior::kAllow, + v8::SideEffectType side_effect = v8::SideEffectType::kHasSideEffect); // Convenience methods for NewFunctionTemplate(). inline void SetMethod(v8::Local that, @@ -836,7 +822,7 @@ class Environment { #define VP(PropertyName, StringValue) V(v8::Private, PropertyName) #define VY(PropertyName, StringValue) V(v8::Symbol, PropertyName) #define VS(PropertyName, StringValue) V(v8::String, PropertyName) -#define V(TypeName, PropertyName) \ +#define V(TypeName, PropertyName) \ inline v8::Local PropertyName() const; PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(VP) PER_ISOLATE_SYMBOL_PROPERTIES(VY) @@ -846,9 +832,9 @@ class Environment { #undef VY #undef VP -#define V(PropertyName, TypeName) \ - inline v8::Local PropertyName() const; \ - inline void set_ ## PropertyName(v8::Local value); +#define V(PropertyName, TypeName) \ + inline v8::Local PropertyName() const; \ + inline void set_##PropertyName(v8::Local value); ENVIRONMENT_STRONG_PERSISTENT_PROPERTIES(V) #undef V @@ -860,7 +846,7 @@ class Environment { typedef ListHead HandleWrapQueue; typedef ListHead, &ReqWrap::req_wrap_queue_> - ReqWrapQueue; + ReqWrapQueue; inline HandleWrapQueue* handle_wrap_queue() { return &handle_wrap_queue_; } inline ReqWrapQueue* req_wrap_queue() { return &req_wrap_queue_; } @@ -885,25 +871,21 @@ class Environment { inline void SetImmediate(native_immediate_callback cb, void* data, v8::Local obj = v8::Local()); - inline void SetUnrefImmediate(native_immediate_callback cb, - void* data, - v8::Local obj = - v8::Local()); + inline void SetUnrefImmediate( + native_immediate_callback cb, + void* data, + v8::Local obj = v8::Local()); // This needs to be available for the JS-land setImmediate(). void ToggleImmediateRef(bool ref); - class TrackingTraceStateObserver : - public v8::TracingController::TraceStateObserver { + class TrackingTraceStateObserver + : public v8::TracingController::TraceStateObserver { public: explicit TrackingTraceStateObserver(Environment* env) : env_(env) {} - void OnTraceEnabled() override { - UpdateTraceCategoryState(); - } + void OnTraceEnabled() override { UpdateTraceCategoryState(); } - void OnTraceDisabled() override { - UpdateTraceCategoryState(); - } + void OnTraceDisabled() override { UpdateTraceCategoryState(); } private: void UpdateTraceCategoryState(); @@ -1109,7 +1091,8 @@ class Environment { // Use an unordered_set, so that we have efficient insertion and removal. std::unordered_set cleanup_hooks_; + CleanupHookCallback::Equal> + cleanup_hooks_; uint64_t cleanup_hook_counter_ = 0; static void EnvPromiseHook(v8::PromiseHookType type, @@ -1119,7 +1102,7 @@ class Environment { template void ForEachBaseObject(T&& iterator); -#define V(PropertyName, TypeName) Persistent PropertyName ## _; +#define V(PropertyName, TypeName) Persistent PropertyName##_; ENVIRONMENT_STRONG_PERSISTENT_PROPERTIES(V) #undef V diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index acc83d017e0633..159fec8946b7be 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -21,11 +21,10 @@ #include "async_wrap-inl.h" #include "env-inl.h" -#include "util-inl.h" -#include "node.h" #include "handle_wrap.h" +#include "node.h" #include "string_bytes.h" - +#include "util-inl.h" namespace node { @@ -47,7 +46,7 @@ using v8::Value; namespace { -class FSEventWrap: public HandleWrap { +class FSEventWrap : public HandleWrap { public: static void Initialize(Local target, Local unused, @@ -67,14 +66,15 @@ class FSEventWrap: public HandleWrap { FSEventWrap(Environment* env, Local object); ~FSEventWrap() override; - static void OnEvent(uv_fs_event_t* handle, const char* filename, int events, - int status); + static void OnEvent(uv_fs_event_t* handle, + const char* filename, + int events, + int status); uv_fs_event_t handle_; enum encoding encoding_ = kDefaultEncoding; }; - FSEventWrap::FSEventWrap(Environment* env, Local object) : HandleWrap(env, object, @@ -83,9 +83,7 @@ FSEventWrap::FSEventWrap(Environment* env, Local object) MarkAsUninitialized(); } - -FSEventWrap::~FSEventWrap() { -} +FSEventWrap::~FSEventWrap() {} void FSEventWrap::GetInitialized(const FunctionCallbackInfo& args) { FSEventWrap* wrap = Unwrap(args.This()); @@ -120,12 +118,13 @@ void FSEventWrap::Initialize(Local target, Local(), static_cast(ReadOnly | DontDelete | v8::DontEnum)); - target->Set(env->context(), - fsevent_string, - t->GetFunction(context).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + fsevent_string, + t->GetFunction(context).ToLocalChecked()) + .FromJust(); } - void FSEventWrap::New(const FunctionCallbackInfo& args) { CHECK(args.IsConstructCall()); Environment* env = Environment::GetCurrent(args); @@ -147,8 +146,7 @@ void FSEventWrap::Start(const FunctionCallbackInfo& args) { CHECK_NOT_NULL(*path); unsigned int flags = 0; - if (args[2]->IsTrue()) - flags |= UV_FS_EVENT_RECURSIVE; + if (args[2]->IsTrue()) flags |= UV_FS_EVENT_RECURSIVE; wrap->encoding_ = ParseEncoding(env->isolate(), args[3], kDefaultEncoding); @@ -173,9 +171,10 @@ void FSEventWrap::Start(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(err); } - -void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename, - int events, int status) { +void FSEventWrap::OnEvent(uv_fs_event_t* handle, + const char* filename, + int events, + int status) { FSEventWrap* wrap = static_cast(handle->data); Environment* env = wrap->env(); @@ -207,24 +206,17 @@ void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename, } Local argv[] = { - Integer::New(env->isolate(), status), - event_string, - Null(env->isolate()) - }; + Integer::New(env->isolate(), status), event_string, Null(env->isolate())}; if (filename != nullptr) { Local error; - MaybeLocal fn = StringBytes::Encode(env->isolate(), - filename, - wrap->encoding_, - &error); + MaybeLocal fn = + StringBytes::Encode(env->isolate(), filename, wrap->encoding_, &error); if (fn.IsEmpty()) { argv[0] = Integer::New(env->isolate(), UV_EINVAL); - argv[2] = StringBytes::Encode(env->isolate(), - filename, - strlen(filename), - BUFFER, - &error).ToLocalChecked(); + argv[2] = StringBytes::Encode( + env->isolate(), filename, strlen(filename), BUFFER, &error) + .ToLocalChecked(); } else { argv[2] = fn.ToLocalChecked(); } diff --git a/src/handle_wrap.cc b/src/handle_wrap.cc index d4c5962c35e806..2c5b3fb93e74ee 100644 --- a/src/handle_wrap.cc +++ b/src/handle_wrap.cc @@ -22,8 +22,8 @@ #include "handle_wrap.h" #include "async_wrap-inl.h" #include "env-inl.h" -#include "util-inl.h" #include "node.h" +#include "util-inl.h" namespace node { @@ -35,32 +35,26 @@ using v8::Local; using v8::Object; using v8::Value; - void HandleWrap::Ref(const FunctionCallbackInfo& args) { HandleWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); - if (IsAlive(wrap)) - uv_ref(wrap->GetHandle()); + if (IsAlive(wrap)) uv_ref(wrap->GetHandle()); } - void HandleWrap::Unref(const FunctionCallbackInfo& args) { HandleWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); - if (IsAlive(wrap)) - uv_unref(wrap->GetHandle()); + if (IsAlive(wrap)) uv_unref(wrap->GetHandle()); } - void HandleWrap::HasRef(const FunctionCallbackInfo& args) { HandleWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); args.GetReturnValue().Set(HasRef(wrap)); } - void HandleWrap::Close(const FunctionCallbackInfo& args) { HandleWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); @@ -69,49 +63,41 @@ void HandleWrap::Close(const FunctionCallbackInfo& args) { } void HandleWrap::Close(Local close_callback) { - if (state_ != kInitialized) - return; + if (state_ != kInitialized) return; CHECK_EQ(false, persistent().IsEmpty()); uv_close(handle_, OnClose); state_ = kClosing; if (!close_callback.IsEmpty() && close_callback->IsFunction()) { - object()->Set(env()->context(), - env()->handle_onclose_symbol(), - close_callback) + object() + ->Set(env()->context(), env()->handle_onclose_symbol(), close_callback) .FromMaybe(false); } } - void HandleWrap::MarkAsInitialized() { env()->handle_wrap_queue()->PushBack(this); state_ = kInitialized; } - void HandleWrap::MarkAsUninitialized() { handle_wrap_queue_.Remove(); state_ = kClosed; } - HandleWrap::HandleWrap(Environment* env, Local object, uv_handle_t* handle, AsyncWrap::ProviderType provider) - : AsyncWrap(env, object, provider), - state_(kInitialized), - handle_(handle) { + : AsyncWrap(env, object, provider), state_(kInitialized), handle_(handle) { handle_->data = this; HandleScope scope(env->isolate()); env->handle_wrap_queue()->PushBack(this); } - void HandleWrap::OnClose(uv_handle_t* handle) { - std::unique_ptr wrap { static_cast(handle->data) }; + std::unique_ptr wrap{static_cast(handle->data)}; Environment* env = wrap->env(); HandleScope scope(env->isolate()); Context::Scope context_scope(env->context()); @@ -124,8 +110,9 @@ void HandleWrap::OnClose(uv_handle_t* handle) { wrap->OnClose(); - if (wrap->object()->Has(env->context(), env->handle_onclose_symbol()) - .FromMaybe(false)) { + if (wrap->object() + ->Has(env->context(), env->handle_onclose_symbol()) + .FromMaybe(false)) { wrap->MakeCallback(env->handle_onclose_symbol(), 0, nullptr); } } @@ -145,5 +132,4 @@ Local HandleWrap::GetConstructorTemplate(Environment* env) { return tmpl; } - } // namespace node diff --git a/src/handle_wrap.h b/src/handle_wrap.h index b2722511c3c09f..7991afe627b3d5 100644 --- a/src/handle_wrap.h +++ b/src/handle_wrap.h @@ -106,7 +106,6 @@ class HandleWrap : public AsyncWrap { uv_handle_t* const handle_; }; - } // namespace node #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS diff --git a/src/heap_utils.cc b/src/heap_utils.cc index a1ca118e6c1f93..6604cf4b415ba5 100644 --- a/src/heap_utils.cc +++ b/src/heap_utils.cc @@ -61,10 +61,9 @@ class JSGraph : public EmbedderGraph { explicit JSGraph(Isolate* isolate) : isolate_(isolate) {} Node* V8Node(const Local& value) override { - std::unique_ptr n { new JSGraphJSNode(isolate_, value) }; + std::unique_ptr n{new JSGraphJSNode(isolate_, value)}; auto it = engine_nodes_.find(n.get()); - if (it != engine_nodes_.end()) - return *it; + if (it != engine_nodes_.end()) return *it; engine_nodes_.insert(n.get()); return AddNode(std::unique_ptr(n.release())); } @@ -162,8 +161,8 @@ class JSGraph : public EmbedderGraph { const char* edge_name = edge.first; if (edge_name != nullptr) { if (!String::NewFromUtf8( - isolate_, edge_name, v8::NewStringType::kNormal) - .ToLocal(&edge_name_value)) { + isolate_, edge_name, v8::NewStringType::kNormal) + .ToLocal(&edge_name_value)) { return MaybeLocal(); } } else { @@ -193,11 +192,9 @@ void BuildEmbedderGraph(const FunctionCallbackInfo& args) { JSGraph graph(env->isolate()); Environment::BuildEmbedderGraph(env->isolate(), &graph, env); Local ret; - if (graph.CreateObject().ToLocal(&ret)) - args.GetReturnValue().Set(ret); + if (graph.CreateObject().ToLocal(&ret)) args.GetReturnValue().Set(ret); } - class BufferOutputStream : public v8::OutputStream { public: BufferOutputStream() : buffer_(new JSString()) {} @@ -210,16 +207,14 @@ class BufferOutputStream : public v8::OutputStream { } Local ToString(Isolate* isolate) { - return String::NewExternalOneByte(isolate, - buffer_.release()).ToLocalChecked(); + return String::NewExternalOneByte(isolate, buffer_.release()) + .ToLocalChecked(); } private: class JSString : public String::ExternalOneByteStringResource { public: - void Append(char* data, size_t count) { - store_.append(data, count); - } + void Append(char* data, size_t count) { store_.append(data, count); } const char* data() const override { return store_.data(); } size_t length() const override { return store_.size(); } @@ -238,8 +233,8 @@ void CreateHeapDump(const FunctionCallbackInfo& args) { snapshot->Serialize(&out, HeapSnapshot::kJSON); const_cast(snapshot)->Delete(); Local ret; - if (JSON::Parse(isolate->GetCurrentContext(), - out.ToString(isolate)).ToLocal(&ret)) { + if (JSON::Parse(isolate->GetCurrentContext(), out.ToString(isolate)) + .ToLocal(&ret)) { args.GetReturnValue().Set(ret); } } diff --git a/src/http_parser_adaptor.h b/src/http_parser_adaptor.h index 6d786bd09519b5..21ba383d30657b 100644 --- a/src/http_parser_adaptor.h +++ b/src/http_parser_adaptor.h @@ -2,15 +2,15 @@ #define SRC_HTTP_PARSER_ADAPTOR_H_ #ifdef NODE_EXPERIMENTAL_HTTP -# include "llhttp.h" +#include "llhttp.h" typedef llhttp_type_t parser_type_t; typedef llhttp_errno_t parser_errno_t; typedef llhttp_settings_t parser_settings_t; typedef llhttp_t parser_t; -#else /* !NODE_EXPERIMENTAL_HTTP */ -# include "http_parser.h" +#else /* !NODE_EXPERIMENTAL_HTTP */ +#include "http_parser.h" typedef enum http_parser_type parser_type_t; typedef enum http_errno parser_errno_t; @@ -19,6 +19,6 @@ typedef http_parser parser_t; #define HPE_USER HPE_UNKNOWN -#endif /* NODE_EXPERIMENTAL_HTTP */ +#endif /* NODE_EXPERIMENTAL_HTTP */ -#endif /* SRC_HTTP_PARSER_ADAPTOR_H_ */ +#endif /* SRC_HTTP_PARSER_ADAPTOR_H_ */ diff --git a/src/inspector/main_thread_interface.cc b/src/inspector/main_thread_interface.cc index 15ffb49d74d1d4..2e5d736cdf0264 100644 --- a/src/inspector/main_thread_interface.cc +++ b/src/inspector/main_thread_interface.cc @@ -3,27 +3,27 @@ #include "node_mutex.h" #include "v8-inspector.h" -#include #include +#include #include "util-inl.h" namespace node { namespace inspector { namespace { -using v8_inspector::StringView; using v8_inspector::StringBuffer; +using v8_inspector::StringView; template class DeletableWrapper : public Deletable { public: explicit DeletableWrapper(std::unique_ptr object) - : object_(std::move(object)) {} + : object_(std::move(object)) {} ~DeletableWrapper() override = default; static T* get(MainThreadInterface* thread, int id) { - return - static_cast*>(thread->GetObject(id))->object_.get(); + return static_cast*>(thread->GetObject(id)) + ->object_.get(); } private: @@ -40,7 +40,7 @@ template class CreateObjectRequest : public Request { public: CreateObjectRequest(int object_id, Factory factory) - : object_id_(object_id), factory_(std::move(factory)) {} + : object_id_(object_id), factory_(std::move(factory)) {} void Call(MainThreadInterface* thread) { thread->AddObject(object_id_, WrapInDeletable(factory_(thread))); @@ -86,11 +86,9 @@ class CallRequest : public Request { class DispatchMessagesTask : public v8::Task { public: explicit DispatchMessagesTask(MainThreadInterface* thread) - : thread_(thread) {} + : thread_(thread) {} - void Run() override { - thread_->DispatchMessages(); - } + void Run() override { thread_->DispatchMessages(); } private: MainThreadInterface* thread_; @@ -106,13 +104,13 @@ void DisposePairCallback(uv_handle_t* ref) { template class AnotherThreadObjectReference { public: - AnotherThreadObjectReference( - std::shared_ptr thread, int object_id) + AnotherThreadObjectReference(std::shared_ptr thread, + int object_id) : thread_(thread), object_id_(object_id) {} template - AnotherThreadObjectReference( - std::shared_ptr thread, Factory factory) + AnotherThreadObjectReference(std::shared_ptr thread, + Factory factory) : AnotherThreadObjectReference(thread, thread->newObjectId()) { thread_->Post(NewCreateRequest(object_id_, std::move(factory))); } @@ -127,8 +125,8 @@ class AnotherThreadObjectReference { template void Call(Fn fn) const { using Request = CallRequest; - thread_->Post(std::unique_ptr( - new Request(object_id_, std::move(fn)))); + thread_->Post( + std::unique_ptr(new Request(object_id_, std::move(fn)))); } template @@ -140,8 +138,9 @@ class AnotherThreadObjectReference { // This has to use non-const reference to support std::bind with non-copyable // types template - static void Apply(T* target, void (T::*fn)(Argument), - /* NOLINT (runtime/references) */ Argument& argument) { + static void Apply(T* target, + void (T::*fn)(Argument), + /* NOLINT (runtime/references) */ Argument& argument) { (target->*fn)(std::move(argument)); } @@ -152,8 +151,7 @@ class AnotherThreadObjectReference { class MainThreadSessionState { public: MainThreadSessionState(MainThreadInterface* thread, bool prevent_shutdown) - : thread_(thread), - prevent_shutdown_(prevent_shutdown) {} + : thread_(thread), prevent_shutdown_(prevent_shutdown) {} static std::unique_ptr Create( MainThreadInterface* thread, bool prevent_shutdown) { @@ -184,9 +182,10 @@ class CrossThreadInspectorSession : public InspectorSession { std::shared_ptr thread, std::unique_ptr delegate, bool prevent_shutdown) - : state_(thread, std::bind(MainThreadSessionState::Create, - std::placeholders::_1, - prevent_shutdown)) { + : state_(thread, + std::bind(MainThreadSessionState::Create, + std::placeholders::_1, + prevent_shutdown)) { state_.Call(&MainThreadSessionState::Connect, std::move(delegate)); } @@ -202,12 +201,11 @@ class CrossThreadInspectorSession : public InspectorSession { class ThreadSafeDelegate : public InspectorSessionDelegate { public: ThreadSafeDelegate(std::shared_ptr thread, int object_id) - : thread_(thread), delegate_(thread, object_id) {} + : thread_(thread), delegate_(thread, object_id) {} void SendMessageToFrontend(const v8_inspector::StringView& message) override { - delegate_.Call( - [m = StringBuffer::create(message)] - (InspectorSessionDelegate* delegate) { + delegate_.Call([m = StringBuffer::create(message)]( + InspectorSessionDelegate* delegate) { delegate->SendMessageToFrontend(m->string()); }); } @@ -218,22 +216,22 @@ class ThreadSafeDelegate : public InspectorSessionDelegate { }; } // namespace - -MainThreadInterface::MainThreadInterface(Agent* agent, uv_loop_t* loop, +MainThreadInterface::MainThreadInterface(Agent* agent, + uv_loop_t* loop, v8::Isolate* isolate, v8::Platform* platform) - : agent_(agent), isolate_(isolate), - platform_(platform) { + : agent_(agent), isolate_(isolate), platform_(platform) { main_thread_request_.reset(new AsyncAndInterface(uv_async_t(), this)); - CHECK_EQ(0, uv_async_init(loop, &main_thread_request_->first, - DispatchMessagesAsyncCallback)); + CHECK_EQ( + 0, + uv_async_init( + loop, &main_thread_request_->first, DispatchMessagesAsyncCallback)); // Inspector uv_async_t should not prevent main loop shutdown. uv_unref(reinterpret_cast(&main_thread_request_->first)); } MainThreadInterface::~MainThreadInterface() { - if (handle_) - handle_->Reset(); + if (handle_) handle_->Reset(); } // static @@ -256,11 +254,13 @@ void MainThreadInterface::Post(std::unique_ptr request) { CHECK_EQ(0, uv_async_send(&main_thread_request_->first)); if (isolate_ != nullptr && platform_ != nullptr) { std::shared_ptr taskrunner = - platform_->GetForegroundTaskRunner(isolate_); + platform_->GetForegroundTaskRunner(isolate_); taskrunner->PostTask(std::make_unique(this)); - isolate_->RequestInterrupt([](v8::Isolate* isolate, void* thread) { - static_cast(thread)->DispatchMessages(); - }, this); + isolate_->RequestInterrupt( + [](v8::Isolate* isolate, void* thread) { + static_cast(thread)->DispatchMessages(); + }, + this); } } incoming_message_cond_.Broadcast(scoped_lock); @@ -279,8 +279,7 @@ bool MainThreadInterface::WaitForFrontendEvent() { } void MainThreadInterface::DispatchMessages() { - if (dispatching_messages_) - return; + if (dispatching_messages_) return; dispatching_messages_ = true; bool had_messages = false; do { @@ -300,13 +299,11 @@ void MainThreadInterface::DispatchMessages() { } std::shared_ptr MainThreadInterface::GetHandle() { - if (handle_ == nullptr) - handle_ = std::make_shared(this); + if (handle_ == nullptr) handle_ = std::make_shared(this); return handle_; } -void MainThreadInterface::AddObject(int id, - std::unique_ptr object) { +void MainThreadInterface::AddObject(int id, std::unique_ptr object) { CHECK_NE(nullptr, object); managed_objects_[id] = std::move(object); } @@ -340,8 +337,7 @@ std::unique_ptr Utf8ToStringView(const std::string& message) { } std::unique_ptr MainThreadHandle::Connect( - std::unique_ptr delegate, - bool prevent_shutdown) { + std::unique_ptr delegate, bool prevent_shutdown) { return std::unique_ptr( new CrossThreadInspectorSession(++next_session_id_, shared_from_this(), @@ -351,8 +347,7 @@ std::unique_ptr MainThreadHandle::Connect( bool MainThreadHandle::Post(std::unique_ptr request) { Mutex::ScopedLock scoped_lock(block_lock_); - if (!main_thread_) - return false; + if (!main_thread_) return false; main_thread_->Post(std::move(request)); return true; } diff --git a/src/inspector/main_thread_interface.h b/src/inspector/main_thread_interface.h index 3e8eb13645b009..c7866e3e23562a 100644 --- a/src/inspector/main_thread_interface.h +++ b/src/inspector/main_thread_interface.h @@ -42,17 +42,14 @@ using MessageQueue = std::deque>; class MainThreadHandle : public std::enable_shared_from_this { public: explicit MainThreadHandle(MainThreadInterface* main_thread) - : main_thread_(main_thread) { - } + : main_thread_(main_thread) {} ~MainThreadHandle() { CHECK_NULL(main_thread_); // main_thread_ should have called Reset } std::unique_ptr Connect( std::unique_ptr delegate, bool prevent_shutdown); - int newObjectId() { - return ++next_object_id_; - } + int newObjectId() { return ++next_object_id_; } bool Post(std::unique_ptr request); std::unique_ptr MakeDelegateThreadSafe( std::unique_ptr delegate); @@ -71,7 +68,9 @@ class MainThreadHandle : public std::enable_shared_from_this { class MainThreadInterface { public: - MainThreadInterface(Agent* agent, uv_loop_t*, v8::Isolate* isolate, + MainThreadInterface(Agent* agent, + uv_loop_t*, + v8::Isolate* isolate, v8::Platform* platform); ~MainThreadInterface(); @@ -79,9 +78,7 @@ class MainThreadInterface { void Post(std::unique_ptr request); bool WaitForFrontendEvent(); std::shared_ptr GetHandle(); - Agent* inspector_agent() { - return agent_; - } + Agent* inspector_agent() { return agent_; } void AddObject(int handle, std::unique_ptr object); Deletable* GetObject(int id); Deletable* GetObjectIfExists(int id); @@ -94,7 +91,7 @@ class MainThreadInterface { static void CloseAsync(AsyncAndInterface*); MessageQueue requests_; - Mutex requests_lock_; // requests_ live across threads + Mutex requests_lock_; // requests_ live across threads // This queue is to maintain the order of the messages for the cases // when we reenter the DispatchMessages function. MessageQueue dispatching_message_queue_; diff --git a/src/inspector/node_string.cc b/src/inspector/node_string.cc index cb9e90c20e807a..05a376cfc3a9d9 100644 --- a/src/inspector/node_string.cc +++ b/src/inspector/node_string.cc @@ -17,34 +17,31 @@ void builderAppendQuotedString(StringBuilder& builder, const String& string) { icu::UnicodeString utf16 = icu::UnicodeString::fromUTF8( icu::StringPiece(string.data(), string.length())); escapeWideStringForJSON( - reinterpret_cast(utf16.getBuffer()), utf16.length(), + reinterpret_cast(utf16.getBuffer()), + utf16.length(), &builder); } builder.put('"'); } std::unique_ptr parseJSON(const String& string) { - if (string.empty()) - return nullptr; + if (string.empty()) return nullptr; - icu::UnicodeString utf16 = - icu::UnicodeString::fromUTF8(icu::StringPiece(string.data(), - string.length())); + icu::UnicodeString utf16 = icu::UnicodeString::fromUTF8( + icu::StringPiece(string.data(), string.length())); return parseJSONCharacters( reinterpret_cast(utf16.getBuffer()), utf16.length()); } std::unique_ptr parseJSON(v8_inspector::StringView string) { - if (string.length() == 0) - return nullptr; + if (string.length() == 0) return nullptr; if (string.is8Bit()) return parseJSONCharacters(string.characters8(), string.length()); return parseJSONCharacters(string.characters16(), string.length()); } String StringViewToUtf8(v8_inspector::StringView view) { - if (view.length() == 0) - return ""; + if (view.length() == 0) return ""; if (view.is8Bit()) { return std::string(reinterpret_cast(view.characters8()), view.length()); @@ -89,4 +86,3 @@ double toDouble(const char* buffer, size_t length, bool* ok) { } // namespace protocol } // namespace inspector } // namespace node - diff --git a/src/inspector/node_string.h b/src/inspector/node_string.h index 504798853675a5..ca98a575a3c029 100644 --- a/src/inspector/node_string.h +++ b/src/inspector/node_string.h @@ -26,7 +26,8 @@ inline void builderAppend(StringBuilder& builder, char c) { } // NOLINTNEXTLINE(runtime/references) -inline void builderAppend(StringBuilder& builder, const char* value, +inline void builderAppend(StringBuilder& builder, + const char* value, size_t length) { builder.write(value, length); } diff --git a/src/inspector/tracing_agent.cc b/src/inspector/tracing_agent.cc index 09d213d8ae539f..1797e7e55a167a 100644 --- a/src/inspector/tracing_agent.cc +++ b/src/inspector/tracing_agent.cc @@ -95,8 +95,7 @@ class InspectorTraceWriter : public node::tracing::AsyncTraceWriter { } void Flush(bool) override { - if (!json_writer_) - return; + if (!json_writer_) return; json_writer_.reset(); std::ostringstream result( "{\"method\":\"NodeTracing.dataCollected\",\"params\":", diff --git a/src/inspector/tracing_agent.h b/src/inspector/tracing_agent.h index 29587b03c88211..8596c97835ad48 100644 --- a/src/inspector/tracing_agent.h +++ b/src/inspector/tracing_agent.h @@ -5,7 +5,6 @@ #include "tracing/agent.h" #include "v8.h" - namespace node { class Environment; @@ -37,7 +36,6 @@ class TracingAgent : public NodeTracing::Backend { std::shared_ptr frontend_; }; - } // namespace protocol } // namespace inspector } // namespace node diff --git a/src/inspector/worker_agent.cc b/src/inspector/worker_agent.cc index d343de8494a36f..3ec877c8ea6297 100644 --- a/src/inspector/worker_agent.cc +++ b/src/inspector/worker_agent.cc @@ -1,19 +1,18 @@ #include "worker_agent.h" #include "main_thread_interface.h" -#include "worker_inspector.h" #include "util-inl.h" +#include "worker_inspector.h" namespace node { namespace inspector { namespace protocol { -class NodeWorkers - : public std::enable_shared_from_this { +class NodeWorkers : public std::enable_shared_from_this { public: explicit NodeWorkers(std::weak_ptr frontend, - std::shared_ptr thread) - : frontend_(frontend), thread_(thread) {} + std::shared_ptr thread) + : frontend_(frontend), thread_(thread) {} void WorkerCreated(const std::string& title, const std::string& url, bool waiting, @@ -33,7 +32,7 @@ namespace { class AgentWorkerInspectorDelegate : public WorkerDelegate { public: explicit AgentWorkerInspectorDelegate(std::shared_ptr workers) - : workers_(workers) {} + : workers_(workers) {} void WorkerCreated(const std::string& title, const std::string& url, @@ -50,11 +49,9 @@ class ParentInspectorSessionDelegate : public InspectorSessionDelegate { public: ParentInspectorSessionDelegate(const std::string& id, std::shared_ptr workers) - : id_(id), workers_(workers) {} + : id_(id), workers_(workers) {} - ~ParentInspectorSessionDelegate() override { - workers_->Detached(id_); - } + ~ParentInspectorSessionDelegate() override { workers_->Detached(id_); } void SendMessageToFrontend(const v8_inspector::StringView& msg) override { std::string message = protocol::StringUtil::StringViewToUtf8(msg); @@ -73,21 +70,20 @@ std::unique_ptr WorkerInfo(const std::string& id, .setWorkerId(id) .setTitle(title) .setUrl(url) - .setType("worker").build(); + .setType("worker") + .build(); } } // namespace WorkerAgent::WorkerAgent(std::weak_ptr manager) - : manager_(manager) {} - + : manager_(manager) {} void WorkerAgent::Wire(UberDispatcher* dispatcher) { frontend_.reset(new NodeWorker::Frontend(dispatcher->channel())); NodeWorker::Dispatcher::wire(dispatcher, this); auto manager = manager_.lock(); CHECK_NOT_NULL(manager); - workers_ = - std::make_shared(frontend_, manager->MainThread()); + workers_ = std::make_shared(frontend_, manager->MainThread()); } DispatchResponse WorkerAgent::sendMessageToWorker(const String& message, @@ -103,7 +99,7 @@ DispatchResponse WorkerAgent::enable(bool waitForDebuggerOnStart) { } if (!event_handle_) { std::unique_ptr delegate( - new AgentWorkerInspectorDelegate(workers_)); + new AgentWorkerInspectorDelegate(workers_)); event_handle_ = manager->SetAutoAttach(std::move(delegate)); } event_handle_->SetWaitOnStart(waitForDebuggerOnStart); @@ -120,11 +116,10 @@ void NodeWorkers::WorkerCreated(const std::string& title, bool waiting, std::shared_ptr target) { auto frontend = frontend_.lock(); - if (!frontend) - return; + if (!frontend) return; std::string id = std::to_string(++next_target_id_); - auto delegate = thread_->MakeDelegateThreadSafe( - std::unique_ptr( + auto delegate = + thread_->MakeDelegateThreadSafe(std::unique_ptr( new ParentInspectorSessionDelegate(id, shared_from_this()))); sessions_[id] = target->Connect(std::move(delegate), true); frontend->attachedToWorker(id, WorkerInfo(id, title, url), waiting); @@ -132,8 +127,7 @@ void NodeWorkers::WorkerCreated(const std::string& title, void NodeWorkers::Send(const std::string& id, const std::string& message) { auto frontend = frontend_.lock(); - if (frontend) - frontend->receivedMessageFromWorker(id, message); + if (frontend) frontend->receivedMessageFromWorker(id, message); } void NodeWorkers::Receive(const std::string& id, const std::string& message) { @@ -143,8 +137,7 @@ void NodeWorkers::Receive(const std::string& id, const std::string& message) { } void NodeWorkers::Detached(const std::string& id) { - if (sessions_.erase(id) == 0) - return; + if (sessions_.erase(id) == 0) return; auto frontend = frontend_.lock(); if (frontend) { frontend->detachedFromWorker(id); diff --git a/src/inspector/worker_agent.h b/src/inspector/worker_agent.h index 402c7194163967..d595a284b9486e 100644 --- a/src/inspector/worker_agent.h +++ b/src/inspector/worker_agent.h @@ -4,7 +4,6 @@ #include "node/inspector/protocol/NodeWorker.h" #include "v8.h" - namespace node { namespace inspector { class WorkerManagerEventHandle; diff --git a/src/inspector/worker_inspector.cc b/src/inspector/worker_inspector.cc index 52e71a562daeb6..0d1cb6f94bdb8c 100644 --- a/src/inspector/worker_inspector.cc +++ b/src/inspector/worker_inspector.cc @@ -31,9 +31,9 @@ class WorkerStartedRequest : public Request { bool waiting_; }; - void Report(const std::unique_ptr& delegate, - const WorkerInfo& info, bool waiting) { + const WorkerInfo& info, + bool waiting) { if (info.worker_thread) delegate->WorkerCreated(info.title, info.url, waiting, info.worker_thread); } @@ -51,11 +51,14 @@ class WorkerFinishedRequest : public Request { }; } // namespace - ParentInspectorHandle::ParentInspectorHandle( - int id, const std::string& url, - std::shared_ptr parent_thread, bool wait_for_connect) - : id_(id), url_(url), parent_thread_(parent_thread), + int id, + const std::string& url, + std::shared_ptr parent_thread, + bool wait_for_connect) + : id_(id), + url_(url), + parent_thread_(parent_thread), wait_(wait_for_connect) {} ParentInspectorHandle::~ParentInspectorHandle() { @@ -77,16 +80,15 @@ void WorkerManager::WorkerFinished(int session_id) { void WorkerManager::WorkerStarted(int session_id, const WorkerInfo& info, bool waiting) { - if (info.worker_thread->Expired()) - return; + if (info.worker_thread->Expired()) return; children_.emplace(session_id, info); for (const auto& delegate : delegates_) { Report(delegate.second, info, waiting); } } -std::unique_ptr -WorkerManager::NewParentHandle(int thread_id, const std::string& url) { +std::unique_ptr WorkerManager::NewParentHandle( + int thread_id, const std::string& url) { bool wait = !delegates_waiting_on_start_.empty(); return std::unique_ptr( new ParentInspectorHandle(thread_id, url, thread_, wait)); @@ -118,7 +120,7 @@ void WorkerManager::SetWaitOnStartForDelegate(int id, bool wait) { } void WorkerManagerEventHandle::SetWaitOnStart(bool wait_on_start) { - manager_->SetWaitOnStartForDelegate(id_, wait_on_start); + manager_->SetWaitOnStartForDelegate(id_, wait_on_start); } WorkerManagerEventHandle::~WorkerManagerEventHandle() { diff --git a/src/inspector/worker_inspector.h b/src/inspector/worker_inspector.h index c1d3b8a5711740..6defe9489f4deb 100644 --- a/src/inspector/worker_inspector.h +++ b/src/inspector/worker_inspector.h @@ -28,7 +28,7 @@ class WorkerManagerEventHandle { public: explicit WorkerManagerEventHandle(std::shared_ptr manager, int id) - : manager_(manager), id_(id) {} + : manager_(manager), id_(id) {} void SetWaitOnStart(bool wait_on_start); ~WorkerManagerEventHandle(); @@ -41,9 +41,7 @@ struct WorkerInfo { WorkerInfo(const std::string& target_title, const std::string& target_url, std::shared_ptr worker_thread) - : title(target_title), - url(target_url), - worker_thread(worker_thread) {} + : title(target_title), url(target_url), worker_thread(worker_thread) {} std::string title; std::string url; std::shared_ptr worker_thread; @@ -51,15 +49,14 @@ struct WorkerInfo { class ParentInspectorHandle { public: - ParentInspectorHandle(int id, const std::string& url, + ParentInspectorHandle(int id, + const std::string& url, std::shared_ptr parent_thread, bool wait_for_connect); ~ParentInspectorHandle(); void WorkerStarted(std::shared_ptr worker_thread, bool waiting); - bool WaitForConnect() { - return wait_; - } + bool WaitForConnect() { return wait_; } private: int id_; @@ -71,7 +68,7 @@ class ParentInspectorHandle { class WorkerManager : public std::enable_shared_from_this { public: explicit WorkerManager(std::shared_ptr thread) - : thread_(thread) {} + : thread_(thread) {} std::unique_ptr NewParentHandle( int thread_id, const std::string& url); @@ -81,9 +78,7 @@ class WorkerManager : public std::enable_shared_from_this { std::unique_ptr attach_delegate); void SetWaitOnStartForDelegate(int id, bool wait); void RemoveAttachDelegate(int id); - std::shared_ptr MainThread() { - return thread_; - } + std::shared_ptr MainThread() { return thread_; } private: std::shared_ptr thread_; diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index f6255489fcbaf5..55adbfbd486265 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -53,15 +53,13 @@ static uv_sem_t start_io_thread_semaphore; static uv_async_t start_io_thread_async; // This is just an additional check to make sure start_io_thread_async // is not accidentally re-used or used when uninitialized. -static std::atomic_bool start_io_thread_async_initialized { false }; +static std::atomic_bool start_io_thread_async_initialized{false}; class StartIoTask : public Task { public: explicit StartIoTask(Agent* agent) : agent(agent) {} - void Run() override { - agent->StartIoThread(); - } + void Run() override { agent->StartIoThread(); } private: Agent* agent; @@ -82,7 +80,6 @@ void StartIoInterrupt(Isolate* isolate, void* agent) { static_cast(agent)->StartIoThread(); } - #ifdef __POSIX__ static void StartIoThreadWakeup(int signo) { uv_sem_post(&start_io_thread_semaphore); @@ -93,8 +90,7 @@ inline void* StartIoThreadMain(void* unused) { uv_sem_wait(&start_io_thread_semaphore); CHECK(start_io_thread_async_initialized); Agent* agent = static_cast(start_io_thread_async.data); - if (agent != nullptr) - agent->RequestIoThreadStart(); + if (agent != nullptr) agent->RequestIoThreadStart(); } return nullptr; } @@ -120,14 +116,15 @@ static int StartDebugSignalHandler() { CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, &savemask)); sigmask = savemask; pthread_t thread; - const int err = pthread_create(&thread, &attr, - StartIoThreadMain, nullptr); + const int err = pthread_create(&thread, &attr, StartIoThreadMain, nullptr); // Restore original mask CHECK_EQ(0, pthread_sigmask(SIG_SETMASK, &sigmask, nullptr)); CHECK_EQ(0, pthread_attr_destroy(&attr)); if (err != 0) { - fprintf(stderr, "node[%u]: pthread_create: %s\n", - uv_os_getpid(), strerror(err)); + fprintf(stderr, + "node[%u]: pthread_create: %s\n", + uv_os_getpid(), + strerror(err)); fflush(stderr); // Leave SIGUSR1 blocked. We don't install a signal handler, // receiving the signal would terminate the process. @@ -142,17 +139,16 @@ static int StartDebugSignalHandler() { } #endif // __POSIX__ - #ifdef _WIN32 DWORD WINAPI StartIoThreadProc(void* arg) { CHECK(start_io_thread_async_initialized); Agent* agent = static_cast(start_io_thread_async.data); - if (agent != nullptr) - agent->RequestIoThreadStart(); + if (agent != nullptr) agent->RequestIoThreadStart(); return 0; } -static int GetDebugSignalHandlerMappingName(DWORD pid, wchar_t* buf, +static int GetDebugSignalHandlerMappingName(DWORD pid, + wchar_t* buf, size_t buf_len) { return _snwprintf(buf, buf_len, L"node-debug-handler-%u", pid); } @@ -165,9 +161,8 @@ static int StartDebugSignalHandler() { pid = uv_os_getpid(); - if (GetDebugSignalHandlerMappingName(pid, - mapping_name, - arraysize(mapping_name)) < 0) { + if (GetDebugSignalHandlerMappingName( + pid, mapping_name, arraysize(mapping_name)) < 0) { return -1; } @@ -181,12 +176,8 @@ static int StartDebugSignalHandler() { return -1; } - handler = reinterpret_cast( - MapViewOfFile(mapping_handle, - FILE_MAP_ALL_ACCESS, - 0, - 0, - sizeof *handler)); + handler = reinterpret_cast(MapViewOfFile( + mapping_handle, FILE_MAP_ALL_ACCESS, 0, 0, sizeof *handler)); if (handler == nullptr) { CloseHandle(mapping_handle); return -1; @@ -200,7 +191,6 @@ static int StartDebugSignalHandler() { } #endif // _WIN32 - const int CONTEXT_GROUP_ID = 1; std::string GetWorkerLabel(node::Environment* env) { @@ -254,9 +244,7 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel, session_->schedulePauseOnNextStatement(buffer->string(), buffer->string()); } - bool preventShutdown() { - return prevent_shutdown_; - } + bool preventShutdown() { return prevent_shutdown_; } private: void sendResponse( @@ -270,7 +258,7 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel, sendMessageToFrontend(message->string()); } - void flushProtocolNotifications() override { } + void flushProtocolNotifications() override {} void sendMessageToFrontend(const StringView& message) { delegate_->SendMessageToFrontend(message); @@ -304,9 +292,8 @@ class InspectorTimer { InspectorTimer(uv_loop_t* loop, double interval_s, V8InspectorClient::TimerCallback callback, - void* data) : timer_(), - callback_(callback), - data_(data) { + void* data) + : timer_(), callback_(callback), data_(data) { uv_timer_init(loop, &timer_); int64_t interval_ms = 1000 * interval_s; uv_timer_start(&timer_, OnTimer, interval_ms, interval_ms); @@ -326,9 +313,8 @@ class InspectorTimer { } static void TimerClosedCb(uv_handle_t* uvtimer) { - std::unique_ptr timer( - node::ContainerOf(&InspectorTimer::timer_, - reinterpret_cast(uvtimer))); + std::unique_ptr timer(node::ContainerOf( + &InspectorTimer::timer_, reinterpret_cast(uvtimer))); // Unique_ptr goes out of scope here and pointer is deleted. } @@ -343,8 +329,10 @@ class InspectorTimer { class InspectorTimerHandle { public: - InspectorTimerHandle(uv_loop_t* loop, double interval_s, - V8InspectorClient::TimerCallback callback, void* data) { + InspectorTimerHandle(uv_loop_t* loop, + double interval_s, + V8InspectorClient::TimerCallback callback, + void* data) { timer_ = new InspectorTimer(loop, interval_s, callback, data); } @@ -355,14 +343,15 @@ class InspectorTimerHandle { timer_->Stop(); timer_ = nullptr; } + private: InspectorTimer* timer_; }; class SameThreadInspectorSession : public InspectorSession { public: - SameThreadInspectorSession( - int session_id, std::shared_ptr client) + SameThreadInspectorSession(int session_id, + std::shared_ptr client) : session_id_(session_id), client_(client) {} ~SameThreadInspectorSession() override; void Dispatch(const v8_inspector::StringView& message) override; @@ -379,19 +368,20 @@ void NotifyClusterWorkersDebugEnabled(Environment* env) { // Send message to enable debug in cluster workers Local message = Object::New(isolate); - message->Set(context, FIXED_ONE_BYTE_STRING(isolate, "cmd"), - FIXED_ONE_BYTE_STRING(isolate, "NODE_DEBUG_ENABLED")).FromJust(); + message + ->Set(context, + FIXED_ONE_BYTE_STRING(isolate, "cmd"), + FIXED_ONE_BYTE_STRING(isolate, "NODE_DEBUG_ENABLED")) + .FromJust(); ProcessEmit(env, "internalMessage", message); } #ifdef _WIN32 bool IsFilePath(const std::string& path) { // '\\' - if (path.length() > 2 && path[0] == '\\' && path[1] == '\\') - return true; + if (path.length() > 2 && path[0] == '\\' && path[1] == '\\') return true; // '[A-Z]:[/\\]' - if (path.length() < 3) - return false; + if (path.length() < 3) return false; if ((path[0] >= 'A' && path[0] <= 'Z') || (path[0] >= 'a' && path[0] <= 'z')) return path[1] == ':' && (path[2] == '/' || path[2] == '\\'); return false; @@ -465,9 +455,7 @@ class NodeInspectorClient : public V8InspectorClient { client_->contextDestroyed(context); } - void quitMessageLoopOnPause() override { - waiting_for_resume_ = false; - } + void quitMessageLoopOnPause() override { waiting_for_resume_ = false; } int connectFrontend(std::unique_ptr delegate, bool prevent_shutdown) { @@ -539,36 +527,28 @@ class NodeInspectorClient : public V8InspectorClient { void startRepeatingTimer(double interval_s, TimerCallback callback, void* data) override { - timers_.emplace(std::piecewise_construct, std::make_tuple(data), - std::make_tuple(env_->event_loop(), interval_s, callback, - data)); + timers_.emplace( + std::piecewise_construct, + std::make_tuple(data), + std::make_tuple(env_->event_loop(), interval_s, callback, data)); } - void cancelTimer(void* data) override { - timers_.erase(data); - } + void cancelTimer(void* data) override { timers_.erase(data); } // Async stack traces instrumentation. - void AsyncTaskScheduled(const StringView& task_name, void* task, + void AsyncTaskScheduled(const StringView& task_name, + void* task, bool recurring) { client_->asyncTaskScheduled(task_name, task, recurring); } - void AsyncTaskCanceled(void* task) { - client_->asyncTaskCanceled(task); - } + void AsyncTaskCanceled(void* task) { client_->asyncTaskCanceled(task); } - void AsyncTaskStarted(void* task) { - client_->asyncTaskStarted(task); - } + void AsyncTaskStarted(void* task) { client_->asyncTaskStarted(task); } - void AsyncTaskFinished(void* task) { - client_->asyncTaskFinished(task); - } + void AsyncTaskFinished(void* task) { client_->asyncTaskFinished(task); } - void AllAsyncTasksCanceled() { - client_->allAsyncTasksCanceled(); - } + void AllAsyncTasksCanceled() { client_->allAsyncTasksCanceled(); } void schedulePauseOnNextStatement(const std::string& reason) { for (const auto& id_channel : channels_) { @@ -579,45 +559,41 @@ class NodeInspectorClient : public V8InspectorClient { bool hasConnectedSessions() { for (const auto& id_channel : channels_) { // Other sessions are "invisible" more most purposes - if (id_channel.second->preventShutdown()) - return true; + if (id_channel.second->preventShutdown()) return true; } return false; } std::shared_ptr getThreadHandle() { if (interface_ == nullptr) { - interface_.reset(new MainThreadInterface( - env_->inspector_agent(), env_->event_loop(), env_->isolate(), - env_->isolate_data()->platform())); + interface_.reset( + new MainThreadInterface(env_->inspector_agent(), + env_->event_loop(), + env_->isolate(), + env_->isolate_data()->platform())); } return interface_->GetHandle(); } std::shared_ptr getWorkerManager() { if (worker_manager_ == nullptr) { - worker_manager_ = - std::make_shared(getThreadHandle()); + worker_manager_ = std::make_shared(getThreadHandle()); } return worker_manager_; } - bool IsActive() { - return !channels_.empty(); - } + bool IsActive() { return !channels_.empty(); } private: bool shouldRunMessageLoop() { - if (waiting_for_frontend_) - return true; + if (waiting_for_frontend_) return true; if (waiting_for_io_shutdown_ || waiting_for_resume_) return hasConnectedSessions(); return false; } void runMessageLoop() { - if (running_nested_loop_) - return; + if (running_nested_loop_) return; running_nested_loop_ = true; @@ -625,7 +601,8 @@ class NodeInspectorClient : public V8InspectorClient { while (shouldRunMessageLoop()) { if (interface_ && hasConnectedSessions()) interface_->WaitForFrontendEvent(); - while (platform->FlushForegroundTasks(env_->isolate())) {} + while (platform->FlushForegroundTasks(env_->isolate())) { + } } running_nested_loop_ = false; } @@ -638,8 +615,7 @@ class NodeInspectorClient : public V8InspectorClient { const StringView& resource_name_view) override { std::string resource_name = protocol::StringUtil::StringViewToUtf8(resource_name_view); - if (!IsFilePath(resource_name)) - return nullptr; + if (!IsFilePath(resource_name)) return nullptr; node::url::URL url = node::url::URL::FromFilePath(resource_name); // TODO(ak239spb): replace this code with url.href(). // Refs: https://github.com/nodejs/node/issues/22610 @@ -688,9 +664,10 @@ bool Agent::Start(const std::string& path, client_ = std::make_shared(parent_env_, is_main); if (parent_env_->owns_inspector()) { CHECK_EQ(start_io_thread_async_initialized.exchange(true), false); - CHECK_EQ(0, uv_async_init(parent_env_->event_loop(), - &start_io_thread_async, - StartIoThreadAsyncCallback)); + CHECK_EQ(0, + uv_async_init(parent_env_->event_loop(), + &start_io_thread_async, + StartIoThreadAsyncCallback)); uv_unref(reinterpret_cast(&start_io_thread_async)); start_io_thread_async.data = this; // Ignore failure, SIGUSR1 won't work, but that should not block node start. @@ -711,11 +688,12 @@ bool Agent::Start(const std::string& path, // is done. if (wait_for_connect) { HandleScope scope(parent_env_->isolate()); - parent_env_->process_object()->DefineOwnProperty( - parent_env_->context(), - FIXED_ONE_BYTE_STRING(parent_env_->isolate(), "_breakFirstLine"), - True(parent_env_->isolate()), - static_cast(v8::ReadOnly | v8::DontEnum)) + parent_env_->process_object() + ->DefineOwnProperty( + parent_env_->context(), + FIXED_ONE_BYTE_STRING(parent_env_->isolate(), "_breakFirstLine"), + True(parent_env_->isolate()), + static_cast(v8::ReadOnly | v8::DontEnum)) .FromJust(); client_->waitForFrontend(); } @@ -723,8 +701,7 @@ bool Agent::Start(const std::string& path, } bool Agent::StartIoThread() { - if (io_ != nullptr) - return true; + if (io_ != nullptr) return true; CHECK_NOT_NULL(client_); @@ -741,11 +718,10 @@ void Agent::Stop() { } std::unique_ptr Agent::Connect( - std::unique_ptr delegate, - bool prevent_shutdown) { + std::unique_ptr delegate, bool prevent_shutdown) { CHECK_NOT_NULL(client_); - int session_id = client_->connectFrontend(std::move(delegate), - prevent_shutdown); + int session_id = + client_->connectFrontend(std::move(delegate), prevent_shutdown); return std::unique_ptr( new SameThreadInspectorSession(session_id, client_)); } @@ -768,8 +744,7 @@ void Agent::WaitForDisconnect() { } void Agent::FatalException(Local error, Local message) { - if (!IsListening()) - return; + if (!IsListening()) return; client_->FatalException(error, message); WaitForDisconnect(); } @@ -823,13 +798,13 @@ void Agent::ToggleAsyncHook(Isolate* isolate, auto context = parent_env_->context(); auto result = fn.Get(isolate)->Call(context, Undefined(isolate), 0, nullptr); if (result.IsEmpty()) { - FatalError( - "node::inspector::Agent::ToggleAsyncHook", - "Cannot toggle Inspector's AsyncHook, please report this."); + FatalError("node::inspector::Agent::ToggleAsyncHook", + "Cannot toggle Inspector's AsyncHook, please report this."); } } -void Agent::AsyncTaskScheduled(const StringView& task_name, void* task, +void Agent::AsyncTaskScheduled(const StringView& task_name, + void* task, bool recurring) { client_->AsyncTaskScheduled(task_name, task, recurring); } @@ -859,7 +834,7 @@ void Agent::RequestIoThreadStart() { Isolate* isolate = parent_env_->isolate(); v8::Platform* platform = parent_env_->isolate_data()->platform(); std::shared_ptr taskrunner = - platform->GetForegroundTaskRunner(isolate); + platform->GetForegroundTaskRunner(isolate); taskrunner->PostTask(std::make_unique(this)); isolate->RequestInterrupt(StartIoInterrupt, this); CHECK(start_io_thread_async_initialized); @@ -874,14 +849,12 @@ void Agent::ContextCreated(Local context, const ContextInfo& info) { bool Agent::WillWaitForConnect() { if (debug_options_.wait_for_connect()) return true; - if (parent_handle_) - return parent_handle_->WaitForConnect(); + if (parent_handle_) return parent_handle_->WaitForConnect(); return false; } bool Agent::IsActive() { - if (client_ == nullptr) - return false; + if (client_ == nullptr) return false; return io_ != nullptr || client_->IsActive(); } @@ -905,18 +878,14 @@ std::shared_ptr Agent::GetWorkerManager() { SameThreadInspectorSession::~SameThreadInspectorSession() { auto client = client_.lock(); - if (client) - client->disconnectFrontend(session_id_); + if (client) client->disconnectFrontend(session_id_); } void SameThreadInspectorSession::Dispatch( const v8_inspector::StringView& message) { auto client = client_.lock(); - if (client) - client->dispatchMessageFromFrontend(session_id_, message); + if (client) client->dispatchMessageFromFrontend(session_id_, message); } - - } // namespace inspector } // namespace node diff --git a/src/inspector_agent.h b/src/inspector_agent.h index 5e599a6339e903..80f3b82a20d0c1 100644 --- a/src/inspector_agent.h +++ b/src/inspector_agent.h @@ -39,8 +39,8 @@ class InspectorSession { class InspectorSessionDelegate { public: virtual ~InspectorSessionDelegate() = default; - virtual void SendMessageToFrontend(const v8_inspector::StringView& message) - = 0; + virtual void SendMessageToFrontend( + const v8_inspector::StringView& message) = 0; }; class Agent { @@ -72,7 +72,8 @@ class Agent { v8::Local message); // Async stack traces instrumentation. - void AsyncTaskScheduled(const v8_inspector::StringView& taskName, void* task, + void AsyncTaskScheduled(const v8_inspector::StringView& taskName, + void* task, bool recurring); void AsyncTaskCanceled(void* task); void AsyncTaskStarted(void* task); @@ -80,8 +81,8 @@ class Agent { void AllAsyncTasksCanceled(); void RegisterAsyncHook(v8::Isolate* isolate, - v8::Local enable_function, - v8::Local disable_function); + v8::Local enable_function, + v8::Local disable_function); void EnableAsyncHook(); void DisableAsyncHook(); @@ -95,9 +96,7 @@ class Agent { void PauseOnNextJavascriptStatement(const std::string& reason); - InspectorIo* io() { - return io_.get(); - } + InspectorIo* io() { return io_.get(); } // Can only be called from the main thread. bool StartIoThread(); diff --git a/src/inspector_io.cc b/src/inspector_io.cc index 7686294b2e2842..b3d6bfddd5dd4f 100644 --- a/src/inspector_io.cc +++ b/src/inspector_io.cc @@ -1,19 +1,19 @@ #include "inspector_io.h" -#include "inspector_socket_server.h" +#include "debug_utils.h" +#include "env-inl.h" #include "inspector/main_thread_interface.h" #include "inspector/node_string.h" -#include "env-inl.h" -#include "debug_utils.h" +#include "inspector_socket_server.h" #include "node.h" #include "node_crypto.h" #include "node_mutex.h" -#include "v8-inspector.h" #include "util.h" +#include "v8-inspector.h" #include "zlib.h" -#include #include +#include #include namespace node { @@ -46,13 +46,15 @@ std::string GenerateID() { sizeof(buffer))); char uuid[256]; - snprintf(uuid, sizeof(uuid), "%04x%04x-%04x-%04x-%04x-%04x%04x%04x", - buffer[0], // time_low - buffer[1], // time_mid - buffer[2], // time_low + snprintf(uuid, + sizeof(uuid), + "%04x%04x-%04x-%04x-%04x-%04x%04x%04x", + buffer[0], // time_low + buffer[1], // time_mid + buffer[2], // time_low (buffer[3] & 0x0fff) | 0x4000, // time_hi_and_version (buffer[4] & 0x3fff) | 0x8000, // clk_seq_hi clk_seq_low - buffer[5], // node + buffer[5], // node buffer[6], buffer[7]); return uuid; @@ -63,9 +65,9 @@ class RequestToServer { RequestToServer(TransportAction action, int session_id, std::unique_ptr message) - : action_(action), - session_id_(session_id), - message_(std::move(message)) {} + : action_(action), + session_id_(session_id), + message_(std::move(message)) {} void Dispatch(InspectorSocketServer* server) const { switch (action_) { @@ -94,7 +96,7 @@ class RequestQueueData { using MessageQueue = std::deque; explicit RequestQueueData(uv_loop_t* loop) - : handle_(std::make_shared(this)) { + : handle_(std::make_shared(this)) { int err = uv_async_init(loop, &async_, [](uv_async_t* async) { RequestQueueData* wrapper = node::ContainerOf(&RequestQueueData::async_, async); @@ -124,13 +126,9 @@ class RequestQueueData { } } - void SetServer(InspectorSocketServer* server) { - server_ = server; - } + void SetServer(InspectorSocketServer* server) { server_ = server; } - std::shared_ptr handle() { - return handle_; - } + std::shared_ptr handle() { return handle_; } private: ~RequestQueueData() = default; @@ -143,8 +141,7 @@ class RequestQueueData { } void DoDispatch() { - if (server_ == nullptr) - return; + if (server_ == nullptr) return; for (const auto& request : GetMessages()) { request.Dispatch(server_); } @@ -172,14 +169,12 @@ class RequestQueue { TransportAction action, std::unique_ptr message) { Mutex::ScopedLock scoped_lock(lock_); - if (data_ != nullptr) - data_->Post(session_id, action, std::move(message)); + if (data_ != nullptr) data_->Post(session_id, action, std::move(message)); } void SetServer(InspectorSocketServer* server) { Mutex::ScopedLock scoped_lock(lock_); - if (data_ != nullptr) - data_->SetServer(server); + if (data_ != nullptr) data_->SetServer(server); } bool Expired() { @@ -195,10 +190,10 @@ class RequestQueue { class IoSessionDelegate : public InspectorSessionDelegate { public: explicit IoSessionDelegate(std::shared_ptr queue, int id) - : request_queue_(queue), id_(id) { } + : request_queue_(queue), id_(id) {} void SendMessageToFrontend(const v8_inspector::StringView& message) override { - request_queue_->Post(id_, TransportAction::kSendMessage, - StringBuffer::create(message)); + request_queue_->Post( + id_, TransportAction::kSendMessage, StringBuffer::create(message)); } private: @@ -208,15 +203,14 @@ class IoSessionDelegate : public InspectorSessionDelegate { // Passed to InspectorSocketServer to handle WS inspector protocol events, // mostly session start, message received, and session end. -class InspectorIoDelegate: public node::inspector::SocketServerDelegate { +class InspectorIoDelegate : public node::inspector::SocketServerDelegate { public: InspectorIoDelegate(std::shared_ptr queue, std::shared_ptr main_threade, const std::string& target_id, const std::string& script_path, const std::string& script_name); - ~InspectorIoDelegate() { - } + ~InspectorIoDelegate() {} void StartSession(int session_id, const std::string& target_id) override; void MessageReceived(int session_id, const std::string& message) override; @@ -287,9 +281,8 @@ void InspectorIo::ThreadMain() { std::shared_ptr queue(new RequestQueueData(&loop), RequestQueueData::CloseAndFree); std::string script_path = ScriptPath(&loop, script_name_); - std::unique_ptr delegate( - new InspectorIoDelegate(queue, main_thread_, id_, - script_path, script_name_)); + std::unique_ptr delegate(new InspectorIoDelegate( + queue, main_thread_, id_, script_path, script_name_)); InspectorSocketServer server(std::move(delegate), &loop, host_port_->host().c_str(), @@ -309,7 +302,7 @@ void InspectorIo::ThreadMain() { } std::vector InspectorIo::GetTargetIds() const { - return { id_ }; + return {id_}; } InspectorIoDelegate::InspectorIoDelegate( @@ -318,15 +311,18 @@ InspectorIoDelegate::InspectorIoDelegate( const std::string& target_id, const std::string& script_path, const std::string& script_name) - : request_queue_(queue), main_thread_(main_thread), - script_name_(script_name), script_path_(script_path), + : request_queue_(queue), + main_thread_(main_thread), + script_name_(script_name), + script_path_(script_path), target_id_(target_id) {} void InspectorIoDelegate::StartSession(int session_id, const std::string& target_id) { auto session = main_thread_->Connect( std::unique_ptr( - new IoSessionDelegate(request_queue_->handle(), session_id)), true); + new IoSessionDelegate(request_queue_->handle(), session_id)), + true); if (session) { sessions_[session_id] = std::move(session); fprintf(stderr, "Debugger attached.\n"); @@ -345,7 +341,7 @@ void InspectorIoDelegate::EndSession(int session_id) { } std::vector InspectorIoDelegate::GetTargetIds() { - return { target_id_ }; + return {target_id_}; } std::string InspectorIoDelegate::GetTargetTitle(const std::string& id) { @@ -362,11 +358,11 @@ void RequestQueueData::CloseAndFree(RequestQueueData* queue) { queue->handle_.reset(); uv_close(reinterpret_cast(&queue->async_), [](uv_handle_t* handle) { - uv_async_t* async = reinterpret_cast(handle); - RequestQueueData* wrapper = - node::ContainerOf(&RequestQueueData::async_, async); - delete wrapper; - }); + uv_async_t* async = reinterpret_cast(handle); + RequestQueueData* wrapper = + node::ContainerOf(&RequestQueueData::async_, async); + delete wrapper; + }); } } // namespace inspector } // namespace node diff --git a/src/inspector_io.h b/src/inspector_io.h index bc09afdd3df54e..6bb9542ab4b68d 100644 --- a/src/inspector_io.h +++ b/src/inspector_io.h @@ -7,14 +7,13 @@ #include "node_mutex.h" #include "uv.h" -#include #include +#include #if !HAVE_INSPECTOR #error("This header can only be used when inspector is enabled") #endif - namespace v8_inspector { class StringBuffer; class StringView; @@ -25,7 +24,8 @@ namespace node { class Environment; namespace inspector { -std::string FormatWsAddress(const std::string& host, int port, +std::string FormatWsAddress(const std::string& host, + int port, const std::string& target_id, bool include_protocol); @@ -34,11 +34,7 @@ class MainThreadHandle; class RequestQueue; // kKill closes connections and stops the server, kStop only stops the server -enum class TransportAction { - kKill, - kSendMessage, - kStop -}; +enum class TransportAction { kKill, kSendMessage, kStop }; class InspectorIo { public: diff --git a/src/inspector_js_api.cc b/src/inspector_js_api.cc index 48ebd73817a50e..2fde91627fe199 100644 --- a/src/inspector_js_api.cc +++ b/src/inspector_js_api.cc @@ -1,8 +1,8 @@ #include "base_object-inl.h" #include "inspector_agent.h" #include "inspector_io.h" -#include "v8.h" #include "v8-inspector.h" +#include "v8.h" namespace node { namespace inspector { @@ -38,18 +38,18 @@ class JSBindingsConnection : public AsyncWrap { public: JSBindingsSessionDelegate(Environment* env, JSBindingsConnection* connection) - : env_(env), - connection_(connection) { - } + : env_(env), connection_(connection) {} - void SendMessageToFrontend(const v8_inspector::StringView& message) - override { + void SendMessageToFrontend( + const v8_inspector::StringView& message) override { Isolate* isolate = env_->isolate(); HandleScope handle_scope(isolate); Context::Scope context_scope(env_->context()); MaybeLocal v8string = - String::NewFromTwoByte(isolate, message.characters16(), - NewStringType::kNormal, message.length()); + String::NewFromTwoByte(isolate, + message.characters16(), + NewStringType::kNormal, + message.length()); Local argument = v8string.ToLocalChecked().As(); connection_->OnMessage(argument); } @@ -62,11 +62,12 @@ class JSBindingsConnection : public AsyncWrap { JSBindingsConnection(Environment* env, Local wrap, Local callback) - : AsyncWrap(env, wrap, PROVIDER_INSPECTORJSBINDING), - callback_(env->isolate(), callback) { + : AsyncWrap(env, wrap, PROVIDER_INSPECTORJSBINDING), + callback_(env->isolate(), callback) { Agent* inspector = env->inspector_agent(); session_ = inspector->Connect(std::unique_ptr( - new JSBindingsSessionDelegate(env, this)), false); + new JSBindingsSessionDelegate(env, this)), + false); } void OnMessage(Local value) { @@ -137,9 +138,8 @@ void CallAndPauseOnStart(const FunctionCallbackInfo& args) { CHECK(args[0]->IsFunction()); SlicedArguments call_args(args, /* start */ 2); env->inspector_agent()->PauseOnNextJavascriptStatement("Break on start"); - v8::MaybeLocal retval = - args[0].As()->Call(env->context(), args[1], - call_args.length(), call_args.out()); + v8::MaybeLocal retval = args[0].As()->Call( + env->context(), args[1], call_args.length(), call_args.out()); if (!retval.IsEmpty()) { args.GetReturnValue().Set(retval.ToLocalChecked()); } @@ -159,23 +159,22 @@ void InspectorConsoleCall(const FunctionCallbackInfo& info) { Local config_object = config_value.As(); Local in_call_key = FIXED_ONE_BYTE_STRING(isolate, "in_call"); if (!config_object->Has(context, in_call_key).FromMaybe(false)) { - CHECK(config_object->Set(context, - in_call_key, - v8::True(isolate)).FromJust()); - CHECK(!inspector_method.As()->Call(context, - info.Holder(), - call_args.length(), - call_args.out()).IsEmpty()); + CHECK(config_object->Set(context, in_call_key, v8::True(isolate)) + .FromJust()); + CHECK( + !inspector_method.As() + ->Call( + context, info.Holder(), call_args.length(), call_args.out()) + .IsEmpty()); } CHECK(config_object->Delete(context, in_call_key).FromJust()); } Local node_method = info[1]; CHECK(node_method->IsFunction()); - node_method.As()->Call(context, - info.Holder(), - call_args.length(), - call_args.out()).FromMaybe(Local()); + node_method.As() + ->Call(context, info.Holder(), call_args.length(), call_args.out()) + .FromMaybe(Local()); } static void* GetAsyncTask(int64_t asyncId) { @@ -223,8 +222,8 @@ static void RegisterAsyncHookWrapper(const FunctionCallbackInfo& args) { Local enable_function = args[0].As(); CHECK(args[1]->IsFunction()); Local disable_function = args[1].As(); - env->inspector_agent()->RegisterAsyncHook(env->isolate(), - enable_function, disable_function); + env->inspector_agent()->RegisterAsyncHook( + env->isolate(), enable_function, disable_function); } void IsEnabled(const FunctionCallbackInfo& args) { @@ -251,8 +250,7 @@ void Open(const FunctionCallbackInfo& args) { wait_for_connect = args[2]->BooleanValue(args.GetIsolate()); } agent->StartIoThread(); - if (wait_for_connect) - agent->WaitForConnect(); + if (wait_for_connect) agent->WaitForConnect(); } void Url(const FunctionCallbackInfo& args) { @@ -270,8 +268,10 @@ void Url(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(OneByteString(env->isolate(), url.c_str())); } -void Initialize(Local target, Local unused, - Local context, void* priv) { +void Initialize(Local target, + Local unused, + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); Agent* agent = env->inspector_agent(); @@ -284,12 +284,15 @@ void Initialize(Local target, Local unused, env->SetMethodNoSideEffect(target, "url", Url); env->SetMethod(target, "asyncTaskScheduled", AsyncTaskScheduledWrapper); - env->SetMethod(target, "asyncTaskCanceled", - InvokeAsyncTaskFnWithId<&Agent::AsyncTaskCanceled>); - env->SetMethod(target, "asyncTaskStarted", - InvokeAsyncTaskFnWithId<&Agent::AsyncTaskStarted>); - env->SetMethod(target, "asyncTaskFinished", - InvokeAsyncTaskFnWithId<&Agent::AsyncTaskFinished>); + env->SetMethod(target, + "asyncTaskCanceled", + InvokeAsyncTaskFnWithId<&Agent::AsyncTaskCanceled>); + env->SetMethod(target, + "asyncTaskStarted", + InvokeAsyncTaskFnWithId<&Agent::AsyncTaskStarted>); + env->SetMethod(target, + "asyncTaskFinished", + InvokeAsyncTaskFnWithId<&Agent::AsyncTaskFinished>); env->SetMethod(target, "registerAsyncHook", RegisterAsyncHookWrapper); env->SetMethodNoSideEffect(target, "isEnabled", IsEnabled); @@ -303,7 +306,8 @@ void Initialize(Local target, Local unused, env->SetProtoMethod(tmpl, "dispatch", JSBindingsConnection::Dispatch); env->SetProtoMethod(tmpl, "disconnect", JSBindingsConnection::Disconnect); target - ->Set(env->context(), conn_str, + ->Set(env->context(), + conn_str, tmpl->GetFunction(env->context()).ToLocalChecked()) .ToChecked(); } @@ -312,5 +316,4 @@ void Initialize(Local target, Local unused, } // namespace inspector } // namespace node -NODE_MODULE_CONTEXT_AWARE_INTERNAL(inspector, - node::inspector::Initialize); +NODE_MODULE_CONTEXT_AWARE_INTERNAL(inspector, node::inspector::Initialize); diff --git a/src/inspector_socket.cc b/src/inspector_socket.cc index 511f144c3f8e1d..8b73459d3edae1 100644 --- a/src/inspector_socket.cc +++ b/src/inspector_socket.cc @@ -10,8 +10,8 @@ #include "openssl/sha.h" // Sha-1 hash -#include #include +#include #define ACCEPT_KEY_LENGTH base64_encoded_size(20) #define BUFFER_GROWTH_CHUNK_SIZE 1024 @@ -31,9 +31,7 @@ class TcpHolder { InspectorSocket::DelegatePointer delegate); void SetHandler(ProtocolHandler* handler); int WriteRaw(const std::vector& buffer, uv_write_cb write_cb); - uv_tcp_t* tcp() { - return &tcp_; - } + uv_tcp_t* tcp() { return &tcp_; } InspectorSocket::Delegate* delegate(); private: @@ -42,7 +40,8 @@ class TcpHolder { reinterpret_cast(handle)); } static void OnClosed(uv_handle_t* handle); - static void OnDataReceivedCb(uv_stream_t* stream, ssize_t nread, + static void OnDataReceivedCb(uv_stream_t* stream, + ssize_t nread, const uv_buf_t* buf); explicit TcpHolder(InspectorSocket::DelegatePointer delegate); ~TcpHolder() = default; @@ -54,7 +53,6 @@ class TcpHolder { std::vector buffer; }; - class ProtocolHandler { public: ProtocolHandler(InspectorSocket* inspector, TcpHolder::Pointer tcp); @@ -67,9 +65,7 @@ class ProtocolHandler { std::string GetHost() const; - InspectorSocket* inspector() { - return inspector_; - } + InspectorSocket* inspector() { return inspector_; } virtual void Shutdown() = 0; protected: @@ -112,10 +108,10 @@ static void dump_hex(const char* buf, size_t len) { class WriteRequest { public: WriteRequest(ProtocolHandler* handler, const std::vector& buffer) - : handler(handler) - , storage(buffer) - , req(uv_write_t()) - , buf(uv_buf_init(storage.data(), storage.size())) {} + : handler(handler), + storage(buffer), + req(uv_write_t()), + buf(uv_buf_init(storage.data(), storage.size())) {} static WriteRequest* from_write_req(uv_write_t* req) { return node::ContainerOf(&WriteRequest::req, req); @@ -141,9 +137,7 @@ static void remove_from_beginning(std::vector* buffer, size_t count) { static const char CLOSE_FRAME[] = {'\x88', '\x00'}; -enum ws_decode_result { - FRAME_OK, FRAME_INCOMPLETE, FRAME_CLOSE, FRAME_ERROR -}; +enum ws_decode_result { FRAME_OK, FRAME_INCOMPLETE, FRAME_CLOSE, FRAME_ERROR }; static void generate_accept_string(const std::string& client_key, char (*buffer)[ACCEPT_KEY_LENGTH]) { @@ -151,15 +145,15 @@ static void generate_accept_string(const std::string& client_key, static const char ws_magic[] = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; std::string input(client_key + ws_magic); char hash[SHA_DIGEST_LENGTH]; - SHA1(reinterpret_cast(&input[0]), input.size(), + SHA1(reinterpret_cast(&input[0]), + input.size(), reinterpret_cast(hash)); node::base64_encode(hash, sizeof(hash), *buffer, sizeof(*buffer)); } static std::string TrimPort(const std::string& host) { size_t last_colon_pos = host.rfind(":"); - if (last_colon_pos == std::string::npos) - return host; + if (last_colon_pos == std::string::npos) return host; size_t bracket = host.rfind("]"); if (bracket == std::string::npos || last_colon_pos > bracket) return host.substr(0, last_colon_pos); @@ -223,8 +217,8 @@ static std::vector encode_frame_hybi17(const std::vector& message) { extended_payload_length[7 - i] = remaining & 0xFF; remaining >>= 8; } - frame.insert(frame.end(), extended_payload_length, - extended_payload_length + 8); + frame.insert( + frame.end(), extended_payload_length, extended_payload_length + 8); CHECK_EQ(0, remaining); } frame.insert(frame.end(), message.begin(), message.end()); @@ -237,8 +231,7 @@ static ws_decode_result decode_frame_hybi17(const std::vector& buffer, std::vector* output, bool* compressed) { *bytes_consumed = 0; - if (buffer.size() < 2) - return FRAME_INCOMPLETE; + if (buffer.size() < 2) return FRAME_INCOMPLETE; auto it = buffer.begin(); @@ -321,18 +314,17 @@ static ws_decode_result decode_frame_hybi17(const std::vector& buffer, class WsHandler : public ProtocolHandler { public: WsHandler(InspectorSocket* inspector, TcpHolder::Pointer tcp) - : ProtocolHandler(inspector, std::move(tcp)), - OnCloseSent(&WsHandler::WaitForCloseReply), - OnCloseRecieved(&WsHandler::CloseFrameReceived), - dispose_(false) { } + : ProtocolHandler(inspector, std::move(tcp)), + OnCloseSent(&WsHandler::WaitForCloseReply), + OnCloseRecieved(&WsHandler::CloseFrameReceived), + dispose_(false) {} - void AcceptUpgrade(const std::string& accept_key) override { } + void AcceptUpgrade(const std::string& accept_key) override {} void CancelHandshake() override {} void OnEof() override { tcp_.reset(); - if (dispose_) - delete this; + if (dispose_) delete this; } void OnData(std::vector* data) override { @@ -373,9 +365,7 @@ class WsHandler : public ProtocolHandler { (handler->*cb)(); } - void WaitForCloseReply() { - OnCloseRecieved = &WsHandler::OnEof; - } + void WaitForCloseReply() { OnCloseRecieved = &WsHandler::OnEof; } void SendClose() { WriteRaw(std::vector(CLOSE_FRAME, CLOSE_FRAME + sizeof(CLOSE_FRAME)), @@ -392,10 +382,8 @@ class WsHandler : public ProtocolHandler { std::vector output; bool compressed = false; - ws_decode_result r = decode_frame_hybi17(buffer, - true /* client_frame */, - &bytes_consumed, &output, - &compressed); + ws_decode_result r = decode_frame_hybi17( + buffer, true /* client_frame */, &bytes_consumed, &output, &compressed); // Compressed frame means client is ignoring the headers and misbehaves if (compressed || r == FRAME_ERROR) { OnEof(); @@ -409,7 +397,6 @@ class WsHandler : public ProtocolHandler { return bytes_consumed; } - Callback OnCloseSent; Callback OnCloseRecieved; bool dispose_; @@ -418,10 +405,16 @@ class WsHandler : public ProtocolHandler { // HTTP protocol class HttpEvent { public: - HttpEvent(const std::string& path, bool upgrade, bool isGET, - const std::string& ws_key, const std::string& host) - : path(path), upgrade(upgrade), isGET(isGET), ws_key(ws_key), - host(host) { } + HttpEvent(const std::string& path, + bool upgrade, + bool isGET, + const std::string& ws_key, + const std::string& host) + : path(path), + upgrade(upgrade), + isGET(isGET), + ws_key(ws_key), + host(host) {} std::string path; bool upgrade; @@ -433,8 +426,7 @@ class HttpEvent { class HttpHandler : public ProtocolHandler { public: explicit HttpHandler(InspectorSocket* inspector, TcpHolder::Pointer tcp) - : ProtocolHandler(inspector, std::move(tcp)), - parsing_value_(false) { + : ProtocolHandler(inspector, std::move(tcp)), parsing_value_(false) { llhttp_init(&parser_, HTTP_REQUEST, &parser_settings); llhttp_settings_init(&parser_settings); parser_settings.on_header_field = OnHeaderField; @@ -453,9 +445,10 @@ class HttpHandler : public ProtocolHandler { const char accept_ws_suffix[] = "\r\n\r\n"; std::vector reply(accept_ws_prefix, accept_ws_prefix + sizeof(accept_ws_prefix) - 1); - reply.insert(reply.end(), accept_string, - accept_string + sizeof(accept_string)); - reply.insert(reply.end(), accept_ws_suffix, + reply.insert( + reply.end(), accept_string, accept_string + sizeof(accept_string)); + reply.insert(reply.end(), + accept_ws_suffix, accept_ws_suffix + sizeof(accept_ws_suffix) - 1); if (WriteRaw(reply, WriteRequest::Cleanup) >= 0) { inspector_->SwitchProtocol(new WsHandler(inspector_, std::move(tcp_))); @@ -470,14 +463,12 @@ class HttpHandler : public ProtocolHandler { "Content-Type: text/html; charset=UTF-8\r\n\r\n" "WebSockets request was expected\r\n"; WriteRaw(std::vector(HANDSHAKE_FAILED_RESPONSE, - HANDSHAKE_FAILED_RESPONSE + sizeof(HANDSHAKE_FAILED_RESPONSE) - 1), + HANDSHAKE_FAILED_RESPONSE + + sizeof(HANDSHAKE_FAILED_RESPONSE) - 1), ThenCloseAndReportFailure); } - - void OnEof() override { - tcp_.reset(); - } + void OnEof() override { tcp_.reset(); } void OnData(std::vector* data) override { parser_errno_t err; @@ -514,9 +505,7 @@ class HttpHandler : public ProtocolHandler { } protected: - void Shutdown() override { - delete this; - } + void Shutdown() override { delete this; } private: static void ThenCloseAndReportFailure(uv_write_t* req, int status) { @@ -556,7 +545,9 @@ class HttpHandler : public ProtocolHandler { // Event needs to be fired after the parser is done. HttpHandler* handler = From(parser); handler->events_.push_back( - HttpEvent(handler->path_, parser->upgrade, parser->method == HTTP_GET, + HttpEvent(handler->path_, + parser->upgrade, + parser->method == HTTP_GET, handler->HeaderValue("Sec-WebSocket-Key"), handler->HeaderValue("Host"))); handler->path_ = ""; @@ -570,10 +561,9 @@ class HttpHandler : public ProtocolHandler { bool header_found = false; std::string value; for (const auto& header_value : headers_) { - if (node::StringEqualNoCaseN(header_value.first.data(), header.data(), - header.length())) { - if (header_found) - return ""; + if (node::StringEqualNoCaseN( + header_value.first.data(), header.data(), header.length())) { + if (header_found) return ""; value = header_value.second; header_found = true; } @@ -583,9 +573,9 @@ class HttpHandler : public ProtocolHandler { bool IsAllowedHost(const std::string& host_with_port) const { std::string host = TrimPort(host_with_port); - return host.empty() || IsIPAddress(host) - || node::StringEqualNoCase(host.data(), "localhost") - || node::StringEqualNoCase(host.data(), "localhost6"); + return host.empty() || IsIPAddress(host) || + node::StringEqualNoCase(host.data(), "localhost") || + node::StringEqualNoCase(host.data(), "localhost6"); } bool parsing_value_; @@ -602,7 +592,7 @@ class HttpHandler : public ProtocolHandler { // Any protocol ProtocolHandler::ProtocolHandler(InspectorSocket* inspector, TcpHolder::Pointer tcp) - : inspector_(inspector), tcp_(std::move(tcp)) { + : inspector_(inspector), tcp_(std::move(tcp)) { CHECK_NOT_NULL(tcp_); tcp_->SetHandler(this); } @@ -620,11 +610,9 @@ std::string ProtocolHandler::GetHost() const { char ip[INET6_ADDRSTRLEN]; sockaddr_storage addr; int len = sizeof(addr); - int err = uv_tcp_getsockname(tcp_->tcp(), - reinterpret_cast(&addr), - &len); - if (err != 0) - return ""; + int err = uv_tcp_getsockname( + tcp_->tcp(), reinterpret_cast(&addr), &len); + if (err != 0) return ""; if (addr.ss_family == AF_INET6) { const sockaddr_in6* v6 = reinterpret_cast(&addr); err = uv_ip6_name(v6, ip, sizeof(ip)); @@ -632,21 +620,17 @@ std::string ProtocolHandler::GetHost() const { const sockaddr_in* v4 = reinterpret_cast(&addr); err = uv_ip4_name(v4, ip, sizeof(ip)); } - if (err != 0) - return ""; + if (err != 0) return ""; return ip; } // RAII uv_tcp_t wrapper TcpHolder::TcpHolder(InspectorSocket::DelegatePointer delegate) - : tcp_(), - delegate_(std::move(delegate)), - handler_(nullptr) { } + : tcp_(), delegate_(std::move(delegate)), handler_(nullptr) {} // static TcpHolder::Pointer TcpHolder::Accept( - uv_stream_t* server, - InspectorSocket::DelegatePointer delegate) { + uv_stream_t* server, InspectorSocket::DelegatePointer delegate) { TcpHolder* result = new TcpHolder(std::move(delegate)); uv_stream_t* tcp = reinterpret_cast(&result->tcp_); int err = uv_tcp_init(server->loop, &result->tcp_); @@ -679,8 +663,7 @@ int TcpHolder::WriteRaw(const std::vector& buffer, uv_write_cb write_cb) { WriteRequest* wr = new WriteRequest(handler_, buffer); uv_stream_t* stream = reinterpret_cast(&tcp_); int err = uv_write(&wr->req, stream, &wr->buf, 1, write_cb); - if (err < 0) - delete wr; + if (err < 0) delete wr; return err < 0; } @@ -693,7 +676,8 @@ void TcpHolder::OnClosed(uv_handle_t* handle) { delete From(handle); } -void TcpHolder::OnDataReceivedCb(uv_stream_t* tcp, ssize_t nread, +void TcpHolder::OnDataReceivedCb(uv_stream_t* tcp, + ssize_t nread, const uv_buf_t* buf) { #if DUMP_READS if (nread >= 0) { diff --git a/src/inspector_socket.h b/src/inspector_socket.h index eca88ad45fe379..20e6576594f777 100644 --- a/src/inspector_socket.h +++ b/src/inspector_socket.h @@ -50,7 +50,6 @@ class InspectorSocket { DISALLOW_COPY_AND_ASSIGN(InspectorSocket); }; - } // namespace inspector } // namespace node diff --git a/src/inspector_socket_server.cc b/src/inspector_socket_server.cc index 1621b408b43274..287c27df955099 100644 --- a/src/inspector_socket_server.cc +++ b/src/inspector_socket_server.cc @@ -14,13 +14,14 @@ namespace inspector { // Function is declared in inspector_io.h so the rest of the node does not // depend on inspector_socket_server.h -std::string FormatWsAddress(const std::string& host, int port, +std::string FormatWsAddress(const std::string& host, + int port, const std::string& target_id, bool include_protocol); namespace { static const uint8_t PROTOCOL_JSON[] = { - #include "v8_inspector_protocol_json.h" // NOLINT(build/include_order) +#include "v8_inspector_protocol_json.h" // NOLINT(build/include_order) }; void Escape(std::string* string) { @@ -48,8 +49,7 @@ std::string FormatAddress(const std::string& host, const std::string& target_id, bool include_protocol) { std::ostringstream url; - if (include_protocol) - url << "ws://"; + if (include_protocol) url << "ws://"; url << host << '/' << target_id; return url.str(); } @@ -59,8 +59,7 @@ std::string MapToString(const std::map& object) { std::ostringstream json; json << "{\n"; for (const auto& name_value : object) { - if (!first) - json << ",\n"; + if (!first) json << ",\n"; first = false; json << " \"" << name_value.first << "\": \""; json << name_value.second << "\""; @@ -75,8 +74,7 @@ std::string MapsToString( std::ostringstream json; json << "[ "; for (const auto& object : array) { - if (!first) - json << ", "; + if (!first) json << ", "; first = false; json << MapToString(object); } @@ -101,11 +99,11 @@ void PrintDebuggerReadyMessage(const std::string& host, return; } for (const std::string& id : ids) { - fprintf(out, "Debugger listening on %s\n", + fprintf(out, + "Debugger listening on %s\n", FormatWsAddress(host, port, id, true).c_str()); } - fprintf(out, "For help, see: %s\n", - "https://nodejs.org/en/docs/inspector"); + fprintf(out, "For help, see: %s\n", "https://nodejs.org/en/docs/inspector"); fflush(out); } @@ -134,10 +132,9 @@ void SendProtocolJson(InspectorSocket* socket) { strm.zfree = Z_NULL; strm.opaque = Z_NULL; CHECK_EQ(Z_OK, inflateInit(&strm)); - static const size_t kDecompressedSize = - PROTOCOL_JSON[0] * 0x10000u + - PROTOCOL_JSON[1] * 0x100u + - PROTOCOL_JSON[2]; + static const size_t kDecompressedSize = PROTOCOL_JSON[0] * 0x10000u + + PROTOCOL_JSON[1] * 0x100u + + PROTOCOL_JSON[2]; strm.next_in = const_cast(PROTOCOL_JSON + 3); strm.avail_in = sizeof(PROTOCOL_JSON) - 3; std::string data(kDecompressedSize, '\0'); @@ -150,7 +147,8 @@ void SendProtocolJson(InspectorSocket* socket) { } } // namespace -std::string FormatWsAddress(const std::string& host, int port, +std::string FormatWsAddress(const std::string& host, + int port, const std::string& target_id, bool include_protocol) { return FormatAddress(FormatHostPort(host, port), target_id, include_protocol); @@ -159,43 +157,30 @@ std::string FormatWsAddress(const std::string& host, int port, class SocketSession { public: SocketSession(InspectorSocketServer* server, int id, int server_port); - void Close() { - ws_socket_.reset(); - } + void Close() { ws_socket_.reset(); } void Send(const std::string& message); void Own(InspectorSocket::Pointer ws_socket) { ws_socket_ = std::move(ws_socket); } int id() const { return id_; } - int server_port() { - return server_port_; - } - InspectorSocket* ws_socket() { - return ws_socket_.get(); - } - void Accept(const std::string& ws_key) { - ws_socket_->AcceptUpgrade(ws_key); - } - void Decline() { - ws_socket_->CancelHandshake(); - } + int server_port() { return server_port_; } + InspectorSocket* ws_socket() { return ws_socket_.get(); } + void Accept(const std::string& ws_key) { ws_socket_->AcceptUpgrade(ws_key); } + void Decline() { ws_socket_->CancelHandshake(); } class Delegate : public InspectorSocket::Delegate { public: Delegate(InspectorSocketServer* server, int session_id) - : server_(server), session_id_(session_id) { } - ~Delegate() { - server_->SessionTerminated(session_id_); - } + : server_(server), session_id_(session_id) {} + ~Delegate() { server_->SessionTerminated(session_id_); } void OnHttpGet(const std::string& host, const std::string& path) override; - void OnSocketUpgrade(const std::string& host, const std::string& path, + void OnSocketUpgrade(const std::string& host, + const std::string& path, const std::string& ws_key) override; void OnWsFrame(const std::vector& data) override; private: - SocketSession* Session() { - return server_->Session(session_id_); - } + SocketSession* Session() { return server_->Session(session_id_); } InspectorSocketServer* server_; int session_id_; @@ -210,7 +195,7 @@ class SocketSession { class ServerSocket { public: explicit ServerSocket(InspectorSocketServer* server) - : tcp_socket_(uv_tcp_t()), server_(server) {} + : tcp_socket_(uv_tcp_t()), server_(server) {} int Listen(sockaddr* addr, uv_loop_t* loop); void Close() { uv_close(reinterpret_cast(&tcp_socket_), FreeOnCloseCallback); @@ -236,10 +221,17 @@ class ServerSocket { }; InspectorSocketServer::InspectorSocketServer( - std::unique_ptr delegate, uv_loop_t* loop, - const std::string& host, int port, FILE* out) - : loop_(loop), delegate_(std::move(delegate)), host_(host), port_(port), - next_session_id_(0), out_(out) { + std::unique_ptr delegate, + uv_loop_t* loop, + const std::string& host, + int port, + FILE* out) + : loop_(loop), + delegate_(std::move(delegate)), + host_(host), + port_(port), + next_session_id_(0), + out_(out) { delegate_->AssignServer(this); state_ = ServerState::kNew; } @@ -274,10 +266,10 @@ void InspectorSocketServer::SessionTerminated(int session_id) { } connected_sessions_.erase(session_id); if (connected_sessions_.empty()) { - if (was_attached && state_ == ServerState::kRunning - && !server_sockets_.empty()) { - PrintDebuggerReadyMessage(host_, server_sockets_[0]->port(), - delegate_->GetTargetIds(), out_); + if (was_attached && state_ == ServerState::kRunning && + !server_sockets_.empty()) { + PrintDebuggerReadyMessage( + host_, server_sockets_[0]->port(), delegate_->GetTargetIds(), out_); } if (state_ == ServerState::kStopped) { delegate_.reset(); @@ -291,8 +283,7 @@ bool InspectorSocketServer::HandleGetRequest(int session_id, SocketSession* session = Session(session_id); InspectorSocket* socket = session->ws_socket(); const char* command = MatchPathSegment(path.c_str(), "/json"); - if (command == nullptr) - return false; + if (command == nullptr) return false; if (MatchPathSegment(command, "list") || command[0] == '\0') { SendListResponse(socket, host, session); @@ -327,22 +318,21 @@ void InspectorSocketServer::SendListResponse(InspectorSocket* socket, std::string detected_host = host; if (detected_host.empty()) { - detected_host = FormatHostPort(socket->GetHost(), - session->server_port()); + detected_host = FormatHostPort(socket->GetHost(), session->server_port()); } std::string formatted_address = FormatAddress(detected_host, id, false); - target_map["devtoolsFrontendUrl"] = GetFrontendURL(false, - formatted_address); + target_map["devtoolsFrontendUrl"] = + GetFrontendURL(false, formatted_address); // The compat URL is for Chrome browsers older than 66.0.3345.0 - target_map["devtoolsFrontendUrlCompat"] = GetFrontendURL(true, - formatted_address); + target_map["devtoolsFrontendUrlCompat"] = + GetFrontendURL(true, formatted_address); target_map["webSocketDebuggerUrl"] = FormatAddress(detected_host, id, true); } SendHttpResponse(socket, MapsToString(response)); } -std::string InspectorSocketServer::GetFrontendURL(bool is_compat, - const std::string &formatted_address) { +std::string InspectorSocketServer::GetFrontendURL( + bool is_compat, const std::string& formatted_address) { std::ostringstream frontend_url; frontend_url << "chrome-devtools://devtools/bundled/"; frontend_url << (is_compat ? "inspector" : "js_app"); @@ -363,11 +353,13 @@ bool InspectorSocketServer::Start() { hints.ai_socktype = SOCK_STREAM; uv_getaddrinfo_t req; const std::string port_string = std::to_string(port_); - int err = uv_getaddrinfo(loop_, &req, nullptr, host_.c_str(), - port_string.c_str(), &hints); + int err = uv_getaddrinfo( + loop_, &req, nullptr, host_.c_str(), port_string.c_str(), &hints); if (err < 0) { if (out_ != nullptr) { - fprintf(out_, "Unable to resolve \"%s\": %s\n", host_.c_str(), + fprintf(out_, + "Unable to resolve \"%s\": %s\n", + host_.c_str(), uv_strerror(err)); } return false; @@ -376,8 +368,7 @@ bool InspectorSocketServer::Start() { address = address->ai_next) { auto server_socket = ServerSocketPtr(new ServerSocket(this)); err = server_socket->Listen(address->ai_addr, loop_); - if (err == 0) - server_sockets_.push_back(std::move(server_socket)); + if (err == 0) server_sockets_.push_back(std::move(server_socket)); } uv_freeaddrinfo(req.addrinfo); @@ -385,8 +376,11 @@ bool InspectorSocketServer::Start() { // show one error, for the last address. if (server_sockets_.empty()) { if (out_ != nullptr) { - fprintf(out_, "Starting inspector on %s:%d failed: %s\n", - host_.c_str(), port_, uv_strerror(err)); + fprintf(out_, + "Starting inspector on %s:%d failed: %s\n", + host_.c_str(), + port_, + uv_strerror(err)); fflush(out_); } return false; @@ -394,19 +388,17 @@ bool InspectorSocketServer::Start() { delegate_.swap(delegate_holder); state_ = ServerState::kRunning; // getaddrinfo sorts the addresses, so the first port is most relevant. - PrintDebuggerReadyMessage(host_, server_sockets_[0]->port(), - delegate_->GetTargetIds(), out_); + PrintDebuggerReadyMessage( + host_, server_sockets_[0]->port(), delegate_->GetTargetIds(), out_); return true; } void InspectorSocketServer::Stop() { - if (state_ == ServerState::kStopped) - return; + if (state_ == ServerState::kStopped) return; CHECK_EQ(state_, ServerState::kRunning); state_ = ServerState::kStopped; server_sockets_.clear(); - if (done()) - delegate_.reset(); + if (done()) delegate_.reset(); } void InspectorSocketServer::TerminateConnections() { @@ -432,9 +424,8 @@ void InspectorSocketServer::Accept(int server_port, std::unique_ptr session( new SocketSession(this, next_session_id_++, server_port)); - InspectorSocket::DelegatePointer delegate = - InspectorSocket::DelegatePointer( - new SocketSession::Delegate(this, session->id())); + InspectorSocket::DelegatePointer delegate = InspectorSocket::DelegatePointer( + new SocketSession::Delegate(this, session->id())); InspectorSocket::Pointer inspector = InspectorSocket::Accept(server_socket, std::move(delegate)); @@ -456,7 +447,8 @@ void InspectorSocketServer::CloseServerSocket(ServerSocket* server) { } // InspectorSession tracking -SocketSession::SocketSession(InspectorSocketServer* server, int id, +SocketSession::SocketSession(InspectorSocketServer* server, + int id, int server_port) : id_(id), server_port_(server_port) {} @@ -478,18 +470,16 @@ void SocketSession::Delegate::OnSocketUpgrade(const std::string& host, } void SocketSession::Delegate::OnWsFrame(const std::vector& data) { - server_->MessageReceived(session_id_, - std::string(data.data(), data.size())); + server_->MessageReceived(session_id_, std::string(data.data(), data.size())); } // ServerSocket implementation int ServerSocket::DetectPort() { sockaddr_storage addr; int len = sizeof(addr); - int err = uv_tcp_getsockname(&tcp_socket_, - reinterpret_cast(&addr), &len); - if (err != 0) - return err; + int err = uv_tcp_getsockname( + &tcp_socket_, reinterpret_cast(&addr), &len); + if (err != 0) return err; int port; if (addr.ss_family == AF_INET6) port = reinterpret_cast(&addr)->sin6_port; @@ -505,7 +495,8 @@ int ServerSocket::Listen(sockaddr* addr, uv_loop_t* loop) { int err = uv_tcp_bind(server, addr, 0); if (err == 0) { // 511 is the value used by a 'net' module by default - err = uv_listen(reinterpret_cast(server), 511, + err = uv_listen(reinterpret_cast(server), + 511, ServerSocket::SocketConnectedCallback); } if (err == 0) { diff --git a/src/inspector_socket_server.h b/src/inspector_socket_server.h index 5c61b4e5ee3ddc..984959f6bb6490 100644 --- a/src/inspector_socket_server.h +++ b/src/inspector_socket_server.h @@ -60,9 +60,11 @@ class InspectorSocketServer { // Session connection lifecycle void Accept(int server_port, uv_stream_t* server_socket); - bool HandleGetRequest(int session_id, const std::string& host, + bool HandleGetRequest(int session_id, + const std::string& host, const std::string& path); - void SessionStarted(int session_id, const std::string& target_id, + void SessionStarted(int session_id, + const std::string& target_id, const std::string& ws_id); void SessionTerminated(int session_id); void MessageReceived(int session_id, const std::string& message) { @@ -77,13 +79,14 @@ class InspectorSocketServer { static void CloseServerSocket(ServerSocket*); using ServerSocketPtr = DeleteFnPtr; - void SendListResponse(InspectorSocket* socket, const std::string& host, + void SendListResponse(InspectorSocket* socket, + const std::string& host, SocketSession* session); std::string GetFrontendURL(bool is_compat, - const std::string &formatted_address); + const std::string& formatted_address); bool TargetExists(const std::string& id); - enum class ServerState {kNew, kRunning, kStopping, kStopped}; + enum class ServerState { kNew, kRunning, kStopping, kStopped }; uv_loop_t* loop_; std::unique_ptr delegate_; const std::string host_; diff --git a/src/js_native_api.h b/src/js_native_api.h index 9d0fa811cfa3af..dc6dd393e96352 100644 --- a/src/js_native_api.h +++ b/src/js_native_api.h @@ -1,8 +1,8 @@ #ifndef SRC_JS_NATIVE_API_H_ #define SRC_JS_NATIVE_API_H_ -#include #include +#include #include "js_native_api_types.h" // Use INT_MAX, this should only be consumed by the pre-processor anyway. @@ -19,11 +19,11 @@ // If you need __declspec(dllimport), either include instead, or // define NAPI_EXTERN as __declspec(dllimport) on the compiler's command line. #ifndef NAPI_EXTERN - #ifdef _WIN32 - #define NAPI_EXTERN __declspec(dllexport) - #else - #define NAPI_EXTERN __attribute__((visibility("default"))) - #endif +#ifdef _WIN32 +#define NAPI_EXTERN __declspec(dllexport) +#else +#define NAPI_EXTERN __attribute__((visibility("default"))) +#endif #endif #define NAPI_AUTO_LENGTH SIZE_MAX @@ -39,8 +39,7 @@ EXTERN_C_START NAPI_EXTERN napi_status -napi_get_last_error_info(napi_env env, - const napi_extended_error_info** result); +napi_get_last_error_info(napi_env env, const napi_extended_error_info** result); // Getters for defined singletons NAPI_EXTERN napi_status napi_get_undefined(napi_env env, napi_value* result); @@ -123,18 +122,12 @@ NAPI_EXTERN napi_status napi_get_value_bool(napi_env env, bool* result); // Copies LATIN-1 encoded bytes from a string into a buffer. -NAPI_EXTERN napi_status napi_get_value_string_latin1(napi_env env, - napi_value value, - char* buf, - size_t bufsize, - size_t* result); +NAPI_EXTERN napi_status napi_get_value_string_latin1( + napi_env env, napi_value value, char* buf, size_t bufsize, size_t* result); // Copies UTF-8 encoded bytes from a string into a buffer. -NAPI_EXTERN napi_status napi_get_value_string_utf8(napi_env env, - napi_value value, - char* buf, - size_t bufsize, - size_t* result); +NAPI_EXTERN napi_status napi_get_value_string_utf8( + napi_env env, napi_value value, char* buf, size_t bufsize, size_t* result); // Copies UTF-16 encoded bytes from a string into a buffer. NAPI_EXTERN napi_status napi_get_value_string_utf16(napi_env env, @@ -186,17 +179,17 @@ NAPI_EXTERN napi_status napi_has_own_property(napi_env env, napi_value key, bool* result); NAPI_EXTERN napi_status napi_set_named_property(napi_env env, - napi_value object, - const char* utf8name, - napi_value value); + napi_value object, + const char* utf8name, + napi_value value); NAPI_EXTERN napi_status napi_has_named_property(napi_env env, - napi_value object, - const char* utf8name, - bool* result); + napi_value object, + const char* utf8name, + bool* result); NAPI_EXTERN napi_status napi_get_named_property(napi_env env, - napi_value object, - const char* utf8name, - napi_value* result); + napi_value object, + const char* utf8name, + napi_value* result); NAPI_EXTERN napi_status napi_set_element(napi_env env, napi_value object, uint32_t index, @@ -337,12 +330,10 @@ NAPI_EXTERN napi_status napi_open_handle_scope(napi_env env, napi_handle_scope* result); NAPI_EXTERN napi_status napi_close_handle_scope(napi_env env, napi_handle_scope scope); -NAPI_EXTERN napi_status -napi_open_escapable_handle_scope(napi_env env, - napi_escapable_handle_scope* result); -NAPI_EXTERN napi_status -napi_close_escapable_handle_scope(napi_env env, - napi_escapable_handle_scope scope); +NAPI_EXTERN napi_status napi_open_escapable_handle_scope( + napi_env env, napi_escapable_handle_scope* result); +NAPI_EXTERN napi_status napi_close_escapable_handle_scope( + napi_env env, napi_escapable_handle_scope scope); NAPI_EXTERN napi_status napi_escape_handle(napi_env env, napi_escapable_handle_scope scope, @@ -355,11 +346,11 @@ NAPI_EXTERN napi_status napi_throw_error(napi_env env, const char* code, const char* msg); NAPI_EXTERN napi_status napi_throw_type_error(napi_env env, - const char* code, - const char* msg); + const char* code, + const char* msg); NAPI_EXTERN napi_status napi_throw_range_error(napi_env env, - const char* code, - const char* msg); + const char* code, + const char* msg); NAPI_EXTERN napi_status napi_is_error(napi_env env, napi_value value, bool* result); diff --git a/src/js_native_api_types.h b/src/js_native_api_types.h index a4739957991e3f..846f2b72aa76c3 100644 --- a/src/js_native_api_types.h +++ b/src/js_native_api_types.h @@ -5,7 +5,7 @@ #include #if !defined __cplusplus || (defined(_MSC_VER) && _MSC_VER < 1900) - typedef uint16_t char16_t; +typedef uint16_t char16_t; #endif // JSVM API types are all opaque pointers for ABI stability @@ -78,8 +78,7 @@ typedef enum { napi_bigint_expected, } napi_status; -typedef napi_value (*napi_callback)(napi_env env, - napi_callback_info info); +typedef napi_value (*napi_callback)(napi_env env, napi_callback_info info); typedef void (*napi_finalize)(napi_env env, void* finalize_data, void* finalize_hint); diff --git a/src/js_native_api_v8.cc b/src/js_native_api_v8.cc index 9e67e2ca24b7c0..a3b40c5911331a 100644 --- a/src/js_native_api_v8.cc +++ b/src/js_native_api_v8.cc @@ -1,35 +1,35 @@ #include // INT_MAX -#include #include +#include #define NAPI_EXPERIMENTAL -#include "js_native_api_v8.h" #include "js_native_api.h" +#include "js_native_api_v8.h" -#define CHECK_MAYBE_NOTHING(env, maybe, status) \ +#define CHECK_MAYBE_NOTHING(env, maybe, status) \ RETURN_STATUS_IF_FALSE((env), !((maybe).IsNothing()), (status)) -#define CHECK_TO_NUMBER(env, context, result, src) \ +#define CHECK_TO_NUMBER(env, context, result, src) \ CHECK_TO_TYPE((env), Number, (context), (result), (src), napi_number_expected) // n-api defines NAPI_AUTO_LENGHTH as the indicator that a string // is null terminated. For V8 the equivalent is -1. The assert // validates that our cast of NAPI_AUTO_LENGTH results in -1 as // needed by V8. -#define CHECK_NEW_FROM_UTF8_LEN(env, result, str, len) \ - do { \ - static_assert(static_cast(NAPI_AUTO_LENGTH) == -1, \ - "Casting NAPI_AUTO_LENGTH to int must result in -1"); \ - RETURN_STATUS_IF_FALSE((env), \ - (len == NAPI_AUTO_LENGTH) || len <= INT_MAX, \ - napi_invalid_arg); \ - auto str_maybe = v8::String::NewFromUtf8( \ - (env)->isolate, (str), v8::NewStringType::kInternalized, \ - static_cast(len)); \ - CHECK_MAYBE_EMPTY((env), str_maybe, napi_generic_failure); \ - (result) = str_maybe.ToLocalChecked(); \ +#define CHECK_NEW_FROM_UTF8_LEN(env, result, str, len) \ + do { \ + static_assert(static_cast(NAPI_AUTO_LENGTH) == -1, \ + "Casting NAPI_AUTO_LENGTH to int must result in -1"); \ + RETURN_STATUS_IF_FALSE( \ + (env), (len == NAPI_AUTO_LENGTH) || len <= INT_MAX, napi_invalid_arg); \ + auto str_maybe = v8::String::NewFromUtf8((env)->isolate, \ + (str), \ + v8::NewStringType::kInternalized, \ + static_cast(len)); \ + CHECK_MAYBE_EMPTY((env), str_maybe, napi_generic_failure); \ + (result) = str_maybe.ToLocalChecked(); \ } while (0) -#define CHECK_NEW_FROM_UTF8(env, result, str) \ +#define CHECK_NEW_FROM_UTF8(env, result, str) \ CHECK_NEW_FROM_UTF8_LEN((env), (result), (str), NAPI_AUTO_LENGTH) #define CREATE_TYPED_ARRAY( \ @@ -37,12 +37,15 @@ do { \ if ((size_of_element) > 1) { \ THROW_RANGE_ERROR_IF_FALSE( \ - (env), (byte_offset) % (size_of_element) == 0, \ + (env), \ + (byte_offset) % (size_of_element) == 0, \ "ERR_NAPI_INVALID_TYPEDARRAY_ALIGNMENT", \ - "start offset of "#type" should be a multiple of "#size_of_element); \ + "start offset of " #type \ + " should be a multiple of " #size_of_element); \ } \ - THROW_RANGE_ERROR_IF_FALSE((env), (length) * (size_of_element) + \ - (byte_offset) <= buffer->ByteLength(), \ + THROW_RANGE_ERROR_IF_FALSE( \ + (env), \ + (length) * (size_of_element) + (byte_offset) <= buffer->ByteLength(), \ "ERR_NAPI_INVALID_TYPEDARRAY_LENGTH", \ "Invalid typed array length"); \ (out) = v8::type::New((buffer), (byte_offset), (length)); \ @@ -52,15 +55,15 @@ namespace v8impl { namespace { -inline static napi_status -V8NameFromPropertyDescriptor(napi_env env, - const napi_property_descriptor* p, - v8::Local* result) { +inline static napi_status V8NameFromPropertyDescriptor( + napi_env env, + const napi_property_descriptor* p, + v8::Local* result) { if (p->utf8name != nullptr) { CHECK_NEW_FROM_UTF8(env, *result, p->utf8name); } else { v8::Local property_value = - v8impl::V8LocalValueFromJsValue(p->name); + v8impl::V8LocalValueFromJsValue(p->name); RETURN_STATUS_IF_FALSE(env, property_value->IsName(), napi_name_expected); *result = property_value.As(); @@ -77,8 +80,9 @@ inline static v8::PropertyAttribute V8PropertyAttributesFromDescriptor( if (descriptor->getter != nullptr || descriptor->setter != nullptr) { // The napi_writable attribute is ignored for accessor descriptors, but // V8 requires the ReadOnly attribute to match nonexistence of a setter. - attribute_flags |= (descriptor->setter == nullptr ? - v8::PropertyAttribute::ReadOnly : v8::PropertyAttribute::None); + attribute_flags |= + (descriptor->setter == nullptr ? v8::PropertyAttribute::ReadOnly + : v8::PropertyAttribute::None); } else if ((descriptor->attributes & napi_writable) == 0) { attribute_flags |= v8::PropertyAttribute::ReadOnly; } @@ -93,13 +97,13 @@ inline static v8::PropertyAttribute V8PropertyAttributesFromDescriptor( return static_cast(attribute_flags); } -inline static napi_deferred -JsDeferredFromNodePersistent(v8impl::Persistent* local) { +inline static napi_deferred JsDeferredFromNodePersistent( + v8impl::Persistent* local) { return reinterpret_cast(local); } -inline static v8impl::Persistent* -NodePersistentFromJsDeferred(napi_deferred local) { +inline static v8impl::Persistent* NodePersistentFromJsDeferred( + napi_deferred local) { return reinterpret_cast*>(local); } @@ -120,9 +124,7 @@ class EscapableHandleScopeWrapper { public: explicit EscapableHandleScopeWrapper(v8::Isolate* isolate) : scope(isolate), escape_called_(false) {} - bool escape_called() const { - return escape_called_; - } + bool escape_called() const { return escape_called_; } template v8::Local Escape(v8::Local handle) { escape_called_ = true; @@ -134,13 +136,13 @@ class EscapableHandleScopeWrapper { bool escape_called_; }; -inline static napi_handle_scope -JsHandleScopeFromV8HandleScope(HandleScopeWrapper* s) { +inline static napi_handle_scope JsHandleScopeFromV8HandleScope( + HandleScopeWrapper* s) { return reinterpret_cast(s); } -inline static HandleScopeWrapper* -V8HandleScopeFromJsHandleScope(napi_handle_scope s) { +inline static HandleScopeWrapper* V8HandleScopeFromJsHandleScope( + napi_handle_scope s) { return reinterpret_cast(s); } @@ -171,9 +173,11 @@ inline static napi_status ConcludeDeferred(napi_env env, auto v8_resolver = v8::Local::Cast(v8_deferred); - v8::Maybe success = is_resolved ? - v8_resolver->Resolve(context, v8impl::V8LocalValueFromJsValue(result)) : - v8_resolver->Reject(context, v8impl::V8LocalValueFromJsValue(result)); + v8::Maybe success = + is_resolved ? v8_resolver->Resolve( + context, v8impl::V8LocalValueFromJsValue(result)) + : v8_resolver->Reject( + context, v8impl::V8LocalValueFromJsValue(result)); delete deferred_ref; @@ -192,7 +196,7 @@ class Reference : private Finalizer { napi_finalize finalize_callback, void* finalize_data, void* finalize_hint) - : Finalizer(env, finalize_callback, finalize_data, finalize_hint), + : Finalizer(env, finalize_callback, finalize_data, finalize_hint), _persistent(env->isolate, value), _refcount(initial_refcount), _delete_self(delete_self) { @@ -203,9 +207,7 @@ class Reference : private Finalizer { } public: - void* Data() { - return _finalize_data; - } + void* Data() { return _finalize_data; } static Reference* New(napi_env env, v8::Local value, @@ -215,12 +217,12 @@ class Reference : private Finalizer { void* finalize_data = nullptr, void* finalize_hint = nullptr) { return new Reference(env, - value, - initial_refcount, - delete_self, - finalize_callback, - finalize_data, - finalize_hint); + value, + initial_refcount, + delete_self, + finalize_callback, + finalize_data, + finalize_hint); } // Delete is called in 2 ways. Either from the finalizer or @@ -244,7 +246,8 @@ class Reference : private Finalizer { // reduce the reference count to 0 and defer until // finalizer runs reference->_delete_self = true; - while (reference->Unref() != 0) {} + while (reference->Unref() != 0) { + } } } @@ -258,7 +261,7 @@ class Reference : private Finalizer { uint32_t Unref() { if (_refcount == 0) { - return 0; + return 0; } if (--_refcount == 0) { _persistent.SetWeak( @@ -268,9 +271,7 @@ class Reference : private Finalizer { return _refcount; } - uint32_t RefCount() { - return _refcount; - } + uint32_t RefCount() { return _refcount; } v8::Local Get() { if (_persistent.IsEmpty()) { @@ -288,11 +289,11 @@ class Reference : private Finalizer { napi_env env = reference->_env; if (reference->_finalize_callback != nullptr) { - NAPI_CALL_INTO_MODULE_THROW(env, - reference->_finalize_callback( - reference->_env, - reference->_finalize_data, - reference->_finalize_hint)); + NAPI_CALL_INTO_MODULE_THROW( + env, + reference->_finalize_callback(reference->_env, + reference->_finalize_data, + reference->_finalize_hint)); } // this is safe because if a request to delete the reference @@ -310,10 +311,7 @@ class Reference : private Finalizer { bool _delete_self; }; -enum UnwrapAction { - KeepWrap, - RemoveWrap -}; +enum UnwrapAction { KeepWrap, RemoveWrap }; inline static napi_status Unwrap(napi_env env, napi_value js_object, @@ -333,7 +331,7 @@ inline static napi_status Unwrap(napi_env env, v8::Local obj = value.As(); auto val = obj->GetPrivate(context, NAPI_PRIVATE_KEY(context, wrapper)) - .ToLocalChecked(); + .ToLocalChecked(); RETURN_STATUS_IF_FALSE(env, val->IsExternal(), napi_invalid_arg); Reference* reference = static_cast(val.As()->Value()); @@ -344,7 +342,7 @@ inline static napi_status Unwrap(napi_env env, if (action == RemoveWrap) { CHECK(obj->DeletePrivate(context, NAPI_PRIVATE_KEY(context, wrapper)) - .FromJust()); + .FromJust()); Reference::Delete(reference); } @@ -367,10 +365,10 @@ struct CallbackBundle { handle.SetWeak(this, WeakCallback, v8::WeakCallbackType::kParameter); } - napi_env env; // Necessary to invoke C++ NAPI callback - void* cb_data; // The user provided callback data - napi_callback function_or_getter; - napi_callback setter; + napi_env env; // Necessary to invoke C++ NAPI callback + void* cb_data; // The user provided callback data + napi_callback function_or_getter; + napi_callback setter; v8impl::Persistent handle; // Die with this JavaScript object private: @@ -412,9 +410,8 @@ template class CallbackWrapperBase : public CallbackWrapper { public: CallbackWrapperBase(const Info& cbinfo, const size_t args_length) - : CallbackWrapper(JsValueFromV8LocalValue(cbinfo.This()), - args_length, - nullptr), + : CallbackWrapper( + JsValueFromV8LocalValue(cbinfo.This()), args_length, nullptr), _cbinfo(cbinfo) { _bundle = reinterpret_cast( v8::Local::Cast(cbinfo.Data())->Value()); @@ -563,10 +560,9 @@ class SetterCallbackWrapper // Creates an object to be made available to the static function callback // wrapper, used to retrieve the native callback function and data pointer. -static -v8::Local CreateFunctionCallbackData(napi_env env, - napi_callback cb, - void* data) { +static v8::Local CreateFunctionCallbackData(napi_env env, + napi_callback cb, + void* data) { CallbackBundle* bundle = new CallbackBundle(); bundle->function_or_getter = cb; bundle->cb_data = data; @@ -595,10 +591,7 @@ inline v8::Local CreateAccessorCallbackData(napi_env env, return cbdata; } -enum WrapType { - retrievable, - anonymous -}; +enum WrapType { retrievable, anonymous }; template inline napi_status Wrap(napi_env env, @@ -618,9 +611,10 @@ inline napi_status Wrap(napi_env env, if (wrap_type == retrievable) { // If we've already wrapped this object, we error out. - RETURN_STATUS_IF_FALSE(env, + RETURN_STATUS_IF_FALSE( + env, !obj->HasPrivate(context, NAPI_PRIVATE_KEY(context, wrapper)) - .FromJust(), + .FromJust(), napi_invalid_arg); } else if (wrap_type == anonymous) { // If no finalize callback is provided, we error out. @@ -639,13 +633,21 @@ inline napi_status Wrap(napi_env env, *result = reinterpret_cast(reference); } else { // Create a self-deleting reference. - reference = v8impl::Reference::New(env, obj, 0, true, finalize_cb, - native_object, finalize_cb == nullptr ? nullptr : finalize_hint); + reference = v8impl::Reference::New( + env, + obj, + 0, + true, + finalize_cb, + native_object, + finalize_cb == nullptr ? nullptr : finalize_hint); } if (wrap_type == retrievable) { - CHECK(obj->SetPrivate(context, NAPI_PRIVATE_KEY(context, wrapper), - v8::External::New(env->isolate, reference)).FromJust()); + CHECK(obj->SetPrivate(context, + NAPI_PRIVATE_KEY(context, wrapper), + v8::External::New(env->isolate, reference)) + .FromJust()); } return GET_RETURN_STATUS(env); @@ -656,25 +658,25 @@ inline napi_status Wrap(napi_env env, } // end of namespace v8impl // Warning: Keep in-sync with napi_status enum -static -const char* error_messages[] = {nullptr, - "Invalid argument", - "An object was expected", - "A string was expected", - "A string or symbol was expected", - "A function was expected", - "A number was expected", - "A boolean was expected", - "An array was expected", - "Unknown failure", - "An exception is pending", - "The async work item was cancelled", - "napi_escape_handle already called on scope", - "Invalid handle scope usage", - "Invalid callback scope usage", - "Thread-safe function queue is full", - "Thread-safe function handle is closing", - "A bigint was expected", +static const char* error_messages[] = { + nullptr, + "Invalid argument", + "An object was expected", + "A string was expected", + "A string or symbol was expected", + "A function was expected", + "A number was expected", + "A boolean was expected", + "An array was expected", + "Unknown failure", + "An exception is pending", + "The async work item was cancelled", + "napi_escape_handle already called on scope", + "Invalid handle scope usage", + "Invalid callback scope usage", + "Thread-safe function queue is full", + "Thread-safe function handle is closing", + "A bigint was expected", }; napi_status napi_get_last_error_info(napi_env env, @@ -686,15 +688,13 @@ napi_status napi_get_last_error_info(napi_env env, // in the napi_status enum each time a new error message is added. // We don't have a napi_status_last as this would result in an ABI // change each time a message was added. - static_assert( - NAPI_ARRAYSIZE(error_messages) == napi_bigint_expected + 1, - "Count of error messages must match count of error values"); + static_assert(NAPI_ARRAYSIZE(error_messages) == napi_bigint_expected + 1, + "Count of error messages must match count of error values"); CHECK_LE(env->last_error.error_code, napi_callback_scope_mismatch); // Wait until someone requests the last error information to fetch the error // message string - env->last_error.error_message = - error_messages[env->last_error.error_code]; + env->last_error.error_message = error_messages[env->last_error.error_code]; *result = &(env->last_error); return napi_ok; @@ -719,10 +719,8 @@ napi_status napi_create_function(napi_env env, RETURN_STATUS_IF_FALSE(env, !cbdata.IsEmpty(), napi_generic_failure); v8::Local context = env->context(); - v8::MaybeLocal maybe_function = - v8::Function::New(context, - v8impl::FunctionCallbackWrapper::Invoke, - cbdata); + v8::MaybeLocal maybe_function = v8::Function::New( + context, v8impl::FunctionCallbackWrapper::Invoke, cbdata); CHECK_MAYBE_EMPTY(env, maybe_function, napi_generic_failure); return_value = scope.Escape(maybe_function.ToLocalChecked()); @@ -790,15 +788,15 @@ napi_status napi_define_class(napi_env env, // difference is it applies to a template instead of an object. if (p->getter != nullptr || p->setter != nullptr) { v8::Local cbdata = v8impl::CreateAccessorCallbackData( - env, p->getter, p->setter, p->data); + env, p->getter, p->setter, p->data); tpl->PrototypeTemplate()->SetAccessor( - property_name, - p->getter ? v8impl::GetterCallbackWrapper::Invoke : nullptr, - p->setter ? v8impl::SetterCallbackWrapper::Invoke : nullptr, - cbdata, - v8::AccessControl::DEFAULT, - attributes); + property_name, + p->getter ? v8impl::GetterCallbackWrapper::Invoke : nullptr, + p->setter ? v8impl::SetterCallbackWrapper::Invoke : nullptr, + cbdata, + v8::AccessControl::DEFAULT, + attributes); } else if (p->method != nullptr) { v8::Local cbdata = v8impl::CreateFunctionCallbackData(env, p->method, p->data); @@ -806,10 +804,10 @@ napi_status napi_define_class(napi_env env, RETURN_STATUS_IF_FALSE(env, !cbdata.IsEmpty(), napi_generic_failure); v8::Local t = - v8::FunctionTemplate::New(isolate, - v8impl::FunctionCallbackWrapper::Invoke, - cbdata, - v8::Signature::New(isolate, tpl)); + v8::FunctionTemplate::New(isolate, + v8impl::FunctionCallbackWrapper::Invoke, + cbdata, + v8::Signature::New(isolate, tpl)); tpl->PrototypeTemplate()->Set(property_name, t, attributes); } else { @@ -833,11 +831,8 @@ napi_status napi_define_class(napi_env env, } } - napi_status status = - napi_define_properties(env, - *result, - static_descriptors.size(), - static_descriptors.data()); + napi_status status = napi_define_properties( + env, *result, static_descriptors.size(), static_descriptors.data()); if (status != napi_ok) return status; } @@ -858,8 +853,8 @@ napi_status napi_get_property_names(napi_env env, CHECK_MAYBE_EMPTY(env, maybe_propertynames, napi_generic_failure); - *result = v8impl::JsValueFromV8LocalValue( - maybe_propertynames.ToLocalChecked()); + *result = + v8impl::JsValueFromV8LocalValue(maybe_propertynames.ToLocalChecked()); return GET_RETURN_STATUS(env); } @@ -945,8 +940,7 @@ napi_status napi_delete_property(napi_env env, v8::Maybe delete_maybe = obj->Delete(context, k); CHECK_MAYBE_NOTHING(env, delete_maybe, napi_generic_failure); - if (result != nullptr) - *result = delete_maybe.FromMaybe(false); + if (result != nullptr) *result = delete_maybe.FromMaybe(false); return GET_RETURN_STATUS(env); } @@ -1115,8 +1109,7 @@ napi_status napi_delete_element(napi_env env, v8::Maybe delete_maybe = obj->Delete(context, index); CHECK_MAYBE_NOTHING(env, delete_maybe, napi_generic_failure); - if (result != nullptr) - *result = delete_maybe.FromMaybe(false); + if (result != nullptr) *result = delete_maybe.FromMaybe(false); return GET_RETURN_STATUS(env); } @@ -1151,19 +1144,16 @@ napi_status napi_define_properties(napi_env env, if (p->getter != nullptr || p->setter != nullptr) { v8::Local cbdata = v8impl::CreateAccessorCallbackData( - env, - p->getter, - p->setter, - p->data); + env, p->getter, p->setter, p->data); auto set_maybe = obj->SetAccessor( - context, - property_name, - p->getter ? v8impl::GetterCallbackWrapper::Invoke : nullptr, - p->setter ? v8impl::SetterCallbackWrapper::Invoke : nullptr, - cbdata, - v8::AccessControl::DEFAULT, - attributes); + context, + property_name, + p->getter ? v8impl::GetterCallbackWrapper::Invoke : nullptr, + p->setter ? v8impl::SetterCallbackWrapper::Invoke : nullptr, + cbdata, + v8::AccessControl::DEFAULT, + attributes); if (!set_maybe.FromMaybe(false)) { return napi_set_last_error(env, napi_invalid_arg); @@ -1174,15 +1164,13 @@ napi_status napi_define_properties(napi_env env, CHECK_MAYBE_EMPTY(env, cbdata, napi_generic_failure); - v8::MaybeLocal maybe_fn = - v8::Function::New(context, - v8impl::FunctionCallbackWrapper::Invoke, - cbdata); + v8::MaybeLocal maybe_fn = v8::Function::New( + context, v8impl::FunctionCallbackWrapper::Invoke, cbdata); CHECK_MAYBE_EMPTY(env, maybe_fn, napi_generic_failure); auto define_maybe = obj->DefineOwnProperty( - context, property_name, maybe_fn.ToLocalChecked(), attributes); + context, property_name, maybe_fn.ToLocalChecked(), attributes); if (!define_maybe.FromMaybe(false)) { return napi_set_last_error(env, napi_generic_failure); @@ -1265,8 +1253,7 @@ napi_status napi_create_object(napi_env env, napi_value* result) { CHECK_ENV(env); CHECK_ARG(env, result); - *result = v8impl::JsValueFromV8LocalValue( - v8::Object::New(env->isolate)); + *result = v8impl::JsValueFromV8LocalValue(v8::Object::New(env->isolate)); return napi_clear_last_error(env); } @@ -1275,8 +1262,7 @@ napi_status napi_create_array(napi_env env, napi_value* result) { CHECK_ENV(env); CHECK_ARG(env, result); - *result = v8impl::JsValueFromV8LocalValue( - v8::Array::New(env->isolate)); + *result = v8impl::JsValueFromV8LocalValue(v8::Array::New(env->isolate)); return napi_clear_last_error(env); } @@ -1287,8 +1273,8 @@ napi_status napi_create_array_with_length(napi_env env, CHECK_ENV(env); CHECK_ARG(env, result); - *result = v8impl::JsValueFromV8LocalValue( - v8::Array::New(env->isolate, length)); + *result = + v8impl::JsValueFromV8LocalValue(v8::Array::New(env->isolate, length)); return napi_clear_last_error(env); } @@ -1345,26 +1331,22 @@ napi_status napi_create_string_utf16(napi_env env, return napi_clear_last_error(env); } -napi_status napi_create_double(napi_env env, - double value, - napi_value* result) { +napi_status napi_create_double(napi_env env, double value, napi_value* result) { CHECK_ENV(env); CHECK_ARG(env, result); - *result = v8impl::JsValueFromV8LocalValue( - v8::Number::New(env->isolate, value)); + *result = + v8impl::JsValueFromV8LocalValue(v8::Number::New(env->isolate, value)); return napi_clear_last_error(env); } -napi_status napi_create_int32(napi_env env, - int32_t value, - napi_value* result) { +napi_status napi_create_int32(napi_env env, int32_t value, napi_value* result) { CHECK_ENV(env); CHECK_ARG(env, result); - *result = v8impl::JsValueFromV8LocalValue( - v8::Integer::New(env->isolate, value)); + *result = + v8impl::JsValueFromV8LocalValue(v8::Integer::New(env->isolate, value)); return napi_clear_last_error(env); } @@ -1381,9 +1363,7 @@ napi_status napi_create_uint32(napi_env env, return napi_clear_last_error(env); } -napi_status napi_create_int64(napi_env env, - int64_t value, - napi_value* result) { +napi_status napi_create_int64(napi_env env, int64_t value, napi_value* result) { CHECK_ENV(env); CHECK_ARG(env, result); @@ -1399,8 +1379,8 @@ napi_status napi_create_bigint_int64(napi_env env, CHECK_ENV(env); CHECK_ARG(env, result); - *result = v8impl::JsValueFromV8LocalValue( - v8::BigInt::New(env->isolate, value)); + *result = + v8impl::JsValueFromV8LocalValue(v8::BigInt::New(env->isolate, value)); return napi_clear_last_error(env); } @@ -1433,8 +1413,8 @@ napi_status napi_create_bigint_words(napi_env env, return napi_set_last_error(env, napi_pending_exception); } - v8::MaybeLocal b = v8::BigInt::NewFromWords( - context, sign_bit, word_count, words); + v8::MaybeLocal b = + v8::BigInt::NewFromWords(context, sign_bit, word_count, words); if (try_catch.HasCaught()) { return napi_set_last_error(env, napi_pending_exception); @@ -1475,7 +1455,7 @@ napi_status napi_create_symbol(napi_env env, RETURN_STATUS_IF_FALSE(env, desc->IsString(), napi_string_expected); *result = v8impl::JsValueFromV8LocalValue( - v8::Symbol::New(isolate, desc.As())); + v8::Symbol::New(isolate, desc.As())); } return napi_clear_last_error(env); @@ -1502,9 +1482,8 @@ static inline napi_status set_error_code(napi_env env, CHECK_NEW_FROM_UTF8(env, code_key, "code"); v8::Maybe set_maybe = err_object->Set(context, code_key, code_value); - RETURN_STATUS_IF_FALSE(env, - set_maybe.FromMaybe(false), - napi_generic_failure); + RETURN_STATUS_IF_FALSE( + env, set_maybe.FromMaybe(false), napi_generic_failure); // now update the name to be "name [code]" where name is the // original name and code is the code associated with the Error @@ -1529,9 +1508,8 @@ static inline napi_status set_error_code(napi_env env, isolate, name_string, NAPI_FIXED_ONE_BYTE_STRING(isolate, "]")); set_maybe = err_object->Set(context, name_key, name_string); - RETURN_STATUS_IF_FALSE(env, - set_maybe.FromMaybe(false), - napi_generic_failure); + RETURN_STATUS_IF_FALSE( + env, set_maybe.FromMaybe(false), napi_generic_failure); } return napi_ok; } @@ -1646,8 +1624,7 @@ napi_status napi_get_undefined(napi_env env, napi_value* result) { CHECK_ENV(env); CHECK_ARG(env, result); - *result = v8impl::JsValueFromV8LocalValue( - v8::Undefined(env->isolate)); + *result = v8impl::JsValueFromV8LocalValue(v8::Undefined(env->isolate)); return napi_clear_last_error(env); } @@ -1656,8 +1633,7 @@ napi_status napi_get_null(napi_env env, napi_value* result) { CHECK_ENV(env); CHECK_ARG(env, result); - *result = v8impl::JsValueFromV8LocalValue( - v8::Null(env->isolate)); + *result = v8impl::JsValueFromV8LocalValue(v8::Null(env->isolate)); return napi_clear_last_error(env); } @@ -1727,8 +1703,11 @@ napi_status napi_call_function(napi_env env, v8::Local v8func; CHECK_TO_FUNCTION(env, v8func, func); - auto maybe = v8func->Call(context, v8recv, argc, - reinterpret_cast*>(const_cast(argv))); + auto maybe = v8func->Call( + context, + v8recv, + argc, + reinterpret_cast*>(const_cast(argv))); if (try_catch.HasCaught()) { return napi_set_last_error(env, napi_pending_exception); @@ -1762,9 +1741,7 @@ napi_status napi_throw(napi_env env, napi_value error) { return napi_clear_last_error(env); } -napi_status napi_throw_error(napi_env env, - const char* code, - const char* msg) { +napi_status napi_throw_error(napi_env env, const char* code, const char* msg) { NAPI_PREAMBLE(env); v8::Isolate* isolate = env->isolate; @@ -2020,11 +1997,8 @@ napi_status napi_get_value_bool(napi_env env, napi_value value, bool* result) { // If buf is NULL, this method returns the length of the string (in bytes) // via the result parameter. // The result argument is optional unless buf is NULL. -napi_status napi_get_value_string_latin1(napi_env env, - napi_value value, - char* buf, - size_t bufsize, - size_t* result) { +napi_status napi_get_value_string_latin1( + napi_env env, napi_value value, char* buf, size_t bufsize, size_t* result) { CHECK_ENV(env); CHECK_ARG(env, value); @@ -2059,11 +2033,8 @@ napi_status napi_get_value_string_latin1(napi_env env, // If buf is NULL, this method returns the length of the string (in bytes) // via the result parameter. // The result argument is optional unless buf is NULL. -napi_status napi_get_value_string_utf8(napi_env env, - napi_value value, - char* buf, - size_t bufsize, - size_t* result) { +napi_status napi_get_value_string_utf8( + napi_env env, napi_value value, char* buf, size_t bufsize, size_t* result) { CHECK_ENV(env); CHECK_ARG(env, value); @@ -2153,7 +2124,7 @@ napi_status napi_coerce_to_bool(napi_env env, v8::Isolate* isolate = env->isolate; v8::Local b = - v8impl::V8LocalValueFromJsValue(value)->ToBoolean(isolate); + v8impl::V8LocalValueFromJsValue(value)->ToBoolean(isolate); *result = v8impl::JsValueFromV8LocalValue(b); return GET_RETURN_STATUS(env); } @@ -2196,12 +2167,8 @@ napi_status napi_wrap(napi_env env, napi_finalize finalize_cb, void* finalize_hint, napi_ref* result) { - return v8impl::Wrap(env, - js_object, - native_object, - finalize_cb, - finalize_hint, - result); + return v8impl::Wrap( + env, js_object, native_object, finalize_cb, finalize_hint, result); } napi_status napi_unwrap(napi_env env, napi_value obj, void** result) { @@ -2226,13 +2193,8 @@ napi_status napi_create_external(napi_env env, // The Reference object will delete itself after invoking the finalizer // callback. - v8impl::Reference::New(env, - external_value, - 0, - true, - finalize_cb, - data, - finalize_hint); + v8impl::Reference::New( + env, external_value, 0, true, finalize_cb, data, finalize_hint); *result = v8impl::JsValueFromV8LocalValue(external_value); @@ -2383,8 +2345,7 @@ napi_status napi_close_handle_scope(napi_env env, napi_handle_scope scope) { } napi_status napi_open_escapable_handle_scope( - napi_env env, - napi_escapable_handle_scope* result) { + napi_env env, napi_escapable_handle_scope* result) { // Omit NAPI_PREAMBLE and GET_RETURN_STATUS because V8 calls here cannot throw // JS exceptions. CHECK_ENV(env); @@ -2397,8 +2358,7 @@ napi_status napi_open_escapable_handle_scope( } napi_status napi_close_escapable_handle_scope( - napi_env env, - napi_escapable_handle_scope scope) { + napi_env env, napi_escapable_handle_scope scope) { // Omit NAPI_PREAMBLE and GET_RETURN_STATUS because V8 calls here cannot throw // JS exceptions. CHECK_ENV(env); @@ -2450,8 +2410,10 @@ napi_status napi_new_instance(napi_env env, v8::Local ctor; CHECK_TO_FUNCTION(env, ctor, constructor); - auto maybe = ctor->NewInstance(context, argc, - reinterpret_cast*>(const_cast(argv))); + auto maybe = ctor->NewInstance( + context, + argc, + reinterpret_cast*>(const_cast(argv))); CHECK_MAYBE_EMPTY(env, maybe, napi_generic_failure); @@ -2475,9 +2437,8 @@ napi_status napi_instanceof(napi_env env, CHECK_TO_OBJECT(env, context, ctor, constructor); if (!ctor->IsFunction()) { - napi_throw_type_error(env, - "ERR_NAPI_CONS_FUNCTION", - "Constructor must be a function"); + napi_throw_type_error( + env, "ERR_NAPI_CONS_FUNCTION", "Constructor must be a function"); return napi_set_last_error(env, napi_function_expected); } @@ -2513,7 +2474,7 @@ napi_status napi_get_and_clear_last_exception(napi_env env, return napi_get_undefined(env, result); } else { *result = v8impl::JsValueFromV8LocalValue( - v8::Local::New(env->isolate, env->last_exception)); + v8::Local::New(env->isolate, env->last_exception)); env->last_exception.Reset(); } @@ -2568,13 +2529,8 @@ napi_status napi_create_external_arraybuffer(napi_env env, if (finalize_cb != nullptr) { // Create a self-deleting weak reference that invokes the finalizer // callback. - v8impl::Reference::New(env, - buffer, - 0, - true, - finalize_cb, - external_data, - finalize_hint); + v8impl::Reference::New( + env, buffer, 0, true, finalize_cb, external_data, finalize_hint); } *result = v8impl::JsValueFromV8LocalValue(buffer); @@ -2761,15 +2717,14 @@ napi_status napi_create_dataview(napi_env env, v8::Local buffer = value.As(); if (byte_length + byte_offset > buffer->ByteLength()) { - napi_throw_range_error( - env, - "ERR_NAPI_INVALID_DATAVIEW_ARGS", - "byte_offset + byte_length should be less than or " - "equal to the size in bytes of the array passed in"); + napi_throw_range_error(env, + "ERR_NAPI_INVALID_DATAVIEW_ARGS", + "byte_offset + byte_length should be less than or " + "equal to the size in bytes of the array passed in"); return napi_set_last_error(env, napi_pending_exception); } - v8::Local DataView = v8::DataView::New(buffer, byte_offset, - byte_length); + v8::Local DataView = + v8::DataView::New(buffer, byte_offset, byte_length); *result = v8impl::JsValueFromV8LocalValue(DataView); return GET_RETURN_STATUS(env); @@ -2886,12 +2841,11 @@ napi_status napi_run_script(napi_env env, v8::Local context = env->context(); - auto maybe_script = v8::Script::Compile(context, - v8::Local::Cast(v8_script)); + auto maybe_script = + v8::Script::Compile(context, v8::Local::Cast(v8_script)); CHECK_MAYBE_EMPTY(env, maybe_script, napi_generic_failure); - auto script_result = - maybe_script.ToLocalChecked()->Run(context); + auto script_result = maybe_script.ToLocalChecked()->Run(context); CHECK_MAYBE_EMPTY(env, script_result, napi_generic_failure); *result = v8impl::JsValueFromV8LocalValue(script_result.ToLocalChecked()); @@ -2904,12 +2858,8 @@ napi_status napi_add_finalizer(napi_env env, napi_finalize finalize_cb, void* finalize_hint, napi_ref* result) { - return v8impl::Wrap(env, - js_object, - native_object, - finalize_cb, - finalize_hint, - result); + return v8impl::Wrap( + env, js_object, native_object, finalize_cb, finalize_hint, result); } napi_status napi_adjust_external_memory(napi_env env, @@ -2918,8 +2868,8 @@ napi_status napi_adjust_external_memory(napi_env env, CHECK_ENV(env); CHECK_ARG(env, adjusted_value); - *adjusted_value = env->isolate->AdjustAmountOfExternalAllocatedMemory( - change_in_bytes); + *adjusted_value = + env->isolate->AdjustAmountOfExternalAllocatedMemory(change_in_bytes); return napi_clear_last_error(env); } diff --git a/src/js_native_api_v8.h b/src/js_native_api_v8.h index 81b00f2aa59b8f..4a8bdbd4a1f51c 100644 --- a/src/js_native_api_v8.h +++ b/src/js_native_api_v8.h @@ -7,8 +7,7 @@ struct napi_env__ { explicit napi_env__(v8::Local context) - : isolate(context->GetIsolate()), - context_persistent(isolate, context) { + : isolate(context->GetIsolate()), context_persistent(isolate, context) { CHECK_EQ(isolate, context->GetIsolate()); } v8::Isolate* const isolate; // Shortcut for context()->GetIsolate() @@ -19,7 +18,9 @@ struct napi_env__ { } inline void Ref() { refs++; } - inline void Unref() { if ( --refs == 0) delete this; } + inline void Unref() { + if (--refs == 0) delete this; + } v8impl::Persistent last_exception; napi_extended_error_info last_error; @@ -37,94 +38,95 @@ static inline napi_status napi_clear_last_error(napi_env env) { return napi_ok; } -static inline -napi_status napi_set_last_error(napi_env env, napi_status error_code, - uint32_t engine_error_code = 0, - void* engine_reserved = nullptr) { +static inline napi_status napi_set_last_error(napi_env env, + napi_status error_code, + uint32_t engine_error_code = 0, + void* engine_reserved = nullptr) { env->last_error.error_code = error_code; env->last_error.engine_error_code = engine_error_code; env->last_error.engine_reserved = engine_reserved; return error_code; } -#define RETURN_STATUS_IF_FALSE(env, condition, status) \ - do { \ - if (!(condition)) { \ - return napi_set_last_error((env), (status)); \ - } \ +#define RETURN_STATUS_IF_FALSE(env, condition, status) \ + do { \ + if (!(condition)) { \ + return napi_set_last_error((env), (status)); \ + } \ } while (0) -#define CHECK_ENV(env) \ - do { \ - if ((env) == nullptr) { \ - return napi_invalid_arg; \ - } \ +#define CHECK_ENV(env) \ + do { \ + if ((env) == nullptr) { \ + return napi_invalid_arg; \ + } \ } while (0) -#define CHECK_ARG(env, arg) \ +#define CHECK_ARG(env, arg) \ RETURN_STATUS_IF_FALSE((env), ((arg) != nullptr), napi_invalid_arg) -#define CHECK_MAYBE_EMPTY(env, maybe, status) \ +#define CHECK_MAYBE_EMPTY(env, maybe, status) \ RETURN_STATUS_IF_FALSE((env), !((maybe).IsEmpty()), (status)) // NAPI_PREAMBLE is not wrapped in do..while: try_catch must have function scope -#define NAPI_PREAMBLE(env) \ - CHECK_ENV((env)); \ - RETURN_STATUS_IF_FALSE((env), (env)->last_exception.IsEmpty(), \ - napi_pending_exception); \ - napi_clear_last_error((env)); \ +#define NAPI_PREAMBLE(env) \ + CHECK_ENV((env)); \ + RETURN_STATUS_IF_FALSE( \ + (env), (env)->last_exception.IsEmpty(), napi_pending_exception); \ + napi_clear_last_error((env)); \ v8impl::TryCatch try_catch((env)) -#define CHECK_TO_TYPE(env, type, context, result, src, status) \ - do { \ - CHECK_ARG((env), (src)); \ - auto maybe = v8impl::V8LocalValueFromJsValue((src))->To##type((context)); \ - CHECK_MAYBE_EMPTY((env), maybe, (status)); \ - (result) = maybe.ToLocalChecked(); \ +#define CHECK_TO_TYPE(env, type, context, result, src, status) \ + do { \ + CHECK_ARG((env), (src)); \ + auto maybe = v8impl::V8LocalValueFromJsValue((src))->To##type((context)); \ + CHECK_MAYBE_EMPTY((env), maybe, (status)); \ + (result) = maybe.ToLocalChecked(); \ } while (0) -#define CHECK_TO_FUNCTION(env, result, src) \ - do { \ - CHECK_ARG((env), (src)); \ - v8::Local v8value = v8impl::V8LocalValueFromJsValue((src)); \ - RETURN_STATUS_IF_FALSE((env), v8value->IsFunction(), napi_invalid_arg); \ - (result) = v8value.As(); \ +#define CHECK_TO_FUNCTION(env, result, src) \ + do { \ + CHECK_ARG((env), (src)); \ + v8::Local v8value = v8impl::V8LocalValueFromJsValue((src)); \ + RETURN_STATUS_IF_FALSE((env), v8value->IsFunction(), napi_invalid_arg); \ + (result) = v8value.As(); \ } while (0) -#define CHECK_TO_OBJECT(env, context, result, src) \ +#define CHECK_TO_OBJECT(env, context, result, src) \ CHECK_TO_TYPE((env), Object, (context), (result), (src), napi_object_expected) -#define CHECK_TO_STRING(env, context, result, src) \ +#define CHECK_TO_STRING(env, context, result, src) \ CHECK_TO_TYPE((env), String, (context), (result), (src), napi_string_expected) -#define GET_RETURN_STATUS(env) \ - (!try_catch.HasCaught() ? napi_ok \ - : napi_set_last_error((env), napi_pending_exception)) - -#define THROW_RANGE_ERROR_IF_FALSE(env, condition, error, message) \ - do { \ - if (!(condition)) { \ - napi_throw_range_error((env), (error), (message)); \ - return napi_set_last_error((env), napi_generic_failure); \ - } \ +#define GET_RETURN_STATUS(env) \ + (!try_catch.HasCaught() \ + ? napi_ok \ + : napi_set_last_error((env), napi_pending_exception)) + +#define THROW_RANGE_ERROR_IF_FALSE(env, condition, error, message) \ + do { \ + if (!(condition)) { \ + napi_throw_range_error((env), (error), (message)); \ + return napi_set_last_error((env), napi_generic_failure); \ + } \ } while (0) -#define NAPI_CALL_INTO_MODULE(env, call, handle_exception) \ - do { \ - int open_handle_scopes = (env)->open_handle_scopes; \ - int open_callback_scopes = (env)->open_callback_scopes; \ - napi_clear_last_error((env)); \ - call; \ - CHECK_EQ((env)->open_handle_scopes, open_handle_scopes); \ - CHECK_EQ((env)->open_callback_scopes, open_callback_scopes); \ - if (!(env)->last_exception.IsEmpty()) { \ - handle_exception( \ - v8::Local::New((env)->isolate, (env)->last_exception)); \ - (env)->last_exception.Reset(); \ - } \ +#define NAPI_CALL_INTO_MODULE(env, call, handle_exception) \ + do { \ + int open_handle_scopes = (env)->open_handle_scopes; \ + int open_callback_scopes = (env)->open_callback_scopes; \ + napi_clear_last_error((env)); \ + call; \ + CHECK_EQ((env)->open_handle_scopes, open_handle_scopes); \ + CHECK_EQ((env)->open_callback_scopes, open_callback_scopes); \ + if (!(env)->last_exception.IsEmpty()) { \ + handle_exception( \ + v8::Local::New((env)->isolate, (env)->last_exception)); \ + (env)->last_exception.Reset(); \ + } \ } while (0) -#define NAPI_CALL_INTO_MODULE_THROW(env, call) \ +#define NAPI_CALL_INTO_MODULE_THROW(env, call) \ NAPI_CALL_INTO_MODULE((env), call, (env)->isolate->ThrowException) namespace v8impl { @@ -134,7 +136,7 @@ namespace v8impl { // This asserts v8::Local<> will always be implemented with a single // pointer field so that we can pass it around as a void*. static_assert(sizeof(v8::Local) == sizeof(napi_value), - "Cannot convert between v8::Local and napi_value"); + "Cannot convert between v8::Local and napi_value"); inline napi_value JsValueFromV8LocalValue(v8::Local local) { return reinterpret_cast(*local); @@ -153,27 +155,22 @@ class Finalizer { napi_finalize finalize_callback, void* finalize_data, void* finalize_hint) - : _env(env), - _finalize_callback(finalize_callback), - _finalize_data(finalize_data), - _finalize_hint(finalize_hint) { - } + : _env(env), + _finalize_callback(finalize_callback), + _finalize_data(finalize_data), + _finalize_hint(finalize_hint) {} - ~Finalizer() { - } + ~Finalizer() {} public: static Finalizer* New(napi_env env, napi_finalize finalize_callback = nullptr, void* finalize_data = nullptr, void* finalize_hint = nullptr) { - return new Finalizer( - env, finalize_callback, finalize_data, finalize_hint); + return new Finalizer(env, finalize_callback, finalize_data, finalize_hint); } - static void Delete(Finalizer* finalizer) { - delete finalizer; - } + static void Delete(Finalizer* finalizer) { delete finalizer; } protected: napi_env _env; @@ -185,8 +182,7 @@ class Finalizer { class TryCatch : public v8::TryCatch { public: - explicit TryCatch(napi_env env) - : v8::TryCatch(env->isolate), _env(env) {} + explicit TryCatch(napi_env env) : v8::TryCatch(env->isolate), _env(env) {} ~TryCatch() { if (HasCaught()) { diff --git a/src/js_native_api_v8_internals.h b/src/js_native_api_v8_internals.h index dcdc62297f6f59..bd2281642f3950 100644 --- a/src/js_native_api_v8_internals.h +++ b/src/js_native_api_v8_internals.h @@ -13,18 +13,17 @@ // are bridged to remove references to the `node` namespace. `node_version.h`, // included below, defines `NAPI_VERSION`. -#include "node_version.h" #include "env.h" #include "node_internals.h" +#include "node_version.h" -#define NAPI_ARRAYSIZE(array) \ - node::arraysize((array)) +#define NAPI_ARRAYSIZE(array) node::arraysize((array)) -#define NAPI_FIXED_ONE_BYTE_STRING(isolate, string) \ +#define NAPI_FIXED_ONE_BYTE_STRING(isolate, string) \ node::FIXED_ONE_BYTE_STRING((isolate), (string)) -#define NAPI_PRIVATE_KEY(context, suffix) \ - (node::Environment::GetCurrent((context))->napi_ ## suffix()) +#define NAPI_PRIVATE_KEY(context, suffix) \ + (node::Environment::GetCurrent((context))->napi_##suffix()) namespace v8impl { diff --git a/src/js_stream.cc b/src/js_stream.cc index 32dea04db5aeec..eb8be2ab205763 100644 --- a/src/js_stream.cc +++ b/src/js_stream.cc @@ -22,38 +22,31 @@ using v8::Object; using v8::String; using v8::Value; - JSStream::JSStream(Environment* env, Local obj) - : AsyncWrap(env, obj, AsyncWrap::PROVIDER_JSSTREAM), - StreamBase(env) { + : AsyncWrap(env, obj, AsyncWrap::PROVIDER_JSSTREAM), StreamBase(env) { MakeWeak(); } - AsyncWrap* JSStream::GetAsyncWrap() { return static_cast(this); } - bool JSStream::IsAlive() { return true; } - bool JSStream::IsClosing() { HandleScope scope(env()->isolate()); Context::Scope context_scope(env()->context()); TryCatchScope try_catch(env()); Local value; if (!MakeCallback(env()->isclosing_string(), 0, nullptr).ToLocal(&value)) { - if (!try_catch.HasTerminated()) - FatalException(env()->isolate(), try_catch); + if (!try_catch.HasTerminated()) FatalException(env()->isolate(), try_catch); return true; } return value->IsTrue(); } - int JSStream::ReadStart() { HandleScope scope(env()->isolate()); Context::Scope context_scope(env()->context()); @@ -62,13 +55,11 @@ int JSStream::ReadStart() { int value_int = UV_EPROTO; if (!MakeCallback(env()->onreadstart_string(), 0, nullptr).ToLocal(&value) || !value->Int32Value(env()->context()).To(&value_int)) { - if (!try_catch.HasTerminated()) - FatalException(env()->isolate(), try_catch); + if (!try_catch.HasTerminated()) FatalException(env()->isolate(), try_catch); } return value_int; } - int JSStream::ReadStop() { HandleScope scope(env()->isolate()); Context::Scope context_scope(env()->context()); @@ -77,35 +68,28 @@ int JSStream::ReadStop() { int value_int = UV_EPROTO; if (!MakeCallback(env()->onreadstop_string(), 0, nullptr).ToLocal(&value) || !value->Int32Value(env()->context()).To(&value_int)) { - if (!try_catch.HasTerminated()) - FatalException(env()->isolate(), try_catch); + if (!try_catch.HasTerminated()) FatalException(env()->isolate(), try_catch); } return value_int; } - int JSStream::DoShutdown(ShutdownWrap* req_wrap) { HandleScope scope(env()->isolate()); Context::Scope context_scope(env()->context()); - Local argv[] = { - req_wrap->object() - }; + Local argv[] = {req_wrap->object()}; TryCatchScope try_catch(env()); Local value; int value_int = UV_EPROTO; - if (!MakeCallback(env()->onshutdown_string(), - arraysize(argv), - argv).ToLocal(&value) || + if (!MakeCallback(env()->onshutdown_string(), arraysize(argv), argv) + .ToLocal(&value) || !value->Int32Value(env()->context()).To(&value_int)) { - if (!try_catch.HasTerminated()) - FatalException(env()->isolate(), try_catch); + if (!try_catch.HasTerminated()) FatalException(env()->isolate(), try_catch); } return value_int; } - int JSStream::DoWrite(WriteWrap* w, uv_buf_t* bufs, size_t count, @@ -122,25 +106,19 @@ int JSStream::DoWrite(WriteWrap* w, bufs_arr->Set(env()->context(), i, buf).FromJust(); } - Local argv[] = { - w->object(), - bufs_arr - }; + Local argv[] = {w->object(), bufs_arr}; TryCatchScope try_catch(env()); Local value; int value_int = UV_EPROTO; - if (!MakeCallback(env()->onwrite_string(), - arraysize(argv), - argv).ToLocal(&value) || + if (!MakeCallback(env()->onwrite_string(), arraysize(argv), argv) + .ToLocal(&value) || !value->Int32Value(env()->context()).To(&value_int)) { - if (!try_catch.HasTerminated()) - FatalException(env()->isolate(), try_catch); + if (!try_catch.HasTerminated()) FatalException(env()->isolate(), try_catch); } return value_int; } - void JSStream::New(const FunctionCallbackInfo& args) { // This constructor should not be exposed to public javascript. // Therefore we assert that we are not trying to call this as a @@ -150,7 +128,6 @@ void JSStream::New(const FunctionCallbackInfo& args) { new JSStream(env, args.This()); } - template void JSStream::Finish(const FunctionCallbackInfo& args) { CHECK(args[0]->IsObject()); @@ -160,7 +137,6 @@ void JSStream::Finish(const FunctionCallbackInfo& args) { w->Done(args[1].As()->Value()); } - void JSStream::ReadBuffer(const FunctionCallbackInfo& args) { JSStream* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); @@ -174,8 +150,7 @@ void JSStream::ReadBuffer(const FunctionCallbackInfo& args) { while (len != 0) { uv_buf_t buf = wrap->EmitAlloc(len); ssize_t avail = len; - if (static_cast(buf.len) < avail) - avail = buf.len; + if (static_cast(buf.len) < avail) avail = buf.len; memcpy(buf.base, data, avail); data += avail; @@ -184,7 +159,6 @@ void JSStream::ReadBuffer(const FunctionCallbackInfo& args) { } } - void JSStream::EmitEOF(const FunctionCallbackInfo& args) { JSStream* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); @@ -192,7 +166,6 @@ void JSStream::EmitEOF(const FunctionCallbackInfo& args) { wrap->EmitRead(UV_EOF); } - void JSStream::Initialize(Local target, Local unused, Local context, @@ -212,9 +185,11 @@ void JSStream::Initialize(Local target, env->SetProtoMethod(t, "emitEOF", EmitEOF); StreamBase::AddMethods(env, t); - target->Set(env->context(), - jsStreamString, - t->GetFunction(context).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + jsStreamString, + t->GetFunction(context).ToLocalChecked()) + .FromJust(); } } // namespace node diff --git a/src/large_pages/node_large_page.cc b/src/large_pages/node_large_page.cc index 4b860d9ccb47ca..deb5dcc04b3927 100644 --- a/src/large_pages/node_large_page.cc +++ b/src/large_pages/node_large_page.cc @@ -21,21 +21,21 @@ // SPDX-License-Identifier: MIT #include -#include // _O_RDWR +#include // _O_RDWR #include // PATH_MAX #include #include +#include #include #include -#include #include -#include #include -#include +#include +#include // readlink #include #include #include -#include // readlink +#include // The functions in this file map the text segment of node into 2M pages. // The algorithm is simple @@ -60,8 +60,8 @@ namespace node { struct text_region { char* from; char* to; - int total_hugepages; - bool found_text_region; + int total_hugepages; + bool found_text_region; }; static const size_t hps = 2L * 1024 * 1024; @@ -72,11 +72,11 @@ static void PrintSystemError(int error) { } inline int64_t hugepage_align_up(int64_t addr) { - return (((addr) + (hps) - 1) & ~((hps) - 1)); + return (((addr) + (hps)-1) & ~((hps)-1)); } inline int64_t hugepage_align_down(int64_t addr) { - return ((addr) & ~((hps) - 1)); + return ((addr) & ~((hps)-1)); } // The format of the maps file is the following @@ -90,7 +90,7 @@ static struct text_region FindNodeTextRegion() { std::string permission; std::string dev; char dash; - int64_t start, end, offset, inode; + int64_t start, end, offset, inode; struct text_region nregion; nregion.found_text_region = false; @@ -103,9 +103,9 @@ static struct text_region FindNodeTextRegion() { std::string exename; { - char selfexe[PATH_MAX]; - ssize_t count = readlink("/proc/self/exe", selfexe, PATH_MAX); - exename = std::string(selfexe, count); + char selfexe[PATH_MAX]; + ssize_t count = readlink("/proc/self/exe", selfexe, PATH_MAX); + exename = std::string(selfexe, count); } while (std::getline(ifs, map_line)) { @@ -146,14 +146,16 @@ static bool IsTransparentHugePagesEnabled() { ifs.open("/sys/kernel/mm/transparent_hugepage/enabled"); if (!ifs) { - fprintf(stderr, "Could not open file: " \ - "/sys/kernel/mm/transparent_hugepage/enabled\n"); + fprintf(stderr, + "Could not open file: " + "/sys/kernel/mm/transparent_hugepage/enabled\n"); return false; } std::string always, madvise, never; if (ifs.is_open()) { - while (ifs >> always >> madvise >> never) {} + while (ifs >> always >> madvise >> never) { + } } int ret_status = false; @@ -181,11 +183,8 @@ static bool IsTransparentHugePagesEnabled() { // the same virtual address // c. madvise with MADV_HUGE_PAGE // d. If successful copy the code there and unmap the original region -int -__attribute__((__section__(".lpstub"))) -__attribute__((__aligned__(hps))) -__attribute__((__noinline__)) -MoveTextRegionToLargePages(const text_region& r) { +int __attribute__((__section__(".lpstub"))) __attribute__((__aligned__(hps))) +__attribute__((__noinline__)) MoveTextRegionToLargePages(const text_region& r) { void* nmem = nullptr; void* tmem = nullptr; int ret = 0; @@ -194,8 +193,12 @@ MoveTextRegionToLargePages(const text_region& r) { void* start = r.from; // Allocate temporary region preparing for copy - nmem = mmap(nullptr, size, - PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + nmem = mmap(nullptr, + size, + PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, + -1, + 0); if (nmem == MAP_FAILED) { PrintSystemError(errno); return -1; @@ -203,13 +206,16 @@ MoveTextRegionToLargePages(const text_region& r) { memcpy(nmem, r.from, size); -// We already know the original page is r-xp -// (PROT_READ, PROT_EXEC, MAP_PRIVATE) -// We want PROT_WRITE because we are writing into it. -// We want it at the fixed address and we use MAP_FIXED. - tmem = mmap(start, size, + // We already know the original page is r-xp + // (PROT_READ, PROT_EXEC, MAP_PRIVATE) + // We want PROT_WRITE because we are writing into it. + // We want it at the fixed address and we use MAP_FIXED. + tmem = mmap(start, + size, PROT_READ | PROT_WRITE | PROT_EXEC, - MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, -1 , 0); + MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED, + -1, + 0); if (tmem == MAP_FAILED) { PrintSystemError(errno); munmap(nmem, size); diff --git a/src/large_pages/node_large_page.h b/src/large_pages/node_large_page.h index bce505585cf0d0..98a47993268d41 100644 --- a/src/large_pages/node_large_page.h +++ b/src/large_pages/node_large_page.h @@ -25,7 +25,6 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS - namespace node { bool IsLargePagesEnabled(); int MapStaticCodeToLargePages(); diff --git a/src/memory_tracker-inl.h b/src/memory_tracker-inl.h index 65bcbccdc02aa4..572e59175c90d3 100644 --- a/src/memory_tracker-inl.h +++ b/src/memory_tracker-inl.h @@ -22,7 +22,7 @@ inline const char* GetNodeName(const char* node_name, const char* edge_name) { class MemoryRetainerNode : public v8::EmbedderGraph::Node { public: inline MemoryRetainerNode(MemoryTracker* tracker, - const MemoryRetainer* retainer) + const MemoryRetainer* retainer) : retainer_(retainer) { CHECK_NOT_NULL(retainer_); v8::HandleScope handle_scope(tracker->isolate()); @@ -34,9 +34,9 @@ class MemoryRetainerNode : public v8::EmbedderGraph::Node { } inline MemoryRetainerNode(MemoryTracker* tracker, - const char* name, - size_t size, - bool is_root_node = false) + const char* name, + size_t size, + bool is_root_node = false) : retainer_(nullptr) { name_ = name; size_ = size; diff --git a/src/memory_tracker.h b/src/memory_tracker.h index 11dd2be7af35c9..1762b8058cf258 100644 --- a/src/memory_tracker.h +++ b/src/memory_tracker.h @@ -3,12 +3,12 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include +#include +#include #include #include #include -#include -#include +#include #include "aliased_buffer.h" #include "v8-profiler.h" @@ -200,9 +200,8 @@ class MemoryTracker { inline v8::EmbedderGraph* graph() { return graph_; } inline v8::Isolate* isolate() { return isolate_; } - inline explicit MemoryTracker(v8::Isolate* isolate, - v8::EmbedderGraph* graph) - : isolate_(isolate), graph_(graph) {} + inline explicit MemoryTracker(v8::Isolate* isolate, v8::EmbedderGraph* graph) + : isolate_(isolate), graph_(graph) {} private: typedef std::unordered_map diff --git a/src/module_wrap.cc b/src/module_wrap.cc index 4414e874ffa697..51d5550b9bb243 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -1,14 +1,14 @@ -#include -#include // PATH_MAX -#include // S_IFDIR #include "module_wrap.h" +#include // PATH_MAX +#include // S_IFDIR +#include #include "env.h" +#include "node_contextify.h" #include "node_errors.h" #include "node_url.h" -#include "util-inl.h" -#include "node_contextify.h" #include "node_watchdog.h" +#include "util-inl.h" namespace node { namespace loader { @@ -49,9 +49,8 @@ static const char* const EXTENSIONS[] = {".mjs", ".js", ".json", ".node"}; ModuleWrap::ModuleWrap(Environment* env, Local object, Local module, - Local url) : - BaseObject(env, object), - id_(env->get_next_module_id()) { + Local url) + : BaseObject(env, object), id_(env->get_next_module_id()) { module_.Reset(env->isolate(), module); url_.Reset(env->isolate(), url); env->id_to_module_map.emplace(id_, this); @@ -70,8 +69,7 @@ ModuleWrap::~ModuleWrap() { } } -ModuleWrap* ModuleWrap::GetFromModule(Environment* env, - Local module) { +ModuleWrap* ModuleWrap::GetFromModule(Environment* env, Local module) { auto range = env->hash_to_module_map.equal_range(module->GetIdentityHash()); for (auto it = range.first; it != range.second; ++it) { if (it->second->module_ == module) { @@ -140,20 +138,21 @@ void ModuleWrap::New(const FunctionCallbackInfo& args) { Local host_defined_options = PrimitiveArray::New(isolate, HostDefinedOptions::kLength); - host_defined_options->Set(isolate, HostDefinedOptions::kType, + host_defined_options->Set(isolate, + HostDefinedOptions::kType, Number::New(isolate, ScriptType::kModule)); // compile { ScriptOrigin origin(url, - line_offset, // line offset - column_offset, // column offset - True(isolate), // is cross origin - Local(), // script id - Local(), // source map URL - False(isolate), // is opaque (?) - False(isolate), // is WASM - True(isolate), // is ES Module + line_offset, // line offset + column_offset, // column offset + True(isolate), // is cross origin + Local(), // script id + Local(), // source map URL + False(isolate), // is opaque (?) + False(isolate), // is WASM + True(isolate), // is ES Module host_defined_options); Context::Scope context_scope(context); ScriptCompiler::Source source(source_text, origin); @@ -161,7 +160,9 @@ void ModuleWrap::New(const FunctionCallbackInfo& args) { CHECK(try_catch.HasCaught()); CHECK(!try_catch.Message().IsEmpty()); CHECK(!try_catch.Exception().IsEmpty()); - AppendExceptionLine(env, try_catch.Exception(), try_catch.Message(), + AppendExceptionLine(env, + try_catch.Exception(), + try_catch.Message(), ErrorHandlingMode::MODULE_ERROR); try_catch.ReThrow(); return; @@ -177,8 +178,8 @@ void ModuleWrap::New(const FunctionCallbackInfo& args) { env->hash_to_module_map.emplace(module->GetIdentityHash(), obj); - host_defined_options->Set(isolate, HostDefinedOptions::kID, - Number::New(isolate, obj->id())); + host_defined_options->Set( + isolate, HostDefinedOptions::kID, Number::New(isolate, obj->id())); that->SetIntegrityLevel(context, IntegrityLevel::kFrozen); args.GetReturnValue().Set(that); @@ -196,8 +197,7 @@ void ModuleWrap::Link(const FunctionCallbackInfo& args) { ModuleWrap* obj; ASSIGN_OR_RETURN_UNWRAP(&obj, that); - if (obj->linked_) - return; + if (obj->linked_) return; obj->linked_ = true; Local resolver_arg = args[0].As(); @@ -205,8 +205,8 @@ void ModuleWrap::Link(const FunctionCallbackInfo& args) { Local mod_context = obj->context_.Get(isolate); Local module = obj->module_.Get(isolate); - Local promises = Array::New(isolate, - module->GetModuleRequestsLength()); + Local promises = + Array::New(isolate, module->GetModuleRequestsLength()); // call the dependency resolve callbacks for (int i = 0; i < module->GetModuleRequestsLength(); i++) { @@ -214,9 +214,7 @@ void ModuleWrap::Link(const FunctionCallbackInfo& args) { Utf8Value specifier_utf8(env->isolate(), specifier); std::string specifier_std(*specifier_utf8, specifier_utf8.length()); - Local argv[] = { - specifier - }; + Local argv[] = {specifier}; MaybeLocal maybe_resolve_return_value = resolver_arg->Call(mod_context, that, 1, argv); @@ -254,7 +252,9 @@ void ModuleWrap::Instantiate(const FunctionCallbackInfo& args) { CHECK(try_catch.HasCaught()); CHECK(!try_catch.Message().IsEmpty()); CHECK(!try_catch.Exception().IsEmpty()); - AppendExceptionLine(env, try_catch.Exception(), try_catch.Message(), + AppendExceptionLine(env, + try_catch.Exception(), + try_catch.Message(), ErrorHandlingMode::MODULE_ERROR); try_catch.ReThrow(); return; @@ -429,16 +429,13 @@ namespace { inline bool ShouldBeTreatedAsRelativeOrAbsolutePath( const std::string& specifier) { size_t len = specifier.length(); - if (len == 0) - return false; + if (len == 0) return false; if (specifier[0] == '/') { return true; } else if (specifier[0] == '.') { - if (len == 1 || specifier[1] == '/') - return true; + if (len == 1 || specifier[1] == '/') return true; if (specifier[1] == '.') { - if (len == 2 || specifier[2] == '/') - return true; + if (len == 2 || specifier[2] == '/') return true; } } return false; @@ -460,17 +457,13 @@ std::string ReadFile(uv_file file) { nullptr); uv_fs_req_cleanup(&req); - if (r <= 0) - break; + if (r <= 0) break; contents.append(buf.base, r); } while (true); return contents; } -enum CheckFileOptions { - LEAVE_OPEN_AFTER_CHECK, - CLOSE_AFTER_CHECK -}; +enum CheckFileOptions { LEAVE_OPEN_AFTER_CHECK, CLOSE_AFTER_CHECK }; Maybe CheckFile(const std::string& path, CheckFileOptions opt = CLOSE_AFTER_CHECK) { @@ -516,8 +509,8 @@ const PackageConfig& GetPackageConfig(Environment* env, } Maybe check = CheckFile(path, LEAVE_OPEN_AFTER_CHECK); if (check.IsNothing()) { - auto entry = env->package_json_cache.emplace(path, - PackageConfig { Exists::No, IsValid::Yes, HasMain::No, "" }); + auto entry = env->package_json_cache.emplace( + path, PackageConfig{Exists::No, IsValid::Yes, HasMain::No, ""}); return entry.first->second; } @@ -533,9 +526,10 @@ const PackageConfig& GetPackageConfig(Environment* env, if (!String::NewFromUtf8(isolate, pkg_src.c_str(), v8::NewStringType::kNormal, - pkg_src.length()).ToLocal(&src)) { - auto entry = env->package_json_cache.emplace(path, - PackageConfig { Exists::No, IsValid::Yes, HasMain::No, "" }); + pkg_src.length()) + .ToLocal(&src)) { + auto entry = env->package_json_cache.emplace( + path, PackageConfig{Exists::No, IsValid::Yes, HasMain::No, ""}); return entry.first->second; } @@ -544,8 +538,8 @@ const PackageConfig& GetPackageConfig(Environment* env, if (!JSON::Parse(env->context(), src).ToLocal(&pkg_json_v) || !pkg_json_v->ToObject(env->context()).ToLocal(&pkg_json)) { - auto entry = env->package_json_cache.emplace(path, - PackageConfig { Exists::Yes, IsValid::No, HasMain::No, "" }); + auto entry = env->package_json_cache.emplace( + path, PackageConfig{Exists::Yes, IsValid::No, HasMain::No, ""}); return entry.first->second; } @@ -558,15 +552,12 @@ const PackageConfig& GetPackageConfig(Environment* env, main_std.assign(std::string(*main_utf8, main_utf8.length())); } - auto entry = env->package_json_cache.emplace(path, - PackageConfig { Exists::Yes, IsValid::Yes, has_main, main_std }); + auto entry = env->package_json_cache.emplace( + path, PackageConfig{Exists::Yes, IsValid::Yes, has_main, main_std}); return entry.first->second; } -enum ResolveExtensionsOptions { - TRY_EXACT_NAME, - ONLY_VIA_EXTENSIONS -}; +enum ResolveExtensionsOptions { TRY_EXACT_NAME, ONLY_VIA_EXTENSIONS }; template Maybe ResolveExtensions(const URL& search) { @@ -596,12 +587,10 @@ inline Maybe ResolveIndex(const URL& search) { Maybe ResolveMain(Environment* env, const URL& search) { URL pkg("package.json", &search); - const PackageConfig& pjson = - GetPackageConfig(env, pkg.ToFilePath()); + const PackageConfig& pjson = GetPackageConfig(env, pkg.ToFilePath()); // Note invalid package.json should throw in resolver // currently we silently ignore which is incorrect - if (pjson.exists == Exists::No || - pjson.is_valid == IsValid::No || + if (pjson.exists == Exists::No || pjson.is_valid == IsValid::No || pjson.has_main == HasMain::No) { return Nothing(); } @@ -623,8 +612,7 @@ Maybe ResolveModule(Environment* env, if (!check.IsNothing()) { const size_t limit = specifier.find('/'); const size_t spec_len = - limit == std::string::npos ? specifier.length() : - limit + 1; + limit == std::string::npos ? specifier.length() : limit + 1; std::string chroot = dir.path() + "node_modules/" + specifier.substr(0, spec_len); if (check.FromJust().path().substr(0, chroot.length()) != chroot) { @@ -644,8 +632,7 @@ Maybe ResolveDirectory(Environment* env, PackageMainCheck check_pjson_main) { if (check_pjson_main) { Maybe main = ResolveMain(env, search); - if (!main.IsNothing()) - return main; + if (!main.IsNothing()) return main; } return ResolveIndex(search); } @@ -671,8 +658,7 @@ Maybe Resolve(Environment* env, if (ShouldBeTreatedAsRelativeOrAbsolutePath(specifier)) { URL resolved(specifier, base); Maybe file = ResolveExtensions(resolved); - if (!file.IsNothing()) - return file; + if (!file.IsNothing()) return file; if (specifier.back() != '/') { resolved = URL(specifier + "/", base); } @@ -708,8 +694,7 @@ void ModuleWrap::Resolve(const FunctionCallbackInfo& args) { } MaybeLocal obj = result.FromJust().ToObject(env); - if (!obj.IsEmpty()) - args.GetReturnValue().Set(obj.ToLocalChecked()); + if (!obj.IsEmpty()) args.GetReturnValue().Set(obj.ToLocalChecked()); } static MaybeLocal ImportModuleDynamically( @@ -722,7 +707,7 @@ static MaybeLocal ImportModuleDynamically( v8::EscapableHandleScope handle_scope(iso); Local import_callback = - env->host_import_module_dynamically_callback(); + env->host_import_module_dynamically_callback(); Local options = referrer->GetHostDefinedOptions(); if (options->Length() != HostDefinedOptions::kLength) { @@ -757,16 +742,15 @@ static MaybeLocal ImportModuleDynamically( } Local import_args[] = { - object, - Local(specifier), + object, + Local(specifier), }; Local result; - if (import_callback->Call( - context, - v8::Undefined(iso), - arraysize(import_args), - import_args).ToLocal(&result)) { + if (import_callback + ->Call( + context, v8::Undefined(iso), arraysize(import_args), import_args) + .ToLocal(&result)) { CHECK(result->IsPromise()); return handle_scope.Escape(result.As()); } @@ -788,8 +772,9 @@ void ModuleWrap::SetImportModuleDynamicallyCallback( iso->SetHostImportModuleDynamicallyCallback(ImportModuleDynamically); } -void ModuleWrap::HostInitializeImportMetaObjectCallback( - Local context, Local module, Local meta) { +void ModuleWrap::HostInitializeImportMetaObjectCallback(Local context, + Local module, + Local meta) { Environment* env = Environment::GetCurrent(context); CHECK_NOT_NULL(env); // TODO(addaleax): Handle nullptr here. ModuleWrap* module_wrap = GetFromModule(env, module); @@ -799,9 +784,8 @@ void ModuleWrap::HostInitializeImportMetaObjectCallback( } Local wrap = module_wrap->object(); - Local callback = - env->host_initialize_import_meta_object_callback(); - Local args[] = { wrap, meta }; + Local callback = env->host_initialize_import_meta_object_callback(); + Local args[] = {wrap, meta}; callback->Call(context, Undefined(env->isolate()), arraysize(args), args) .ToLocalChecked(); } @@ -837,11 +821,14 @@ void ModuleWrap::Initialize(Local target, env->SetProtoMethodNoSideEffect(tpl, "namespace", Namespace); env->SetProtoMethodNoSideEffect(tpl, "getStatus", GetStatus); env->SetProtoMethodNoSideEffect(tpl, "getError", GetError); - env->SetProtoMethodNoSideEffect(tpl, "getStaticDependencySpecifiers", - GetStaticDependencySpecifiers); - - target->Set(env->context(), FIXED_ONE_BYTE_STRING(isolate, "ModuleWrap"), - tpl->GetFunction(context).ToLocalChecked()).FromJust(); + env->SetProtoMethodNoSideEffect( + tpl, "getStaticDependencySpecifiers", GetStaticDependencySpecifiers); + + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(isolate, "ModuleWrap"), + tpl->GetFunction(context).ToLocalChecked()) + .FromJust(); env->SetMethod(target, "resolve", Resolve); env->SetMethod(target, "setImportModuleDynamicallyCallback", @@ -851,16 +838,17 @@ void ModuleWrap::Initialize(Local target, SetInitializeImportMetaObjectCallback); #define V(name) \ - target->Set(context, \ - FIXED_ONE_BYTE_STRING(env->isolate(), #name), \ - Integer::New(env->isolate(), Module::Status::name)) \ - .FromJust() - V(kUninstantiated); - V(kInstantiating); - V(kInstantiated); - V(kEvaluating); - V(kEvaluated); - V(kErrored); + target \ + ->Set(context, \ + FIXED_ONE_BYTE_STRING(env->isolate(), #name), \ + Integer::New(env->isolate(), Module::Status::name)) \ + .FromJust() + V(kUninstantiated); + V(kInstantiating); + V(kInstantiated); + V(kEvaluating); + V(kEvaluated); + V(kErrored); #undef V } diff --git a/src/module_wrap.h b/src/module_wrap.h index 6d231631d6a69e..290405c6487331 100644 --- a/src/module_wrap.h +++ b/src/module_wrap.h @@ -3,19 +3,16 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include #include +#include #include -#include "node_url.h" #include "base_object-inl.h" +#include "node_url.h" namespace node { namespace loader { -enum PackageMainCheck : bool { - CheckMain = true, - IgnoreMain = false -}; +enum PackageMainCheck : bool { CheckMain = true, IgnoreMain = false }; enum ScriptType : int { kScript, diff --git a/src/node.cc b/src/node.cc index 20206b8199b751..dc2c4b4a33aa0e 100644 --- a/src/node.cc +++ b/src/node.cc @@ -72,7 +72,7 @@ #endif #include -#include // _O_RDWR +#include // _O_RDWR #include // PATH_MAX #include #include @@ -167,8 +167,7 @@ static void WaitForInspectorDisconnect(Environment* env) { struct sigaction act; memset(&act, 0, sizeof(act)); for (unsigned nr = 1; nr < kMaxSignal; nr += 1) { - if (nr == SIGKILL || nr == SIGSTOP || nr == SIGPROF) - continue; + if (nr == SIGKILL || nr == SIGSTOP || nr == SIGPROF) continue; act.sa_handler = (nr == SIGPIPE) ? SIG_IGN : SIG_DFL; CHECK_EQ(0, sigaction(nr, &act, nullptr)); } @@ -257,14 +256,12 @@ MaybeLocal RunBootstrapping(Environment* env) { // Store primordials env->set_primordials(Object::New(isolate)); std::vector> primordials_params = { - FIXED_ONE_BYTE_STRING(isolate, "breakAtBootstrap"), - env->primordials_string() - }; + FIXED_ONE_BYTE_STRING(isolate, "breakAtBootstrap"), + env->primordials_string()}; std::vector> primordials_args = { - Boolean::New(isolate, - env->options()->debug_options().break_node_first_line), - env->primordials() - }; + Boolean::New(isolate, + env->options()->debug_options().break_node_first_line), + env->primordials()}; MaybeLocal primordials_ret = ExecuteBootstrapper(env, "internal/bootstrap/primordials", @@ -428,7 +425,6 @@ void LoadEnvironment(Environment* env) { } } - #ifdef __POSIX__ void RegisterSignalHandler(int signal, void (*handler)(int signal), @@ -460,14 +456,11 @@ inline void PlatformInit() { // Make sure file descriptors 0-2 are valid before we start logging anything. for (int fd = STDIN_FILENO; fd <= STDERR_FILENO; fd += 1) { struct stat ignored; - if (fstat(fd, &ignored) == 0) - continue; + if (fstat(fd, &ignored) == 0) continue; // Anything but EBADF means something is seriously wrong. We don't // have to special-case EINTR, fstat() is not interruptible. - if (errno != EBADF) - ABORT(); - if (fd != open("/dev/null", O_RDWR)) - ABORT(); + if (errno != EBADF) ABORT(); + if (fd != open("/dev/null", O_RDWR)) ABORT(); } #if HAVE_INSPECTOR @@ -483,8 +476,7 @@ inline void PlatformInit() { // it evaluates to 32, 34 or 64, depending on whether RT signals are enabled. // Counting up to SIGRTMIN doesn't work for the same reason. for (unsigned nr = 1; nr < kMaxSignal; nr += 1) { - if (nr == SIGKILL || nr == SIGSTOP) - continue; + if (nr == SIGKILL || nr == SIGSTOP) continue; act.sa_handler = (nr == SIGPIPE) ? SIG_IGN : SIG_DFL; CHECK_EQ(0, sigaction(nr, &act, nullptr)); } @@ -522,8 +514,7 @@ inline void PlatformInit() { // Ignore _close result. If it fails or not depends on used Windows // version. We will just check _open result. _close(fd); - if (fd != _open("nul", _O_RDWR)) - ABORT(); + if (fd != _open("nul", _O_RDWR)) ABORT(); } } #endif // _WIN32 @@ -557,9 +548,11 @@ int ProcessGlobalArgs(std::vector* args, } auto env_opts = per_process::cli_options->per_isolate->per_env; - if (std::find(v8_args.begin(), v8_args.end(), + if (std::find(v8_args.begin(), + v8_args.end(), "--abort-on-uncaught-exception") != v8_args.end() || - std::find(v8_args.begin(), v8_args.end(), + std::find(v8_args.begin(), + v8_args.end(), "--abort_on_uncaught_exception") != v8_args.end()) { env_opts->abort_on_uncaught_exception = true; } @@ -737,18 +730,17 @@ void Init(int* argc, *exec_argv = Malloc(*exec_argc); for (int i = 0; i < *exec_argc; ++i) (*exec_argv)[i] = strdup(exec_argv_[i].c_str()); - for (int i = 0; i < *argc; ++i) - argv[i] = strdup(argv_[i].c_str()); + for (int i = 0; i < *argc; ++i) argv[i] = strdup(argv_[i].c_str()); } void RunBeforeExit(Environment* env) { env->RunBeforeExitCallbacks(); - if (!uv_loop_alive(env->event_loop())) - EmitBeforeExit(env); + if (!uv_loop_alive(env->event_loop())) EmitBeforeExit(env); } -inline int Start(Isolate* isolate, IsolateData* isolate_data, +inline int Start(Isolate* isolate, + IsolateData* isolate_data, const std::vector& args, const std::vector& exec_args) { HandleScope handle_scope(isolate); @@ -800,8 +792,7 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data, per_process::v8_platform.DrainVMTasks(isolate); more = uv_loop_alive(env.event_loop()); - if (more) - continue; + if (more) continue; RunBeforeExit(&env); @@ -840,8 +831,7 @@ inline int Start(uv_loop_t* event_loop, std::unique_ptr allocator(CreateArrayBufferAllocator(), &FreeArrayBufferAllocator); Isolate* const isolate = NewIsolate(allocator.get(), event_loop); - if (isolate == nullptr) - return 12; // Signal internal error. + if (isolate == nullptr) return 12; // Signal internal error. if (per_process::cli_options->print_version) { printf("%s\n", NODE_VERSION); @@ -869,8 +859,7 @@ inline int Start(uv_loop_t* event_loop, if (isolate_data->options()->track_heap_objects) { isolate->GetHeapProfiler()->StartTrackingHeapObjects(true); } - exit_code = - Start(isolate, isolate_data.get(), args, exec_args); + exit_code = Start(isolate, isolate_data.get(), args, exec_args); } isolate->Dispose(); @@ -880,7 +869,7 @@ inline int Start(uv_loop_t* event_loop, } int Start(int argc, char** argv) { - atexit([] () { uv_tty_reset_mode(); }); + atexit([]() { uv_tty_reset_mode(); }); PlatformInit(); performance::performance_node_start = PERFORMANCE_NOW(); @@ -928,8 +917,7 @@ int Start(int argc, char** argv) { V8::Initialize(); performance::performance_v8_start = PERFORMANCE_NOW(); per_process::v8_initialized = true; - const int exit_code = - Start(uv_default_loop(), args, exec_args); + const int exit_code = Start(uv_default_loop(), args, exec_args); per_process::v8_initialized = false; V8::Dispose(); diff --git a/src/node.h b/src/node.h index c260d172c01ebf..fad4fe899731d2 100644 --- a/src/node.h +++ b/src/node.h @@ -23,31 +23,31 @@ #define SRC_NODE_H_ #ifdef _WIN32 -# ifndef BUILDING_NODE_EXTENSION -# define NODE_EXTERN __declspec(dllexport) -# else -# define NODE_EXTERN __declspec(dllimport) -# endif +#ifndef BUILDING_NODE_EXTENSION +#define NODE_EXTERN __declspec(dllexport) #else -# define NODE_EXTERN __attribute__((visibility("default"))) +#define NODE_EXTERN __declspec(dllimport) +#endif +#else +#define NODE_EXTERN __attribute__((visibility("default"))) #endif #ifdef BUILDING_NODE_EXTENSION -# undef BUILDING_V8_SHARED -# undef BUILDING_UV_SHARED -# define USING_V8_SHARED 1 -# define USING_UV_SHARED 1 +#undef BUILDING_V8_SHARED +#undef BUILDING_UV_SHARED +#define USING_V8_SHARED 1 +#define USING_UV_SHARED 1 #endif // This should be defined in make system. // See issue https://github.com/nodejs/node-v0.x-archive/issues/1236 #if defined(__MINGW32__) || defined(_MSC_VER) #ifndef _WIN32_WINNT -# define _WIN32_WINNT 0x0600 // Windows Server 2008 +#define _WIN32_WINNT 0x0600 // Windows Server 2008 #endif #ifndef NOMINMAX -# define NOMINMAX +#define NOMINMAX #endif #endif @@ -57,44 +57,43 @@ #endif #ifdef _WIN32 -# define SIGKILL 9 +#define SIGKILL 9 #endif -#include "v8.h" // NOLINT(build/include_order) -#include "v8-platform.h" // NOLINT(build/include_order) #include "node_version.h" // NODE_MODULE_VERSION +#include "v8-platform.h" // NOLINT(build/include_order) +#include "v8.h" // NOLINT(build/include_order) -#define NODE_MAKE_VERSION(major, minor, patch) \ - ((major) * 0x1000 + (minor) * 0x100 + (patch)) +#define NODE_MAKE_VERSION(major, minor, patch) \ + ((major)*0x1000 + (minor)*0x100 + (patch)) #ifdef __clang__ -# define NODE_CLANG_AT_LEAST(major, minor, patch) \ - (NODE_MAKE_VERSION(major, minor, patch) <= \ - NODE_MAKE_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__)) +#define NODE_CLANG_AT_LEAST(major, minor, patch) \ + (NODE_MAKE_VERSION(major, minor, patch) <= \ + NODE_MAKE_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__)) #else -# define NODE_CLANG_AT_LEAST(major, minor, patch) (0) +#define NODE_CLANG_AT_LEAST(major, minor, patch) (0) #endif #ifdef __GNUC__ -# define NODE_GNUC_AT_LEAST(major, minor, patch) \ - (NODE_MAKE_VERSION(major, minor, patch) <= \ - NODE_MAKE_VERSION(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)) +#define NODE_GNUC_AT_LEAST(major, minor, patch) \ + (NODE_MAKE_VERSION(major, minor, patch) <= \ + NODE_MAKE_VERSION(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)) #else -# define NODE_GNUC_AT_LEAST(major, minor, patch) (0) +#define NODE_GNUC_AT_LEAST(major, minor, patch) (0) #endif #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -# define NODE_DEPRECATED(message, declarator) declarator +#define NODE_DEPRECATED(message, declarator) declarator #else // NODE_WANT_INTERNALS -# if NODE_CLANG_AT_LEAST(2, 9, 0) || NODE_GNUC_AT_LEAST(4, 5, 0) -# define NODE_DEPRECATED(message, declarator) \ - __attribute__((deprecated(message))) declarator -# elif defined(_MSC_VER) -# define NODE_DEPRECATED(message, declarator) \ - __declspec(deprecated) declarator -# else -# define NODE_DEPRECATED(message, declarator) declarator -# endif +#if NODE_CLANG_AT_LEAST(2, 9, 0) || NODE_GNUC_AT_LEAST(4, 5, 0) +#define NODE_DEPRECATED(message, declarator) \ + __attribute__((deprecated(message))) declarator +#elif defined(_MSC_VER) +#define NODE_DEPRECATED(message, declarator) __declspec(deprecated) declarator +#else +#define NODE_DEPRECATED(message, declarator) declarator +#endif #endif // Forward-declare libuv loop @@ -107,7 +106,6 @@ namespace node { namespace tracing { class TracingController; - } NODE_EXTERN v8::Local ErrnoException(v8::Isolate* isolate, @@ -122,30 +120,25 @@ NODE_EXTERN v8::Local UVException(v8::Isolate* isolate, const char* path = nullptr, const char* dest = nullptr); -NODE_DEPRECATED("Use ErrnoException(isolate, ...)", - inline v8::Local ErrnoException( - int errorno, - const char* syscall = nullptr, - const char* message = nullptr, - const char* path = nullptr) { - return ErrnoException(v8::Isolate::GetCurrent(), - errorno, - syscall, - message, - path); -}) - -NODE_DEPRECATED("Use UVException(isolate, ...)", - inline v8::Local UVException(int errorno, - const char* syscall = nullptr, - const char* message = nullptr, - const char* path = nullptr) { - return UVException(v8::Isolate::GetCurrent(), - errorno, - syscall, - message, - path); -}) +NODE_DEPRECATED( + "Use ErrnoException(isolate, ...)", + inline v8::Local ErrnoException(int errorno, + const char* syscall = nullptr, + const char* message = nullptr, + const char* path = nullptr) { + return ErrnoException( + v8::Isolate::GetCurrent(), errorno, syscall, message, path); + }) + +NODE_DEPRECATED( + "Use UVException(isolate, ...)", + inline v8::Local UVException(int errorno, + const char* syscall = nullptr, + const char* message = nullptr, + const char* path = nullptr) { + return UVException( + v8::Isolate::GetCurrent(), errorno, syscall, message, path); + }) /* * These methods need to be called in a HandleScope. @@ -154,20 +147,20 @@ NODE_DEPRECATED("Use UVException(isolate, ...)", * `async_context` arguments. */ -NODE_DEPRECATED("Use MakeCallback(..., async_context)", - NODE_EXTERN v8::Local MakeCallback( - v8::Isolate* isolate, - v8::Local recv, - const char* method, - int argc, - v8::Local* argv)); -NODE_DEPRECATED("Use MakeCallback(..., async_context)", - NODE_EXTERN v8::Local MakeCallback( - v8::Isolate* isolate, - v8::Local recv, - v8::Local symbol, - int argc, - v8::Local* argv)); +NODE_DEPRECATED( + "Use MakeCallback(..., async_context)", + NODE_EXTERN v8::Local MakeCallback(v8::Isolate* isolate, + v8::Local recv, + const char* method, + int argc, + v8::Local* argv)); +NODE_DEPRECATED( + "Use MakeCallback(..., async_context)", + NODE_EXTERN v8::Local MakeCallback(v8::Isolate* isolate, + v8::Local recv, + v8::Local symbol, + int argc, + v8::Local* argv)); NODE_DEPRECATED("Use MakeCallback(..., async_context)", NODE_EXTERN v8::Local MakeCallback( v8::Isolate* isolate, @@ -189,13 +182,12 @@ NODE_DEPRECATED("Use MakeCallback(..., async_context)", #ifdef _WIN32 #if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED) typedef intptr_t ssize_t; -# define _SSIZE_T_ -# define _SSIZE_T_DEFINED +#define _SSIZE_T_ +#define _SSIZE_T_DEFINED #endif -#else // !_WIN32 -# include // size_t, ssize_t -#endif // _WIN32 - +#else // !_WIN32 +#include // size_t, ssize_t +#endif // _WIN32 namespace node { @@ -220,7 +212,7 @@ class Environment; class NODE_EXTERN MultiIsolatePlatform : public v8::Platform { public: - virtual ~MultiIsolatePlatform() { } + virtual ~MultiIsolatePlatform() {} // Returns true if work was dispatched or executed. New tasks that are // posted during flushing of the queue are postponed until the next // flushing. @@ -275,8 +267,7 @@ NODE_EXTERN Environment* GetCurrentEnvironment(v8::Local context); NODE_EXTERN MultiIsolatePlatform* GetMainThreadMultiIsolatePlatform(); NODE_EXTERN MultiIsolatePlatform* CreatePlatform( - int thread_pool_size, - node::tracing::TracingController* tracing_controller); + int thread_pool_size, node::tracing::TracingController* tracing_controller); MultiIsolatePlatform* InitializeV8Platform(int thread_pool_size); NODE_EXTERN void FreePlatform(MultiIsolatePlatform* platform); @@ -299,48 +290,46 @@ NODE_DEPRECATED("Use v8::Date::New() directly", #define NODE_UNIXTIME_V8 node::NODE_UNIXTIME_V8 NODE_DEPRECATED("Use v8::Date::ValueOf() directly", inline double NODE_V8_UNIXTIME(v8::Local date) { - return date->ValueOf() / 1000; -}) + return date->ValueOf() / 1000; + }) #define NODE_V8_UNIXTIME node::NODE_V8_UNIXTIME -#define NODE_DEFINE_CONSTANT(target, constant) \ - do { \ - v8::Isolate* isolate = target->GetIsolate(); \ - v8::Local context = isolate->GetCurrentContext(); \ - v8::Local constant_name = \ - v8::String::NewFromUtf8(isolate, #constant, \ - v8::NewStringType::kInternalized).ToLocalChecked(); \ - v8::Local constant_value = \ - v8::Number::New(isolate, static_cast(constant)); \ - v8::PropertyAttribute constant_attributes = \ - static_cast(v8::ReadOnly | v8::DontDelete); \ - (target)->DefineOwnProperty(context, \ - constant_name, \ - constant_value, \ - constant_attributes).FromJust(); \ - } \ - while (0) - -#define NODE_DEFINE_HIDDEN_CONSTANT(target, constant) \ - do { \ - v8::Isolate* isolate = target->GetIsolate(); \ - v8::Local context = isolate->GetCurrentContext(); \ - v8::Local constant_name = \ - v8::String::NewFromUtf8(isolate, #constant, \ - v8::NewStringType::kInternalized) \ - .ToLocalChecked(); \ - v8::Local constant_value = \ - v8::Number::New(isolate, static_cast(constant)); \ - v8::PropertyAttribute constant_attributes = \ - static_cast(v8::ReadOnly | \ - v8::DontDelete | \ - v8::DontEnum); \ - (target)->DefineOwnProperty(context, \ - constant_name, \ - constant_value, \ - constant_attributes).FromJust(); \ - } \ - while (0) +#define NODE_DEFINE_CONSTANT(target, constant) \ + do { \ + v8::Isolate* isolate = target->GetIsolate(); \ + v8::Local context = isolate->GetCurrentContext(); \ + v8::Local constant_name = \ + v8::String::NewFromUtf8( \ + isolate, #constant, v8::NewStringType::kInternalized) \ + .ToLocalChecked(); \ + v8::Local constant_value = \ + v8::Number::New(isolate, static_cast(constant)); \ + v8::PropertyAttribute constant_attributes = \ + static_cast(v8::ReadOnly | v8::DontDelete); \ + (target) \ + ->DefineOwnProperty( \ + context, constant_name, constant_value, constant_attributes) \ + .FromJust(); \ + } while (0) + +#define NODE_DEFINE_HIDDEN_CONSTANT(target, constant) \ + do { \ + v8::Isolate* isolate = target->GetIsolate(); \ + v8::Local context = isolate->GetCurrentContext(); \ + v8::Local constant_name = \ + v8::String::NewFromUtf8( \ + isolate, #constant, v8::NewStringType::kInternalized) \ + .ToLocalChecked(); \ + v8::Local constant_value = \ + v8::Number::New(isolate, static_cast(constant)); \ + v8::PropertyAttribute constant_attributes = \ + static_cast(v8::ReadOnly | v8::DontDelete | \ + v8::DontEnum); \ + (target) \ + ->DefineOwnProperty( \ + context, constant_name, constant_value, constant_attributes) \ + .FromJust(); \ + } while (0) // Used to be a macro, hence the uppercase name. inline void NODE_SET_METHOD(v8::Local recv, @@ -348,10 +337,11 @@ inline void NODE_SET_METHOD(v8::Local recv, v8::FunctionCallback callback) { v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::HandleScope handle_scope(isolate); - v8::Local t = v8::FunctionTemplate::New(isolate, - callback); - v8::Local fn_name = v8::String::NewFromUtf8(isolate, name, - v8::NewStringType::kInternalized).ToLocalChecked(); + v8::Local t = + v8::FunctionTemplate::New(isolate, callback); + v8::Local fn_name = + v8::String::NewFromUtf8(isolate, name, v8::NewStringType::kInternalized) + .ToLocalChecked(); t->SetClassName(fn_name); recv->Set(fn_name, t); } @@ -363,11 +353,12 @@ inline void NODE_SET_METHOD(v8::Local recv, v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::HandleScope handle_scope(isolate); v8::Local context = isolate->GetCurrentContext(); - v8::Local t = v8::FunctionTemplate::New(isolate, - callback); + v8::Local t = + v8::FunctionTemplate::New(isolate, callback); v8::Local fn = t->GetFunction(context).ToLocalChecked(); - v8::Local fn_name = v8::String::NewFromUtf8(isolate, name, - v8::NewStringType::kInternalized).ToLocalChecked(); + v8::Local fn_name = + v8::String::NewFromUtf8(isolate, name, v8::NewStringType::kInternalized) + .ToLocalChecked(); fn->SetName(fn_name); recv->Set(context, fn_name, fn).FromJust(); } @@ -383,15 +374,25 @@ inline void NODE_SET_PROTOTYPE_METHOD(v8::Local recv, v8::Local s = v8::Signature::New(isolate, recv); v8::Local t = v8::FunctionTemplate::New(isolate, callback, v8::Local(), s); - v8::Local fn_name = v8::String::NewFromUtf8(isolate, name, - v8::NewStringType::kInternalized).ToLocalChecked(); + v8::Local fn_name = + v8::String::NewFromUtf8(isolate, name, v8::NewStringType::kInternalized) + .ToLocalChecked(); t->SetClassName(fn_name); recv->PrototypeTemplate()->Set(fn_name, t); } #define NODE_SET_PROTOTYPE_METHOD node::NODE_SET_PROTOTYPE_METHOD // BINARY is a deprecated alias of LATIN1. -enum encoding {ASCII, UTF8, BASE64, UCS2, BINARY, HEX, BUFFER, LATIN1 = BINARY}; +enum encoding { + ASCII, + UTF8, + BASE64, + UCS2, + BINARY, + HEX, + BUFFER, + LATIN1 = BINARY +}; NODE_EXTERN enum encoding ParseEncoding( v8::Isolate* isolate, @@ -433,17 +434,14 @@ NODE_EXTERN v8::Local WinapiErrnoException( const char* signo_string(int errorno); +typedef void (*addon_register_func)(v8::Local exports, + v8::Local module, + void* priv); -typedef void (*addon_register_func)( - v8::Local exports, - v8::Local module, - void* priv); - -typedef void (*addon_context_register_func)( - v8::Local exports, - v8::Local module, - v8::Local context, - void* priv); +typedef void (*addon_context_register_func)(v8::Local exports, + v8::Local module, + v8::Local context, + void* priv); struct node_module { int nm_version; @@ -460,76 +458,70 @@ struct node_module { extern "C" NODE_EXTERN void node_module_register(void* mod); #ifdef _WIN32 -# define NODE_MODULE_EXPORT __declspec(dllexport) +#define NODE_MODULE_EXPORT __declspec(dllexport) #else -# define NODE_MODULE_EXPORT __attribute__((visibility("default"))) +#define NODE_MODULE_EXPORT __attribute__((visibility("default"))) #endif #ifdef NODE_SHARED_MODE -# define NODE_CTOR_PREFIX +#define NODE_CTOR_PREFIX #else -# define NODE_CTOR_PREFIX static +#define NODE_CTOR_PREFIX static #endif #if defined(_MSC_VER) #pragma section(".CRT$XCU", read) -#define NODE_C_CTOR(fn) \ - NODE_CTOR_PREFIX void __cdecl fn(void); \ - __declspec(dllexport, allocate(".CRT$XCU")) \ - void (__cdecl*fn ## _)(void) = fn; \ +#define NODE_C_CTOR(fn) \ + NODE_CTOR_PREFIX void __cdecl fn(void); \ + __declspec(dllexport, allocate(".CRT$XCU")) void(__cdecl * fn##_)(void) = \ + fn; \ NODE_CTOR_PREFIX void __cdecl fn(void) #else -#define NODE_C_CTOR(fn) \ - NODE_CTOR_PREFIX void fn(void) __attribute__((constructor)); \ +#define NODE_C_CTOR(fn) \ + NODE_CTOR_PREFIX void fn(void) __attribute__((constructor)); \ NODE_CTOR_PREFIX void fn(void) #endif -#define NODE_MODULE_X(modname, regfunc, priv, flags) \ - extern "C" { \ - static node::node_module _module = \ - { \ - NODE_MODULE_VERSION, \ - flags, \ - NULL, /* NOLINT (readability/null_usage) */ \ - __FILE__, \ - (node::addon_register_func) (regfunc), \ - NULL, /* NOLINT (readability/null_usage) */ \ - NODE_STRINGIFY(modname), \ - priv, \ - NULL /* NOLINT (readability/null_usage) */ \ - }; \ - NODE_C_CTOR(_register_ ## modname) { \ - node_module_register(&_module); \ - } \ +#define NODE_MODULE_X(modname, regfunc, priv, flags) \ + extern "C" { \ + static node::node_module _module = { \ + NODE_MODULE_VERSION, \ + flags, \ + NULL, /* NOLINT (readability/null_usage) */ \ + __FILE__, \ + (node::addon_register_func)(regfunc), \ + NULL, /* NOLINT (readability/null_usage) */ \ + NODE_STRINGIFY(modname), \ + priv, \ + NULL /* NOLINT (readability/null_usage) */ \ + }; \ + NODE_C_CTOR(_register_##modname) { node_module_register(&_module); } \ } -#define NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, priv, flags) \ - extern "C" { \ - static node::node_module _module = \ - { \ - NODE_MODULE_VERSION, \ - flags, \ - NULL, /* NOLINT (readability/null_usage) */ \ - __FILE__, \ - NULL, /* NOLINT (readability/null_usage) */ \ - (node::addon_context_register_func) (regfunc), \ - NODE_STRINGIFY(modname), \ - priv, \ - NULL /* NOLINT (readability/null_usage) */ \ - }; \ - NODE_C_CTOR(_register_ ## modname) { \ - node_module_register(&_module); \ - } \ +#define NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, priv, flags) \ + extern "C" { \ + static node::node_module _module = { \ + NODE_MODULE_VERSION, \ + flags, \ + NULL, /* NOLINT (readability/null_usage) */ \ + __FILE__, \ + NULL, /* NOLINT (readability/null_usage) */ \ + (node::addon_context_register_func)(regfunc), \ + NODE_STRINGIFY(modname), \ + priv, \ + NULL /* NOLINT (readability/null_usage) */ \ + }; \ + NODE_C_CTOR(_register_##modname) { node_module_register(&_module); } \ } // Usage: `NODE_MODULE(NODE_GYP_MODULE_NAME, InitializerFunction)` // If no NODE_MODULE is declared, Node.js looks for the well-known // symbol `node_register_module_v${NODE_MODULE_VERSION}`. -#define NODE_MODULE(modname, regfunc) \ +#define NODE_MODULE(modname, regfunc) \ NODE_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) -#define NODE_MODULE_CONTEXT_AWARE(modname, regfunc) \ - /* NOLINTNEXTLINE (readability/null_usage) */ \ +#define NODE_MODULE_CONTEXT_AWARE(modname, regfunc) \ + /* NOLINTNEXTLINE (readability/null_usage) */ \ NODE_MODULE_CONTEXT_AWARE_X(modname, regfunc, NULL, 0) /* @@ -539,24 +531,22 @@ extern "C" NODE_EXTERN void node_module_register(void* mod); #define NODE_MODULE_INITIALIZER_BASE node_register_module_v -#define NODE_MODULE_INITIALIZER_X(base, version) \ - NODE_MODULE_INITIALIZER_X_HELPER(base, version) +#define NODE_MODULE_INITIALIZER_X(base, version) \ + NODE_MODULE_INITIALIZER_X_HELPER(base, version) #define NODE_MODULE_INITIALIZER_X_HELPER(base, version) base##version -#define NODE_MODULE_INITIALIZER \ - NODE_MODULE_INITIALIZER_X(NODE_MODULE_INITIALIZER_BASE, \ - NODE_MODULE_VERSION) - -#define NODE_MODULE_INIT() \ - extern "C" NODE_MODULE_EXPORT void \ - NODE_MODULE_INITIALIZER(v8::Local exports, \ - v8::Local module, \ - v8::Local context); \ - NODE_MODULE_CONTEXT_AWARE(NODE_GYP_MODULE_NAME, \ - NODE_MODULE_INITIALIZER) \ - void NODE_MODULE_INITIALIZER(v8::Local exports, \ - v8::Local module, \ +#define NODE_MODULE_INITIALIZER \ + NODE_MODULE_INITIALIZER_X(NODE_MODULE_INITIALIZER_BASE, NODE_MODULE_VERSION) + +#define NODE_MODULE_INIT() \ + extern "C" NODE_MODULE_EXPORT void NODE_MODULE_INITIALIZER( \ + v8::Local exports, \ + v8::Local module, \ + v8::Local context); \ + NODE_MODULE_CONTEXT_AWARE(NODE_GYP_MODULE_NAME, NODE_MODULE_INITIALIZER) \ + void NODE_MODULE_INITIALIZER(v8::Local exports, \ + v8::Local module, \ v8::Local context) /* Called after the event loop exits but before the VM is disposed. @@ -570,10 +560,10 @@ NODE_EXTERN void AtExit(void (*cb)(void* arg), void* arg = 0); */ NODE_EXTERN void AtExit(Environment* env, void (*cb)(void* arg), void* arg = 0); -typedef void (*promise_hook_func) (v8::PromiseHookType type, - v8::Local promise, - v8::Local parent, - void* arg); +typedef void (*promise_hook_func)(v8::PromiseHookType type, + v8::Local promise, + v8::Local parent, + void* arg); typedef double async_id; struct async_context { @@ -704,10 +694,8 @@ class AsyncResource { v8::Local resource, const char* name, async_id trigger_async_id = -1) - : isolate_(isolate), - resource_(isolate, resource) { - async_context_ = EmitAsyncInit(isolate, resource, name, - trigger_async_id); + : isolate_(isolate), resource_(isolate, resource) { + async_context_ = EmitAsyncInit(isolate, resource, name, trigger_async_id); } virtual ~AsyncResource() { @@ -715,40 +703,30 @@ class AsyncResource { resource_.Reset(); } - v8::MaybeLocal MakeCallback( - v8::Local callback, - int argc, - v8::Local* argv) { - return node::MakeCallback(isolate_, get_resource(), - callback, argc, argv, - async_context_); + v8::MaybeLocal MakeCallback(v8::Local callback, + int argc, + v8::Local* argv) { + return node::MakeCallback( + isolate_, get_resource(), callback, argc, argv, async_context_); } - v8::MaybeLocal MakeCallback( - const char* method, - int argc, - v8::Local* argv) { - return node::MakeCallback(isolate_, get_resource(), - method, argc, argv, - async_context_); + v8::MaybeLocal MakeCallback(const char* method, + int argc, + v8::Local* argv) { + return node::MakeCallback( + isolate_, get_resource(), method, argc, argv, async_context_); } - v8::MaybeLocal MakeCallback( - v8::Local symbol, - int argc, - v8::Local* argv) { - return node::MakeCallback(isolate_, get_resource(), - symbol, argc, argv, - async_context_); + v8::MaybeLocal MakeCallback(v8::Local symbol, + int argc, + v8::Local* argv) { + return node::MakeCallback( + isolate_, get_resource(), symbol, argc, argv, async_context_); } - v8::Local get_resource() { - return resource_.Get(isolate_); - } + v8::Local get_resource() { return resource_.Get(isolate_); } - async_id get_async_id() const { - return async_context_.async_id; - } + async_id get_async_id() const { return async_context_.async_id; } async_id get_trigger_async_id() const { return async_context_.trigger_async_id; @@ -758,9 +736,9 @@ class AsyncResource { class CallbackScope : public node::CallbackScope { public: explicit CallbackScope(AsyncResource* res) - : node::CallbackScope(res->isolate_, - res->resource_.Get(res->isolate_), - res->async_context_) {} + : node::CallbackScope(res->isolate_, + res->resource_.Get(res->isolate_), + res->async_context_) {} }; private: diff --git a/src/node_api.cc b/src/node_api.cc index 7d843c08f5a69d..67f8b78a06c8de 100644 --- a/src/node_api.cc +++ b/src/node_api.cc @@ -8,8 +8,8 @@ #include "node_internals.h" struct node_napi_env__ : public napi_env__ { - explicit node_napi_env__(v8::Local context): - napi_env__(context) { + explicit node_napi_env__(v8::Local context) + : napi_env__(context) { CHECK_NOT_NULL(node_env()); } inline node::Environment* node_env() const { @@ -23,17 +23,16 @@ namespace v8impl { namespace { -class BufferFinalizer: private Finalizer { +class BufferFinalizer : private Finalizer { public: // node::Buffer::FreeCallback static void FinalizeBufferCallback(char* data, void* hint) { BufferFinalizer* finalizer = static_cast(hint); if (finalizer->_finalize_callback != nullptr) { - NAPI_CALL_INTO_MODULE_THROW(finalizer->_env, - finalizer->_finalize_callback( + NAPI_CALL_INTO_MODULE_THROW( finalizer->_env, - data, - finalizer->_finalize_hint)); + finalizer->_finalize_callback( + finalizer->_env, data, finalizer->_finalize_hint)); } Delete(finalizer); @@ -52,7 +51,7 @@ static inline napi_env GetEnv(v8::Local context) { // // Re https://github.com/nodejs/node/pull/14217#discussion_r128775149 auto value = global->GetPrivate(context, NAPI_PRIVATE_KEY(context, env)) - .ToLocalChecked(); + .ToLocalChecked(); if (value->IsExternal()) { result = static_cast(value.As()->Value()); @@ -63,7 +62,7 @@ static inline napi_env GetEnv(v8::Local context) { // We must also stop hard if the result of assigning the env to the global // is either nothing or false. CHECK(global->SetPrivate(context, NAPI_PRIVATE_KEY(context, env), external) - .FromJust()); + .FromJust()); // TODO(addaleax): There was previously code that tried to delete the // napi_env when its v8::Context was garbage collected; @@ -73,29 +72,27 @@ static inline napi_env GetEnv(v8::Local context) { // once all N-API addons using this napi_env are unloaded. // For now, a per-Environment cleanup hook is the best we can do. result->node_env()->AddCleanupHook( - [](void* arg) { - static_cast(arg)->Unref(); - }, + [](void* arg) { static_cast(arg)->Unref(); }, static_cast(result)); } return result; } -static inline napi_callback_scope -JsCallbackScopeFromV8CallbackScope(node::CallbackScope* s) { +static inline napi_callback_scope JsCallbackScopeFromV8CallbackScope( + node::CallbackScope* s) { return reinterpret_cast(s); } -static inline node::CallbackScope* -V8CallbackScopeFromJsCallbackScope(napi_callback_scope s) { +static inline node::CallbackScope* V8CallbackScopeFromJsCallbackScope( + napi_callback_scope s) { return reinterpret_cast(s); } -static inline void trigger_fatal_exception( - napi_env env, v8::Local local_err) { +static inline void trigger_fatal_exception(napi_env env, + v8::Local local_err) { v8::Local local_msg = - v8::Exception::CreateMessage(env->isolate, local_err); + v8::Exception::CreateMessage(env->isolate, local_err); node::FatalException(env->isolate, local_err, local_msg); } @@ -110,19 +107,19 @@ class ThreadSafeFunction : public node::AsyncResource { node_napi_env env_, void* finalize_data_, napi_finalize finalize_cb_, - napi_threadsafe_function_call_js call_js_cb_): - AsyncResource(env_->isolate, - resource, - *v8::String::Utf8Value(env_->isolate, name)), - thread_count(thread_count_), - is_closing(false), - context(context_), - max_queue_size(max_queue_size_), - env(env_), - finalize_data(finalize_data_), - finalize_cb(finalize_cb_), - call_js_cb(call_js_cb_ == nullptr ? CallJs : call_js_cb_), - handles_closing(false) { + napi_threadsafe_function_call_js call_js_cb_) + : AsyncResource(env_->isolate, + resource, + *v8::String::Utf8Value(env_->isolate, name)), + thread_count(thread_count_), + is_closing(false), + context(context_), + max_queue_size(max_queue_size_), + env(env_), + finalize_data(finalize_data_), + finalize_cb(finalize_cb_), + call_js_cb(call_js_cb_ == nullptr ? CallJs : call_js_cb_), + handles_closing(false) { ref.Reset(env->isolate, func); node::AddEnvironmentCleanupHook(env->isolate, Cleanup, this); env->Ref(); @@ -138,9 +135,8 @@ class ThreadSafeFunction : public node::AsyncResource { napi_status Push(void* data, napi_threadsafe_function_call_mode mode) { node::Mutex::ScopedLock lock(this->mutex); - while (queue.size() >= max_queue_size && - max_queue_size > 0 && - !is_closing) { + while (queue.size() >= max_queue_size && max_queue_size > 0 && + !is_closing) { if (mode == napi_tsfn_nonblocking) { return napi_queue_full; } @@ -200,7 +196,7 @@ class ThreadSafeFunction : public node::AsyncResource { } void EmptyQueueAndDelete() { - for (; !queue.empty() ; queue.pop()) { + for (; !queue.empty(); queue.pop()) { call_js_cb(nullptr, nullptr, context, queue.front()); } delete this; @@ -302,10 +298,7 @@ class ThreadSafeFunction : public node::AsyncResource { } else { v8::Local js_cb = v8::Local::New(env->isolate, ref); - call_js_cb(env, - v8impl::JsValueFromV8LocalValue(js_cb), - context, - data); + call_js_cb(env, v8impl::JsValueFromV8LocalValue(js_cb), context, data); } } } @@ -329,9 +322,7 @@ class ThreadSafeFunction : public node::AsyncResource { EmptyQueueAndDelete(); } - inline void* Context() { - return context; - } + inline void* Context() { return context; } void CloseHandlesAndMaybeDelete(bool set_closing = false) { v8::HandleScope scope(env->isolate); @@ -373,15 +364,16 @@ class ThreadSafeFunction : public node::AsyncResource { status = napi_get_undefined(env, &recv); if (status != napi_ok) { - napi_throw_error(env, "ERR_NAPI_TSFN_GET_UNDEFINED", - "Failed to retrieve undefined value"); + napi_throw_error(env, + "ERR_NAPI_TSFN_GET_UNDEFINED", + "Failed to retrieve undefined value"); return; } status = napi_call_function(env, recv, cb, 0, nullptr, nullptr); if (status != napi_ok && status != napi_pending_exception) { - napi_throw_error(env, "ERR_NAPI_TSFN_CALL_JS", - "Failed to call JS callback"); + napi_throw_error( + env, "ERR_NAPI_TSFN_CALL_JS", "Failed to call JS callback"); return; } } @@ -400,8 +392,8 @@ class ThreadSafeFunction : public node::AsyncResource { } static void Cleanup(void* data) { - reinterpret_cast(data) - ->CloseHandlesAndMaybeDelete(true); + reinterpret_cast(data)->CloseHandlesAndMaybeDelete( + true); } private: @@ -439,7 +431,10 @@ static void napi_module_register_cb(v8::Local exports, v8::Local module, v8::Local context, void* priv) { - napi_module_register_by_symbol(exports, module, context, + napi_module_register_by_symbol( + exports, + module, + context, static_cast(priv)->nm_register_func); } @@ -450,8 +445,7 @@ void napi_module_register_by_symbol(v8::Local exports, if (init == nullptr) { node::Environment* node_env = node::Environment::GetCurrent(context); CHECK_NOT_NULL(node_env); - node_env->ThrowError( - "Module has no declared entry point."); + node_env->ThrowError("Module has no declared entry point."); return; } @@ -460,8 +454,8 @@ void napi_module_register_by_symbol(v8::Local exports, napi_env env = v8impl::GetEnv(context); napi_value _exports; - NAPI_CALL_INTO_MODULE_THROW(env, - _exports = init(env, v8impl::JsValueFromV8LocalValue(exports))); + NAPI_CALL_INTO_MODULE_THROW( + env, _exports = init(env, v8impl::JsValueFromV8LocalValue(exports))); // If register function returned a non-null exports object different from // the exports object we passed it, set that as the "exports" property of @@ -475,16 +469,16 @@ void napi_module_register_by_symbol(v8::Local exports, // Registers a NAPI module. void napi_module_register(napi_module* mod) { - node::node_module* nm = new node::node_module { - -1, - mod->nm_flags, - nullptr, - mod->nm_filename, - nullptr, - napi_module_register_cb, - mod->nm_modname, - mod, // priv - nullptr, + node::node_module* nm = new node::node_module{ + -1, + mod->nm_flags, + nullptr, + mod->nm_filename, + nullptr, + napi_module_register_cb, + mod->nm_modname, + mod, // priv + nullptr, }; node::node_module_register(nm); } @@ -529,19 +523,15 @@ NAPI_NO_RETURN void napi_fatal_error(const char* location, std::string message_string; if (location_len != NAPI_AUTO_LENGTH) { - location_string.assign( - const_cast(location), location_len); + location_string.assign(const_cast(location), location_len); } else { - location_string.assign( - const_cast(location), strlen(location)); + location_string.assign(const_cast(location), strlen(location)); } if (message_len != NAPI_AUTO_LENGTH) { - message_string.assign( - const_cast(message), message_len); + message_string.assign(const_cast(message), message_len); } else { - message_string.assign( - const_cast(message), strlen(message)); + message_string.assign(const_cast(message), strlen(message)); } node::FatalError(location_string.c_str(), message_string.c_str()); @@ -565,9 +555,7 @@ napi_status napi_open_callback_scope(napi_env env, CHECK_TO_OBJECT(env, context, resource, resource_object); *result = v8impl::JsCallbackScopeFromV8CallbackScope( - new node::CallbackScope(env->isolate, - resource, - *node_async_context)); + new node::CallbackScope(env->isolate, resource, *node_async_context)); env->open_callback_scopes++; return napi_clear_last_error(env); @@ -618,8 +606,7 @@ napi_status napi_async_init(napi_env env, return napi_clear_last_error(env); } -napi_status napi_async_destroy(napi_env env, - napi_async_context async_context) { +napi_status napi_async_destroy(napi_env env, napi_async_context async_context) { CHECK_ENV(env); CHECK_ARG(env, async_context); @@ -655,14 +642,17 @@ napi_status napi_make_callback(napi_env env, CHECK_TO_FUNCTION(env, v8func, func); node::async_context* node_async_context = - reinterpret_cast(async_context); + reinterpret_cast(async_context); if (node_async_context == nullptr) { - static node::async_context empty_context = { 0, 0 }; + static node::async_context empty_context = {0, 0}; node_async_context = &empty_context; } v8::MaybeLocal callback_result = node::MakeCallback( - env->isolate, v8recv, v8func, argc, + env->isolate, + v8recv, + v8func, + argc, reinterpret_cast*>(const_cast(argv)), *node_async_context); @@ -671,8 +661,8 @@ napi_status napi_make_callback(napi_env env, } else { CHECK_MAYBE_EMPTY(env, callback_result, napi_generic_failure); if (result != nullptr) { - *result = v8impl::JsValueFromV8LocalValue( - callback_result.ToLocalChecked()); + *result = + v8impl::JsValueFromV8LocalValue(callback_result.ToLocalChecked()); } } @@ -713,14 +703,15 @@ napi_status napi_create_external_buffer(napi_env env, v8::Isolate* isolate = env->isolate; // The finalizer object will delete itself after invoking the callback. - v8impl::Finalizer* finalizer = v8impl::Finalizer::New( - env, finalize_cb, nullptr, finalize_hint); + v8impl::Finalizer* finalizer = + v8impl::Finalizer::New(env, finalize_cb, nullptr, finalize_hint); - auto maybe = node::Buffer::New(isolate, - static_cast(data), - length, - v8impl::BufferFinalizer::FinalizeBufferCallback, - finalizer); + auto maybe = + node::Buffer::New(isolate, + static_cast(data), + length, + v8impl::BufferFinalizer::FinalizeBufferCallback, + finalizer); CHECK_MAYBE_EMPTY(env, maybe, napi_generic_failure); @@ -740,8 +731,8 @@ napi_status napi_create_buffer_copy(napi_env env, NAPI_PREAMBLE(env); CHECK_ARG(env, result); - auto maybe = node::Buffer::Copy(env->isolate, - static_cast(data), length); + auto maybe = + node::Buffer::Copy(env->isolate, static_cast(data), length); CHECK_MAYBE_EMPTY(env, maybe, napi_generic_failure); @@ -788,11 +779,7 @@ napi_status napi_get_node_version(napi_env env, CHECK_ENV(env); CHECK_ARG(env, result); static const napi_node_version version = { - NODE_MAJOR_VERSION, - NODE_MINOR_VERSION, - NODE_PATCH_VERSION, - NODE_RELEASE - }; + NODE_MAJOR_VERSION, NODE_MINOR_VERSION, NODE_PATCH_VERSION, NODE_RELEASE}; *result = &version; return napi_clear_last_error(env); } @@ -802,12 +789,12 @@ namespace uvimpl { static napi_status ConvertUVErrorCode(int code) { switch (code) { - case 0: - return napi_ok; - case UV_EINVAL: - return napi_invalid_arg; - case UV_ECANCELED: - return napi_cancelled; + case 0: + return napi_ok; + case UV_EINVAL: + return napi_invalid_arg; + case UV_ECANCELED: + return napi_cancelled; } return napi_generic_failure; @@ -822,17 +809,17 @@ class Work : public node::AsyncResource, public node::ThreadPoolWork { napi_async_execute_callback execute, napi_async_complete_callback complete = nullptr, void* data = nullptr) - : AsyncResource(env->isolate, - async_resource, - *v8::String::Utf8Value(env->isolate, async_resource_name)), - ThreadPoolWork(env->node_env()), - _env(env), - _data(data), - _execute(execute), - _complete(complete) { - } - - virtual ~Work() { } + : AsyncResource( + env->isolate, + async_resource, + *v8::String::Utf8Value(env->isolate, async_resource_name)), + ThreadPoolWork(env->node_env()), + _env(env), + _data(data), + _execute(execute), + _complete(complete) {} + + virtual ~Work() {} public: static Work* New(node_napi_env env, @@ -841,21 +828,16 @@ class Work : public node::AsyncResource, public node::ThreadPoolWork { napi_async_execute_callback execute, napi_async_complete_callback complete, void* data) { - return new Work(env, async_resource, async_resource_name, - execute, complete, data); + return new Work( + env, async_resource, async_resource_name, execute, complete, data); } - static void Delete(Work* work) { - delete work; - } + static void Delete(Work* work) { delete work; } - void DoThreadPoolWork() override { - _execute(_env, _data); - } + void DoThreadPoolWork() override { _execute(_env, _data); } void AfterThreadPoolWork(int status) override { - if (_complete == nullptr) - return; + if (_complete == nullptr) return; // Establish a handle scope here so that every callback doesn't have to. // Also it is needed for the exception-handling below. @@ -870,13 +852,14 @@ class Work : public node::AsyncResource, public node::ThreadPoolWork { napi_env env = _env; NAPI_CALL_INTO_MODULE(env, - _complete(_env, ConvertUVErrorCode(status), _data), - [env] (v8::Local local_err) { - // If there was an unhandled exception in the complete callback, - // report it as a fatal exception. (There is no JavaScript on the - // callstack that can possibly handle it.) - v8impl::trigger_fatal_exception(env, local_err); - }); + _complete(_env, ConvertUVErrorCode(status), _data), + [env](v8::Local local_err) { + // If there was an unhandled exception in the + // complete callback, report it as a fatal + // exception. (There is no JavaScript on the + // callstack that can possibly handle it.) + v8impl::trigger_fatal_exception(env, local_err); + }); // Note: Don't access `work` after this point because it was // likely deleted by the complete callback. @@ -892,13 +875,13 @@ class Work : public node::AsyncResource, public node::ThreadPoolWork { } // end of namespace uvimpl } // end of anonymous namespace -#define CALL_UV(env, condition) \ - do { \ - int result = (condition); \ - napi_status status = uvimpl::ConvertUVErrorCode(result); \ - if (status != napi_ok) { \ - return napi_set_last_error(env, status, result); \ - } \ +#define CALL_UV(env, condition) \ + do { \ + int result = (condition); \ + napi_status status = uvimpl::ConvertUVErrorCode(result); \ + if (status != napi_ok) { \ + return napi_set_last_error(env, status, result); \ + } \ } while (0) napi_status napi_create_async_work(napi_env env, @@ -959,8 +942,7 @@ napi_status napi_queue_async_work(napi_env env, napi_async_work work) { napi_status status; uv_loop_t* event_loop = nullptr; status = napi_get_uv_event_loop(env, &event_loop); - if (status != napi_ok) - return napi_set_last_error(env, status); + if (status != napi_ok) return napi_set_last_error(env, status); uvimpl::Work* w = reinterpret_cast(work); @@ -980,18 +962,18 @@ napi_status napi_cancel_async_work(napi_env env, napi_async_work work) { return napi_clear_last_error(env); } -napi_status -napi_create_threadsafe_function(napi_env env, - napi_value func, - napi_value async_resource, - napi_value async_resource_name, - size_t max_queue_size, - size_t initial_thread_count, - void* thread_finalize_data, - napi_finalize thread_finalize_cb, - void* context, - napi_threadsafe_function_call_js call_js_cb, - napi_threadsafe_function* result) { +napi_status napi_create_threadsafe_function( + napi_env env, + napi_value func, + napi_value async_resource, + napi_value async_resource_name, + size_t max_queue_size, + size_t initial_thread_count, + void* thread_finalize_data, + napi_finalize thread_finalize_cb, + void* context, + napi_threadsafe_function_call_js call_js_cb, + napi_threadsafe_function* result) { CHECK_ENV(env); CHECK_ARG(env, func); CHECK_ARG(env, async_resource_name); @@ -1040,9 +1022,8 @@ napi_create_threadsafe_function(napi_env env, return napi_set_last_error(env, status); } -napi_status -napi_get_threadsafe_function_context(napi_threadsafe_function func, - void** result) { +napi_status napi_get_threadsafe_function_context(napi_threadsafe_function func, + void** result) { CHECK(func != nullptr); CHECK(result != nullptr); @@ -1050,36 +1031,34 @@ napi_get_threadsafe_function_context(napi_threadsafe_function func, return napi_ok; } -napi_status -napi_call_threadsafe_function(napi_threadsafe_function func, - void* data, - napi_threadsafe_function_call_mode is_blocking) { +napi_status napi_call_threadsafe_function( + napi_threadsafe_function func, + void* data, + napi_threadsafe_function_call_mode is_blocking) { CHECK(func != nullptr); return reinterpret_cast(func)->Push(data, is_blocking); } -napi_status -napi_acquire_threadsafe_function(napi_threadsafe_function func) { +napi_status napi_acquire_threadsafe_function(napi_threadsafe_function func) { CHECK(func != nullptr); return reinterpret_cast(func)->Acquire(); } -napi_status -napi_release_threadsafe_function(napi_threadsafe_function func, - napi_threadsafe_function_release_mode mode) { +napi_status napi_release_threadsafe_function( + napi_threadsafe_function func, napi_threadsafe_function_release_mode mode) { CHECK(func != nullptr); return reinterpret_cast(func)->Release(mode); } -napi_status -napi_unref_threadsafe_function(napi_env env, napi_threadsafe_function func) { +napi_status napi_unref_threadsafe_function(napi_env env, + napi_threadsafe_function func) { CHECK(func != nullptr); return reinterpret_cast(func)->Unref(); } -napi_status -napi_ref_threadsafe_function(napi_env env, napi_threadsafe_function func) { +napi_status napi_ref_threadsafe_function(napi_env env, + napi_threadsafe_function func) { CHECK(func != nullptr); return reinterpret_cast(func)->Ref(); } diff --git a/src/node_api.h b/src/node_api.h index a37ee06ce16a70..97dd9c45e7a707 100644 --- a/src/node_api.h +++ b/src/node_api.h @@ -2,10 +2,10 @@ #define SRC_NODE_API_H_ #ifdef BUILDING_NODE_EXTENSION - #ifdef _WIN32 - // Building native module against node - #define NAPI_EXTERN __declspec(dllimport) - #endif +#ifdef _WIN32 +// Building native module against node +#define NAPI_EXTERN __declspec(dllimport) +#endif #endif #include "js_native_api.h" #include "node_api_types.h" @@ -13,9 +13,9 @@ struct uv_loop_s; // Forward declaration. #ifdef _WIN32 -# define NAPI_MODULE_EXPORT __declspec(dllexport) +#define NAPI_MODULE_EXPORT __declspec(dllexport) #else -# define NAPI_MODULE_EXPORT __attribute__((visibility("default"))) +#define NAPI_MODULE_EXPORT __attribute__((visibility("default"))) #endif #ifdef __GNUC__ @@ -37,59 +37,54 @@ typedef struct { void* reserved[4]; } napi_module; -#define NAPI_MODULE_VERSION 1 +#define NAPI_MODULE_VERSION 1 #if defined(_MSC_VER) #pragma section(".CRT$XCU", read) -#define NAPI_C_CTOR(fn) \ - static void __cdecl fn(void); \ - __declspec(dllexport, allocate(".CRT$XCU")) void(__cdecl * fn##_)(void) = \ - fn; \ +#define NAPI_C_CTOR(fn) \ + static void __cdecl fn(void); \ + __declspec(dllexport, allocate(".CRT$XCU")) void(__cdecl * fn##_)(void) = \ + fn; \ static void __cdecl fn(void) #else -#define NAPI_C_CTOR(fn) \ - static void fn(void) __attribute__((constructor)); \ +#define NAPI_C_CTOR(fn) \ + static void fn(void) __attribute__((constructor)); \ static void fn(void) #endif -#define NAPI_MODULE_X(modname, regfunc, priv, flags) \ - EXTERN_C_START \ - static napi_module _module = \ - { \ - NAPI_MODULE_VERSION, \ - flags, \ - __FILE__, \ - regfunc, \ - #modname, \ - priv, \ - {0}, \ - }; \ - NAPI_C_CTOR(_register_ ## modname) { \ - napi_module_register(&_module); \ - } \ +#define NAPI_MODULE_X(modname, regfunc, priv, flags) \ + EXTERN_C_START \ + static napi_module _module = { \ + NAPI_MODULE_VERSION, \ + flags, \ + __FILE__, \ + regfunc, \ + #modname, \ + priv, \ + {0}, \ + }; \ + NAPI_C_CTOR(_register_##modname) { napi_module_register(&_module); } \ EXTERN_C_END -#define NAPI_MODULE(modname, regfunc) \ +#define NAPI_MODULE(modname, regfunc) \ NAPI_MODULE_X(modname, regfunc, NULL, 0) // NOLINT (readability/null_usage) #define NAPI_MODULE_INITIALIZER_BASE napi_register_module_v -#define NAPI_MODULE_INITIALIZER_X(base, version) \ - NAPI_MODULE_INITIALIZER_X_HELPER(base, version) +#define NAPI_MODULE_INITIALIZER_X(base, version) \ + NAPI_MODULE_INITIALIZER_X_HELPER(base, version) #define NAPI_MODULE_INITIALIZER_X_HELPER(base, version) base##version -#define NAPI_MODULE_INITIALIZER \ - NAPI_MODULE_INITIALIZER_X(NAPI_MODULE_INITIALIZER_BASE, \ - NAPI_MODULE_VERSION) +#define NAPI_MODULE_INITIALIZER \ + NAPI_MODULE_INITIALIZER_X(NAPI_MODULE_INITIALIZER_BASE, NAPI_MODULE_VERSION) -#define NAPI_MODULE_INIT() \ - EXTERN_C_START \ - NAPI_MODULE_EXPORT napi_value \ - NAPI_MODULE_INITIALIZER(napi_env env, napi_value exports); \ - EXTERN_C_END \ - NAPI_MODULE(NODE_GYP_MODULE_NAME, NAPI_MODULE_INITIALIZER) \ - napi_value NAPI_MODULE_INITIALIZER(napi_env env, \ - napi_value exports) +#define NAPI_MODULE_INIT() \ + EXTERN_C_START \ + NAPI_MODULE_EXPORT napi_value NAPI_MODULE_INITIALIZER(napi_env env, \ + napi_value exports); \ + EXTERN_C_END \ + NAPI_MODULE(NODE_GYP_MODULE_NAME, NAPI_MODULE_INITIALIZER) \ + napi_value NAPI_MODULE_INITIALIZER(napi_env env, napi_value exports) EXTERN_C_START @@ -208,9 +203,8 @@ napi_create_threadsafe_function(napi_env env, napi_threadsafe_function_call_js call_js_cb, napi_threadsafe_function* result); -NAPI_EXTERN napi_status -napi_get_threadsafe_function_context(napi_threadsafe_function func, - void** result); +NAPI_EXTERN napi_status napi_get_threadsafe_function_context( + napi_threadsafe_function func, void** result); NAPI_EXTERN napi_status napi_call_threadsafe_function(napi_threadsafe_function func, @@ -220,9 +214,8 @@ napi_call_threadsafe_function(napi_threadsafe_function func, NAPI_EXTERN napi_status napi_acquire_threadsafe_function(napi_threadsafe_function func); -NAPI_EXTERN napi_status -napi_release_threadsafe_function(napi_threadsafe_function func, - napi_threadsafe_function_release_mode mode); +NAPI_EXTERN napi_status napi_release_threadsafe_function( + napi_threadsafe_function func, napi_threadsafe_function_release_mode mode); NAPI_EXTERN napi_status napi_unref_threadsafe_function(napi_env env, napi_threadsafe_function func); diff --git a/src/node_api_types.h b/src/node_api_types.h index 1c9a2b8aa21889..7a395407de10d1 100644 --- a/src/node_api_types.h +++ b/src/node_api_types.h @@ -22,8 +22,7 @@ typedef enum { } napi_threadsafe_function_call_mode; #endif // NAPI_VERSION >= 4 -typedef void (*napi_async_execute_callback)(napi_env env, - void* data); +typedef void (*napi_async_execute_callback)(napi_env env, void* data); typedef void (*napi_async_complete_callback)(napi_env env, napi_status status, void* data); diff --git a/src/node_buffer.cc b/src/node_buffer.cc index 1aebe51e0bc292..b0233b54475375 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -31,28 +31,28 @@ #include "v8-profiler.h" #include "v8.h" -#include #include +#include #define MIN(a, b) ((a) < (b) ? (a) : (b)) -#define THROW_AND_RETURN_UNLESS_BUFFER(env, obj) \ - THROW_AND_RETURN_IF_NOT_BUFFER(env, obj, "argument") \ - -#define THROW_AND_RETURN_IF_OOB(r) \ - do { \ - if ((r).IsNothing()) return; \ - if (!(r).FromJust()) \ - return node::THROW_ERR_OUT_OF_RANGE(env, "Index out of range"); \ - } while (0) \ - -#define SLICE_START_END(env, start_arg, end_arg, end_max) \ - size_t start; \ - size_t end; \ - THROW_AND_RETURN_IF_OOB(ParseArrayIndex(env, start_arg, 0, &start)); \ - THROW_AND_RETURN_IF_OOB(ParseArrayIndex(env, end_arg, end_max, &end)); \ - if (end < start) end = start; \ - THROW_AND_RETURN_IF_OOB(Just(end <= end_max)); \ +#define THROW_AND_RETURN_UNLESS_BUFFER(env, obj) \ + THROW_AND_RETURN_IF_NOT_BUFFER(env, obj, "argument") + +#define THROW_AND_RETURN_IF_OOB(r) \ + do { \ + if ((r).IsNothing()) return; \ + if (!(r).FromJust()) \ + return node::THROW_ERR_OUT_OF_RANGE(env, "Index out of range"); \ + } while (0) + +#define SLICE_START_END(env, start_arg, end_arg, end_max) \ + size_t start; \ + size_t end; \ + THROW_AND_RETURN_IF_OOB(ParseArrayIndex(env, start_arg, 0, &start)); \ + THROW_AND_RETURN_IF_OOB(ParseArrayIndex(env, end_arg, end_max, &end)); \ + if (end < start) end = start; \ + THROW_AND_RETURN_IF_OOB(Just(end <= end_max)); \ size_t length = end - start; namespace node { @@ -60,9 +60,9 @@ namespace node { namespace { inline void* BufferMalloc(size_t length) { - return per_process::cli_options->zero_fill_all_buffers ? - node::UncheckedCalloc(length) : - node::UncheckedMalloc(length); + return per_process::cli_options->zero_fill_all_buffers + ? node::UncheckedCalloc(length) + : node::UncheckedMalloc(length); } } // namespace @@ -100,6 +100,7 @@ class CallbackInfo { FreeCallback callback, char* data, void* hint = nullptr); + private: static void WeakCallback(const WeakCallbackInfo&); inline void WeakCallback(Isolate* isolate); @@ -115,12 +116,10 @@ class CallbackInfo { DISALLOW_COPY_AND_ASSIGN(CallbackInfo); }; - void CallbackInfo::Free(char* data, void*) { ::free(data); } - CallbackInfo* CallbackInfo::New(Isolate* isolate, Local object, FreeCallback callback, @@ -129,7 +128,6 @@ CallbackInfo* CallbackInfo::New(Isolate* isolate, return new CallbackInfo(isolate, object, callback, data, hint); } - CallbackInfo::CallbackInfo(Isolate* isolate, Local object, FreeCallback callback, @@ -141,29 +139,24 @@ CallbackInfo::CallbackInfo(Isolate* isolate, hint_(hint) { ArrayBuffer::Contents obj_c = object->GetContents(); CHECK_EQ(data_, static_cast(obj_c.Data())); - if (object->ByteLength() != 0) - CHECK_NOT_NULL(data_); + if (object->ByteLength() != 0) CHECK_NOT_NULL(data_); persistent_.SetWeak(this, WeakCallback, v8::WeakCallbackType::kParameter); isolate->AdjustAmountOfExternalAllocatedMemory(sizeof(*this)); } - -void CallbackInfo::WeakCallback( - const WeakCallbackInfo& data) { +void CallbackInfo::WeakCallback(const WeakCallbackInfo& data) { CallbackInfo* self = data.GetParameter(); self->WeakCallback(data.GetIsolate()); delete self; } - void CallbackInfo::WeakCallback(Isolate* isolate) { callback_(data_, hint_); int64_t change_in_bytes = -static_cast(sizeof(*this)); isolate->AdjustAmountOfExternalAllocatedMemory(change_in_bytes); } - // Parse index for external array data. An empty Maybe indicates // a pending exception. `false` indicates that the index is out-of-bounds. inline MUST_USE_RESULT Maybe ParseArrayIndex(Environment* env, @@ -176,17 +169,14 @@ inline MUST_USE_RESULT Maybe ParseArrayIndex(Environment* env, } int64_t tmp_i; - if (!arg->IntegerValue(env->context()).To(&tmp_i)) - return Nothing(); + if (!arg->IntegerValue(env->context()).To(&tmp_i)) return Nothing(); - if (tmp_i < 0) - return Just(false); + if (tmp_i < 0) return Just(false); // Check that the result fits in a size_t. const uint64_t kSizeMax = static_cast(static_cast(-1)); // coverity[pointless_expression] - if (static_cast(tmp_i) > kSizeMax) - return Just(false); + if (static_cast(tmp_i) > kSizeMax) return Just(false); *ret = static_cast(tmp_i); return Just(true); @@ -200,12 +190,10 @@ bool HasInstance(Local val) { return val->IsArrayBufferView(); } - bool HasInstance(Local obj) { return obj->IsArrayBufferView(); } - char* Data(Local val) { CHECK(val->IsArrayBufferView()); Local ui = val.As(); @@ -213,7 +201,6 @@ char* Data(Local val) { return static_cast(ab_c.Data()) + ui->ByteOffset(); } - char* Data(Local obj) { CHECK(obj->IsArrayBufferView()); Local ui = obj.As(); @@ -221,21 +208,18 @@ char* Data(Local obj) { return static_cast(ab_c.Data()) + ui->ByteOffset(); } - size_t Length(Local val) { CHECK(val->IsArrayBufferView()); Local ui = val.As(); return ui->ByteLength(); } - size_t Length(Local obj) { CHECK(obj->IsArrayBufferView()); Local ui = obj.As(); return ui->ByteLength(); } - MaybeLocal New(Isolate* isolate, Local string, enum encoding enc) { @@ -267,15 +251,13 @@ MaybeLocal New(Isolate* isolate, } Local buf; - if (New(isolate, data, actual).ToLocal(&buf)) - return scope.Escape(buf); + if (New(isolate, data, actual).ToLocal(&buf)) return scope.Escape(buf); // Object failed to be created. Clean up resources. free(data); return Local(); } - MaybeLocal New(Isolate* isolate, size_t length) { EscapableHandleScope handle_scope(isolate); Local obj; @@ -284,12 +266,10 @@ MaybeLocal New(Isolate* isolate, size_t length) { THROW_ERR_BUFFER_CONTEXT_NOT_AVAILABLE(isolate); return MaybeLocal(); } - if (Buffer::New(env, length).ToLocal(&obj)) - return handle_scope.Escape(obj); + if (Buffer::New(env, length).ToLocal(&obj)) return handle_scope.Escape(obj); return Local(); } - MaybeLocal New(Environment* env, size_t length) { EscapableHandleScope scope(env->isolate()); @@ -310,18 +290,13 @@ MaybeLocal New(Environment* env, size_t length) { data = nullptr; } - Local ab = - ArrayBuffer::New(env->isolate(), - data, - length, - ArrayBufferCreationMode::kInternalized); + Local ab = ArrayBuffer::New( + env->isolate(), data, length, ArrayBufferCreationMode::kInternalized); Local obj; - if (Buffer::New(env, ab, 0, length).ToLocal(&obj)) - return scope.Escape(obj); + if (Buffer::New(env, ab, 0, length).ToLocal(&obj)) return scope.Escape(obj); return Local(); } - MaybeLocal Copy(Isolate* isolate, const char* data, size_t length) { EscapableHandleScope handle_scope(isolate); Environment* env = Environment::GetCurrent(isolate); @@ -335,7 +310,6 @@ MaybeLocal Copy(Isolate* isolate, const char* data, size_t length) { return Local(); } - MaybeLocal Copy(Environment* env, const char* data, size_t length) { EscapableHandleScope scope(env->isolate()); @@ -358,18 +332,13 @@ MaybeLocal Copy(Environment* env, const char* data, size_t length) { new_data = nullptr; } - Local ab = - ArrayBuffer::New(env->isolate(), - new_data, - length, - ArrayBufferCreationMode::kInternalized); + Local ab = ArrayBuffer::New( + env->isolate(), new_data, length, ArrayBufferCreationMode::kInternalized); Local obj; - if (Buffer::New(env, ab, 0, length).ToLocal(&obj)) - return scope.Escape(obj); + if (Buffer::New(env, ab, 0, length).ToLocal(&obj)) return scope.Escape(obj); return Local(); } - MaybeLocal New(Isolate* isolate, char* data, size_t length, @@ -388,7 +357,6 @@ MaybeLocal New(Isolate* isolate, return Local(); } - MaybeLocal New(Environment* env, char* data, size_t length, @@ -407,13 +375,11 @@ MaybeLocal New(Environment* env, CallbackInfo::New(env->isolate(), ab, callback, data, hint); - if (ui.IsEmpty()) - return MaybeLocal(); + if (ui.IsEmpty()) return MaybeLocal(); return scope.Escape(ui.ToLocalChecked()); } - MaybeLocal New(Isolate* isolate, char* data, size_t length) { EscapableHandleScope handle_scope(isolate); Environment* env = Environment::GetCurrent(isolate); @@ -428,18 +394,14 @@ MaybeLocal New(Isolate* isolate, char* data, size_t length) { return Local(); } - MaybeLocal New(Environment* env, char* data, size_t length) { if (length > 0) { CHECK_NOT_NULL(data); CHECK(length <= kMaxLength); } - Local ab = - ArrayBuffer::New(env->isolate(), - data, - length, - ArrayBufferCreationMode::kInternalized); + Local ab = ArrayBuffer::New( + env->isolate(), data, length, ArrayBufferCreationMode::kInternalized); return Buffer::New(env, ab, 0, length).FromMaybe(Local()); } @@ -449,15 +411,13 @@ void CreateFromString(const FunctionCallbackInfo& args) { CHECK(args[0]->IsString()); CHECK(args[1]->IsString()); - enum encoding enc = ParseEncoding(args.GetIsolate(), - args[1].As(), - UTF8); + enum encoding enc = + ParseEncoding(args.GetIsolate(), args[1].As(), UTF8); Local buf; if (New(args.GetIsolate(), args[0].As(), enc).ToLocal(&buf)) args.GetReturnValue().Set(buf); } - template void StringSlice(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -466,18 +426,13 @@ void StringSlice(const FunctionCallbackInfo& args) { THROW_AND_RETURN_UNLESS_BUFFER(env, args.This()); SPREAD_BUFFER_ARG(args.This(), ts_obj); - if (ts_obj_length == 0) - return args.GetReturnValue().SetEmptyString(); + if (ts_obj_length == 0) return args.GetReturnValue().SetEmptyString(); SLICE_START_END(env, args[0], args[1], ts_obj_length) Local error; - MaybeLocal ret = - StringBytes::Encode(isolate, - ts_obj_data + start, - length, - encoding, - &error); + MaybeLocal ret = StringBytes::Encode( + isolate, ts_obj_data + start, length, encoding, &error); if (ret.IsEmpty()) { CHECK(!error.IsEmpty()); isolate->ThrowException(error); @@ -486,9 +441,8 @@ void StringSlice(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(ret.ToLocalChecked()); } - // bytesCopied = copy(buffer, target[, targetStart][, sourceStart][, sourceEnd]) -void Copy(const FunctionCallbackInfo &args) { +void Copy(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); THROW_AND_RETURN_UNLESS_BUFFER(env, args[0]); @@ -504,8 +458,8 @@ void Copy(const FunctionCallbackInfo &args) { THROW_AND_RETURN_IF_OOB(ParseArrayIndex(env, args[2], 0, &target_start)); THROW_AND_RETURN_IF_OOB(ParseArrayIndex(env, args[3], 0, &source_start)); - THROW_AND_RETURN_IF_OOB(ParseArrayIndex(env, args[4], ts_obj_length, - &source_end)); + THROW_AND_RETURN_IF_OOB( + ParseArrayIndex(env, args[4], ts_obj_length, &source_end)); // Copy 0 bytes; we're done if (target_start >= target_length || source_start >= source_end) @@ -518,15 +472,14 @@ void Copy(const FunctionCallbackInfo &args) { if (source_end - source_start > target_length - target_start) source_end = source_start + target_length - target_start; - uint32_t to_copy = MIN(MIN(source_end - source_start, - target_length - target_start), - ts_obj_length - source_start); + uint32_t to_copy = + MIN(MIN(source_end - source_start, target_length - target_start), + ts_obj_length - source_start); memmove(target_data + target_start, ts_obj_data + source_start, to_copy); args.GetReturnValue().Set(to_copy); } - void Fill(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); Local ctx = env->context(); @@ -594,18 +547,16 @@ void Fill(const FunctionCallbackInfo& args) { nullptr); } - start_fill: +start_fill: - if (str_length >= fill_length) - return; + if (str_length >= fill_length) return; // If str_length is zero, then either an empty buffer was provided, or Write() // indicated that no bytes could be written. If no bytes could be written, // then return -1 because the fill value is invalid. This will trigger a throw // in JavaScript. Silently failing should be avoided because it can lead to // buffers with unexpected contents. - if (str_length == 0) - return args.GetReturnValue().Set(-1); + if (str_length == 0) return args.GetReturnValue().Set(-1); size_t in_there = str_length; char* ptr = ts_obj_data + start + str_length; @@ -621,7 +572,6 @@ void Fill(const FunctionCallbackInfo& args) { } } - template void StringWrite(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -642,24 +592,19 @@ void StringWrite(const FunctionCallbackInfo& args) { env, "\"offset\" is outside of buffer bounds"); } - THROW_AND_RETURN_IF_OOB(ParseArrayIndex(env, args[2], ts_obj_length - offset, - &max_length)); + THROW_AND_RETURN_IF_OOB( + ParseArrayIndex(env, args[2], ts_obj_length - offset, &max_length)); max_length = MIN(ts_obj_length - offset, max_length); - if (max_length == 0) - return args.GetReturnValue().Set(0); + if (max_length == 0) return args.GetReturnValue().Set(0); - uint32_t written = StringBytes::Write(env->isolate(), - ts_obj_data + offset, - max_length, - str, - encoding, - nullptr); + uint32_t written = StringBytes::Write( + env->isolate(), ts_obj_data + offset, max_length, str, encoding, nullptr); args.GetReturnValue().Set(written); } -void ByteLengthUtf8(const FunctionCallbackInfo &args) { +void ByteLengthUtf8(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); CHECK(args[0]->IsString()); @@ -684,7 +629,7 @@ static int normalizeCompareVal(int val, size_t a_length, size_t b_length) { return val; } -void CompareOffset(const FunctionCallbackInfo &args) { +void CompareOffset(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); THROW_AND_RETURN_UNLESS_BUFFER(env, args[0]); @@ -699,10 +644,10 @@ void CompareOffset(const FunctionCallbackInfo &args) { THROW_AND_RETURN_IF_OOB(ParseArrayIndex(env, args[2], 0, &target_start)); THROW_AND_RETURN_IF_OOB(ParseArrayIndex(env, args[3], 0, &source_start)); - THROW_AND_RETURN_IF_OOB(ParseArrayIndex(env, args[4], target_length, - &target_end)); - THROW_AND_RETURN_IF_OOB(ParseArrayIndex(env, args[5], ts_obj_length, - &source_end)); + THROW_AND_RETURN_IF_OOB( + ParseArrayIndex(env, args[4], target_length, &target_end)); + THROW_AND_RETURN_IF_OOB( + ParseArrayIndex(env, args[5], ts_obj_length, &source_end)); if (source_start > ts_obj_length) return THROW_ERR_OUT_OF_RANGE( @@ -714,21 +659,20 @@ void CompareOffset(const FunctionCallbackInfo &args) { CHECK_LE(source_start, source_end); CHECK_LE(target_start, target_end); - size_t to_cmp = MIN(MIN(source_end - source_start, - target_end - target_start), + size_t to_cmp = MIN(MIN(source_end - source_start, target_end - target_start), ts_obj_length - source_start); - int val = normalizeCompareVal(to_cmp > 0 ? - memcmp(ts_obj_data + source_start, - target_data + target_start, - to_cmp) : 0, + int val = normalizeCompareVal(to_cmp > 0 ? memcmp(ts_obj_data + source_start, + target_data + target_start, + to_cmp) + : 0, source_end - source_start, target_end - target_start); args.GetReturnValue().Set(val); } -void Compare(const FunctionCallbackInfo &args) { +void Compare(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); THROW_AND_RETURN_UNLESS_BUFFER(env, args[0]); @@ -738,13 +682,13 @@ void Compare(const FunctionCallbackInfo &args) { size_t cmp_length = MIN(obj_a_length, obj_b_length); - int val = normalizeCompareVal(cmp_length > 0 ? - memcmp(obj_a_data, obj_b_data, cmp_length) : 0, - obj_a_length, obj_b_length); + int val = normalizeCompareVal( + cmp_length > 0 ? memcmp(obj_a_data, obj_b_data, cmp_length) : 0, + obj_a_length, + obj_b_length); args.GetReturnValue().Set(val); } - // Computes the offset for starting an indexOf or lastIndexOf search. // Returns either a valid offset in [0...], ie inside the Buffer, // or -1 to signal that there is no possible match. @@ -800,16 +744,15 @@ void IndexOfString(const FunctionCallbackInfo& args) { const char* haystack = ts_obj_data; // Round down to the nearest multiple of 2 in case of UCS2. - const size_t haystack_length = (enc == UCS2) ? - ts_obj_length &~ 1 : ts_obj_length; // NOLINT(whitespace/operators) + const size_t haystack_length = + (enc == UCS2) ? ts_obj_length & ~1 + : ts_obj_length; // NOLINT(whitespace/operators) size_t needle_length; if (!StringBytes::Size(isolate, needle, enc).To(&needle_length)) return; - int64_t opt_offset = IndexOfOffset(haystack_length, - offset_i64, - needle_length, - is_forward); + int64_t opt_offset = + IndexOfOffset(haystack_length, offset_i64, needle_length, is_forward); if (needle_length == 0) { // Match String#indexOf() and String#lastIndexOf() behavior. @@ -835,8 +778,7 @@ void IndexOfString(const FunctionCallbackInfo& args) { if (enc == UCS2) { String::Value needle_value(isolate, needle); - if (*needle_value == nullptr) - return args.GetReturnValue().Set(-1); + if (*needle_value == nullptr) return args.GetReturnValue().Set(-1); if (haystack_length < 2 || needle_value.length() < 1) { return args.GetReturnValue().Set(-1); @@ -848,8 +790,7 @@ void IndexOfString(const FunctionCallbackInfo& args) { const uint16_t* decoded_string = reinterpret_cast(decoder.out()); - if (decoded_string == nullptr) - return args.GetReturnValue().Set(-1); + if (decoded_string == nullptr) return args.GetReturnValue().Set(-1); result = SearchString(reinterpret_cast(haystack), haystack_length / 2, @@ -868,8 +809,7 @@ void IndexOfString(const FunctionCallbackInfo& args) { result *= 2; } else if (enc == UTF8) { String::Utf8Value needle_value(isolate, needle); - if (*needle_value == nullptr) - return args.GetReturnValue().Set(-1); + if (*needle_value == nullptr) return args.GetReturnValue().Set(-1); result = SearchString(reinterpret_cast(haystack), haystack_length, @@ -903,9 +843,7 @@ void IndexOfBuffer(const FunctionCallbackInfo& args) { CHECK(args[2]->IsNumber()); CHECK(args[4]->IsBoolean()); - enum encoding enc = ParseEncoding(args.GetIsolate(), - args[3], - UTF8); + enum encoding enc = ParseEncoding(args.GetIsolate(), args[3], UTF8); THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[0]); THROW_AND_RETURN_UNLESS_BUFFER(Environment::GetCurrent(args), args[1]); @@ -919,10 +857,8 @@ void IndexOfBuffer(const FunctionCallbackInfo& args) { const char* needle = buf_data; const size_t needle_length = buf_length; - int64_t opt_offset = IndexOfOffset(haystack_length, - offset_i64, - needle_length, - is_forward); + int64_t opt_offset = + IndexOfOffset(haystack_length, offset_i64, needle_length, is_forward); if (needle_length == 0) { // Match String#indexOf() and String#lastIndexOf() behavior. @@ -950,22 +886,20 @@ void IndexOfBuffer(const FunctionCallbackInfo& args) { if (haystack_length < 2 || needle_length < 2) { return args.GetReturnValue().Set(-1); } - result = SearchString( - reinterpret_cast(haystack), - haystack_length / 2, - reinterpret_cast(needle), - needle_length / 2, - offset / 2, - is_forward); + result = SearchString(reinterpret_cast(haystack), + haystack_length / 2, + reinterpret_cast(needle), + needle_length / 2, + offset / 2, + is_forward); result *= 2; } else { - result = SearchString( - reinterpret_cast(haystack), - haystack_length, - reinterpret_cast(needle), - needle_length, - offset, - is_forward); + result = SearchString(reinterpret_cast(haystack), + haystack_length, + reinterpret_cast(needle), + needle_length, + offset, + is_forward); } args.GetReturnValue().Set( @@ -1002,7 +936,6 @@ void IndexOfNumber(const FunctionCallbackInfo& args) { : -1); } - void Swap16(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); THROW_AND_RETURN_UNLESS_BUFFER(env, args[0]); @@ -1011,7 +944,6 @@ void Swap16(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(args[0]); } - void Swap32(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); THROW_AND_RETURN_UNLESS_BUFFER(env, args[0]); @@ -1020,7 +952,6 @@ void Swap32(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(args[0]); } - void Swap64(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); THROW_AND_RETURN_UNLESS_BUFFER(env, args[0]); @@ -1029,7 +960,6 @@ void Swap64(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(args[0]); } - // Encode a single string to a UTF-8 Uint8Array (not Buffer). // Used in TextEncoder.prototype.encode. static void EncodeUtf8String(const FunctionCallbackInfo& args) { @@ -1052,7 +982,6 @@ static void EncodeUtf8String(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(array); } - void SetBufferPrototype(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -1061,7 +990,6 @@ void SetBufferPrototype(const FunctionCallbackInfo& args) { env->set_buffer_prototype_object(proto); } - void Initialize(Local target, Local unused, Local context, @@ -1086,13 +1014,17 @@ void Initialize(Local target, env->SetMethodNoSideEffect(target, "encodeUtf8String", EncodeUtf8String); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "kMaxLength"), - Integer::NewFromUnsigned(env->isolate(), kMaxLength)).FromJust(); - - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "kStringMaxLength"), - Integer::New(env->isolate(), String::kMaxLength)).FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "kMaxLength"), + Integer::NewFromUnsigned(env->isolate(), kMaxLength)) + .FromJust(); + + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "kStringMaxLength"), + Integer::New(env->isolate(), String::kMaxLength)) + .FromJust(); env->SetMethodNoSideEffect(target, "asciiSlice", StringSlice); env->SetMethodNoSideEffect(target, "base64Slice", StringSlice); diff --git a/src/node_buffer.h b/src/node_buffer.h index 122afc37709f73..548a7287216461 100644 --- a/src/node_buffer.h +++ b/src/node_buffer.h @@ -69,12 +69,10 @@ NODE_EXTERN v8::MaybeLocal New(v8::Isolate* isolate, static inline bool IsWithinBounds(size_t off, size_t len, size_t max) { // Asking to seek too far into the buffer // check to avoid wrapping in subsequent subtraction - if (off > max) - return false; + if (off > max) return false; // Asking for more than is left over in the buffer - if (max - off < len) - return false; + if (max - off < len) return false; // Otherwise we're in bounds return true; diff --git a/src/node_config.cc b/src/node_config.cc index 56672308d1bc1e..d24420b3db6af7 100644 --- a/src/node_config.cc +++ b/src/node_config.cc @@ -72,9 +72,8 @@ static void Initialize(Local target, if (env->abort_on_uncaught_exception()) READONLY_TRUE_PROPERTY(target, "shouldAbortOnUncaughtException"); - READONLY_PROPERTY(target, - "bits", - Number::New(env->isolate(), 8 * sizeof(intptr_t))); + READONLY_PROPERTY( + target, "bits", Number::New(env->isolate(), 8 * sizeof(intptr_t))); Local debug_options_obj = Object::New(isolate); READONLY_PROPERTY(target, "debugOptions", debug_options_obj); diff --git a/src/node_constants.cc b/src/node_constants.cc index debcf0e10045a1..352e92fec8a97e 100644 --- a/src/node_constants.cc +++ b/src/node_constants.cc @@ -30,16 +30,16 @@ #endif #include #include -#include #include +#include #include #if HAVE_OPENSSL -# include -# include -# ifndef OPENSSL_NO_ENGINE -# include -# endif // !OPENSSL_NO_ENGINE +#include +#include +#ifndef OPENSSL_NO_ENGINE +#include +#endif // !OPENSSL_NO_ENGINE #endif #if defined(__POSIX__) @@ -676,7 +676,6 @@ void DefineSignalConstants(Local target) { NODE_DEFINE_CONSTANT(target, SIGSTKFLT); #endif - #ifdef SIGCONT NODE_DEFINE_CONSTANT(target, SIGCONT); #endif @@ -756,286 +755,286 @@ void DefineSignalConstants(Local target) { void DefinePriorityConstants(Local target) { #ifdef UV_PRIORITY_LOW -# define PRIORITY_LOW UV_PRIORITY_LOW +#define PRIORITY_LOW UV_PRIORITY_LOW NODE_DEFINE_CONSTANT(target, PRIORITY_LOW); -# undef PRIORITY_LOW +#undef PRIORITY_LOW #endif #ifdef UV_PRIORITY_BELOW_NORMAL -# define PRIORITY_BELOW_NORMAL UV_PRIORITY_BELOW_NORMAL +#define PRIORITY_BELOW_NORMAL UV_PRIORITY_BELOW_NORMAL NODE_DEFINE_CONSTANT(target, PRIORITY_BELOW_NORMAL); -# undef PRIORITY_BELOW_NORMAL +#undef PRIORITY_BELOW_NORMAL #endif #ifdef UV_PRIORITY_NORMAL -# define PRIORITY_NORMAL UV_PRIORITY_NORMAL +#define PRIORITY_NORMAL UV_PRIORITY_NORMAL NODE_DEFINE_CONSTANT(target, PRIORITY_NORMAL); -# undef PRIORITY_NORMAL +#undef PRIORITY_NORMAL #endif #ifdef UV_PRIORITY_ABOVE_NORMAL -# define PRIORITY_ABOVE_NORMAL UV_PRIORITY_ABOVE_NORMAL +#define PRIORITY_ABOVE_NORMAL UV_PRIORITY_ABOVE_NORMAL NODE_DEFINE_CONSTANT(target, PRIORITY_ABOVE_NORMAL); -# undef PRIORITY_ABOVE_NORMAL +#undef PRIORITY_ABOVE_NORMAL #endif #ifdef UV_PRIORITY_HIGH -# define PRIORITY_HIGH UV_PRIORITY_HIGH +#define PRIORITY_HIGH UV_PRIORITY_HIGH NODE_DEFINE_CONSTANT(target, PRIORITY_HIGH); -# undef PRIORITY_HIGH +#undef PRIORITY_HIGH #endif #ifdef UV_PRIORITY_HIGHEST -# define PRIORITY_HIGHEST UV_PRIORITY_HIGHEST +#define PRIORITY_HIGHEST UV_PRIORITY_HIGHEST NODE_DEFINE_CONSTANT(target, PRIORITY_HIGHEST); -# undef PRIORITY_HIGHEST +#undef PRIORITY_HIGHEST #endif } void DefineOpenSSLConstants(Local target) { #ifdef OPENSSL_VERSION_NUMBER - NODE_DEFINE_CONSTANT(target, OPENSSL_VERSION_NUMBER); + NODE_DEFINE_CONSTANT(target, OPENSSL_VERSION_NUMBER); #endif #ifdef SSL_OP_ALL - NODE_DEFINE_CONSTANT(target, SSL_OP_ALL); + NODE_DEFINE_CONSTANT(target, SSL_OP_ALL); #endif #ifdef SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION - NODE_DEFINE_CONSTANT(target, SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION); + NODE_DEFINE_CONSTANT(target, SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION); #endif #ifdef SSL_OP_CIPHER_SERVER_PREFERENCE - NODE_DEFINE_CONSTANT(target, SSL_OP_CIPHER_SERVER_PREFERENCE); + NODE_DEFINE_CONSTANT(target, SSL_OP_CIPHER_SERVER_PREFERENCE); #endif #ifdef SSL_OP_CISCO_ANYCONNECT - NODE_DEFINE_CONSTANT(target, SSL_OP_CISCO_ANYCONNECT); + NODE_DEFINE_CONSTANT(target, SSL_OP_CISCO_ANYCONNECT); #endif #ifdef SSL_OP_COOKIE_EXCHANGE - NODE_DEFINE_CONSTANT(target, SSL_OP_COOKIE_EXCHANGE); + NODE_DEFINE_CONSTANT(target, SSL_OP_COOKIE_EXCHANGE); #endif #ifdef SSL_OP_CRYPTOPRO_TLSEXT_BUG - NODE_DEFINE_CONSTANT(target, SSL_OP_CRYPTOPRO_TLSEXT_BUG); + NODE_DEFINE_CONSTANT(target, SSL_OP_CRYPTOPRO_TLSEXT_BUG); #endif #ifdef SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS - NODE_DEFINE_CONSTANT(target, SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS); + NODE_DEFINE_CONSTANT(target, SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS); #endif #ifdef SSL_OP_EPHEMERAL_RSA - NODE_DEFINE_CONSTANT(target, SSL_OP_EPHEMERAL_RSA); + NODE_DEFINE_CONSTANT(target, SSL_OP_EPHEMERAL_RSA); #endif #ifdef SSL_OP_LEGACY_SERVER_CONNECT - NODE_DEFINE_CONSTANT(target, SSL_OP_LEGACY_SERVER_CONNECT); + NODE_DEFINE_CONSTANT(target, SSL_OP_LEGACY_SERVER_CONNECT); #endif #ifdef SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER - NODE_DEFINE_CONSTANT(target, SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER); + NODE_DEFINE_CONSTANT(target, SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER); #endif #ifdef SSL_OP_MICROSOFT_SESS_ID_BUG - NODE_DEFINE_CONSTANT(target, SSL_OP_MICROSOFT_SESS_ID_BUG); + NODE_DEFINE_CONSTANT(target, SSL_OP_MICROSOFT_SESS_ID_BUG); #endif #ifdef SSL_OP_MSIE_SSLV2_RSA_PADDING - NODE_DEFINE_CONSTANT(target, SSL_OP_MSIE_SSLV2_RSA_PADDING); + NODE_DEFINE_CONSTANT(target, SSL_OP_MSIE_SSLV2_RSA_PADDING); #endif #ifdef SSL_OP_NETSCAPE_CA_DN_BUG - NODE_DEFINE_CONSTANT(target, SSL_OP_NETSCAPE_CA_DN_BUG); + NODE_DEFINE_CONSTANT(target, SSL_OP_NETSCAPE_CA_DN_BUG); #endif #ifdef SSL_OP_NETSCAPE_CHALLENGE_BUG - NODE_DEFINE_CONSTANT(target, SSL_OP_NETSCAPE_CHALLENGE_BUG); + NODE_DEFINE_CONSTANT(target, SSL_OP_NETSCAPE_CHALLENGE_BUG); #endif #ifdef SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG - NODE_DEFINE_CONSTANT(target, SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG); + NODE_DEFINE_CONSTANT(target, SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG); #endif #ifdef SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG - NODE_DEFINE_CONSTANT(target, SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG); + NODE_DEFINE_CONSTANT(target, SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG); #endif #ifdef SSL_OP_NO_COMPRESSION - NODE_DEFINE_CONSTANT(target, SSL_OP_NO_COMPRESSION); + NODE_DEFINE_CONSTANT(target, SSL_OP_NO_COMPRESSION); #endif #ifdef SSL_OP_NO_QUERY_MTU - NODE_DEFINE_CONSTANT(target, SSL_OP_NO_QUERY_MTU); + NODE_DEFINE_CONSTANT(target, SSL_OP_NO_QUERY_MTU); #endif #ifdef SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION - NODE_DEFINE_CONSTANT(target, SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION); + NODE_DEFINE_CONSTANT(target, SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION); #endif #ifdef SSL_OP_NO_SSLv2 - NODE_DEFINE_CONSTANT(target, SSL_OP_NO_SSLv2); + NODE_DEFINE_CONSTANT(target, SSL_OP_NO_SSLv2); #endif #ifdef SSL_OP_NO_SSLv3 - NODE_DEFINE_CONSTANT(target, SSL_OP_NO_SSLv3); + NODE_DEFINE_CONSTANT(target, SSL_OP_NO_SSLv3); #endif #ifdef SSL_OP_NO_TICKET - NODE_DEFINE_CONSTANT(target, SSL_OP_NO_TICKET); + NODE_DEFINE_CONSTANT(target, SSL_OP_NO_TICKET); #endif #ifdef SSL_OP_NO_TLSv1 - NODE_DEFINE_CONSTANT(target, SSL_OP_NO_TLSv1); + NODE_DEFINE_CONSTANT(target, SSL_OP_NO_TLSv1); #endif #ifdef SSL_OP_NO_TLSv1_1 - NODE_DEFINE_CONSTANT(target, SSL_OP_NO_TLSv1_1); + NODE_DEFINE_CONSTANT(target, SSL_OP_NO_TLSv1_1); #endif #ifdef SSL_OP_NO_TLSv1_2 - NODE_DEFINE_CONSTANT(target, SSL_OP_NO_TLSv1_2); + NODE_DEFINE_CONSTANT(target, SSL_OP_NO_TLSv1_2); #endif #ifdef SSL_OP_PKCS1_CHECK_1 - NODE_DEFINE_CONSTANT(target, SSL_OP_PKCS1_CHECK_1); + NODE_DEFINE_CONSTANT(target, SSL_OP_PKCS1_CHECK_1); #endif #ifdef SSL_OP_PKCS1_CHECK_2 - NODE_DEFINE_CONSTANT(target, SSL_OP_PKCS1_CHECK_2); + NODE_DEFINE_CONSTANT(target, SSL_OP_PKCS1_CHECK_2); #endif #ifdef SSL_OP_SINGLE_DH_USE - NODE_DEFINE_CONSTANT(target, SSL_OP_SINGLE_DH_USE); + NODE_DEFINE_CONSTANT(target, SSL_OP_SINGLE_DH_USE); #endif #ifdef SSL_OP_SINGLE_ECDH_USE - NODE_DEFINE_CONSTANT(target, SSL_OP_SINGLE_ECDH_USE); + NODE_DEFINE_CONSTANT(target, SSL_OP_SINGLE_ECDH_USE); #endif #ifdef SSL_OP_SSLEAY_080_CLIENT_DH_BUG - NODE_DEFINE_CONSTANT(target, SSL_OP_SSLEAY_080_CLIENT_DH_BUG); + NODE_DEFINE_CONSTANT(target, SSL_OP_SSLEAY_080_CLIENT_DH_BUG); #endif #ifdef SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG - NODE_DEFINE_CONSTANT(target, SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG); + NODE_DEFINE_CONSTANT(target, SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG); #endif #ifdef SSL_OP_TLS_BLOCK_PADDING_BUG - NODE_DEFINE_CONSTANT(target, SSL_OP_TLS_BLOCK_PADDING_BUG); + NODE_DEFINE_CONSTANT(target, SSL_OP_TLS_BLOCK_PADDING_BUG); #endif #ifdef SSL_OP_TLS_D5_BUG - NODE_DEFINE_CONSTANT(target, SSL_OP_TLS_D5_BUG); + NODE_DEFINE_CONSTANT(target, SSL_OP_TLS_D5_BUG); #endif #ifdef SSL_OP_TLS_ROLLBACK_BUG - NODE_DEFINE_CONSTANT(target, SSL_OP_TLS_ROLLBACK_BUG); + NODE_DEFINE_CONSTANT(target, SSL_OP_TLS_ROLLBACK_BUG); #endif -# ifndef OPENSSL_NO_ENGINE +#ifndef OPENSSL_NO_ENGINE -# ifdef ENGINE_METHOD_RSA - NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_RSA); -# endif +#ifdef ENGINE_METHOD_RSA + NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_RSA); +#endif -# ifdef ENGINE_METHOD_DSA - NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_DSA); -# endif +#ifdef ENGINE_METHOD_DSA + NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_DSA); +#endif -# ifdef ENGINE_METHOD_DH - NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_DH); -# endif +#ifdef ENGINE_METHOD_DH + NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_DH); +#endif -# ifdef ENGINE_METHOD_RAND - NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_RAND); -# endif +#ifdef ENGINE_METHOD_RAND + NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_RAND); +#endif -# ifdef ENGINE_METHOD_EC - NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_EC); -# endif +#ifdef ENGINE_METHOD_EC + NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_EC); +#endif -# ifdef ENGINE_METHOD_CIPHERS - NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_CIPHERS); -# endif +#ifdef ENGINE_METHOD_CIPHERS + NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_CIPHERS); +#endif -# ifdef ENGINE_METHOD_DIGESTS - NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_DIGESTS); -# endif +#ifdef ENGINE_METHOD_DIGESTS + NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_DIGESTS); +#endif -# ifdef ENGINE_METHOD_PKEY_METHS - NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_PKEY_METHS); -# endif +#ifdef ENGINE_METHOD_PKEY_METHS + NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_PKEY_METHS); +#endif -# ifdef ENGINE_METHOD_PKEY_ASN1_METHS - NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_PKEY_ASN1_METHS); -# endif +#ifdef ENGINE_METHOD_PKEY_ASN1_METHS + NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_PKEY_ASN1_METHS); +#endif -# ifdef ENGINE_METHOD_ALL - NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_ALL); -# endif +#ifdef ENGINE_METHOD_ALL + NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_ALL); +#endif -# ifdef ENGINE_METHOD_NONE - NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_NONE); -# endif +#ifdef ENGINE_METHOD_NONE + NODE_DEFINE_CONSTANT(target, ENGINE_METHOD_NONE); +#endif -# endif // !OPENSSL_NO_ENGINE +#endif // !OPENSSL_NO_ENGINE #ifdef DH_CHECK_P_NOT_SAFE_PRIME - NODE_DEFINE_CONSTANT(target, DH_CHECK_P_NOT_SAFE_PRIME); + NODE_DEFINE_CONSTANT(target, DH_CHECK_P_NOT_SAFE_PRIME); #endif #ifdef DH_CHECK_P_NOT_PRIME - NODE_DEFINE_CONSTANT(target, DH_CHECK_P_NOT_PRIME); + NODE_DEFINE_CONSTANT(target, DH_CHECK_P_NOT_PRIME); #endif #ifdef DH_UNABLE_TO_CHECK_GENERATOR - NODE_DEFINE_CONSTANT(target, DH_UNABLE_TO_CHECK_GENERATOR); + NODE_DEFINE_CONSTANT(target, DH_UNABLE_TO_CHECK_GENERATOR); #endif #ifdef DH_NOT_SUITABLE_GENERATOR - NODE_DEFINE_CONSTANT(target, DH_NOT_SUITABLE_GENERATOR); + NODE_DEFINE_CONSTANT(target, DH_NOT_SUITABLE_GENERATOR); #endif #ifdef TLSEXT_TYPE_application_layer_protocol_negotiation #define ALPN_ENABLED 1 - NODE_DEFINE_CONSTANT(target, ALPN_ENABLED); + NODE_DEFINE_CONSTANT(target, ALPN_ENABLED); #endif #ifdef RSA_PKCS1_PADDING - NODE_DEFINE_CONSTANT(target, RSA_PKCS1_PADDING); + NODE_DEFINE_CONSTANT(target, RSA_PKCS1_PADDING); #endif #ifdef RSA_SSLV23_PADDING - NODE_DEFINE_CONSTANT(target, RSA_SSLV23_PADDING); + NODE_DEFINE_CONSTANT(target, RSA_SSLV23_PADDING); #endif #ifdef RSA_NO_PADDING - NODE_DEFINE_CONSTANT(target, RSA_NO_PADDING); + NODE_DEFINE_CONSTANT(target, RSA_NO_PADDING); #endif #ifdef RSA_PKCS1_OAEP_PADDING - NODE_DEFINE_CONSTANT(target, RSA_PKCS1_OAEP_PADDING); + NODE_DEFINE_CONSTANT(target, RSA_PKCS1_OAEP_PADDING); #endif #ifdef RSA_X931_PADDING - NODE_DEFINE_CONSTANT(target, RSA_X931_PADDING); + NODE_DEFINE_CONSTANT(target, RSA_X931_PADDING); #endif #ifdef RSA_PKCS1_PSS_PADDING - NODE_DEFINE_CONSTANT(target, RSA_PKCS1_PSS_PADDING); + NODE_DEFINE_CONSTANT(target, RSA_PKCS1_PSS_PADDING); #endif #ifdef RSA_PSS_SALTLEN_DIGEST - NODE_DEFINE_CONSTANT(target, RSA_PSS_SALTLEN_DIGEST); + NODE_DEFINE_CONSTANT(target, RSA_PSS_SALTLEN_DIGEST); #endif #ifdef RSA_PSS_SALTLEN_MAX_SIGN - NODE_DEFINE_CONSTANT(target, RSA_PSS_SALTLEN_MAX_SIGN); + NODE_DEFINE_CONSTANT(target, RSA_PSS_SALTLEN_MAX_SIGN); #endif #ifdef RSA_PSS_SALTLEN_AUTO - NODE_DEFINE_CONSTANT(target, RSA_PSS_SALTLEN_AUTO); + NODE_DEFINE_CONSTANT(target, RSA_PSS_SALTLEN_AUTO); #endif #if HAVE_OPENSSL @@ -1130,7 +1129,6 @@ void DefineSystemConstants(Local target) { NODE_DEFINE_CONSTANT(target, O_DSYNC); #endif - #ifdef O_SYMLINK NODE_DEFINE_CONSTANT(target, O_SYMLINK); #endif @@ -1208,32 +1206,31 @@ void DefineSystemConstants(Local target) { #endif #ifdef UV_FS_COPYFILE_EXCL -# define COPYFILE_EXCL UV_FS_COPYFILE_EXCL +#define COPYFILE_EXCL UV_FS_COPYFILE_EXCL NODE_DEFINE_CONSTANT(target, UV_FS_COPYFILE_EXCL); NODE_DEFINE_CONSTANT(target, COPYFILE_EXCL); -# undef COPYFILE_EXCL +#undef COPYFILE_EXCL #endif #ifdef UV_FS_COPYFILE_FICLONE -# define COPYFILE_FICLONE UV_FS_COPYFILE_FICLONE +#define COPYFILE_FICLONE UV_FS_COPYFILE_FICLONE NODE_DEFINE_CONSTANT(target, UV_FS_COPYFILE_FICLONE); NODE_DEFINE_CONSTANT(target, COPYFILE_FICLONE); -# undef COPYFILE_FICLONE +#undef COPYFILE_FICLONE #endif #ifdef UV_FS_COPYFILE_FICLONE_FORCE -# define COPYFILE_FICLONE_FORCE UV_FS_COPYFILE_FICLONE_FORCE +#define COPYFILE_FICLONE_FORCE UV_FS_COPYFILE_FICLONE_FORCE NODE_DEFINE_CONSTANT(target, UV_FS_COPYFILE_FICLONE_FORCE); NODE_DEFINE_CONSTANT(target, COPYFILE_FICLONE_FORCE); -# undef COPYFILE_FICLONE_FORCE +#undef COPYFILE_FICLONE_FORCE #endif } void DefineCryptoConstants(Local target) { #if HAVE_OPENSSL - NODE_DEFINE_STRING_CONSTANT(target, - "defaultCoreCipherList", - DEFAULT_CIPHER_LIST_CORE); + NODE_DEFINE_STRING_CONSTANT( + target, "defaultCoreCipherList", DEFAULT_CIPHER_LIST_CORE); NODE_DEFINE_STRING_CONSTANT( target, "defaultCipherList", @@ -1303,40 +1300,40 @@ void DefineConstants(v8::Isolate* isolate, Local target) { Environment* env = Environment::GetCurrent(isolate); Local os_constants = Object::New(isolate); - CHECK(os_constants->SetPrototype(env->context(), - Null(env->isolate())).FromJust()); + CHECK(os_constants->SetPrototype(env->context(), Null(env->isolate())) + .FromJust()); Local err_constants = Object::New(isolate); - CHECK(err_constants->SetPrototype(env->context(), - Null(env->isolate())).FromJust()); + CHECK(err_constants->SetPrototype(env->context(), Null(env->isolate())) + .FromJust()); Local sig_constants = Object::New(isolate); - CHECK(sig_constants->SetPrototype(env->context(), - Null(env->isolate())).FromJust()); + CHECK(sig_constants->SetPrototype(env->context(), Null(env->isolate())) + .FromJust()); Local priority_constants = Object::New(isolate); - CHECK(priority_constants->SetPrototype(env->context(), - Null(env->isolate())).FromJust()); + CHECK(priority_constants->SetPrototype(env->context(), Null(env->isolate())) + .FromJust()); Local fs_constants = Object::New(isolate); - CHECK(fs_constants->SetPrototype(env->context(), - Null(env->isolate())).FromJust()); + CHECK(fs_constants->SetPrototype(env->context(), Null(env->isolate())) + .FromJust()); Local crypto_constants = Object::New(isolate); - CHECK(crypto_constants->SetPrototype(env->context(), - Null(env->isolate())).FromJust()); + CHECK(crypto_constants->SetPrototype(env->context(), Null(env->isolate())) + .FromJust()); Local zlib_constants = Object::New(isolate); - CHECK(zlib_constants->SetPrototype(env->context(), - Null(env->isolate())).FromJust()); + CHECK(zlib_constants->SetPrototype(env->context(), Null(env->isolate())) + .FromJust()); Local dlopen_constants = Object::New(isolate); - CHECK(dlopen_constants->SetPrototype(env->context(), - Null(env->isolate())).FromJust()); + CHECK(dlopen_constants->SetPrototype(env->context(), Null(env->isolate())) + .FromJust()); Local trace_constants = Object::New(isolate); - CHECK(trace_constants->SetPrototype(env->context(), - Null(env->isolate())).FromJust()); + CHECK(trace_constants->SetPrototype(env->context(), Null(env->isolate())) + .FromJust()); DefineErrnoConstants(err_constants); DefineWindowsErrorConstants(err_constants); @@ -1352,33 +1349,31 @@ void DefineConstants(v8::Isolate* isolate, Local target) { // Define libuv constants. NODE_DEFINE_CONSTANT(os_constants, UV_UDP_REUSEADDR); - os_constants->Set(env->context(), - OneByteString(isolate, "dlopen"), - dlopen_constants).FromJust(); - os_constants->Set(env->context(), - OneByteString(isolate, "errno"), - err_constants).FromJust(); - os_constants->Set(env->context(), - OneByteString(isolate, "signals"), - sig_constants).FromJust(); - os_constants->Set(env->context(), - OneByteString(isolate, "priority"), - priority_constants).FromJust(); - target->Set(env->context(), - OneByteString(isolate, "os"), - os_constants).FromJust(); - target->Set(env->context(), - OneByteString(isolate, "fs"), - fs_constants).FromJust(); - target->Set(env->context(), - OneByteString(isolate, "crypto"), - crypto_constants).FromJust(); - target->Set(env->context(), - OneByteString(isolate, "zlib"), - zlib_constants).FromJust(); - target->Set(env->context(), - OneByteString(isolate, "trace"), - trace_constants).FromJust(); + os_constants + ->Set(env->context(), OneByteString(isolate, "dlopen"), dlopen_constants) + .FromJust(); + os_constants + ->Set(env->context(), OneByteString(isolate, "errno"), err_constants) + .FromJust(); + os_constants + ->Set(env->context(), OneByteString(isolate, "signals"), sig_constants) + .FromJust(); + os_constants + ->Set(env->context(), + OneByteString(isolate, "priority"), + priority_constants) + .FromJust(); + target->Set(env->context(), OneByteString(isolate, "os"), os_constants) + .FromJust(); + target->Set(env->context(), OneByteString(isolate, "fs"), fs_constants) + .FromJust(); + target + ->Set(env->context(), OneByteString(isolate, "crypto"), crypto_constants) + .FromJust(); + target->Set(env->context(), OneByteString(isolate, "zlib"), zlib_constants) + .FromJust(); + target->Set(env->context(), OneByteString(isolate, "trace"), trace_constants) + .FromJust(); } } // namespace node diff --git a/src/node_constants.h b/src/node_constants.h index 6f73fb4d7d9bfc..0937d70c5ac9a5 100644 --- a/src/node_constants.h +++ b/src/node_constants.h @@ -41,27 +41,28 @@ #define RSA_PSS_SALTLEN_AUTO -2 #endif -#define DEFAULT_CIPHER_LIST_CORE "ECDHE-RSA-AES128-GCM-SHA256:" \ - "ECDHE-ECDSA-AES128-GCM-SHA256:" \ - "ECDHE-RSA-AES256-GCM-SHA384:" \ - "ECDHE-ECDSA-AES256-GCM-SHA384:" \ - "DHE-RSA-AES128-GCM-SHA256:" \ - "ECDHE-RSA-AES128-SHA256:" \ - "DHE-RSA-AES128-SHA256:" \ - "ECDHE-RSA-AES256-SHA384:" \ - "DHE-RSA-AES256-SHA384:" \ - "ECDHE-RSA-AES256-SHA256:" \ - "DHE-RSA-AES256-SHA256:" \ - "HIGH:" \ - "!aNULL:" \ - "!eNULL:" \ - "!EXPORT:" \ - "!DES:" \ - "!RC4:" \ - "!MD5:" \ - "!PSK:" \ - "!SRP:" \ - "!CAMELLIA" +#define DEFAULT_CIPHER_LIST_CORE \ + "ECDHE-RSA-AES128-GCM-SHA256:" \ + "ECDHE-ECDSA-AES128-GCM-SHA256:" \ + "ECDHE-RSA-AES256-GCM-SHA384:" \ + "ECDHE-ECDSA-AES256-GCM-SHA384:" \ + "DHE-RSA-AES128-GCM-SHA256:" \ + "ECDHE-RSA-AES128-SHA256:" \ + "DHE-RSA-AES128-SHA256:" \ + "ECDHE-RSA-AES256-SHA384:" \ + "DHE-RSA-AES256-SHA384:" \ + "ECDHE-RSA-AES256-SHA256:" \ + "DHE-RSA-AES256-SHA256:" \ + "HIGH:" \ + "!aNULL:" \ + "!eNULL:" \ + "!EXPORT:" \ + "!DES:" \ + "!RC4:" \ + "!MD5:" \ + "!PSK:" \ + "!SRP:" \ + "!CAMELLIA" #endif namespace node { diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 952acfe06f4b85..1c6864bb321463 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -19,14 +19,13 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "node_errors.h" -#include "node_internals.h" -#include "node_watchdog.h" -#include "base_object-inl.h" #include "node_contextify.h" +#include "base_object-inl.h" +#include "module_wrap.h" #include "node_context_data.h" #include "node_errors.h" -#include "module_wrap.h" +#include "node_internals.h" +#include "node_watchdog.h" namespace node { namespace contextify { @@ -95,15 +94,17 @@ namespace { // Convert an int to a V8 Name (String or Symbol). Local Uint32ToName(Local context, uint32_t index) { - return Uint32::New(context->GetIsolate(), index)->ToString(context) + return Uint32::New(context->GetIsolate(), index) + ->ToString(context) .ToLocalChecked(); } } // anonymous namespace -ContextifyContext::ContextifyContext( - Environment* env, - Local sandbox_obj, const ContextOptions& options) : env_(env) { +ContextifyContext::ContextifyContext(Environment* env, + Local sandbox_obj, + const ContextOptions& options) + : env_(env) { MaybeLocal v8_context = CreateV8Context(env, sandbox_obj, options); // Allocation failure, maximum call stack size reached, termination, etc. @@ -113,7 +114,6 @@ ContextifyContext::ContextifyContext( context_.SetWeak(this, WeakCallback, WeakCallbackType::kParameter); } - // This is an object that just keeps an internal pointer to this // ContextifyContext. It's passed to the NamedPropertyHandler. If we // pass the main JavaScript context object we're embedded in, then the @@ -141,8 +141,7 @@ MaybeLocal ContextifyContext::CreateV8Context( function_template->SetClassName(sandbox_obj->GetConstructorName()); - Local object_template = - function_template->InstanceTemplate(); + Local object_template = function_template->InstanceTemplate(); Local data_wrapper; if (!CreateDataWrapper(env).ToLocal(&data_wrapper)) @@ -184,9 +183,8 @@ MaybeLocal ContextifyContext::CreateV8Context( // directly in an Object, we instead hold onto the new context's global // object instead (which then has a reference to the context). ctx->SetEmbedderData(ContextEmbedderIndex::kSandboxObject, sandbox_obj); - sandbox_obj->SetPrivate(env->context(), - env->contextify_global_private_symbol(), - ctx->Global()); + sandbox_obj->SetPrivate( + env->context(), env->contextify_global_private_symbol(), ctx->Global()); Utf8Value name_val(env->isolate(), options.name); ctx->AllowCodeGenerationFromStrings(options.allow_code_gen_strings->IsTrue()); @@ -205,7 +203,6 @@ MaybeLocal ContextifyContext::CreateV8Context( return scope.Escape(ctx); } - void ContextifyContext::Init(Environment* env, Local target) { Local function_template = FunctionTemplate::New(env->isolate()); @@ -218,7 +215,6 @@ void ContextifyContext::Init(Environment* env, Local target) { env->SetMethod(target, "compileFunction", CompileFunction); } - // makeContext(sandbox, name, origin, strings, wasm); void ContextifyContext::MakeContext(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -228,10 +224,10 @@ void ContextifyContext::MakeContext(const FunctionCallbackInfo& args) { Local sandbox = args[0].As(); // Don't allow contextifying a sandbox multiple times. - CHECK( - !sandbox->HasPrivate( - env->context(), - env->contextify_context_private_symbol()).FromJust()); + CHECK(!sandbox + ->HasPrivate(env->context(), + env->contextify_context_private_symbol()) + .FromJust()); ContextOptions options; @@ -257,29 +253,24 @@ void ContextifyContext::MakeContext(const FunctionCallbackInfo& args) { return; } - if (context->context().IsEmpty()) - return; + if (context->context().IsEmpty()) return; - sandbox->SetPrivate( - env->context(), - env->contextify_context_private_symbol(), - External::New(env->isolate(), context)); + sandbox->SetPrivate(env->context(), + env->contextify_context_private_symbol(), + External::New(env->isolate(), context)); } - void ContextifyContext::IsContext(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); CHECK(args[0]->IsObject()); Local sandbox = args[0].As(); - Maybe result = - sandbox->HasPrivate(env->context(), - env->contextify_context_private_symbol()); + Maybe result = sandbox->HasPrivate( + env->context(), env->contextify_context_private_symbol()); args.GetReturnValue().Set(result.FromJust()); } - void ContextifyContext::WeakCallback( const WeakCallbackInfo& data) { ContextifyContext* context = data.GetParameter(); @@ -288,11 +279,9 @@ void ContextifyContext::WeakCallback( // static ContextifyContext* ContextifyContext::ContextFromContextifiedSandbox( - Environment* env, - const Local& sandbox) { - MaybeLocal maybe_value = - sandbox->GetPrivate(env->context(), - env->contextify_context_private_symbol()); + Environment* env, const Local& sandbox) { + MaybeLocal maybe_value = sandbox->GetPrivate( + env->context(), env->contextify_context_private_symbol()); Local context_external_v; if (maybe_value.ToLocal(&context_external_v) && context_external_v->IsExternal()) { @@ -312,27 +301,22 @@ ContextifyContext* ContextifyContext::Get(const PropertyCallbackInfo& args) { // static void ContextifyContext::PropertyGetterCallback( - Local property, - const PropertyCallbackInfo& args) { + Local property, const PropertyCallbackInfo& args) { ContextifyContext* ctx = ContextifyContext::Get(args); // Still initializing - if (ctx->context_.IsEmpty()) - return; + if (ctx->context_.IsEmpty()) return; Local context = ctx->context(); Local sandbox = ctx->sandbox(); - MaybeLocal maybe_rv = - sandbox->GetRealNamedProperty(context, property); + MaybeLocal maybe_rv = sandbox->GetRealNamedProperty(context, property); if (maybe_rv.IsEmpty()) { - maybe_rv = - ctx->global_proxy()->GetRealNamedProperty(context, property); + maybe_rv = ctx->global_proxy()->GetRealNamedProperty(context, property); } Local rv; if (maybe_rv.ToLocal(&rv)) { - if (rv == sandbox) - rv = ctx->global_proxy(); + if (rv == sandbox) rv = ctx->global_proxy(); args.GetReturnValue().Set(rv); } @@ -346,26 +330,24 @@ void ContextifyContext::PropertySetterCallback( ContextifyContext* ctx = ContextifyContext::Get(args); // Still initializing - if (ctx->context_.IsEmpty()) - return; + if (ctx->context_.IsEmpty()) return; auto attributes = PropertyAttribute::None; - bool is_declared_on_global_proxy = ctx->global_proxy() - ->GetRealNamedPropertyAttributes(ctx->context(), property) - .To(&attributes); - bool read_only = - static_cast(attributes) & - static_cast(PropertyAttribute::ReadOnly); - - bool is_declared_on_sandbox = ctx->sandbox() - ->GetRealNamedPropertyAttributes(ctx->context(), property) - .To(&attributes); - read_only = read_only || - (static_cast(attributes) & - static_cast(PropertyAttribute::ReadOnly)); - - if (read_only) - return; + bool is_declared_on_global_proxy = + ctx->global_proxy() + ->GetRealNamedPropertyAttributes(ctx->context(), property) + .To(&attributes); + bool read_only = static_cast(attributes) & + static_cast(PropertyAttribute::ReadOnly); + + bool is_declared_on_sandbox = + ctx->sandbox() + ->GetRealNamedPropertyAttributes(ctx->context(), property) + .To(&attributes); + read_only = read_only || (static_cast(attributes) & + static_cast(PropertyAttribute::ReadOnly)); + + if (read_only) return; // true for x = 5 // false for this.x = 5 @@ -387,7 +369,7 @@ void ContextifyContext::PropertySetterCallback( !is_function) return; - if (!is_declared_on_global_proxy && is_declared_on_sandbox && + if (!is_declared_on_global_proxy && is_declared_on_sandbox && args.ShouldThrowOnError() && is_contextual_store && !is_function) { // The property exists on the sandbox but not on the global // proxy. Setting it would throw because we are in strict mode. @@ -401,13 +383,11 @@ void ContextifyContext::PropertySetterCallback( // static void ContextifyContext::PropertyDescriptorCallback( - Local property, - const PropertyCallbackInfo& args) { + Local property, const PropertyCallbackInfo& args) { ContextifyContext* ctx = ContextifyContext::Get(args); // Still initializing - if (ctx->context_.IsEmpty()) - return; + if (ctx->context_.IsEmpty()) return; Local context = ctx->context(); @@ -415,8 +395,7 @@ void ContextifyContext::PropertyDescriptorCallback( if (sandbox->HasOwnProperty(context, property).FromMaybe(false)) { args.GetReturnValue().Set( - sandbox->GetOwnPropertyDescriptor(context, property) - .ToLocalChecked()); + sandbox->GetOwnPropertyDescriptor(context, property).ToLocalChecked()); } } @@ -428,40 +407,35 @@ void ContextifyContext::PropertyDefinerCallback( ContextifyContext* ctx = ContextifyContext::Get(args); // Still initializing - if (ctx->context_.IsEmpty()) - return; + if (ctx->context_.IsEmpty()) return; Local context = ctx->context(); Isolate* isolate = context->GetIsolate(); auto attributes = PropertyAttribute::None; bool is_declared = - ctx->global_proxy()->GetRealNamedPropertyAttributes(ctx->context(), - property) + ctx->global_proxy() + ->GetRealNamedPropertyAttributes(ctx->context(), property) .To(&attributes); - bool read_only = - static_cast(attributes) & - static_cast(PropertyAttribute::ReadOnly); + bool read_only = static_cast(attributes) & + static_cast(PropertyAttribute::ReadOnly); // If the property is set on the global as read_only, don't change it on // the global or sandbox. - if (is_declared && read_only) - return; + if (is_declared && read_only) return; Local sandbox = ctx->sandbox(); - auto define_prop_on_sandbox = - [&] (PropertyDescriptor* desc_for_sandbox) { - if (desc.has_enumerable()) { - desc_for_sandbox->set_enumerable(desc.enumerable()); - } - if (desc.has_configurable()) { - desc_for_sandbox->set_configurable(desc.configurable()); - } - // Set the property on the sandbox. - sandbox->DefineProperty(context, property, *desc_for_sandbox) - .FromJust(); - }; + auto define_prop_on_sandbox = [&](PropertyDescriptor* desc_for_sandbox) { + if (desc.has_enumerable()) { + desc_for_sandbox->set_enumerable(desc.enumerable()); + } + if (desc.has_configurable()) { + desc_for_sandbox->set_configurable(desc.configurable()); + } + // Set the property on the sandbox. + sandbox->DefineProperty(context, property, *desc_for_sandbox).FromJust(); + }; if (desc.has_get() || desc.has_set()) { PropertyDescriptor desc_for_sandbox( @@ -485,18 +459,15 @@ void ContextifyContext::PropertyDefinerCallback( // static void ContextifyContext::PropertyDeleterCallback( - Local property, - const PropertyCallbackInfo& args) { + Local property, const PropertyCallbackInfo& args) { ContextifyContext* ctx = ContextifyContext::Get(args); // Still initializing - if (ctx->context_.IsEmpty()) - return; + if (ctx->context_.IsEmpty()) return; Maybe success = ctx->sandbox()->Delete(ctx->context(), property); - if (success.FromMaybe(false)) - return; + if (success.FromMaybe(false)) return; // Delete failed on the sandbox, intercept and do not delete on // the global object. @@ -509,8 +480,7 @@ void ContextifyContext::PropertyEnumeratorCallback( ContextifyContext* ctx = ContextifyContext::Get(args); // Still initializing - if (ctx->context_.IsEmpty()) - return; + if (ctx->context_.IsEmpty()) return; Local properties; @@ -522,19 +492,16 @@ void ContextifyContext::PropertyEnumeratorCallback( // static void ContextifyContext::IndexedPropertyGetterCallback( - uint32_t index, - const PropertyCallbackInfo& args) { + uint32_t index, const PropertyCallbackInfo& args) { ContextifyContext* ctx = ContextifyContext::Get(args); // Still initializing - if (ctx->context_.IsEmpty()) - return; + if (ctx->context_.IsEmpty()) return; - ContextifyContext::PropertyGetterCallback( - Uint32ToName(ctx->context(), index), args); + ContextifyContext::PropertyGetterCallback(Uint32ToName(ctx->context(), index), + args); } - void ContextifyContext::IndexedPropertySetterCallback( uint32_t index, Local value, @@ -542,8 +509,7 @@ void ContextifyContext::IndexedPropertySetterCallback( ContextifyContext* ctx = ContextifyContext::Get(args); // Still initializing - if (ctx->context_.IsEmpty()) - return; + if (ctx->context_.IsEmpty()) return; ContextifyContext::PropertySetterCallback( Uint32ToName(ctx->context(), index), value, args); @@ -551,19 +517,16 @@ void ContextifyContext::IndexedPropertySetterCallback( // static void ContextifyContext::IndexedPropertyDescriptorCallback( - uint32_t index, - const PropertyCallbackInfo& args) { + uint32_t index, const PropertyCallbackInfo& args) { ContextifyContext* ctx = ContextifyContext::Get(args); // Still initializing - if (ctx->context_.IsEmpty()) - return; + if (ctx->context_.IsEmpty()) return; ContextifyContext::PropertyDescriptorCallback( Uint32ToName(ctx->context(), index), args); } - void ContextifyContext::IndexedPropertyDefinerCallback( uint32_t index, const PropertyDescriptor& desc, @@ -571,8 +534,7 @@ void ContextifyContext::IndexedPropertyDefinerCallback( ContextifyContext* ctx = ContextifyContext::Get(args); // Still initializing - if (ctx->context_.IsEmpty()) - return; + if (ctx->context_.IsEmpty()) return; ContextifyContext::PropertyDefinerCallback( Uint32ToName(ctx->context(), index), desc, args); @@ -580,18 +542,15 @@ void ContextifyContext::IndexedPropertyDefinerCallback( // static void ContextifyContext::IndexedPropertyDeleterCallback( - uint32_t index, - const PropertyCallbackInfo& args) { + uint32_t index, const PropertyCallbackInfo& args) { ContextifyContext* ctx = ContextifyContext::Get(args); // Still initializing - if (ctx->context_.IsEmpty()) - return; + if (ctx->context_.IsEmpty()) return; Maybe success = ctx->sandbox()->Delete(ctx->context(), index); - if (success.FromMaybe(false)) - return; + if (success.FromMaybe(false)) return; // Delete failed on the sandbox, intercept and do not delete on // the global object. @@ -610,8 +569,11 @@ void ContextifyScript::Init(Environment* env, Local target) { env->SetProtoMethod(script_tmpl, "runInContext", RunInContext); env->SetProtoMethod(script_tmpl, "runInThisContext", RunInThisContext); - target->Set(env->context(), class_name, - script_tmpl->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + class_name, + script_tmpl->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); env->set_script_context_constructor_template(script_tmpl); } @@ -664,17 +626,16 @@ void ContextifyScript::New(const FunctionCallbackInfo& args) { column_offset = Integer::New(isolate, 0); } - ContextifyScript* contextify_script = - new ContextifyScript(env, args.This()); + ContextifyScript* contextify_script = new ContextifyScript(env, args.This()); if (*TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( TRACING_CATEGORY_NODE2(vm, script)) != 0) { Utf8Value fn(isolate, filename); - TRACE_EVENT_NESTABLE_ASYNC_BEGIN1( - TRACING_CATEGORY_NODE2(vm, script), - "ContextifyScript::New", - contextify_script, - "filename", TRACE_STR_COPY(*fn)); + TRACE_EVENT_NESTABLE_ASYNC_BEGIN1(TRACING_CATEGORY_NODE2(vm, script), + "ContextifyScript::New", + contextify_script, + "filename", + TRACE_STR_COPY(*fn)); } ScriptCompiler::CachedData* cached_data = nullptr; @@ -687,20 +648,22 @@ void ContextifyScript::New(const FunctionCallbackInfo& args) { Local host_defined_options = PrimitiveArray::New(isolate, loader::HostDefinedOptions::kLength); - host_defined_options->Set(isolate, loader::HostDefinedOptions::kType, + host_defined_options->Set(isolate, + loader::HostDefinedOptions::kType, Number::New(isolate, loader::ScriptType::kScript)); - host_defined_options->Set(isolate, loader::HostDefinedOptions::kID, + host_defined_options->Set(isolate, + loader::HostDefinedOptions::kID, Number::New(isolate, contextify_script->id())); ScriptOrigin origin(filename, - line_offset, // line offset - column_offset, // column offset - True(isolate), // is cross origin - Local(), // script id - Local(), // source map URL - False(isolate), // is opaque (?) - False(isolate), // is WASM - False(isolate), // is ES Module + line_offset, // line offset + column_offset, // column offset + True(isolate), // is cross origin + Local(), // script id + Local(), // source map URL + False(isolate), // is opaque (?) + False(isolate), // is WASM + False(isolate), // is ES Module host_defined_options); ScriptCompiler::Source source(code, origin, cached_data); ScriptCompiler::CompileOptions compile_options = @@ -713,54 +676,51 @@ void ContextifyScript::New(const FunctionCallbackInfo& args) { Environment::ShouldNotAbortOnUncaughtScope no_abort_scope(env); Context::Scope scope(parsing_context); - MaybeLocal v8_script = ScriptCompiler::CompileUnboundScript( - isolate, - &source, - compile_options); + MaybeLocal v8_script = + ScriptCompiler::CompileUnboundScript(isolate, &source, compile_options); if (v8_script.IsEmpty()) { DecorateErrorStack(env, try_catch); no_abort_scope.Close(); try_catch.ReThrow(); - TRACE_EVENT_NESTABLE_ASYNC_END0( - TRACING_CATEGORY_NODE2(vm, script), - "ContextifyScript::New", - contextify_script); + TRACE_EVENT_NESTABLE_ASYNC_END0(TRACING_CATEGORY_NODE2(vm, script), + "ContextifyScript::New", + contextify_script); return; } contextify_script->script_.Reset(isolate, v8_script.ToLocalChecked()); if (compile_options == ScriptCompiler::kConsumeCodeCache) { - args.This()->Set( - env->context(), - env->cached_data_rejected_string(), - Boolean::New(isolate, source.GetCachedData()->rejected)).FromJust(); + args.This() + ->Set(env->context(), + env->cached_data_rejected_string(), + Boolean::New(isolate, source.GetCachedData()->rejected)) + .FromJust(); } else if (produce_cached_data) { const ScriptCompiler::CachedData* cached_data = - ScriptCompiler::CreateCodeCache(v8_script.ToLocalChecked()); + ScriptCompiler::CreateCodeCache(v8_script.ToLocalChecked()); bool cached_data_produced = cached_data != nullptr; if (cached_data_produced) { - MaybeLocal buf = Buffer::Copy( - env, - reinterpret_cast(cached_data->data), - cached_data->length); - args.This()->Set(env->context(), - env->cached_data_string(), - buf.ToLocalChecked()).FromJust(); + MaybeLocal buf = + Buffer::Copy(env, + reinterpret_cast(cached_data->data), + cached_data->length); + args.This() + ->Set(env->context(), env->cached_data_string(), buf.ToLocalChecked()) + .FromJust(); } - args.This()->Set( - env->context(), - env->cached_data_produced_string(), - Boolean::New(isolate, cached_data_produced)).FromJust(); + args.This() + ->Set(env->context(), + env->cached_data_produced_string(), + Boolean::New(isolate, cached_data_produced)) + .FromJust(); } - TRACE_EVENT_NESTABLE_ASYNC_END0( - TRACING_CATEGORY_NODE2(vm, script), - "ContextifyScript::New", - contextify_script); + TRACE_EVENT_NESTABLE_ASYNC_END0(TRACING_CATEGORY_NODE2(vm, script), + "ContextifyScript::New", + contextify_script); } -bool ContextifyScript::InstanceOf(Environment* env, - const Local& value) { +bool ContextifyScript::InstanceOf(Environment* env, const Local& value) { return !value.IsEmpty() && env->script_context_constructor_template()->HasInstance(value); } @@ -777,10 +737,10 @@ void ContextifyScript::CreateCachedData( if (!cached_data) { args.GetReturnValue().Set(Buffer::New(env, 0).ToLocalChecked()); } else { - MaybeLocal buf = Buffer::Copy( - env, - reinterpret_cast(cached_data->data), - cached_data->length); + MaybeLocal buf = + Buffer::Copy(env, + reinterpret_cast(cached_data->data), + cached_data->length); args.GetReturnValue().Set(buf.ToLocalChecked()); } } @@ -812,12 +772,8 @@ void ContextifyScript::RunInThisContext( bool break_on_first_line = args[3]->IsTrue(); // Do the eval within this context - EvalMachine(env, - timeout, - display_errors, - break_on_sigint, - break_on_first_line, - args); + EvalMachine( + env, timeout, display_errors, break_on_sigint, break_on_first_line, args); TRACE_EVENT_NESTABLE_ASYNC_END0( TRACING_CATEGORY_NODE2(vm, script), "RunInThisContext", wrapped_script); @@ -838,8 +794,7 @@ void ContextifyScript::RunInContext(const FunctionCallbackInfo& args) { ContextifyContext::ContextFromContextifiedSandbox(env, sandbox); CHECK_NOT_NULL(contextify_context); - if (contextify_context->context().IsEmpty()) - return; + if (contextify_context->context().IsEmpty()) return; TRACE_EVENT_NESTABLE_ASYNC_BEGIN0( TRACING_CATEGORY_NODE2(vm, script), "RunInContext", wrapped_script); @@ -875,8 +830,7 @@ bool ContextifyScript::EvalMachine(Environment* env, const bool break_on_sigint, const bool break_on_first_line, const FunctionCallbackInfo& args) { - if (!env->can_call_into_js()) - return false; + if (!env->can_call_into_js()) return false; if (!ContextifyScript::InstanceOf(env, args.Holder())) { env->ThrowTypeError( "Script methods can only be called on script instances."); @@ -945,20 +899,16 @@ bool ContextifyScript::EvalMachine(Environment* env, return true; } - ContextifyScript::ContextifyScript(Environment* env, Local object) - : BaseObject(env, object), - id_(env->get_next_script_id()) { + : BaseObject(env, object), id_(env->get_next_script_id()) { MakeWeak(); env->id_to_script_map.emplace(id_, this); } - ContextifyScript::~ContextifyScript() { env()->id_to_script_map.erase(id_); } - void ContextifyContext::CompileFunction( const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -997,8 +947,8 @@ void ContextifyContext::CompileFunction( if (!args[6]->IsUndefined()) { CHECK(args[6]->IsObject()); ContextifyContext* sandbox = - ContextifyContext::ContextFromContextifiedSandbox( - env, args[6].As()); + ContextifyContext::ContextFromContextifiedSandbox(env, + args[6].As()); CHECK_NOT_NULL(sandbox); parsing_context = sandbox->context(); } else { @@ -1025,7 +975,7 @@ void ContextifyContext::CompileFunction( ArrayBuffer::Contents contents = cached_data_buf->Buffer()->GetContents(); uint8_t* data = static_cast(contents.Data()); cached_data = new ScriptCompiler::CachedData( - data + cached_data_buf->ByteOffset(), cached_data_buf->ByteLength()); + data + cached_data_buf->ByteOffset(), cached_data_buf->ByteLength()); } ScriptOrigin origin(filename, line_offset, column_offset, True(isolate)); @@ -1062,9 +1012,14 @@ void ContextifyContext::CompileFunction( } } - MaybeLocal maybe_fun = ScriptCompiler::CompileFunctionInContext( - parsing_context, &source, params.size(), params.data(), - context_extensions.size(), context_extensions.data(), options); + MaybeLocal maybe_fun = + ScriptCompiler::CompileFunctionInContext(parsing_context, + &source, + params.size(), + params.data(), + context_extensions.size(), + context_extensions.data(), + options); Local fun; if (maybe_fun.IsEmpty() || !maybe_fun.ToLocal(&fun)) { @@ -1078,25 +1033,26 @@ void ContextifyContext::CompileFunction( ScriptCompiler::CreateCodeCacheForFunction(fun)); bool cached_data_produced = cached_data != nullptr; if (cached_data_produced) { - MaybeLocal buf = Buffer::Copy( - env, - reinterpret_cast(cached_data->data), - cached_data->length); - if (fun->Set( - parsing_context, - env->cached_data_string(), - buf.ToLocalChecked()).IsNothing()) return; + MaybeLocal buf = + Buffer::Copy(env, + reinterpret_cast(cached_data->data), + cached_data->length); + if (fun->Set(parsing_context, + env->cached_data_string(), + buf.ToLocalChecked()) + .IsNothing()) + return; } - if (fun->Set( - parsing_context, - env->cached_data_produced_string(), - Boolean::New(isolate, cached_data_produced)).IsNothing()) return; + if (fun->Set(parsing_context, + env->cached_data_produced_string(), + Boolean::New(isolate, cached_data_produced)) + .IsNothing()) + return; } args.GetReturnValue().Set(fun); } - void Initialize(Local target, Local unused, Local context, diff --git a/src/node_contextify.h b/src/node_contextify.h index 71c4bfc0d61f5a..10ad22a6c9f130 100644 --- a/src/node_contextify.h +++ b/src/node_contextify.h @@ -30,12 +30,9 @@ class ContextifyContext { static void Init(Environment* env, v8::Local target); static ContextifyContext* ContextFromContextifiedSandbox( - Environment* env, - const v8::Local& sandbox); + Environment* env, const v8::Local& sandbox); - inline Environment* env() const { - return env_; - } + inline Environment* env() const { return env_; } inline v8::Local context() const { return PersistentToLocal::Default(env()->isolate(), context_); @@ -50,17 +47,14 @@ class ContextifyContext { context()->GetEmbedderData(ContextEmbedderIndex::kSandboxObject)); } - template static ContextifyContext* Get(const v8::PropertyCallbackInfo& args); private: static void MakeContext(const v8::FunctionCallbackInfo& args); static void IsContext(const v8::FunctionCallbackInfo& args); - static void CompileFunction( - const v8::FunctionCallbackInfo& args); - static void WeakCallback( - const v8::WeakCallbackInfo& data); + static void CompileFunction(const v8::FunctionCallbackInfo& args); + static void WeakCallback(const v8::WeakCallbackInfo& data); static void PropertyGetterCallback( v8::Local property, const v8::PropertyCallbackInfo& args); @@ -81,22 +75,19 @@ class ContextifyContext { static void PropertyEnumeratorCallback( const v8::PropertyCallbackInfo& args); static void IndexedPropertyGetterCallback( - uint32_t index, - const v8::PropertyCallbackInfo& args); + uint32_t index, const v8::PropertyCallbackInfo& args); static void IndexedPropertySetterCallback( uint32_t index, v8::Local value, const v8::PropertyCallbackInfo& args); static void IndexedPropertyDescriptorCallback( - uint32_t index, - const v8::PropertyCallbackInfo& args); + uint32_t index, const v8::PropertyCallbackInfo& args); static void IndexedPropertyDefinerCallback( uint32_t index, const v8::PropertyDescriptor& desc, const v8::PropertyCallbackInfo& args); static void IndexedPropertyDeleterCallback( - uint32_t index, - const v8::PropertyCallbackInfo& args); + uint32_t index, const v8::PropertyCallbackInfo& args); Environment* const env_; Persistent context_; }; @@ -113,8 +104,7 @@ class ContextifyScript : public BaseObject { static void Init(Environment* env, v8::Local target); static void New(const v8::FunctionCallbackInfo& args); static bool InstanceOf(Environment* env, const v8::Local& args); - static void CreateCachedData( - const v8::FunctionCallbackInfo& args); + static void CreateCachedData(const v8::FunctionCallbackInfo& args); static void RunInThisContext(const v8::FunctionCallbackInfo& args); static void RunInContext(const v8::FunctionCallbackInfo& args); static bool EvalMachine(Environment* env, diff --git a/src/node_credentials.cc b/src/node_credentials.cc index 8d38c38a0c5706..7b96c6e434f522 100644 --- a/src/node_credentials.cc +++ b/src/node_credentials.cc @@ -258,16 +258,14 @@ static void GetGroups(const FunctionCallbackInfo& args) { std::vector groups(ngroups); ngroups = getgroups(ngroups, groups.data()); - if (ngroups == -1) - return env->ThrowErrnoException(errno, "getgroups"); + if (ngroups == -1) return env->ThrowErrnoException(errno, "getgroups"); groups.resize(ngroups); gid_t egid = getegid(); if (std::find(groups.begin(), groups.end(), egid) == groups.end()) groups.push_back(egid); MaybeLocal array = ToV8Value(env->context(), groups); - if (!array.IsEmpty()) - args.GetReturnValue().Set(array.ToLocalChecked()); + if (!array.IsEmpty()) args.GetReturnValue().Set(array.ToLocalChecked()); } static void SetGroups(const FunctionCallbackInfo& args) { diff --git a/src/node_crypto.cc b/src/node_crypto.cc index c30212117ef4f4..4f55b354965a79 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -46,15 +46,15 @@ #include #include -static const int X509_NAME_FLAGS = ASN1_STRFLGS_ESC_CTRL - | ASN1_STRFLGS_UTF8_CONVERT - | XN_FLAG_SEP_MULTILINE - | XN_FLAG_FN_SN; +static const int X509_NAME_FLAGS = ASN1_STRFLGS_ESC_CTRL | + ASN1_STRFLGS_UTF8_CONVERT | + XN_FLAG_SEP_MULTILINE | XN_FLAG_FN_SN; namespace node { namespace Buffer { // OpenSSL uses `unsigned char*` for raw data, make this easier for us. -v8::MaybeLocal New(Environment* env, unsigned char* udata, +v8::MaybeLocal New(Environment* env, + unsigned char* udata, size_t length) { char* data = reinterpret_cast(udata); return Buffer::New(env, data, length); @@ -99,18 +99,18 @@ using v8::Undefined; using v8::Value; #ifdef OPENSSL_NO_OCB -# define IS_OCB_MODE(mode) false +#define IS_OCB_MODE(mode) false #else -# define IS_OCB_MODE(mode) ((mode) == EVP_CIPH_OCB_MODE) +#define IS_OCB_MODE(mode) ((mode) == EVP_CIPH_OCB_MODE) #endif struct StackOfX509Deleter { - void operator()(STACK_OF(X509)* p) const { sk_X509_pop_free(p, X509_free); } + void operator()(STACK_OF(X509) * p) const { sk_X509_pop_free(p, X509_free); } }; using StackOfX509 = std::unique_ptr; struct StackOfXASN1Deleter { - void operator()(STACK_OF(ASN1_OBJECT)* p) const { + void operator()(STACK_OF(ASN1_OBJECT) * p) const { sk_ASN1_OBJECT_pop_free(p, ASN1_OBJECT_free); } }; @@ -139,27 +139,20 @@ template void SSLWrap::ConfigureSecureContext(SecureContext* sc); template void SSLWrap::SetSNIContext(SecureContext* sc); template int SSLWrap::SetCACerts(SecureContext* sc); template SSL_SESSION* SSLWrap::GetSessionCallback( - SSL* s, - const unsigned char* key, - int len, - int* copy); -template int SSLWrap::NewSessionCallback(SSL* s, - SSL_SESSION* sess); + SSL* s, const unsigned char* key, int len, int* copy); +template int SSLWrap::NewSessionCallback(SSL* s, SSL_SESSION* sess); template void SSLWrap::OnClientHello( - void* arg, - const ClientHelloParser::ClientHello& hello); + void* arg, const ClientHelloParser::ClientHello& hello); template int SSLWrap::TLSExtStatusCallback(SSL* s, void* arg); template void SSLWrap::DestroySSL(); template int SSLWrap::SSLCertCallback(SSL* s, void* arg); template void SSLWrap::WaitForCertCb(CertCb cb, void* arg); -template int SSLWrap::SelectALPNCallback( - SSL* s, - const unsigned char** out, - unsigned char* outlen, - const unsigned char* in, - unsigned int inlen, - void* arg); - +template int SSLWrap::SelectALPNCallback(SSL* s, + const unsigned char** out, + unsigned char* outlen, + const unsigned char* in, + unsigned int inlen, + void* arg); static int PasswordCallback(char* buf, int size, int rwflag, void* u) { if (u) { @@ -200,8 +193,8 @@ static ENGINE* LoadEngineById(const char* engine_id, char (*errmsg)[1024]) { if (err != 0) { ERR_error_string_n(err, *errmsg, sizeof(*errmsg)); } else { - snprintf(*errmsg, sizeof(*errmsg), - "Engine \"%s\" was not found", engine_id); + snprintf( + *errmsg, sizeof(*errmsg), "Engine \"%s\" was not found", engine_id); } } @@ -218,7 +211,6 @@ static int NoPasswordCallback(char* buf, int size, int rwflag, void* u) { return 0; } - struct CryptoErrorVector : public std::vector { inline void Capture() { clear(); @@ -238,10 +230,11 @@ struct CryptoErrorVector : public std::vector { if (copy.empty()) copy.push_back("no error"); // But possibly a bug... // Use last element as the error message, everything else goes // into the .opensslErrorStack property on the exception object. - auto exception_string = - String::NewFromUtf8(env->isolate(), copy.back().data(), - NewStringType::kNormal, copy.back().size()) - .ToLocalChecked(); + auto exception_string = String::NewFromUtf8(env->isolate(), + copy.back().data(), + NewStringType::kNormal, + copy.back().size()) + .ToLocalChecked(); copy.pop_back(); return copy.ToException(env, exception_string); } @@ -252,9 +245,10 @@ struct CryptoErrorVector : public std::vector { if (!empty()) { CHECK(exception_v->IsObject()); Local exception = exception_v.As(); - exception->Set(env->context(), - env->openssl_error_stack(), - ToV8Value(env->context(), *this).ToLocalChecked()) + exception + ->Set(env->context(), + env->openssl_error_stack(), + ToV8Value(env->context(), *this).ToLocalChecked()) .FromJust(); } @@ -262,7 +256,6 @@ struct CryptoErrorVector : public std::vector { } }; - void ThrowCryptoError(Environment* env, unsigned long err, // NOLINT(runtime/int) const char* message = nullptr) { @@ -274,14 +267,13 @@ void ThrowCryptoError(Environment* env, HandleScope scope(env->isolate()); auto exception_string = String::NewFromUtf8(env->isolate(), message, NewStringType::kNormal) - .ToLocalChecked(); + .ToLocalChecked(); CryptoErrorVector errors; errors.Capture(); auto exception = errors.ToException(env, exception_string); env->isolate()->ThrowException(exception); } - // Ensure that OpenSSL has enough entropy (at least 256 bits) for its PRNG. // The entropy pool starts out empty and needs to fill up before the PRNG // can be used securely. Once the pool is filled, it never dries up again; @@ -306,16 +298,13 @@ inline void CheckEntropy() { for (;;) { int status = RAND_status(); CHECK_GE(status, 0); // Cannot fail. - if (status != 0) - break; + if (status != 0) break; // Give up, RAND_poll() not supported. - if (RAND_poll() == 0) - break; + if (RAND_poll() == 0) break; } } - bool EntropySource(unsigned char* buffer, size_t length) { // Ensure that OpenSSL's PRNG is properly seeded. CheckEntropy(); @@ -325,7 +314,6 @@ bool EntropySource(unsigned char* buffer, size_t length) { return RAND_bytes(buffer, length) != -1; } - template static T* MallocOpenSSL(size_t count) { void* mem = OPENSSL_malloc(MultiplyWithOverflowCheck(count, sizeof(T))); @@ -333,7 +321,6 @@ static T* MallocOpenSSL(size_t count) { return static_cast(mem); } - void SecureContext::Initialize(Environment* env, Local target) { Local t = env->NewFunctionTemplate(New); t->InstanceTemplate()->SetInternalFieldCount(1); @@ -366,8 +353,8 @@ void SecureContext::Initialize(Environment* env, Local target) { env->SetProtoMethodNoSideEffect(t, "getIssuer", GetCertificate); #define SET_INTEGER_CONSTANTS(name, value) \ - t->Set(FIXED_ONE_BYTE_STRING(env->isolate(), name), \ - Integer::NewFromUnsigned(env->isolate(), value)); + t->Set(FIXED_ONE_BYTE_STRING(env->isolate(), name), \ + Integer::NewFromUnsigned(env->isolate(), value)); SET_INTEGER_CONSTANTS("kTicketKeyReturnIndex", kTicketKeyReturnIndex); SET_INTEGER_CONSTANTS("kTicketKeyHMACIndex", kTicketKeyHMACIndex); SET_INTEGER_CONSTANTS("kTicketKeyAESIndex", kTicketKeyAESIndex); @@ -382,25 +369,25 @@ void SecureContext::Initialize(Environment* env, Local target) { env->as_external(), Signature::New(env->isolate(), t)); - t->PrototypeTemplate()->SetAccessorProperty( FIXED_ONE_BYTE_STRING(env->isolate(), "_external"), ctx_getter_templ, Local(), static_cast(ReadOnly | DontDelete)); - target->Set(env->context(), secureContextString, - t->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + secureContextString, + t->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); env->set_secure_context_constructor_template(t); } - void SecureContext::New(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); new SecureContext(env, args.This()); } - void SecureContext::Init(const FunctionCallbackInfo& args) { SecureContext* sc; ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder()); @@ -512,10 +499,9 @@ void SecureContext::Init(const FunctionCallbackInfo& args) { // SSL session cache configuration SSL_CTX_set_session_cache_mode(sc->ctx_.get(), - SSL_SESS_CACHE_CLIENT | - SSL_SESS_CACHE_SERVER | - SSL_SESS_CACHE_NO_INTERNAL | - SSL_SESS_CACHE_NO_AUTO_CLEAR); + SSL_SESS_CACHE_CLIENT | SSL_SESS_CACHE_SERVER | + SSL_SESS_CACHE_NO_INTERNAL | + SSL_SESS_CACHE_NO_AUTO_CLEAR); SSL_CTX_set_min_proto_version(sc->ctx_.get(), min_version); @@ -537,7 +523,6 @@ void SecureContext::Init(const FunctionCallbackInfo& args) { SSL_CTX_set_tlsext_ticket_key_cb(sc->ctx_.get(), TicketCompatibilityCallback); } - // Takes a string or buffer and loads it into a BIO. // Caller responsible for BIO_free_all-ing the returned object. static BIOPointer LoadBIO(Environment* env, Local v) { @@ -555,7 +540,6 @@ static BIOPointer LoadBIO(Environment* env, Local v) { return nullptr; } - void SecureContext::SetKey(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -579,16 +563,12 @@ void SecureContext::SetKey(const FunctionCallbackInfo& args) { } BIOPointer bio(LoadBIO(env, args[0])); - if (!bio) - return; + if (!bio) return; node::Utf8Value passphrase(env->isolate(), args[1]); - EVPKeyPointer key( - PEM_read_bio_PrivateKey(bio.get(), - nullptr, - PasswordCallback, - len == 1 ? nullptr : *passphrase)); + EVPKeyPointer key(PEM_read_bio_PrivateKey( + bio.get(), nullptr, PasswordCallback, len == 1 ? nullptr : *passphrase)); if (!key) { unsigned long err = ERR_get_error(); // NOLINT(runtime/int) @@ -602,13 +582,11 @@ void SecureContext::SetKey(const FunctionCallbackInfo& args) { if (!rv) { unsigned long err = ERR_get_error(); // NOLINT(runtime/int) - if (!err) - return env->ThrowError("SSL_CTX_use_PrivateKey"); + if (!err) return env->ThrowError("SSL_CTX_use_PrivateKey"); return ThrowCryptoError(env, err); } } - int SSL_CTX_get_issuer(SSL_CTX* ctx, X509* cert, X509** issuer) { X509_STORE* store = SSL_CTX_get_cert_store(ctx); DeleteFnPtr store_ctx( @@ -618,10 +596,9 @@ int SSL_CTX_get_issuer(SSL_CTX* ctx, X509* cert, X509** issuer) { X509_STORE_CTX_get1_issuer(issuer, store_ctx.get(), cert) == 1; } - int SSL_CTX_use_certificate_chain(SSL_CTX* ctx, X509Pointer&& x, - STACK_OF(X509)* extra_certs, + STACK_OF(X509) * extra_certs, X509Pointer* cert, X509Pointer* issuer_) { CHECK(!*issuer_); @@ -677,13 +654,11 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx, if (ret && x != nullptr) { cert->reset(X509_dup(x.get())); - if (!*cert) - ret = 0; + if (!*cert) ret = 0; } return ret; } - // Read a file that contains our certificate in "PEM" format, // possibly followed by a sequence of CA certificates that should be // sent to the peer in the Certificate message. @@ -700,19 +675,15 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx, X509Pointer x( PEM_read_bio_X509_AUX(in.get(), nullptr, NoPasswordCallback, nullptr)); - if (!x) - return 0; + if (!x) return 0; unsigned long err = 0; // NOLINT(runtime/int) StackOfX509 extra_certs(sk_X509_new_null()); - if (!extra_certs) - return 0; + if (!extra_certs) return 0; - while (X509Pointer extra {PEM_read_bio_X509(in.get(), - nullptr, - NoPasswordCallback, - nullptr)}) { + while (X509Pointer extra{ + PEM_read_bio_X509(in.get(), nullptr, NoPasswordCallback, nullptr)}) { if (sk_X509_push(extra_certs.get(), extra.get())) { extra.release(); continue; @@ -731,14 +702,10 @@ int SSL_CTX_use_certificate_chain(SSL_CTX* ctx, return 0; } - return SSL_CTX_use_certificate_chain(ctx, - std::move(x), - extra_certs.get(), - cert, - issuer); + return SSL_CTX_use_certificate_chain( + ctx, std::move(x), extra_certs.get(), cert, issuer); } - void SecureContext::SetCert(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -750,16 +717,13 @@ void SecureContext::SetCert(const FunctionCallbackInfo& args) { } BIOPointer bio(LoadBIO(env, args[0])); - if (!bio) - return; + if (!bio) return; sc->cert_.reset(); sc->issuer_.reset(); - int rv = SSL_CTX_use_certificate_chain(sc->ctx_.get(), - std::move(bio), - &sc->cert_, - &sc->issuer_); + int rv = SSL_CTX_use_certificate_chain( + sc->ctx_.get(), std::move(bio), &sc->cert_, &sc->issuer_); if (!rv) { unsigned long err = ERR_get_error(); // NOLINT(runtime/int) @@ -770,7 +734,6 @@ void SecureContext::SetCert(const FunctionCallbackInfo& args) { } } - static X509_STORE* NewRootCertStore() { static std::vector root_certs_vector; static Mutex root_certs_vector_mutex; @@ -778,12 +741,11 @@ static X509_STORE* NewRootCertStore() { if (root_certs_vector.empty()) { for (size_t i = 0; i < arraysize(root_certs); i++) { - X509* x509 = - PEM_read_bio_X509(NodeBIO::NewFixed(root_certs[i], - strlen(root_certs[i])).get(), - nullptr, // no re-use of X509 structure - NoPasswordCallback, - nullptr); // no callback data + X509* x509 = PEM_read_bio_X509( + NodeBIO::NewFixed(root_certs[i], strlen(root_certs[i])).get(), + nullptr, // no re-use of X509 structure + NoPasswordCallback, + nullptr); // no callback data // Parse errors from the built-in roots are fatal. CHECK_NOT_NULL(x509); @@ -808,7 +770,6 @@ static X509_STORE* NewRootCertStore() { return store; } - void SecureContext::AddCACert(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -821,12 +782,11 @@ void SecureContext::AddCACert(const FunctionCallbackInfo& args) { } BIOPointer bio(LoadBIO(env, args[0])); - if (!bio) - return; + if (!bio) return; X509_STORE* cert_store = SSL_CTX_get_cert_store(sc->ctx_.get()); while (X509* x509 = PEM_read_bio_X509_AUX( - bio.get(), nullptr, NoPasswordCallback, nullptr)) { + bio.get(), nullptr, NoPasswordCallback, nullptr)) { if (cert_store == root_cert_store) { cert_store = NewRootCertStore(); SSL_CTX_set_cert_store(sc->ctx_.get(), cert_store); @@ -837,7 +797,6 @@ void SecureContext::AddCACert(const FunctionCallbackInfo& args) { } } - void SecureContext::AddCRL(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -851,14 +810,12 @@ void SecureContext::AddCRL(const FunctionCallbackInfo& args) { ClearErrorOnReturn clear_error_on_return; BIOPointer bio(LoadBIO(env, args[0])); - if (!bio) - return; + if (!bio) return; DeleteFnPtr crl( PEM_read_bio_X509_CRL(bio.get(), nullptr, NoPasswordCallback, nullptr)); - if (!crl) - return env->ThrowError("Failed to parse CRL"); + if (!crl) return env->ThrowError("Failed to parse CRL"); X509_STORE* cert_store = SSL_CTX_get_cert_store(sc->ctx_.get()); if (cert_store == root_cert_store) { @@ -871,7 +828,6 @@ void SecureContext::AddCRL(const FunctionCallbackInfo& args) { X509_V_FLAG_CRL_CHECK | X509_V_FLAG_CRL_CHECK_ALL); } - static unsigned long AddCertsFromFile( // NOLINT(runtime/int) X509_STORE* store, const char* file) { @@ -879,11 +835,10 @@ static unsigned long AddCertsFromFile( // NOLINT(runtime/int) MarkPopErrorOnReturn mark_pop_error_on_return; BIOPointer bio(BIO_new_file(file, "r")); - if (!bio) - return ERR_get_error(); + if (!bio) return ERR_get_error(); - while (X509* x509 = - PEM_read_bio_X509(bio.get(), nullptr, NoPasswordCallback, nullptr)) { + while (X509* x509 = PEM_read_bio_X509( + bio.get(), nullptr, NoPasswordCallback, nullptr)) { X509_STORE_add_cert(store, x509); X509_free(x509); } @@ -898,7 +853,6 @@ static unsigned long AddCertsFromFile( // NOLINT(runtime/int) return err; } - void UseExtraCaCerts(const std::string& file) { ClearErrorOnReturn clear_error_on_return; @@ -907,8 +861,8 @@ void UseExtraCaCerts(const std::string& file) { if (!file.empty()) { unsigned long err = AddCertsFromFile( // NOLINT(runtime/int) - root_cert_store, - file.c_str()); + root_cert_store, + file.c_str()); if (err) { fprintf(stderr, "Warning: Ignoring extra certs from `%s`, load failed: %s\n", @@ -921,13 +875,11 @@ void UseExtraCaCerts(const std::string& file) { } } - static void IsExtraRootCertsFileLoaded( const FunctionCallbackInfo& args) { return args.GetReturnValue().Set(extra_root_certs_loaded); } - void SecureContext::AddRootCerts(const FunctionCallbackInfo& args) { SecureContext* sc; ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder()); @@ -942,7 +894,6 @@ void SecureContext::AddRootCerts(const FunctionCallbackInfo& args) { SSL_CTX_set_cert_store(sc->ctx_.get(), root_cert_store); } - void SecureContext::SetCiphers(const FunctionCallbackInfo& args) { SecureContext* sc; ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder()); @@ -983,7 +934,6 @@ void SecureContext::SetCiphers(const FunctionCallbackInfo& args) { } } - void SecureContext::SetECDHCurve(const FunctionCallbackInfo& args) { SecureContext* sc; ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder()); @@ -996,14 +946,12 @@ void SecureContext::SetECDHCurve(const FunctionCallbackInfo& args) { node::Utf8Value curve(env->isolate(), args[0]); - if (strcmp(*curve, "auto") == 0) - return; + if (strcmp(*curve, "auto") == 0) return; if (!SSL_CTX_set1_curves_list(sc->ctx_.get(), *curve)) return env->ThrowError("Failed to set ECDH curve"); } - void SecureContext::SetDHParam(const FunctionCallbackInfo& args) { SecureContext* sc; ASSIGN_OR_RETURN_UNWRAP(&sc, args.This()); @@ -1018,22 +966,20 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo& args) { DHPointer dh; { BIOPointer bio(LoadBIO(env, args[0])); - if (!bio) - return; + if (!bio) return; dh.reset(PEM_read_bio_DHparams(bio.get(), nullptr, nullptr, nullptr)); } // Invalid dhparam is silently discarded and DHE is no longer used. - if (!dh) - return; + if (!dh) return; const BIGNUM* p; DH_get0_pqg(dh.get(), &p, nullptr, nullptr); const int size = BN_num_bits(p); if (size < 1024) { - return THROW_ERR_INVALID_ARG_VALUE( - env, "DH parameter is less than 1024 bits"); + return THROW_ERR_INVALID_ARG_VALUE(env, + "DH parameter is less than 1024 bits"); } else if (size < 2048) { args.GetReturnValue().Set(FIXED_ONE_BYTE_STRING( env->isolate(), "DH parameter is less than 2048 bits")); @@ -1042,11 +988,9 @@ void SecureContext::SetDHParam(const FunctionCallbackInfo& args) { SSL_CTX_set_options(sc->ctx_.get(), SSL_OP_SINGLE_DH_USE); int r = SSL_CTX_set_tmp_dh(sc->ctx_.get(), dh.get()); - if (!r) - return env->ThrowTypeError("Error setting temp DH parameter"); + if (!r) return env->ThrowTypeError("Error setting temp DH parameter"); } - void SecureContext::SetOptions(const FunctionCallbackInfo& args) { SecureContext* sc; ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder()); @@ -1054,15 +998,14 @@ void SecureContext::SetOptions(const FunctionCallbackInfo& args) { if (args.Length() != 1 || !args[0]->IntegerValue(args.GetIsolate()->GetCurrentContext()).To(&val)) { - return THROW_ERR_INVALID_ARG_TYPE( - sc->env(), "Options must be an integer value"); + return THROW_ERR_INVALID_ARG_TYPE(sc->env(), + "Options must be an integer value"); } SSL_CTX_set_options(sc->ctx_.get(), static_cast(val)); // NOLINT(runtime/int) } - void SecureContext::SetSessionIdContext( const FunctionCallbackInfo& args) { SecureContext* sc; @@ -1070,8 +1013,8 @@ void SecureContext::SetSessionIdContext( Environment* env = sc->env(); if (args.Length() != 1) { - return THROW_ERR_MISSING_ARGS( - env, "Session ID context argument is mandatory"); + return THROW_ERR_MISSING_ARGS(env, + "Session ID context argument is mandatory"); } THROW_AND_RETURN_IF_NOT_STRING(env, args[0], "Session ID context"); @@ -1082,8 +1025,7 @@ void SecureContext::SetSessionIdContext( unsigned int sid_ctx_len = sessionIdContext.length(); int r = SSL_CTX_set_session_id_context(sc->ctx_.get(), sid_ctx, sid_ctx_len); - if (r == 1) - return; + if (r == 1) return; BUF_MEM* mem; Local message; @@ -1101,7 +1043,6 @@ void SecureContext::SetSessionIdContext( args.GetIsolate()->ThrowException(Exception::TypeError(message)); } - void SecureContext::SetSessionTimeout(const FunctionCallbackInfo& args) { SecureContext* sc; ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder()); @@ -1115,14 +1056,12 @@ void SecureContext::SetSessionTimeout(const FunctionCallbackInfo& args) { SSL_CTX_set_timeout(sc->ctx_.get(), sessionTimeout); } - void SecureContext::Close(const FunctionCallbackInfo& args) { SecureContext* sc; ASSIGN_OR_RETURN_UNWRAP(&sc, args.Holder()); sc->Reset(); } - // Takes .pfx or .p12 and password in string or buffer format void SecureContext::LoadPKCS12(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -1139,8 +1078,7 @@ void SecureContext::LoadPKCS12(const FunctionCallbackInfo& args) { } BIOPointer in(LoadBIO(env, args[0])); - if (!in) - return env->ThrowError("Unable to load BIO"); + if (!in) return env->ThrowError("Unable to load BIO"); if (args.Length() >= 2) { THROW_AND_RETURN_IF_NOT_BUFFER(env, args[1], "Pass phrase"); @@ -1167,12 +1105,12 @@ void SecureContext::LoadPKCS12(const FunctionCallbackInfo& args) { STACK_OF(X509)* extra_certs_ptr = nullptr; if (d2i_PKCS12_bio(in.get(), &p12_ptr) && (p12.reset(p12_ptr), true) && // Move ownership to the smart pointer. - PKCS12_parse(p12.get(), pass.data(), - &pkey_ptr, - &cert_ptr, - &extra_certs_ptr) && - (pkey.reset(pkey_ptr), cert.reset(cert_ptr), - extra_certs.reset(extra_certs_ptr), true) && // Move ownership. + PKCS12_parse( + p12.get(), pass.data(), &pkey_ptr, &cert_ptr, &extra_certs_ptr) && + (pkey.reset(pkey_ptr), + cert.reset(cert_ptr), + extra_certs.reset(extra_certs_ptr), + true) && // Move ownership. SSL_CTX_use_certificate_chain(sc->ctx_.get(), std::move(cert), extra_certs.get(), @@ -1200,10 +1138,11 @@ void SecureContext::LoadPKCS12(const FunctionCallbackInfo& args) { } } - #ifndef OPENSSL_NO_ENGINE // Helper for the smart pointer. -void ENGINE_free_fn(ENGINE* engine) { ENGINE_free(engine); } +void ENGINE_free_fn(ENGINE* engine) { + ENGINE_free(engine); +} void SecureContext::SetClientCertEngine( const FunctionCallbackInfo& args) { @@ -1231,18 +1170,15 @@ void SecureContext::SetClientCertEngine( DeleteFnPtr engine( LoadEngineById(*engine_id, &errmsg)); - if (!engine) - return env->ThrowError(errmsg); + if (!engine) return env->ThrowError(errmsg); // Note that this takes another reference to `engine`. int r = SSL_CTX_set_client_cert_engine(sc->ctx_.get(), engine.get()); - if (r == 0) - return ThrowCryptoError(env, ERR_get_error()); + if (r == 0) return ThrowCryptoError(env, ERR_get_error()); sc->client_cert_engine_provided_ = true; } #endif // !OPENSSL_NO_ENGINE - void SecureContext::GetTicketKeys(const FunctionCallbackInfo& args) { #if !defined(OPENSSL_NO_TLSEXT) && defined(SSL_CTX_get_tlsext_ticket_keys) @@ -1258,7 +1194,6 @@ void SecureContext::GetTicketKeys(const FunctionCallbackInfo& args) { #endif // !def(OPENSSL_NO_TLSEXT) && def(SSL_CTX_get_tlsext_ticket_keys) } - void SecureContext::SetTicketKeys(const FunctionCallbackInfo& args) { #if !defined(OPENSSL_NO_TLSEXT) && defined(SSL_CTX_get_tlsext_ticket_keys) SecureContext* wrap; @@ -1272,8 +1207,8 @@ void SecureContext::SetTicketKeys(const FunctionCallbackInfo& args) { THROW_AND_RETURN_IF_NOT_BUFFER(env, args[0], "Ticket keys"); if (Buffer::Length(args[0]) != 48) { - return THROW_ERR_INVALID_ARG_VALUE( - env, "Ticket keys length must be 48 bytes"); + return THROW_ERR_INVALID_ARG_VALUE(env, + "Ticket keys length must be 48 bytes"); } memcpy(wrap->ticket_key_name_, Buffer::Data(args[0]), 16); @@ -1284,11 +1219,9 @@ void SecureContext::SetTicketKeys(const FunctionCallbackInfo& args) { #endif // !def(OPENSSL_NO_TLSEXT) && def(SSL_CTX_get_tlsext_ticket_keys) } - void SecureContext::SetFreeListLength(const FunctionCallbackInfo& args) { } - // Currently, EnableTicketKeyCallback and TicketKeyCallback are only present for // the regression test in test/parallel/test-https-resume-after-renew.js. void SecureContext::EnableTicketKeyCallback( @@ -1299,7 +1232,6 @@ void SecureContext::EnableTicketKeyCallback( SSL_CTX_set_tlsext_ticket_key_cb(wrap->ctx_.get(), TicketKeyCallback); } - int SecureContext::TicketKeyCallback(SSL* ssl, unsigned char* name, unsigned char* iv, @@ -1308,50 +1240,46 @@ int SecureContext::TicketKeyCallback(SSL* ssl, int enc) { static const int kTicketPartSize = 16; - SecureContext* sc = static_cast( - SSL_CTX_get_app_data(SSL_get_SSL_CTX(ssl))); + SecureContext* sc = + static_cast(SSL_CTX_get_app_data(SSL_get_SSL_CTX(ssl))); Environment* env = sc->env(); HandleScope handle_scope(env->isolate()); Context::Scope context_scope(env->context()); Local argv[] = { - Buffer::Copy(env, - reinterpret_cast(name), - kTicketPartSize).ToLocalChecked(), - Buffer::Copy(env, - reinterpret_cast(iv), - kTicketPartSize).ToLocalChecked(), - Boolean::New(env->isolate(), enc != 0) - }; + Buffer::Copy(env, reinterpret_cast(name), kTicketPartSize) + .ToLocalChecked(), + Buffer::Copy(env, reinterpret_cast(iv), kTicketPartSize) + .ToLocalChecked(), + Boolean::New(env->isolate(), enc != 0)}; Local ret = node::MakeCallback(env->isolate(), sc->object(), env->ticketkeycallback_string(), arraysize(argv), argv, - {0, 0}).ToLocalChecked(); + {0, 0}) + .ToLocalChecked(); Local arr = ret.As(); - int r = - arr->Get(env->context(), - kTicketKeyReturnIndex).ToLocalChecked() - ->Int32Value(env->context()).FromJust(); - if (r < 0) - return r; - - Local hmac = arr->Get(env->context(), - kTicketKeyHMACIndex).ToLocalChecked(); - Local aes = arr->Get(env->context(), - kTicketKeyAESIndex).ToLocalChecked(); - if (Buffer::Length(aes) != kTicketPartSize) - return -1; + int r = arr->Get(env->context(), kTicketKeyReturnIndex) + .ToLocalChecked() + ->Int32Value(env->context()) + .FromJust(); + if (r < 0) return r; + + Local hmac = + arr->Get(env->context(), kTicketKeyHMACIndex).ToLocalChecked(); + Local aes = + arr->Get(env->context(), kTicketKeyAESIndex).ToLocalChecked(); + if (Buffer::Length(aes) != kTicketPartSize) return -1; if (enc) { - Local name_val = arr->Get(env->context(), - kTicketKeyNameIndex).ToLocalChecked(); - Local iv_val = arr->Get(env->context(), - kTicketKeyIVIndex).ToLocalChecked(); + Local name_val = + arr->Get(env->context(), kTicketKeyNameIndex).ToLocalChecked(); + Local iv_val = + arr->Get(env->context(), kTicketKeyIVIndex).ToLocalChecked(); if (Buffer::Length(name_val) != kTicketPartSize || Buffer::Length(iv_val) != kTicketPartSize) { @@ -1362,48 +1290,39 @@ int SecureContext::TicketKeyCallback(SSL* ssl, memcpy(iv, Buffer::Data(iv_val), kTicketPartSize); } - HMAC_Init_ex(hctx, - Buffer::Data(hmac), - Buffer::Length(hmac), - EVP_sha256(), - nullptr); + HMAC_Init_ex( + hctx, Buffer::Data(hmac), Buffer::Length(hmac), EVP_sha256(), nullptr); const unsigned char* aes_key = reinterpret_cast(Buffer::Data(aes)); if (enc) { - EVP_EncryptInit_ex(ectx, - EVP_aes_128_cbc(), - nullptr, - aes_key, - iv); + EVP_EncryptInit_ex(ectx, EVP_aes_128_cbc(), nullptr, aes_key, iv); } else { - EVP_DecryptInit_ex(ectx, - EVP_aes_128_cbc(), - nullptr, - aes_key, - iv); + EVP_DecryptInit_ex(ectx, EVP_aes_128_cbc(), nullptr, aes_key, iv); } return r; } - int SecureContext::TicketCompatibilityCallback(SSL* ssl, unsigned char* name, unsigned char* iv, EVP_CIPHER_CTX* ectx, HMAC_CTX* hctx, int enc) { - SecureContext* sc = static_cast( - SSL_CTX_get_app_data(SSL_get_SSL_CTX(ssl))); + SecureContext* sc = + static_cast(SSL_CTX_get_app_data(SSL_get_SSL_CTX(ssl))); if (enc) { memcpy(name, sc->ticket_key_name_, sizeof(sc->ticket_key_name_)); if (RAND_bytes(iv, 16) <= 0 || - EVP_EncryptInit_ex(ectx, EVP_aes_128_cbc(), nullptr, - sc->ticket_key_aes_, iv) <= 0 || - HMAC_Init_ex(hctx, sc->ticket_key_hmac_, sizeof(sc->ticket_key_hmac_), - EVP_sha256(), nullptr) <= 0) { + EVP_EncryptInit_ex( + ectx, EVP_aes_128_cbc(), nullptr, sc->ticket_key_aes_, iv) <= 0 || + HMAC_Init_ex(hctx, + sc->ticket_key_hmac_, + sizeof(sc->ticket_key_hmac_), + EVP_sha256(), + nullptr) <= 0) { return -1; } return 1; @@ -1414,16 +1333,18 @@ int SecureContext::TicketCompatibilityCallback(SSL* ssl, return 0; } - if (EVP_DecryptInit_ex(ectx, EVP_aes_128_cbc(), nullptr, sc->ticket_key_aes_, - iv) <= 0 || - HMAC_Init_ex(hctx, sc->ticket_key_hmac_, sizeof(sc->ticket_key_hmac_), - EVP_sha256(), nullptr) <= 0) { + if (EVP_DecryptInit_ex( + ectx, EVP_aes_128_cbc(), nullptr, sc->ticket_key_aes_, iv) <= 0 || + HMAC_Init_ex(hctx, + sc->ticket_key_hmac_, + sizeof(sc->ticket_key_hmac_), + EVP_sha256(), + nullptr) <= 0) { return -1; } return 1; } - void SecureContext::CtxGetter(const FunctionCallbackInfo& info) { SecureContext* sc; ASSIGN_OR_RETURN_UNWRAP(&sc, info.This()); @@ -1431,7 +1352,6 @@ void SecureContext::CtxGetter(const FunctionCallbackInfo& info) { info.GetReturnValue().Set(ext); } - template void SecureContext::GetCertificate(const FunctionCallbackInfo& args) { SecureContext* wrap; @@ -1443,19 +1363,17 @@ void SecureContext::GetCertificate(const FunctionCallbackInfo& args) { cert = wrap->cert_.get(); else cert = wrap->issuer_.get(); - if (cert == nullptr) - return args.GetReturnValue().SetNull(); + if (cert == nullptr) return args.GetReturnValue().SetNull(); int size = i2d_X509(cert, nullptr); Local buff = Buffer::New(env, size).ToLocalChecked(); - unsigned char* serialized = reinterpret_cast( - Buffer::Data(buff)); + unsigned char* serialized = + reinterpret_cast(Buffer::Data(buff)); i2d_X509(cert, &serialized); args.GetReturnValue().Set(buff); } - template void SSLWrap::AddMethods(Environment* env, Local t) { HandleScope scope(env->isolate()); @@ -1477,20 +1395,19 @@ void SSLWrap::AddMethods(Environment* env, Local t) { env->SetProtoMethod(t, "newSessionDone", NewSessionDone); env->SetProtoMethod(t, "setOCSPResponse", SetOCSPResponse); env->SetProtoMethod(t, "requestOCSP", RequestOCSP); - env->SetProtoMethodNoSideEffect(t, "getEphemeralKeyInfo", - GetEphemeralKeyInfo); + env->SetProtoMethodNoSideEffect( + t, "getEphemeralKeyInfo", GetEphemeralKeyInfo); env->SetProtoMethodNoSideEffect(t, "getProtocol", GetProtocol); #ifdef SSL_set_max_send_fragment env->SetProtoMethod(t, "setMaxSendFragment", SetMaxSendFragment); #endif // SSL_set_max_send_fragment - env->SetProtoMethodNoSideEffect(t, "getALPNNegotiatedProtocol", - GetALPNNegotiatedProto); + env->SetProtoMethodNoSideEffect( + t, "getALPNNegotiatedProtocol", GetALPNNegotiatedProto); env->SetProtoMethod(t, "setALPNProtocols", SetALPNProtocols); } - template void SSLWrap::ConfigureSecureContext(SecureContext* sc) { // OCSP stapling @@ -1498,7 +1415,6 @@ void SSLWrap::ConfigureSecureContext(SecureContext* sc) { SSL_CTX_set_tlsext_status_arg(sc->ctx_.get(), nullptr); } - template SSL_SESSION* SSLWrap::GetSessionCallback(SSL* s, const unsigned char* key, @@ -1510,7 +1426,6 @@ SSL_SESSION* SSLWrap::GetSessionCallback(SSL* s, return w->next_sess_.release(); } - template int SSLWrap::NewSessionCallback(SSL* s, SSL_SESSION* sess) { Base* w = static_cast(SSL_get_app_data(s)); @@ -1518,39 +1433,36 @@ int SSLWrap::NewSessionCallback(SSL* s, SSL_SESSION* sess) { HandleScope handle_scope(env->isolate()); Context::Scope context_scope(env->context()); - if (!w->session_callbacks_) - return 0; + if (!w->session_callbacks_) return 0; // Check if session is small enough to be stored int size = i2d_SSL_SESSION(sess, nullptr); - if (size > SecureContext::kMaxSessionSize) - return 0; + if (size > SecureContext::kMaxSessionSize) return 0; // Serialize session Local session = Buffer::New(env, size).ToLocalChecked(); - unsigned char* session_data = reinterpret_cast( - Buffer::Data(session)); + unsigned char* session_data = + reinterpret_cast(Buffer::Data(session)); memset(session_data, 0, size); i2d_SSL_SESSION(sess, &session_data); unsigned int session_id_length; - const unsigned char* session_id_data = SSL_SESSION_get_id(sess, - &session_id_length); - Local session_id = Buffer::Copy( - env, - reinterpret_cast(session_id_data), - session_id_length).ToLocalChecked(); - Local argv[] = { session_id, session }; + const unsigned char* session_id_data = + SSL_SESSION_get_id(sess, &session_id_length); + Local session_id = + Buffer::Copy(env, + reinterpret_cast(session_id_data), + session_id_length) + .ToLocalChecked(); + Local argv[] = {session_id, session}; // On servers, we pause the handshake until callback of 'newSession', which // calls NewSessionDoneCb(). On clients, there is no callback to wait for. - if (w->is_server()) - w->awaiting_new_session_ = true; + if (w->is_server()) w->awaiting_new_session_ = true; w->MakeCallback(env->onnewsession_string(), arraysize(argv), argv); return 0; } - template void SSLWrap::OnClientHello(void* arg, const ClientHelloParser::ClientHello& hello) { @@ -1561,45 +1473,43 @@ void SSLWrap::OnClientHello(void* arg, Context::Scope context_scope(context); Local hello_obj = Object::New(env->isolate()); - Local buff = Buffer::Copy( - env, - reinterpret_cast(hello.session_id()), - hello.session_size()).ToLocalChecked(); + Local buff = + Buffer::Copy(env, + reinterpret_cast(hello.session_id()), + hello.session_size()) + .ToLocalChecked(); hello_obj->Set(context, env->session_id_string(), buff).FromJust(); if (hello.servername() == nullptr) { - hello_obj->Set(context, - env->servername_string(), - String::Empty(env->isolate())).FromJust(); + hello_obj + ->Set(context, env->servername_string(), String::Empty(env->isolate())) + .FromJust(); } else { - Local servername = OneByteString(env->isolate(), - hello.servername(), - hello.servername_size()); + Local servername = OneByteString( + env->isolate(), hello.servername(), hello.servername_size()); hello_obj->Set(context, env->servername_string(), servername).FromJust(); } - hello_obj->Set(context, - env->tls_ticket_string(), - Boolean::New(env->isolate(), hello.has_ticket())).FromJust(); + hello_obj + ->Set(context, + env->tls_ticket_string(), + Boolean::New(env->isolate(), hello.has_ticket())) + .FromJust(); - Local argv[] = { hello_obj }; + Local argv[] = {hello_obj}; w->MakeCallback(env->onclienthello_string(), arraysize(argv), argv); } - static bool SafeX509ExtPrint(BIO* out, X509_EXTENSION* ext) { const X509V3_EXT_METHOD* method = X509V3_EXT_get(ext); - if (method != X509V3_EXT_get_nid(NID_subject_alt_name)) - return false; + if (method != X509V3_EXT_get_nid(NID_subject_alt_name)) return false; GENERAL_NAMES* names = static_cast(X509V3_EXT_d2i(ext)); - if (names == nullptr) - return false; + if (names == nullptr) return false; for (int i = 0; i < sk_GENERAL_NAME_num(names); i++) { GENERAL_NAME* gen = sk_GENERAL_NAME_value(names, i); - if (i != 0) - BIO_write(out, ", ", 2); + if (i != 0) BIO_write(out, ", ", 2); if (gen->type == GEN_DNS) { ASN1_IA5STRING* name = gen->d.dNSName; @@ -1609,8 +1519,7 @@ static bool SafeX509ExtPrint(BIO* out, X509_EXTENSION* ext) { } else { STACK_OF(CONF_VALUE)* nval = i2v_GENERAL_NAME( const_cast(method), gen, nullptr); - if (nval == nullptr) - return false; + if (nval == nullptr) return false; X509V3_EXT_val_prn(out, nval, 0, 0); sk_CONF_VALUE_pop_free(nval, X509V3_conf_free); } @@ -1620,7 +1529,6 @@ static bool SafeX509ExtPrint(BIO* out, X509_EXTENSION* ext) { return true; } - static void AddFingerprintDigest(const unsigned char* md, unsigned int md_size, char (*fingerprint)[3 * EVP_MAX_MD_SIZE + 1]) { @@ -1628,19 +1536,18 @@ static void AddFingerprintDigest(const unsigned char* md, const char hex[] = "0123456789ABCDEF"; for (i = 0; i < md_size; i++) { - (*fingerprint)[3*i] = hex[(md[i] & 0xf0) >> 4]; - (*fingerprint)[(3*i)+1] = hex[(md[i] & 0x0f)]; - (*fingerprint)[(3*i)+2] = ':'; + (*fingerprint)[3 * i] = hex[(md[i] & 0xf0) >> 4]; + (*fingerprint)[(3 * i) + 1] = hex[(md[i] & 0x0f)]; + (*fingerprint)[(3 * i) + 2] = ':'; } if (md_size > 0) { - (*fingerprint)[(3*(md_size-1))+2] = '\0'; + (*fingerprint)[(3 * (md_size - 1)) + 2] = '\0'; } else { (*fingerprint)[0] = '\0'; } } - static MaybeLocal ECPointToBuffer(Environment* env, const EC_GROUP* group, const EC_POINT* point, @@ -1660,7 +1567,6 @@ static MaybeLocal ECPointToBuffer(Environment* env, return Buffer::New(env, buf.release(), len); } - static Local X509ToObject(Environment* env, X509* cert) { EscapableHandleScope scope(env->isolate()); Local context = env->context(); @@ -1668,36 +1574,39 @@ static Local X509ToObject(Environment* env, X509* cert) { BIOPointer bio(BIO_new(BIO_s_mem())); BUF_MEM* mem; - if (X509_NAME_print_ex(bio.get(), - X509_get_subject_name(cert), - 0, - X509_NAME_FLAGS) > 0) { + if (X509_NAME_print_ex( + bio.get(), X509_get_subject_name(cert), 0, X509_NAME_FLAGS) > 0) { BIO_get_mem_ptr(bio.get(), &mem); - info->Set(context, env->subject_string(), - String::NewFromUtf8(env->isolate(), mem->data, - NewStringType::kNormal, - mem->length).ToLocalChecked()).FromJust(); + info->Set( + context, + env->subject_string(), + String::NewFromUtf8( + env->isolate(), mem->data, NewStringType::kNormal, mem->length) + .ToLocalChecked()) + .FromJust(); } USE(BIO_reset(bio.get())); X509_NAME* issuer_name = X509_get_issuer_name(cert); if (X509_NAME_print_ex(bio.get(), issuer_name, 0, X509_NAME_FLAGS) > 0) { BIO_get_mem_ptr(bio.get(), &mem); - info->Set(context, env->issuer_string(), - String::NewFromUtf8(env->isolate(), mem->data, - NewStringType::kNormal, - mem->length).ToLocalChecked()).FromJust(); + info->Set( + context, + env->issuer_string(), + String::NewFromUtf8( + env->isolate(), mem->data, NewStringType::kNormal, mem->length) + .ToLocalChecked()) + .FromJust(); } USE(BIO_reset(bio.get())); - int nids[] = { NID_subject_alt_name, NID_info_access }; - Local keys[] = { env->subjectaltname_string(), - env->infoaccess_string() }; + int nids[] = {NID_subject_alt_name, NID_info_access}; + Local keys[] = {env->subjectaltname_string(), + env->infoaccess_string()}; CHECK_EQ(arraysize(nids), arraysize(keys)); for (size_t i = 0; i < arraysize(nids); i++) { int index = X509_get_ext_by_NID(cert, nids[i], -1); - if (index < 0) - continue; + if (index < 0) continue; X509_EXTENSION* ext = X509_get_ext(cert, index); CHECK_NOT_NULL(ext); @@ -1707,10 +1616,13 @@ static Local X509ToObject(Environment* env, X509* cert) { } BIO_get_mem_ptr(bio.get(), &mem); - info->Set(context, keys[i], - String::NewFromUtf8(env->isolate(), mem->data, - NewStringType::kNormal, - mem->length).ToLocalChecked()).FromJust(); + info->Set( + context, + keys[i], + String::NewFromUtf8( + env->isolate(), mem->data, NewStringType::kNormal, mem->length) + .ToLocalChecked()) + .FromJust(); USE(BIO_reset(bio.get())); } @@ -1735,15 +1647,18 @@ static Local X509ToObject(Environment* env, X509* cert) { RSA_get0_key(rsa.get(), &n, &e, nullptr); BN_print(bio.get(), n); BIO_get_mem_ptr(bio.get(), &mem); - info->Set(context, env->modulus_string(), - String::NewFromUtf8(env->isolate(), mem->data, - NewStringType::kNormal, - mem->length).ToLocalChecked()).FromJust(); + info->Set( + context, + env->modulus_string(), + String::NewFromUtf8( + env->isolate(), mem->data, NewStringType::kNormal, mem->length) + .ToLocalChecked()) + .FromJust(); USE(BIO_reset(bio.get())); int bits = BN_num_bits(n); - info->Set(context, env->bits_string(), - Integer::New(env->isolate(), bits)).FromJust(); + info->Set(context, env->bits_string(), Integer::New(env->isolate(), bits)) + .FromJust(); uint64_t exponent_word = static_cast(BN_get_word(e)); uint32_t lo = static_cast(exponent_word); @@ -1754,10 +1669,13 @@ static Local X509ToObject(Environment* env, X509* cert) { BIO_printf(bio.get(), "0x%x%08x", hi, lo); } BIO_get_mem_ptr(bio.get(), &mem); - info->Set(context, env->exponent_string(), - String::NewFromUtf8(env->isolate(), mem->data, - NewStringType::kNormal, - mem->length).ToLocalChecked()).FromJust(); + info->Set( + context, + env->exponent_string(), + String::NewFromUtf8( + env->isolate(), mem->data, NewStringType::kNormal, mem->length) + .ToLocalChecked()) + .FromJust(); USE(BIO_reset(bio.get())); int size = i2d_RSA_PUBKEY(rsa.get(), nullptr); @@ -1772,8 +1690,9 @@ static Local X509ToObject(Environment* env, X509* cert) { if (group != nullptr) { int bits = EC_GROUP_order_bits(group); if (bits > 0) { - info->Set(context, env->bits_string(), - Integer::New(env->isolate(), bits)).FromJust(); + info->Set( + context, env->bits_string(), Integer::New(env->isolate(), bits)) + .FromJust(); } } @@ -1791,13 +1710,17 @@ static Local X509ToObject(Environment* env, X509* cert) { // Curve is well-known, get its OID and NIST nick-name (if it has one). if (const char* sn = OBJ_nid2sn(nid)) { - info->Set(context, env->asn1curve_string(), - OneByteString(env->isolate(), sn)).FromJust(); + info->Set(context, + env->asn1curve_string(), + OneByteString(env->isolate(), sn)) + .FromJust(); } if (const char* nist = EC_curve_nid2nist(nid)) { - info->Set(context, env->nistcurve_string(), - OneByteString(env->isolate(), nist)).FromJust(); + info->Set(context, + env->nistcurve_string(), + OneByteString(env->isolate(), nist)) + .FromJust(); } } else { // Unnamed curves can be described by their mathematical properties, @@ -1811,32 +1734,40 @@ static Local X509ToObject(Environment* env, X509* cert) { ASN1_TIME_print(bio.get(), X509_get_notBefore(cert)); BIO_get_mem_ptr(bio.get(), &mem); - info->Set(context, env->valid_from_string(), - String::NewFromUtf8(env->isolate(), mem->data, - NewStringType::kNormal, - mem->length).ToLocalChecked()).FromJust(); + info->Set(context, + env->valid_from_string(), + String::NewFromUtf8( + env->isolate(), mem->data, NewStringType::kNormal, mem->length) + .ToLocalChecked()) + .FromJust(); USE(BIO_reset(bio.get())); ASN1_TIME_print(bio.get(), X509_get_notAfter(cert)); BIO_get_mem_ptr(bio.get(), &mem); - info->Set(context, env->valid_to_string(), - String::NewFromUtf8(env->isolate(), mem->data, - NewStringType::kNormal, - mem->length).ToLocalChecked()).FromJust(); + info->Set(context, + env->valid_to_string(), + String::NewFromUtf8( + env->isolate(), mem->data, NewStringType::kNormal, mem->length) + .ToLocalChecked()) + .FromJust(); bio.reset(); unsigned char md[EVP_MAX_MD_SIZE]; unsigned int md_size; char fingerprint[EVP_MAX_MD_SIZE * 3 + 1]; if (X509_digest(cert, EVP_sha1(), md, &md_size)) { - AddFingerprintDigest(md, md_size, &fingerprint); - info->Set(context, env->fingerprint_string(), - OneByteString(env->isolate(), fingerprint)).FromJust(); + AddFingerprintDigest(md, md_size, &fingerprint); + info->Set(context, + env->fingerprint_string(), + OneByteString(env->isolate(), fingerprint)) + .FromJust(); } if (X509_digest(cert, EVP_sha256(), md, &md_size)) { - AddFingerprintDigest(md, md_size, &fingerprint); - info->Set(context, env->fingerprint256_string(), - OneByteString(env->isolate(), fingerprint)).FromJust(); + AddFingerprintDigest(md, md_size, &fingerprint); + info->Set(context, + env->fingerprint256_string(), + OneByteString(env->isolate(), fingerprint)) + .FromJust(); } StackOfASN1 eku(static_cast( @@ -1847,12 +1778,10 @@ static Local X509ToObject(Environment* env, X509* cert) { int j = 0; for (int i = 0; i < sk_ASN1_OBJECT_num(eku.get()); i++) { - if (OBJ_obj2txt(buf, - sizeof(buf), - sk_ASN1_OBJECT_value(eku.get(), i), 1) >= 0) { - ext_key_usage->Set(context, - j++, - OneByteString(env->isolate(), buf)).FromJust(); + if (OBJ_obj2txt( + buf, sizeof(buf), sk_ASN1_OBJECT_value(eku.get(), i), 1) >= 0) { + ext_key_usage->Set(context, j++, OneByteString(env->isolate(), buf)) + .FromJust(); } } @@ -1865,8 +1794,10 @@ static Local X509ToObject(Environment* env, X509* cert) { if (bn) { OpenSSLBuffer buf(BN_bn2hex(bn.get())); if (buf) { - info->Set(context, env->serial_number_string(), - OneByteString(env->isolate(), buf.get())).FromJust(); + info->Set(context, + env->serial_number_string(), + OneByteString(env->isolate(), buf.get())) + .FromJust(); } } } @@ -1874,15 +1805,14 @@ static Local X509ToObject(Environment* env, X509* cert) { // Raw DER certificate int size = i2d_X509(cert, nullptr); Local buff = Buffer::New(env, size).ToLocalChecked(); - unsigned char* serialized = reinterpret_cast( - Buffer::Data(buff)); + unsigned char* serialized = + reinterpret_cast(Buffer::Data(buff)); i2d_X509(cert, &serialized); info->Set(context, env->raw_string(), buff).FromJust(); return scope.Escape(info); } - static Local AddIssuerChainToObject(X509Pointer* cert, Local object, StackOfX509&& peer_certs, @@ -1893,8 +1823,7 @@ static Local AddIssuerChainToObject(X509Pointer* cert, int i; for (i = 0; i < sk_X509_num(peer_certs.get()); i++) { X509* ca = sk_X509_value(peer_certs.get(), i); - if (X509_check_issued(ca, cert->get()) != X509_V_OK) - continue; + if (X509_check_issued(ca, cert->get()) != X509_V_OK) continue; Local ca_info = X509ToObject(env, ca); object->Set(context, env->issuercert_string(), ca_info).FromJust(); @@ -1907,18 +1836,15 @@ static Local AddIssuerChainToObject(X509Pointer* cert, } // Issuer not found, break out of the loop. - if (i == sk_X509_num(peer_certs.get())) - break; + if (i == sk_X509_num(peer_certs.get())) break; } return object; } - static StackOfX509 CloneSSLCerts(X509Pointer&& cert, - const STACK_OF(X509)* const ssl_certs) { + const STACK_OF(X509) * const ssl_certs) { StackOfX509 peer_certs(sk_X509_new(nullptr)); - if (cert) - sk_X509_push(peer_certs.get(), cert.release()); + if (cert) sk_X509_push(peer_certs.get(), cert.release()); for (int i = 0; i < sk_X509_num(ssl_certs); i++) { X509Pointer cert(X509_dup(sk_X509_value(ssl_certs, i))); if (!cert || !sk_X509_push(peer_certs.get(), cert.get())) @@ -1929,7 +1855,6 @@ static StackOfX509 CloneSSLCerts(X509Pointer&& cert, return peer_certs; } - static Local GetLastIssuedCert(X509Pointer* cert, const SSLPointer& ssl, Local issuer_chain, @@ -1950,7 +1875,6 @@ static Local GetLastIssuedCert(X509Pointer* cert, return issuer_chain; } - template void SSLWrap::GetPeerCertificate( const FunctionCallbackInfo& args) { @@ -1966,11 +1890,10 @@ void SSLWrap::GetPeerCertificate( // NOTE: This is because of the odd OpenSSL behavior. On client `cert_chain` // contains the `peer_certificate`, but on server it doesn't. - X509Pointer cert( - w->is_server() ? SSL_get_peer_certificate(w->ssl_.get()) : nullptr); + X509Pointer cert(w->is_server() ? SSL_get_peer_certificate(w->ssl_.get()) + : nullptr); STACK_OF(X509)* ssl_certs = SSL_get_peer_cert_chain(w->ssl_.get()); - if (!cert && (ssl_certs == nullptr || sk_X509_num(ssl_certs) == 0)) - goto done; + if (!cert && (ssl_certs == nullptr || sk_X509_num(ssl_certs) == 0)) goto done; // Short result requested. if (args.Length() < 1 || !args[0]->IsTrue()) { @@ -1989,19 +1912,16 @@ void SSLWrap::GetPeerCertificate( issuer_chain = GetLastIssuedCert(&cert, w->ssl_, issuer_chain, env); // Last certificate should be self-signed. if (X509_check_issued(cert.get(), cert.get()) == X509_V_OK) - issuer_chain->Set(env->context(), - env->issuercert_string(), - issuer_chain).FromJust(); + issuer_chain->Set(env->context(), env->issuercert_string(), issuer_chain) + .FromJust(); } - done: +done: args.GetReturnValue().Set(result); } - template -void SSLWrap::GetCertificate( - const FunctionCallbackInfo& args) { +void SSLWrap::GetCertificate(const FunctionCallbackInfo& args) { Base* w; ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder()); Environment* env = w->ssl_env(); @@ -2012,13 +1932,11 @@ void SSLWrap::GetCertificate( X509* cert = SSL_get_certificate(w->ssl_.get()); - if (cert != nullptr) - result = X509ToObject(env, cert); + if (cert != nullptr) result = X509ToObject(env, cert); args.GetReturnValue().Set(result); } - template void SSLWrap::GetFinished(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -2033,15 +1951,13 @@ void SSLWrap::GetFinished(const FunctionCallbackInfo& args) { // Thus, we use a dummy byte. char dummy[1]; size_t len = SSL_get_finished(w->ssl_.get(), dummy, sizeof dummy); - if (len == 0) - return; + if (len == 0) return; char* buf = Malloc(len); CHECK_EQ(len, SSL_get_finished(w->ssl_.get(), buf, len)); args.GetReturnValue().Set(Buffer::New(env, buf, len).ToLocalChecked()); } - template void SSLWrap::GetPeerFinished(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -2056,15 +1972,13 @@ void SSLWrap::GetPeerFinished(const FunctionCallbackInfo& args) { // Thus, we use a dummy byte. char dummy[1]; size_t len = SSL_get_peer_finished(w->ssl_.get(), dummy, sizeof dummy); - if (len == 0) - return; + if (len == 0) return; char* buf = Malloc(len); CHECK_EQ(len, SSL_get_peer_finished(w->ssl_.get(), buf, len)); args.GetReturnValue().Set(Buffer::New(env, buf, len).ToLocalChecked()); } - template void SSLWrap::GetSession(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -2073,8 +1987,7 @@ void SSLWrap::GetSession(const FunctionCallbackInfo& args) { ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder()); SSL_SESSION* sess = SSL_get_session(w->ssl_.get()); - if (sess == nullptr) - return; + if (sess == nullptr) return; int slen = i2d_SSL_SESSION(sess, nullptr); CHECK_GT(slen, 0); @@ -2085,7 +1998,6 @@ void SSLWrap::GetSession(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(Buffer::New(env, sbuf, slen).ToLocalChecked()); } - template void SSLWrap::SetSession(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -2100,22 +2012,18 @@ void SSLWrap::SetSession(const FunctionCallbackInfo& args) { THROW_AND_RETURN_IF_NOT_BUFFER(env, args[0], "Session"); size_t slen = Buffer::Length(args[0]); std::vector sbuf(slen); - if (char* p = Buffer::Data(args[0])) - sbuf.assign(p, p + slen); + if (char* p = Buffer::Data(args[0])) sbuf.assign(p, p + slen); const unsigned char* p = reinterpret_cast(sbuf.data()); SSLSessionPointer sess(d2i_SSL_SESSION(nullptr, &p, slen)); - if (sess == nullptr) - return; + if (sess == nullptr) return; int r = SSL_set_session(w->ssl_.get(), sess.get()); - if (!r) - return env->ThrowError("SSL_set_session error"); + if (!r) return env->ThrowError("SSL_set_session error"); } - template void SSLWrap::LoadSession(const FunctionCallbackInfo& args) { Base* w; @@ -2133,7 +2041,6 @@ void SSLWrap::LoadSession(const FunctionCallbackInfo& args) { } } - template void SSLWrap::IsSessionReused(const FunctionCallbackInfo& args) { Base* w; @@ -2142,7 +2049,6 @@ void SSLWrap::IsSessionReused(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(yes); } - template void SSLWrap::EndParser(const FunctionCallbackInfo& args) { Base* w; @@ -2150,7 +2056,6 @@ void SSLWrap::EndParser(const FunctionCallbackInfo& args) { w->hello_parser_.End(); } - template void SSLWrap::Renegotiate(const FunctionCallbackInfo& args) { Base* w; @@ -2163,7 +2068,6 @@ void SSLWrap::Renegotiate(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(yes); } - template void SSLWrap::GetTLSTicket(const FunctionCallbackInfo& args) { Base* w; @@ -2171,23 +2075,21 @@ void SSLWrap::GetTLSTicket(const FunctionCallbackInfo& args) { Environment* env = w->ssl_env(); SSL_SESSION* sess = SSL_get_session(w->ssl_.get()); - if (sess == nullptr) - return; + if (sess == nullptr) return; const unsigned char* ticket; size_t length; SSL_SESSION_get0_ticket(sess, &ticket, &length); - if (ticket == nullptr) - return; + if (ticket == nullptr) return; - Local buff = Buffer::Copy( - env, reinterpret_cast(ticket), length).ToLocalChecked(); + Local buff = + Buffer::Copy(env, reinterpret_cast(ticket), length) + .ToLocalChecked(); args.GetReturnValue().Set(buff); } - template void SSLWrap::NewSessionDone(const FunctionCallbackInfo& args) { Base* w; @@ -2196,7 +2098,6 @@ void SSLWrap::NewSessionDone(const FunctionCallbackInfo& args) { w->NewSessionDoneCb(); } - template void SSLWrap::SetOCSPResponse(const FunctionCallbackInfo& args) { Base* w; @@ -2211,7 +2112,6 @@ void SSLWrap::SetOCSPResponse(const FunctionCallbackInfo& args) { w->ocsp_response_.Reset(args.GetIsolate(), args[0].As()); } - template void SSLWrap::RequestOCSP(const FunctionCallbackInfo& args) { Base* w; @@ -2220,7 +2120,6 @@ void SSLWrap::RequestOCSP(const FunctionCallbackInfo& args) { SSL_set_tlsext_status_type(w->ssl_.get(), TLSEXT_STATUSTYPE_ocsp); } - template void SSLWrap::GetEphemeralKeyInfo( const FunctionCallbackInfo& args) { @@ -2232,8 +2131,7 @@ void SSLWrap::GetEphemeralKeyInfo( CHECK(w->ssl_); // tmp key is available on only client - if (w->is_server()) - return args.GetReturnValue().SetNull(); + if (w->is_server()) return args.GetReturnValue().SetNull(); Local info = Object::New(env->isolate()); @@ -2243,35 +2141,41 @@ void SSLWrap::GetEphemeralKeyInfo( int kid = EVP_PKEY_id(key); switch (kid) { case EVP_PKEY_DH: - info->Set(context, env->type_string(), - FIXED_ONE_BYTE_STRING(env->isolate(), "DH")).FromJust(); - info->Set(context, env->size_string(), - Integer::New(env->isolate(), EVP_PKEY_bits(key))).FromJust(); + info->Set(context, + env->type_string(), + FIXED_ONE_BYTE_STRING(env->isolate(), "DH")) + .FromJust(); + info->Set(context, + env->size_string(), + Integer::New(env->isolate(), EVP_PKEY_bits(key))) + .FromJust(); break; case EVP_PKEY_EC: // TODO(shigeki) Change this to EVP_PKEY_X25519 and add EVP_PKEY_X448 // after upgrading to 1.1.1. - case NID_X25519: - { - const char* curve_name; - if (kid == EVP_PKEY_EC) { - EC_KEY* ec = EVP_PKEY_get1_EC_KEY(key); - int nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec)); - curve_name = OBJ_nid2sn(nid); - EC_KEY_free(ec); - } else { - curve_name = OBJ_nid2sn(kid); - } - info->Set(context, env->type_string(), - FIXED_ONE_BYTE_STRING(env->isolate(), "ECDH")).FromJust(); - info->Set(context, env->name_string(), - OneByteString(args.GetIsolate(), - curve_name)).FromJust(); - info->Set(context, env->size_string(), - Integer::New(env->isolate(), - EVP_PKEY_bits(key))).FromJust(); + case NID_X25519: { + const char* curve_name; + if (kid == EVP_PKEY_EC) { + EC_KEY* ec = EVP_PKEY_get1_EC_KEY(key); + int nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec)); + curve_name = OBJ_nid2sn(nid); + EC_KEY_free(ec); + } else { + curve_name = OBJ_nid2sn(kid); } - break; + info->Set(context, + env->type_string(), + FIXED_ONE_BYTE_STRING(env->isolate(), "ECDH")) + .FromJust(); + info->Set(context, + env->name_string(), + OneByteString(args.GetIsolate(), curve_name)) + .FromJust(); + info->Set(context, + env->size_string(), + Integer::New(env->isolate(), EVP_PKEY_bits(key))) + .FromJust(); + } break; } EVP_PKEY_free(key); } @@ -2279,7 +2183,6 @@ void SSLWrap::GetEphemeralKeyInfo( return args.GetReturnValue().Set(info); } - #ifdef SSL_set_max_send_fragment template void SSLWrap::SetMaxSendFragment( @@ -2290,13 +2193,11 @@ void SSLWrap::SetMaxSendFragment( ASSIGN_OR_RETURN_UNWRAP(&w, args.Holder()); int rv = SSL_set_max_send_fragment( - w->ssl_.get(), - args[0]->Int32Value(w->ssl_env()->context()).FromJust()); + w->ssl_.get(), args[0]->Int32Value(w->ssl_env()->context()).FromJust()); args.GetReturnValue().Set(rv); } #endif // SSL_set_max_send_fragment - template void SSLWrap::VerifyError(const FunctionCallbackInfo& args) { Base* w; @@ -2312,12 +2213,14 @@ void SSLWrap::VerifyError(const FunctionCallbackInfo& args) { x509_verify_error = SSL_get_verify_result(w->ssl_.get()); } - if (x509_verify_error == X509_V_OK) - return args.GetReturnValue().SetNull(); + if (x509_verify_error == X509_V_OK) return args.GetReturnValue().SetNull(); const char* reason = X509_verify_cert_error_string(x509_verify_error); const char* code = reason; -#define CASE_X509_ERR(CODE) case X509_V_ERR_##CODE: code = #CODE; break; +#define CASE_X509_ERR(CODE) \ + case X509_V_ERR_##CODE: \ + code = #CODE; \ + break; switch (x509_verify_error) { CASE_X509_ERR(UNABLE_TO_GET_ISSUER_CERT) CASE_X509_ERR(UNABLE_TO_GET_CRL) @@ -2353,13 +2256,15 @@ void SSLWrap::VerifyError(const FunctionCallbackInfo& args) { Local reason_string = OneByteString(isolate, reason); Local exception_value = Exception::Error(reason_string); Local exception_object = - exception_value->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); - exception_object->Set(w->env()->context(), w->env()->code_string(), - OneByteString(isolate, code)).FromJust(); + exception_value->ToObject(isolate->GetCurrentContext()).ToLocalChecked(); + exception_object + ->Set(w->env()->context(), + w->env()->code_string(), + OneByteString(isolate, code)) + .FromJust(); args.GetReturnValue().Set(exception_object); } - template void SSLWrap::GetCurrentCipher(const FunctionCallbackInfo& args) { Base* w; @@ -2368,19 +2273,21 @@ void SSLWrap::GetCurrentCipher(const FunctionCallbackInfo& args) { Local context = env->context(); const SSL_CIPHER* c = SSL_get_current_cipher(w->ssl_.get()); - if (c == nullptr) - return; + if (c == nullptr) return; Local info = Object::New(env->isolate()); const char* cipher_name = SSL_CIPHER_get_name(c); - info->Set(context, env->name_string(), - OneByteString(args.GetIsolate(), cipher_name)).FromJust(); - info->Set(context, env->version_string(), - OneByteString(args.GetIsolate(), "TLSv1/SSLv3")).FromJust(); + info->Set(context, + env->name_string(), + OneByteString(args.GetIsolate(), cipher_name)) + .FromJust(); + info->Set(context, + env->version_string(), + OneByteString(args.GetIsolate(), "TLSv1/SSLv3")) + .FromJust(); args.GetReturnValue().Set(info); } - template void SSLWrap::GetProtocol(const FunctionCallbackInfo& args) { Base* w; @@ -2390,7 +2297,6 @@ void SSLWrap::GetProtocol(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(OneByteString(args.GetIsolate(), tls_version)); } - template int SSLWrap::SelectALPNCallback(SSL* s, const unsigned char** out, @@ -2404,15 +2310,19 @@ int SSLWrap::SelectALPNCallback(SSL* s, Context::Scope context_scope(env->context()); Local alpn_buffer = - w->object()->GetPrivate( - env->context(), - env->alpn_buffer_private_symbol()).ToLocalChecked(); + w->object() + ->GetPrivate(env->context(), env->alpn_buffer_private_symbol()) + .ToLocalChecked(); CHECK(Buffer::HasInstance(alpn_buffer)); const unsigned char* alpn_protos = reinterpret_cast(Buffer::Data(alpn_buffer)); unsigned alpn_protos_len = Buffer::Length(alpn_buffer); - int status = SSL_select_next_proto(const_cast(out), outlen, - alpn_protos, alpn_protos_len, in, inlen); + int status = SSL_select_next_proto(const_cast(out), + outlen, + alpn_protos, + alpn_protos_len, + in, + inlen); // According to 3.2. Protocol Selection of RFC7301, fatal // no_application_protocol alert shall be sent but OpenSSL 1.0.2 does not // support it yet. See @@ -2421,7 +2331,6 @@ int SSLWrap::SelectALPNCallback(SSL* s, : SSL_TLSEXT_ERR_NOACK; } - template void SSLWrap::GetALPNNegotiatedProto( const FunctionCallbackInfo& args) { @@ -2433,14 +2342,12 @@ void SSLWrap::GetALPNNegotiatedProto( SSL_get0_alpn_selected(w->ssl_.get(), &alpn_proto, &alpn_proto_len); - if (!alpn_proto) - return args.GetReturnValue().Set(false); + if (!alpn_proto) return args.GetReturnValue().Set(false); args.GetReturnValue().Set( OneByteString(args.GetIsolate(), alpn_proto, alpn_proto_len)); } - template void SSLWrap::SetALPNProtocols(const FunctionCallbackInfo& args) { Base* w; @@ -2456,19 +2363,16 @@ void SSLWrap::SetALPNProtocols(const FunctionCallbackInfo& args) { int r = SSL_set_alpn_protos(w->ssl_.get(), alpn_protos, alpn_protos_len); CHECK_EQ(r, 0); } else { - CHECK( - w->object()->SetPrivate( - env->context(), - env->alpn_buffer_private_symbol(), - args[0]).FromJust()); + CHECK(w->object() + ->SetPrivate( + env->context(), env->alpn_buffer_private_symbol(), args[0]) + .FromJust()); // Server should select ALPN protocol from list of advertised by client - SSL_CTX_set_alpn_select_cb(SSL_get_SSL_CTX(w->ssl_.get()), - SelectALPNCallback, - nullptr); + SSL_CTX_set_alpn_select_cb( + SSL_get_SSL_CTX(w->ssl_.get()), SelectALPNCallback, nullptr); } } - template int SSLWrap::TLSExtStatusCallback(SSL* s, void* arg) { Base* w = static_cast(SSL_get_app_data(s)); @@ -2483,9 +2387,8 @@ int SSLWrap::TLSExtStatusCallback(SSL* s, void* arg) { if (resp == nullptr) { arg = Null(env->isolate()); } else { - arg = - Buffer::Copy(env, reinterpret_cast(resp), len) - .ToLocalChecked(); + arg = Buffer::Copy(env, reinterpret_cast(resp), len) + .ToLocalChecked(); } w->MakeCallback(env->onocspresponse_string(), 1, &arg); @@ -2494,11 +2397,10 @@ int SSLWrap::TLSExtStatusCallback(SSL* s, void* arg) { return 1; } else { // Outgoing response - if (w->ocsp_response_.IsEmpty()) - return SSL_TLSEXT_ERR_NOACK; + if (w->ocsp_response_.IsEmpty()) return SSL_TLSEXT_ERR_NOACK; - Local obj = PersistentToLocal::Default(env->isolate(), - w->ocsp_response_); + Local obj = + PersistentToLocal::Default(env->isolate(), w->ocsp_response_); char* resp = Buffer::Data(obj); size_t len = Buffer::Length(obj); @@ -2506,34 +2408,28 @@ int SSLWrap::TLSExtStatusCallback(SSL* s, void* arg) { unsigned char* data = MallocOpenSSL(len); memcpy(data, resp, len); - if (!SSL_set_tlsext_status_ocsp_resp(s, data, len)) - OPENSSL_free(data); + if (!SSL_set_tlsext_status_ocsp_resp(s, data, len)) OPENSSL_free(data); w->ocsp_response_.Reset(); return SSL_TLSEXT_ERR_OK; } } - template void SSLWrap::WaitForCertCb(CertCb cb, void* arg) { cert_cb_ = cb; cert_cb_arg_ = arg; } - template int SSLWrap::SSLCertCallback(SSL* s, void* arg) { Base* w = static_cast(SSL_get_app_data(s)); - if (!w->is_server()) - return 1; + if (!w->is_server()) return 1; - if (!w->is_waiting_cert_cb()) - return 1; + if (!w->is_waiting_cert_cb()) return 1; - if (w->cert_cb_running_) - return -1; + if (w->cert_cb_running_) return -1; Environment* env = w->env(); Local context = env->context(); @@ -2545,30 +2441,29 @@ int SSLWrap::SSLCertCallback(SSL* s, void* arg) { const char* servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name); if (servername == nullptr) { - info->Set(context, - env->servername_string(), - String::Empty(env->isolate())).FromJust(); + info->Set(context, env->servername_string(), String::Empty(env->isolate())) + .FromJust(); } else { - Local str = OneByteString(env->isolate(), servername, - strlen(servername)); + Local str = + OneByteString(env->isolate(), servername, strlen(servername)); info->Set(context, env->servername_string(), str).FromJust(); } const bool ocsp = (SSL_get_tlsext_status_type(s) == TLSEXT_STATUSTYPE_ocsp); - info->Set(context, env->ocsp_request_string(), - Boolean::New(env->isolate(), ocsp)).FromJust(); + info->Set(context, + env->ocsp_request_string(), + Boolean::New(env->isolate(), ocsp)) + .FromJust(); - Local argv[] = { info }; + Local argv[] = {info}; w->MakeCallback(env->oncertcb_string(), arraysize(argv), argv); - if (!w->cert_cb_running_) - return 1; + if (!w->cert_cb_running_) return 1; // Performing async action, wait... return -1; } - template void SSLWrap::CertCbDone(const FunctionCallbackInfo& args) { Base* w; @@ -2578,13 +2473,12 @@ void SSLWrap::CertCbDone(const FunctionCallbackInfo& args) { CHECK(w->is_waiting_cert_cb() && w->cert_cb_running_); Local object = w->object(); - Local ctx = object->Get(env->context(), - env->sni_context_string()).ToLocalChecked(); + Local ctx = + object->Get(env->context(), env->sni_context_string()).ToLocalChecked(); Local cons = env->secure_context_constructor_template(); // Not an object, probably undefined or null - if (!ctx->IsObject()) - goto fire_cb; + if (!ctx->IsObject()) goto fire_cb; if (cons->HasInstance(ctx)) { SecureContext* sc; @@ -2596,21 +2490,16 @@ void SSLWrap::CertCbDone(const FunctionCallbackInfo& args) { // NOTE: reference count is not increased by this API methods X509* x509 = SSL_CTX_get0_certificate(sc->ctx_.get()); EVP_PKEY* pkey = SSL_CTX_get0_privatekey(sc->ctx_.get()); - STACK_OF(X509)* chain; + STACK_OF(X509) * chain; rv = SSL_CTX_get0_chain_certs(sc->ctx_.get(), &chain); - if (rv) - rv = SSL_use_certificate(w->ssl_.get(), x509); - if (rv) - rv = SSL_use_PrivateKey(w->ssl_.get(), pkey); - if (rv && chain != nullptr) - rv = SSL_set1_chain(w->ssl_.get(), chain); - if (rv) - rv = w->SetCACerts(sc); + if (rv) rv = SSL_use_certificate(w->ssl_.get(), x509); + if (rv) rv = SSL_use_PrivateKey(w->ssl_.get(), pkey); + if (rv && chain != nullptr) rv = SSL_set1_chain(w->ssl_.get(), chain); + if (rv) rv = w->SetCACerts(sc); if (!rv) { unsigned long err = ERR_get_error(); // NOLINT(runtime/int) - if (!err) - return env->ThrowError("CertCbDone"); + if (!err) return env->ThrowError("CertCbDone"); return ThrowCryptoError(env, err); } } else { @@ -2620,7 +2509,7 @@ void SSLWrap::CertCbDone(const FunctionCallbackInfo& args) { return; } - fire_cb: +fire_cb: CertCb cb; void* arg; @@ -2634,17 +2523,14 @@ void SSLWrap::CertCbDone(const FunctionCallbackInfo& args) { cb(arg); } - template void SSLWrap::DestroySSL() { - if (!ssl_) - return; + if (!ssl_) return; env_->isolate()->AdjustAmountOfExternalAllocatedMemory(-kExternalSize); ssl_.reset(); } - template void SSLWrap::SetSNIContext(SecureContext* sc) { ConfigureSecureContext(sc); @@ -2653,16 +2539,14 @@ void SSLWrap::SetSNIContext(SecureContext* sc) { SetCACerts(sc); } - template int SSLWrap::SetCACerts(SecureContext* sc) { int err = SSL_set1_verify_cert_store(ssl_.get(), SSL_CTX_get_cert_store(sc->ctx_.get())); - if (err != 1) - return err; + if (err != 1) return err; - STACK_OF(X509_NAME)* list = SSL_dup_CA_list( - SSL_CTX_get_client_CA_list(sc->ctx_.get())); + STACK_OF(X509_NAME)* list = + SSL_dup_CA_list(SSL_CTX_get_client_CA_list(sc->ctx_.get())); // NOTE: `SSL_set_client_CA_list` takes the ownership of `list` SSL_set_client_CA_list(ssl_.get(), list); @@ -2691,8 +2575,7 @@ static bool IsSupportedAuthenticatedMode(const EVP_CIPHER* cipher) { // Check `chacha20-poly1305` separately, it is also an AEAD cipher, // but its mode is 0 which doesn't indicate return EVP_CIPHER_nid(cipher) == NID_chacha20_poly1305 || - mode == EVP_CIPH_CCM_MODE || - mode == EVP_CIPH_GCM_MODE || + mode == EVP_CIPH_CCM_MODE || mode == EVP_CIPH_GCM_MODE || IS_OCB_MODE(mode); } @@ -2719,8 +2602,9 @@ static ParsePublicKeyResult TryParsePublicKey( // This skips surrounding data and decodes PEM to DER. { MarkPopErrorOnReturn mark_pop_error_on_return; - if (PEM_bytes_read_bio(&der_data, &der_len, nullptr, name, - bp.get(), nullptr, nullptr) != 1) + if (PEM_bytes_read_bio( + &der_data, &der_len, nullptr, name, bp.get(), nullptr, nullptr) != + 1) return ParsePublicKeyResult::kParsePublicNotRecognized; } @@ -2729,39 +2613,45 @@ static ParsePublicKeyResult TryParsePublicKey( pkey->reset(parse(&p, der_len)); OPENSSL_clear_free(der_data, der_len); - return *pkey ? ParsePublicKeyResult::kParsePublicOk : - ParsePublicKeyResult::kParsePublicFailed; + return *pkey ? ParsePublicKeyResult::kParsePublicOk + : ParsePublicKeyResult::kParsePublicFailed; } static ParsePublicKeyResult ParsePublicKeyPEM(EVPKeyPointer* pkey, const char* key_pem, int key_pem_len) { BIOPointer bp(BIO_new_mem_buf(const_cast(key_pem), key_pem_len)); - if (!bp) - return ParsePublicKeyResult::kParsePublicFailed; + if (!bp) return ParsePublicKeyResult::kParsePublicFailed; ParsePublicKeyResult ret; // Try parsing as a SubjectPublicKeyInfo first. - ret = TryParsePublicKey(pkey, bp, "PUBLIC KEY", + ret = TryParsePublicKey( + pkey, + bp, + "PUBLIC KEY", [](const unsigned char** p, long l) { // NOLINT(runtime/int) return d2i_PUBKEY(nullptr, p, l); }); - if (ret != ParsePublicKeyResult::kParsePublicNotRecognized) - return ret; + if (ret != ParsePublicKeyResult::kParsePublicNotRecognized) return ret; // Maybe it is PKCS#1. CHECK(BIO_reset(bp.get())); - ret = TryParsePublicKey(pkey, bp, "RSA PUBLIC KEY", + ret = TryParsePublicKey( + pkey, + bp, + "RSA PUBLIC KEY", [](const unsigned char** p, long l) { // NOLINT(runtime/int) return d2i_PublicKey(EVP_PKEY_RSA, nullptr, p, l); }); - if (ret != ParsePublicKeyResult::kParsePublicNotRecognized) - return ret; + if (ret != ParsePublicKeyResult::kParsePublicNotRecognized) return ret; // X.509 fallback. CHECK(BIO_reset(bp.get())); - return TryParsePublicKey(pkey, bp, "CERTIFICATE", + return TryParsePublicKey( + pkey, + bp, + "CERTIFICATE", [](const unsigned char** p, long l) { // NOLINT(runtime/int) X509Pointer x509(d2i_X509(nullptr, p, l)); return x509 ? X509_get_pubkey(x509.get()) : nullptr; @@ -2773,8 +2663,7 @@ static bool ParsePublicKey(EVPKeyPointer* pkey, const char* key, size_t key_len) { if (config.format_ == kKeyFormatPEM) { - ParsePublicKeyResult r = - ParsePublicKeyPEM(pkey, key, key_len); + ParsePublicKeyResult r = ParsePublicKeyPEM(pkey, key, key_len); return r == ParsePublicKeyResult::kParsePublicOk; } else { CHECK_EQ(config.format_, kKeyFormatDER); @@ -2797,9 +2686,9 @@ static inline Local BIOToStringOrBuffer(Environment* env, BIO_get_mem_ptr(bio, &bptr); if (format == kKeyFormatPEM) { // PEM is an ASCII format, so we will return it as a string. - return String::NewFromUtf8(env->isolate(), bptr->data, - NewStringType::kNormal, - bptr->length).ToLocalChecked(); + return String::NewFromUtf8( + env->isolate(), bptr->data, NewStringType::kNormal, bptr->length) + .ToLocalChecked(); } else { CHECK_EQ(format, kKeyFormatDER); // DER is binary, return it as a buffer. @@ -2855,14 +2744,11 @@ static EVPKeyPointer ParsePrivateKey(const PrivateKeyEncodingConfig& config, if (config.format_ == kKeyFormatPEM) { BIOPointer bio(BIO_new_mem_buf(key, key_len)); - if (!bio) - return pkey; + if (!bio) return pkey; char* pass = const_cast(config.passphrase_.get()); - pkey.reset(PEM_read_bio_PrivateKey(bio.get(), - nullptr, - PasswordCallback, - pass)); + pkey.reset( + PEM_read_bio_PrivateKey(bio.get(), nullptr, PasswordCallback, pass)); } else { CHECK_EQ(config.format_, kKeyFormatDER); @@ -2871,13 +2757,10 @@ static EVPKeyPointer ParsePrivateKey(const PrivateKeyEncodingConfig& config, pkey.reset(d2i_PrivateKey(EVP_PKEY_RSA, nullptr, &p, key_len)); } else if (config.type_.ToChecked() == kKeyEncodingPKCS8) { BIOPointer bio(BIO_new_mem_buf(key, key_len)); - if (!bio) - return pkey; + if (!bio) return pkey; char* pass = const_cast(config.passphrase_.get()); - pkey.reset(d2i_PKCS8PrivateKey_bio(bio.get(), - nullptr, - PasswordCallback, - pass)); + pkey.reset( + d2i_PKCS8PrivateKey_bio(bio.get(), nullptr, PasswordCallback, pass)); } else { CHECK_EQ(config.type_.ToChecked(), kKeyEncodingSEC1); const unsigned char* p = reinterpret_cast(key); @@ -2886,16 +2769,15 @@ static EVPKeyPointer ParsePrivateKey(const PrivateKeyEncodingConfig& config, } // OpenSSL can fail to parse the key but still return a non-null pointer. - if (ERR_peek_error() != 0) - pkey.reset(); + if (ERR_peek_error() != 0) pkey.reset(); return pkey; } ByteSource::ByteSource(ByteSource&& other) - : data_(other.data_), - allocated_data_(other.allocated_data_), - size_(other.size_) { + : data_(other.data_), + allocated_data_(other.allocated_data_), + size_(other.size_) { other.allocated_data_ = nullptr; } @@ -2928,7 +2810,8 @@ ByteSource ByteSource::FromStringOrBuffer(Environment* env, : FromString(env, value.As()); } -ByteSource ByteSource::FromString(Environment* env, Local str, +ByteSource ByteSource::FromString(Environment* env, + Local str, bool ntc) { CHECK(str->IsString()); size_t size = str->Utf8Length(env->isolate()); @@ -2965,9 +2848,7 @@ ByteSource ByteSource::FromSymmetricKeyObject(Local handle) { } ByteSource::ByteSource(const char* data, char* allocated_data, size_t size) - : data_(data), - allocated_data_(allocated_data), - size_(size) {} + : data_(data), allocated_data_(allocated_data), size_(size) {} ByteSource ByteSource::Allocated(char* data, size_t size) { return ByteSource(data, data, size); @@ -2983,11 +2864,10 @@ enum KeyEncodingContext { kKeyContextGenerate }; -static void GetKeyFormatAndTypeFromJs( - AsymmetricKeyEncodingConfig* config, - const FunctionCallbackInfo& args, - unsigned int* offset, - KeyEncodingContext context) { +static void GetKeyFormatAndTypeFromJs(AsymmetricKeyEncodingConfig* config, + const FunctionCallbackInfo& args, + unsigned int* offset, + KeyEncodingContext context) { // During key pair generation, it is possible not to specify a key encoding, // which will lead to a key object being returned. if (args[*offset]->IsUndefined()) { @@ -2998,12 +2878,12 @@ static void GetKeyFormatAndTypeFromJs( config->output_key_object_ = false; CHECK(args[*offset]->IsInt32()); - config->format_ = static_cast( - args[*offset].As()->Value()); + config->format_ = + static_cast(args[*offset].As()->Value()); if (args[*offset + 1]->IsInt32()) { - config->type_ = Just(static_cast( - args[*offset + 1].As()->Value())); + config->type_ = Just( + static_cast(args[*offset + 1].As()->Value())); } else { CHECK(context == kKeyContextInput && config->format_ == kKeyFormatPEM); CHECK(args[*offset + 1]->IsNullOrUndefined()); @@ -3033,8 +2913,7 @@ static NonCopyableMaybe GetPrivateKeyEncodingFromJs( GetKeyFormatAndTypeFromJs(&result, args, offset, context); if (result.output_key_object_) { - if (context != kKeyContextInput) - (*offset)++; + if (context != kKeyContextInput) (*offset)++; } else { bool needs_passphrase = false; if (context != kKeyContextInput) { @@ -3076,8 +2955,7 @@ static ManagedEVPPKey GetPrivateKeyFromJs( ByteSource key = ByteSource::FromStringOrBuffer(env, args[(*offset)++]); NonCopyableMaybe config = GetPrivateKeyEncodingFromJs(args, offset, kKeyContextInput); - if (config.IsEmpty()) - return ManagedEVPPKey(); + if (config.IsEmpty()) return ManagedEVPPKey(); EVPKeyPointer pkey = ParsePrivateKey(config.Release(), key.get(), key.size()); if (!pkey) @@ -3100,11 +2978,9 @@ static bool IsRSAPrivateKey(const unsigned char* data, size_t size) { if (data[1] & 0x80) { // Long form. size_t n_bytes = data[1] & ~0x80; - if (n_bytes + 2 > size || n_bytes > sizeof(size_t)) - return false; + if (n_bytes + 2 > size || n_bytes > sizeof(size_t)) return false; size_t i, length = 0; - for (i = 0; i < n_bytes; i++) - length = (length << 8) | data[i + 2]; + for (i = 0; i < n_bytes; i++) length = (length << 8) | data[i + 2]; offset = 2 + n_bytes; size = std::min(size, length + 2); } else { @@ -3118,9 +2994,7 @@ static bool IsRSAPrivateKey(const unsigned char* data, size_t size) { // (which is the product of two primes and therefore at least 4), so we can // decide the type of the structure based on the first three bytes of the // sequence. - return size - offset >= 3 && - data[offset] == 2 && - data[offset + 1] == 1 && + return size - offset >= 3 && data[offset] == 2 && data[offset + 1] == 1 && !(data[offset + 2] & 0xfe); } @@ -3136,15 +3010,14 @@ static ManagedEVPPKey GetPublicOrPrivateKeyFromJs( ByteSource data = ByteSource::FromStringOrBuffer(env, args[(*offset)++]); NonCopyableMaybe config_ = GetPrivateKeyEncodingFromJs(args, offset, kKeyContextInput); - if (config_.IsEmpty()) - return ManagedEVPPKey(); + if (config_.IsEmpty()) return ManagedEVPPKey(); PrivateKeyEncodingConfig config = config_.Release(); EVPKeyPointer pkey; if (config.format_ == kKeyFormatPEM) { // For PEM, we can easily determine whether it is a public or private key // by looking for the respective PEM tags. - ParsePublicKeyResult ret = ParsePublicKeyPEM(&pkey, data.get(), - data.size()); + ParsePublicKeyResult ret = + ParsePublicKeyPEM(&pkey, data.get(), data.size()); if (ret == ParsePublicKeyResult::kParsePublicNotRecognized) { pkey = ParsePrivateKey(config, data.get(), data.size()); } @@ -3188,9 +3061,7 @@ static ManagedEVPPKey GetPublicOrPrivateKeyFromJs( } static MaybeLocal WritePrivateKey( - Environment* env, - EVP_PKEY* pkey, - const PrivateKeyEncodingConfig& config) { + Environment* env, EVP_PKEY* pkey, const PrivateKeyEncodingConfig& config) { BIOPointer bio(BIO_new(BIO_s_mem())); CHECK(bio); @@ -3205,11 +3076,13 @@ static MaybeLocal WritePrivateKey( // Encode PKCS#1 as PEM. const char* pass = config.passphrase_.get(); err = PEM_write_bio_RSAPrivateKey( - bio.get(), rsa.get(), + bio.get(), + rsa.get(), config.cipher_, reinterpret_cast(const_cast(pass)), config.passphrase_.size(), - nullptr, nullptr) != 1; + nullptr, + nullptr) != 1; } else { // Encode PKCS#1 as DER. This does not permit encryption. CHECK_EQ(config.format_, kKeyFormatDER); @@ -3220,20 +3093,23 @@ static MaybeLocal WritePrivateKey( if (config.format_ == kKeyFormatPEM) { // Encode PKCS#8 as PEM. err = PEM_write_bio_PKCS8PrivateKey( - bio.get(), pkey, + bio.get(), + pkey, config.cipher_, const_cast(config.passphrase_.get()), config.passphrase_.size(), - nullptr, nullptr) != 1; + nullptr, + nullptr) != 1; } else { // Encode PKCS#8 as DER. CHECK_EQ(config.format_, kKeyFormatDER); - err = i2d_PKCS8PrivateKey_bio( - bio.get(), pkey, - config.cipher_, - const_cast(config.passphrase_.get()), - config.passphrase_.size(), - nullptr, nullptr) != 1; + err = i2d_PKCS8PrivateKey_bio(bio.get(), + pkey, + config.cipher_, + const_cast(config.passphrase_.get()), + config.passphrase_.size(), + nullptr, + nullptr) != 1; } } else { CHECK_EQ(config.type_.ToChecked(), kKeyEncodingSEC1); @@ -3246,11 +3122,13 @@ static MaybeLocal WritePrivateKey( // Encode SEC1 as PEM. const char* pass = config.passphrase_.get(); err = PEM_write_bio_ECPrivateKey( - bio.get(), ec_key.get(), + bio.get(), + ec_key.get(), config.cipher_, reinterpret_cast(const_cast(pass)), config.passphrase_.size(), - nullptr, nullptr) != 1; + nullptr, + nullptr) != 1; } else { // Encode SEC1 as DER. This does not permit encryption. CHECK_EQ(config.format_, kKeyFormatDER); @@ -3309,16 +3187,18 @@ Local KeyObject::Initialize(Environment* env, Local target) { t->InstanceTemplate()->SetInternalFieldCount(1); env->SetProtoMethod(t, "init", Init); - env->SetProtoMethodNoSideEffect(t, "getSymmetricKeySize", - GetSymmetricKeySize); - env->SetProtoMethodNoSideEffect(t, "getAsymmetricKeyType", - GetAsymmetricKeyType); + env->SetProtoMethodNoSideEffect( + t, "getSymmetricKeySize", GetSymmetricKeySize); + env->SetProtoMethodNoSideEffect( + t, "getAsymmetricKeyType", GetAsymmetricKeyType); env->SetProtoMethod(t, "export", Export); auto function = t->GetFunction(env->context()).ToLocalChecked(); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "KeyObject"), - function).FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "KeyObject"), + function) + .FromJust(); return function; } @@ -3379,30 +3259,28 @@ void KeyObject::Init(const FunctionCallbackInfo& args) { ManagedEVPPKey pkey; switch (key->key_type_) { - case kKeyTypeSecret: - CHECK_EQ(args.Length(), 1); - key->InitSecret(Buffer::Data(args[0]), Buffer::Length(args[0])); - break; - case kKeyTypePublic: - CHECK_EQ(args.Length(), 3); + case kKeyTypeSecret: + CHECK_EQ(args.Length(), 1); + key->InitSecret(Buffer::Data(args[0]), Buffer::Length(args[0])); + break; + case kKeyTypePublic: + CHECK_EQ(args.Length(), 3); - offset = 0; - pkey = GetPublicOrPrivateKeyFromJs(args, &offset, false); - if (!pkey) - return; - key->InitPublic(pkey); - break; - case kKeyTypePrivate: - CHECK_EQ(args.Length(), 4); + offset = 0; + pkey = GetPublicOrPrivateKeyFromJs(args, &offset, false); + if (!pkey) return; + key->InitPublic(pkey); + break; + case kKeyTypePrivate: + CHECK_EQ(args.Length(), 4); - offset = 0; - pkey = GetPrivateKeyFromJs(args, &offset, false); - if (!pkey) - return; - key->InitPrivate(pkey); - break; - default: - CHECK(false); + offset = 0; + pkey = GetPrivateKeyFromJs(args, &offset, false); + if (!pkey) return; + key->InitPrivate(pkey); + break; + default: + CHECK(false); } } @@ -3411,10 +3289,8 @@ void KeyObject::InitSecret(const char* key, size_t key_len) { char* mem = MallocOpenSSL(key_len); memcpy(mem, key, key_len); - this->symmetric_key_ = std::unique_ptr>(mem, - [key_len](char* p) { - OPENSSL_clear_free(p, key_len); - }); + this->symmetric_key_ = std::unique_ptr>( + mem, [key_len](char* p) { OPENSSL_clear_free(p, key_len); }); this->symmetric_key_len_ = key_len; } @@ -3433,14 +3309,14 @@ void KeyObject::InitPrivate(const ManagedEVPPKey& pkey) { Local KeyObject::GetAsymmetricKeyType() const { CHECK_NE(this->key_type_, kKeyTypeSecret); switch (EVP_PKEY_id(this->asymmetric_key_.get())) { - case EVP_PKEY_RSA: - return env()->crypto_rsa_string(); - case EVP_PKEY_DSA: - return env()->crypto_dsa_string(); - case EVP_PKEY_EC: - return env()->crypto_ec_string(); - default: - CHECK(false); + case EVP_PKEY_RSA: + return env()->crypto_rsa_string(); + case EVP_PKEY_DSA: + return env()->crypto_dsa_string(); + case EVP_PKEY_EC: + return env()->crypto_ec_string(); + default: + CHECK(false); } } @@ -3475,14 +3351,12 @@ void KeyObject::Export(const v8::FunctionCallbackInfo& args) { unsigned int offset = 0; NonCopyableMaybe config = GetPrivateKeyEncodingFromJs(args, &offset, kKeyContextExport); - if (config.IsEmpty()) - return; + if (config.IsEmpty()) return; CHECK_EQ(offset, static_cast(args.Length())); result = key->ExportPrivateKey(config.Release()); } - if (!result.IsEmpty()) - args.GetReturnValue().Set(result.ToLocalChecked()); + if (!result.IsEmpty()) args.GetReturnValue().Set(result.ToLocalChecked()); } Local KeyObject::ExportSecretKey() const { @@ -3500,7 +3374,6 @@ MaybeLocal KeyObject::ExportPrivateKey( return WritePrivateKey(env(), asymmetric_key_.get(), config); } - void CipherBase::Initialize(Environment* env, Local target) { Local t = env->NewFunctionTemplate(New); @@ -3515,12 +3388,13 @@ void CipherBase::Initialize(Environment* env, Local target) { env->SetProtoMethod(t, "setAuthTag", SetAuthTag); env->SetProtoMethod(t, "setAAD", SetAAD); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "CipherBase"), - t->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "CipherBase"), + t->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); } - void CipherBase::New(const FunctionCallbackInfo& args) { CHECK(args.IsConstructCall()); CipherKind kind = args[0]->IsTrue() ? kCipher : kDecipher; @@ -3543,16 +3417,15 @@ void CipherBase::CommonInit(const char* cipher_type, EVP_CIPHER_CTX_set_flags(ctx_.get(), EVP_CIPHER_CTX_FLAG_WRAP_ALLOW); const bool encrypt = (kind_ == kCipher); - if (1 != EVP_CipherInit_ex(ctx_.get(), cipher, nullptr, - nullptr, nullptr, encrypt)) { - return ThrowCryptoError(env(), ERR_get_error(), - "Failed to initialize cipher"); + if (1 != EVP_CipherInit_ex( + ctx_.get(), cipher, nullptr, nullptr, nullptr, encrypt)) { + return ThrowCryptoError( + env(), ERR_get_error(), "Failed to initialize cipher"); } if (IsSupportedAuthenticatedMode(cipher)) { CHECK_GE(iv_len, 0); - if (!InitAuthenticated(cipher_type, iv_len, auth_tag_len)) - return; + if (!InitAuthenticated(cipher_type, iv_len, auth_tag_len)) return; } if (!EVP_CIPHER_CTX_set_key_length(ctx_.get(), key_len)) { @@ -3561,8 +3434,8 @@ void CipherBase::CommonInit(const char* cipher_type, } if (1 != EVP_CipherInit_ex(ctx_.get(), nullptr, nullptr, key, iv, encrypt)) { - return ThrowCryptoError(env(), ERR_get_error(), - "Failed to initialize cipher"); + return ThrowCryptoError( + env(), ERR_get_error(), "Failed to initialize cipher"); } } @@ -3581,8 +3454,7 @@ void CipherBase::Init(const char* cipher_type, #endif // NODE_FIPS_MODE const EVP_CIPHER* const cipher = EVP_get_cipherbyname(cipher_type); - if (cipher == nullptr) - return env()->ThrowError("Unknown cipher"); + if (cipher == nullptr) return env()->ThrowError("Unknown cipher"); unsigned char key[EVP_MAX_KEY_LENGTH]; unsigned char iv[EVP_MAX_IV_LENGTH]; @@ -3598,21 +3470,24 @@ void CipherBase::Init(const char* cipher_type, CHECK_NE(key_len, 0); const int mode = EVP_CIPHER_mode(cipher); - if (kind_ == kCipher && (mode == EVP_CIPH_CTR_MODE || - mode == EVP_CIPH_GCM_MODE || - mode == EVP_CIPH_CCM_MODE)) { + if (kind_ == kCipher && + (mode == EVP_CIPH_CTR_MODE || mode == EVP_CIPH_GCM_MODE || + mode == EVP_CIPH_CCM_MODE)) { // Ignore the return value (i.e. possible exception) because we are // not calling back into JS anyway. - ProcessEmitWarning(env(), - "Use Cipheriv for counter mode of %s", - cipher_type); + ProcessEmitWarning( + env(), "Use Cipheriv for counter mode of %s", cipher_type); } - CommonInit(cipher_type, cipher, key, key_len, iv, - EVP_CIPHER_iv_length(cipher), auth_tag_len); + CommonInit(cipher_type, + cipher, + key, + key_len, + iv, + EVP_CIPHER_iv_length(cipher), + auth_tag_len); } - void CipherBase::Init(const FunctionCallbackInfo& args) { CipherBase* cipher; ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder()); @@ -3669,14 +3544,13 @@ void CipherBase::InitIv(const char* cipher_type, CommonInit(cipher_type, cipher, key, key_len, iv, iv_len, auth_tag_len); } - static ByteSource GetSecretKeyBytes(Environment* env, Local value) { // A key can be passed as a string, buffer or KeyObject with type 'secret'. // If it is a string, we need to convert it to a buffer. We are not doing that // in JS to avoid creating an unprotected copy on the heap. - return value->IsString() || Buffer::HasInstance(value) ? - ByteSource::FromStringOrBuffer(env, value) : - ByteSource::FromSymmetricKeyObject(value); + return value->IsString() || Buffer::HasInstance(value) + ? ByteSource::FromStringOrBuffer(env, value) + : ByteSource::FromSymmetricKeyObject(value); } void CipherBase::InitIv(const FunctionCallbackInfo& args) { @@ -3717,20 +3591,18 @@ void CipherBase::InitIv(const FunctionCallbackInfo& args) { auth_tag_len); } - static bool IsValidGCMTagLength(unsigned int tag_len) { return tag_len == 4 || tag_len == 8 || (tag_len >= 12 && tag_len <= 16); } -bool CipherBase::InitAuthenticated(const char* cipher_type, int iv_len, +bool CipherBase::InitAuthenticated(const char* cipher_type, + int iv_len, unsigned int auth_tag_len) { CHECK(IsAuthenticatedMode()); MarkPopErrorOnReturn mark_pop_error_on_return; - if (!EVP_CIPHER_CTX_ctrl(ctx_.get(), - EVP_CTRL_AEAD_SET_IVLEN, - iv_len, - nullptr)) { + if (!EVP_CIPHER_CTX_ctrl( + ctx_.get(), EVP_CTRL_AEAD_SET_IVLEN, iv_len, nullptr)) { env()->ThrowError("Invalid IV length"); return false; } @@ -3740,8 +3612,10 @@ bool CipherBase::InitAuthenticated(const char* cipher_type, int iv_len, if (auth_tag_len != kNoAuthTagLength) { if (!IsValidGCMTagLength(auth_tag_len)) { char msg[50]; - snprintf(msg, sizeof(msg), - "Invalid authentication tag length: %u", auth_tag_len); + snprintf(msg, + sizeof(msg), + "Invalid authentication tag length: %u", + auth_tag_len); env()->ThrowError(msg); return false; } @@ -3766,8 +3640,8 @@ bool CipherBase::InitAuthenticated(const char* cipher_type, int iv_len, #endif // Tell OpenSSL about the desired length. - if (!EVP_CIPHER_CTX_ctrl(ctx_.get(), EVP_CTRL_AEAD_SET_TAG, auth_tag_len, - nullptr)) { + if (!EVP_CIPHER_CTX_ctrl( + ctx_.get(), EVP_CTRL_AEAD_SET_TAG, auth_tag_len, nullptr)) { env()->ThrowError("Invalid authentication tag length"); return false; } @@ -3787,7 +3661,6 @@ bool CipherBase::InitAuthenticated(const char* cipher_type, int iv_len, return true; } - bool CipherBase::CheckCCMMessageLength(int message_len) { CHECK(ctx_); CHECK(EVP_CIPHER_CTX_mode(ctx_.get()) == EVP_CIPH_CCM_MODE); @@ -3800,39 +3673,34 @@ bool CipherBase::CheckCCMMessageLength(int message_len) { return true; } - bool CipherBase::IsAuthenticatedMode() const { // Check if this cipher operates in an AEAD mode that we support. CHECK(ctx_); return IsSupportedAuthenticatedMode(ctx_.get()); } - void CipherBase::GetAuthTag(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); CipherBase* cipher; ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder()); // Only callable after Final and if encrypting. - if (cipher->ctx_ || - cipher->kind_ != kCipher || + if (cipher->ctx_ || cipher->kind_ != kCipher || cipher->auth_tag_len_ == kNoAuthTagLength) { return args.GetReturnValue().SetUndefined(); } Local buf = Buffer::Copy(env, cipher->auth_tag_, cipher->auth_tag_len_) - .ToLocalChecked(); + .ToLocalChecked(); args.GetReturnValue().Set(buf); } - void CipherBase::SetAuthTag(const FunctionCallbackInfo& args) { CipherBase* cipher; ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder()); - if (!cipher->ctx_ || - !cipher->IsAuthenticatedMode() || + if (!cipher->ctx_ || !cipher->IsAuthenticatedMode() || cipher->kind_ != kDecipher || cipher->auth_tag_state_ != kAuthTagUnknown) { return args.GetReturnValue().Set(false); @@ -3856,8 +3724,8 @@ void CipherBase::SetAuthTag(const FunctionCallbackInfo& args) { if (!is_valid) { char msg[50]; - snprintf(msg, sizeof(msg), - "Invalid authentication tag length: %u", tag_len); + snprintf( + msg, sizeof(msg), "Invalid authentication tag length: %u", tag_len); return cipher->env()->ThrowError(msg); } @@ -3871,7 +3739,6 @@ void CipherBase::SetAuthTag(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(true); } - bool CipherBase::MaybePassAuthTagToOpenSSL() { if (auth_tag_state_ == kAuthTagKnown) { if (!EVP_CIPHER_CTX_ctrl(ctx_.get(), @@ -3885,10 +3752,8 @@ bool CipherBase::MaybePassAuthTagToOpenSSL() { return true; } - bool CipherBase::SetAAD(const char* data, unsigned int len, int plaintext_len) { - if (!ctx_ || !IsAuthenticatedMode()) - return false; + if (!ctx_ || !IsAuthenticatedMode()) return false; MarkPopErrorOnReturn mark_pop_error_on_return; int outlen; @@ -3902,12 +3767,10 @@ bool CipherBase::SetAAD(const char* data, unsigned int len, int plaintext_len) { return false; } - if (!CheckCCMMessageLength(plaintext_len)) - return false; + if (!CheckCCMMessageLength(plaintext_len)) return false; if (kind_ == kDecipher) { - if (!MaybePassAuthTagToOpenSSL()) - return false; + if (!MaybePassAuthTagToOpenSSL()) return false; } // Specify the plaintext length. @@ -3922,7 +3785,6 @@ bool CipherBase::SetAAD(const char* data, unsigned int len, int plaintext_len) { len); } - void CipherBase::SetAAD(const FunctionCallbackInfo& args) { CipherBase* cipher; ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder()); @@ -3931,25 +3793,22 @@ void CipherBase::SetAAD(const FunctionCallbackInfo& args) { CHECK(args[1]->IsInt32()); int plaintext_len = args[1].As()->Value(); - bool b = cipher->SetAAD(Buffer::Data(args[0]), Buffer::Length(args[0]), - plaintext_len); + bool b = cipher->SetAAD( + Buffer::Data(args[0]), Buffer::Length(args[0]), plaintext_len); args.GetReturnValue().Set(b); // Possibly report invalid state failure } - CipherBase::UpdateResult CipherBase::Update(const char* data, int len, unsigned char** out, int* out_len) { - if (!ctx_) - return kErrorState; + if (!ctx_) return kErrorState; MarkPopErrorOnReturn mark_pop_error_on_return; const int mode = EVP_CIPHER_CTX_mode(ctx_.get()); if (mode == EVP_CIPH_CCM_MODE) { - if (!CheckCCMMessageLength(len)) - return kErrorMessageSize; + if (!CheckCCMMessageLength(len)) return kErrorMessageSize; } // Pass the authentication tag to OpenSSL if possible. This will only happen @@ -3989,7 +3848,6 @@ CipherBase::UpdateResult CipherBase::Update(const char* data, return r == 1 ? kSuccess : kErrorState; } - void CipherBase::Update(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -4016,8 +3874,8 @@ void CipherBase::Update(const FunctionCallbackInfo& args) { if (r != kSuccess) { free(out); if (r == kErrorState) { - ThrowCryptoError(env, ERR_get_error(), - "Trying to add data in unsupported state"); + ThrowCryptoError( + env, ERR_get_error(), "Trying to add data in unsupported state"); } return; } @@ -4029,15 +3887,12 @@ void CipherBase::Update(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(buf); } - bool CipherBase::SetAutoPadding(bool auto_padding) { - if (!ctx_) - return false; + if (!ctx_) return false; MarkPopErrorOnReturn mark_pop_error_on_return; return EVP_CIPHER_CTX_set_padding(ctx_.get(), auto_padding); } - void CipherBase::SetAutoPadding(const FunctionCallbackInfo& args) { CipherBase* cipher; ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder()); @@ -4046,10 +3901,8 @@ void CipherBase::SetAutoPadding(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(b); // Possibly report invalid state failure } - bool CipherBase::Final(unsigned char** out, int* out_len) { - if (!ctx_) - return false; + if (!ctx_) return false; const int mode = EVP_CIPHER_CTX_mode(ctx_.get()); @@ -4076,9 +3929,12 @@ bool CipherBase::Final(unsigned char** out, int* out_len) { CHECK(mode == EVP_CIPH_GCM_MODE); auth_tag_len_ = sizeof(auth_tag_); } - CHECK_EQ(1, EVP_CIPHER_CTX_ctrl(ctx_.get(), EVP_CTRL_AEAD_GET_TAG, - auth_tag_len_, - reinterpret_cast(auth_tag_))); + CHECK_EQ( + 1, + EVP_CIPHER_CTX_ctrl(ctx_.get(), + EVP_CTRL_AEAD_GET_TAG, + auth_tag_len_, + reinterpret_cast(auth_tag_))); } } @@ -4087,7 +3943,6 @@ bool CipherBase::Final(unsigned char** out, int* out_len) { return ok; } - void CipherBase::Final(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -4107,24 +3962,20 @@ void CipherBase::Final(const FunctionCallbackInfo& args) { out_value = nullptr; out_len = 0; if (!r) { - const char* msg = is_auth_mode ? - "Unsupported state or unable to authenticate data" : - "Unsupported state"; + const char* msg = is_auth_mode + ? "Unsupported state or unable to authenticate data" + : "Unsupported state"; - return ThrowCryptoError(env, - ERR_get_error(), - msg); + return ThrowCryptoError(env, ERR_get_error(), msg); } } - Local buf = Buffer::New( - env, - reinterpret_cast(out_value), - out_len).ToLocalChecked(); + Local buf = + Buffer::New(env, reinterpret_cast(out_value), out_len) + .ToLocalChecked(); args.GetReturnValue().Set(buf); } - void Hmac::Initialize(Environment* env, Local target) { Local t = env->NewFunctionTemplate(New); @@ -4134,18 +3985,18 @@ void Hmac::Initialize(Environment* env, Local target) { env->SetProtoMethod(t, "update", HmacUpdate); env->SetProtoMethod(t, "digest", HmacDigest); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "Hmac"), - t->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "Hmac"), + t->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); } - void Hmac::New(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); new Hmac(env, args.This()); } - void Hmac::HmacInit(const char* hash_type, const char* key, int key_len) { HandleScope scope(env()->isolate()); @@ -4163,7 +4014,6 @@ void Hmac::HmacInit(const char* hash_type, const char* key, int key_len) { } } - void Hmac::HmacInit(const FunctionCallbackInfo& args) { Hmac* hmac; ASSIGN_OR_RETURN_UNWRAP(&hmac, args.Holder()); @@ -4174,17 +4024,13 @@ void Hmac::HmacInit(const FunctionCallbackInfo& args) { hmac->HmacInit(*hash_type, key.get(), key.size()); } - bool Hmac::HmacUpdate(const char* data, int len) { - if (!ctx_) - return false; - int r = HMAC_Update(ctx_.get(), - reinterpret_cast(data), - len); + if (!ctx_) return false; + int r = HMAC_Update( + ctx_.get(), reinterpret_cast(data), len); return r == 1; } - void Hmac::HmacUpdate(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -4209,7 +4055,6 @@ void Hmac::HmacUpdate(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(r); } - void Hmac::HmacDigest(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -4245,7 +4090,6 @@ void Hmac::HmacDigest(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(rc.ToLocalChecked()); } - void Hash::Initialize(Environment* env, Local target) { Local t = env->NewFunctionTemplate(New); @@ -4254,12 +4098,13 @@ void Hash::Initialize(Environment* env, Local target) { env->SetProtoMethod(t, "update", HashUpdate); env->SetProtoMethod(t, "digest", HashDigest); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "Hash"), - t->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "Hash"), + t->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); } - void Hash::New(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -4267,16 +4112,14 @@ void Hash::New(const FunctionCallbackInfo& args) { Hash* hash = new Hash(env, args.This()); if (!hash->HashInit(*hash_type)) { - return ThrowCryptoError(env, ERR_get_error(), - "Digest method not supported"); + return ThrowCryptoError( + env, ERR_get_error(), "Digest method not supported"); } } - bool Hash::HashInit(const char* hash_type) { const EVP_MD* md = EVP_get_digestbyname(hash_type); - if (md == nullptr) - return false; + if (md == nullptr) return false; mdctx_.reset(EVP_MD_CTX_new()); if (!mdctx_ || EVP_DigestInit_ex(mdctx_.get(), md, nullptr) <= 0) { mdctx_.reset(); @@ -4285,15 +4128,12 @@ bool Hash::HashInit(const char* hash_type) { return true; } - bool Hash::HashUpdate(const char* data, int len) { - if (!mdctx_) - return false; + if (!mdctx_) return false; EVP_DigestUpdate(mdctx_.get(), data, len); return true; } - void Hash::HashUpdate(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -4319,7 +4159,6 @@ void Hash::HashUpdate(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(r); } - void Hash::HashDigest(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -4351,18 +4190,15 @@ void Hash::HashDigest(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(rc.ToLocalChecked()); } - SignBase::Error SignBase::Init(const char* sign_type) { CHECK_NULL(mdctx_); // Historically, "dss1" and "DSS1" were DSA aliases for SHA-1 // exposed through the public API. - if (strcmp(sign_type, "dss1") == 0 || - strcmp(sign_type, "DSS1") == 0) { + if (strcmp(sign_type, "dss1") == 0 || strcmp(sign_type, "DSS1") == 0) { sign_type = "SHA1"; } const EVP_MD* md = EVP_get_digestbyname(sign_type); - if (md == nullptr) - return kSignUnknownDigest; + if (md == nullptr) return kSignUnknownDigest; mdctx_.reset(EVP_MD_CTX_new()); if (!mdctx_ || !EVP_DigestInit_ex(mdctx_.get(), md, nullptr)) { @@ -4373,16 +4209,12 @@ SignBase::Error SignBase::Init(const char* sign_type) { return kSignOk; } - SignBase::Error SignBase::Update(const char* data, int len) { - if (mdctx_ == nullptr) - return kSignNotInitialised; - if (!EVP_DigestUpdate(mdctx_.get(), data, len)) - return kSignUpdate; + if (mdctx_ == nullptr) return kSignNotInitialised; + if (!EVP_DigestUpdate(mdctx_.get(), data, len)) return kSignUpdate; return kSignOk; } - void SignBase::CheckThrow(SignBase::Error error) { HandleScope scope(env()->isolate()); @@ -4396,24 +4228,22 @@ void SignBase::CheckThrow(SignBase::Error error) { case kSignInit: case kSignUpdate: case kSignPrivateKey: - case kSignPublicKey: - { - unsigned long err = ERR_get_error(); // NOLINT(runtime/int) - if (err) - return ThrowCryptoError(env(), err); - switch (error) { - case kSignInit: - return env()->ThrowError("EVP_SignInit_ex failed"); - case kSignUpdate: - return env()->ThrowError("EVP_SignUpdate failed"); - case kSignPrivateKey: - return env()->ThrowError("PEM_read_bio_PrivateKey failed"); - case kSignPublicKey: - return env()->ThrowError("PEM_read_bio_PUBKEY failed"); - default: - ABORT(); - } + case kSignPublicKey: { + unsigned long err = ERR_get_error(); // NOLINT(runtime/int) + if (err) return ThrowCryptoError(env(), err); + switch (error) { + case kSignInit: + return env()->ThrowError("EVP_SignInit_ex failed"); + case kSignUpdate: + return env()->ThrowError("EVP_SignUpdate failed"); + case kSignPrivateKey: + return env()->ThrowError("PEM_read_bio_PrivateKey failed"); + case kSignPublicKey: + return env()->ThrowError("PEM_read_bio_PUBKEY failed"); + default: + ABORT(); } + } case kSignOk: return; @@ -4426,19 +4256,15 @@ static bool ApplyRSAOptions(const ManagedEVPPKey& pkey, int salt_len) { if (EVP_PKEY_id(pkey.get()) == EVP_PKEY_RSA || EVP_PKEY_id(pkey.get()) == EVP_PKEY_RSA2) { - if (EVP_PKEY_CTX_set_rsa_padding(pkctx, padding) <= 0) - return false; + if (EVP_PKEY_CTX_set_rsa_padding(pkctx, padding) <= 0) return false; if (padding == RSA_PKCS1_PSS_PADDING) { - if (EVP_PKEY_CTX_set_rsa_pss_saltlen(pkctx, salt_len) <= 0) - return false; + if (EVP_PKEY_CTX_set_rsa_pss_saltlen(pkctx, salt_len) <= 0) return false; } } return true; } - - void Sign::Initialize(Environment* env, Local target) { Local t = env->NewFunctionTemplate(New); @@ -4448,18 +4274,18 @@ void Sign::Initialize(Environment* env, Local target) { env->SetProtoMethod(t, "update", SignUpdate); env->SetProtoMethod(t, "sign", SignFinal); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "Sign"), - t->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "Sign"), + t->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); } - void Sign::New(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); new Sign(env, args.This()); } - void Sign::SignInit(const FunctionCallbackInfo& args) { Sign* sign; ASSIGN_OR_RETURN_UNWRAP(&sign, args.Holder()); @@ -4468,7 +4294,6 @@ void Sign::SignInit(const FunctionCallbackInfo& args) { sign->CheckThrow(sign->Init(*sign_type)); } - void Sign::SignUpdate(const FunctionCallbackInfo& args) { Sign* sign; ASSIGN_OR_RETURN_UNWRAP(&sign, args.Holder()); @@ -4497,11 +4322,10 @@ static MallocedBuffer Node_SignFinal(EVPMDPointer&& mdctx, MallocedBuffer sig(sig_len); EVPKeyCtxPointer pkctx(EVP_PKEY_CTX_new(pkey.get(), nullptr)); - if (pkctx && - EVP_PKEY_sign_init(pkctx.get()) > 0 && + if (pkctx && EVP_PKEY_sign_init(pkctx.get()) > 0 && ApplyRSAOptions(pkey, pkctx.get(), padding, pss_salt_len) && - EVP_PKEY_CTX_set_signature_md(pkctx.get(), - EVP_MD_CTX_md(mdctx.get())) > 0 && + EVP_PKEY_CTX_set_signature_md(pkctx.get(), EVP_MD_CTX_md(mdctx.get())) > + 0 && EVP_PKEY_sign(pkctx.get(), sig.data, &sig_len, m, m_len) > 0) { sig.Truncate(sig_len); return sig; @@ -4510,12 +4334,10 @@ static MallocedBuffer Node_SignFinal(EVPMDPointer&& mdctx, return MallocedBuffer(); } -Sign::SignResult Sign::SignFinal( - const ManagedEVPPKey& pkey, - int padding, - int salt_len) { - if (!mdctx_) - return SignResult(kSignNotInitialised); +Sign::SignResult Sign::SignFinal(const ManagedEVPPKey& pkey, + int padding, + int salt_len) { + if (!mdctx_) return SignResult(kSignNotInitialised); EVPMDPointer mdctx = std::move(mdctx_); @@ -4552,7 +4374,6 @@ Sign::SignResult Sign::SignFinal( return SignResult(error, std::move(buffer)); } - void Sign::SignFinal(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -4561,8 +4382,7 @@ void Sign::SignFinal(const FunctionCallbackInfo& args) { unsigned int offset = 0; ManagedEVPPKey key = GetPrivateKeyFromJs(args, &offset, true); - if (!key) - return; + if (!key) return; CHECK(args[offset]->IsInt32()); int padding = args[offset].As()->Value(); @@ -4572,20 +4392,15 @@ void Sign::SignFinal(const FunctionCallbackInfo& args) { ClearErrorOnReturn clear_error_on_return; - SignResult ret = sign->SignFinal( - key, - padding, - salt_len); + SignResult ret = sign->SignFinal(key, padding, salt_len); - if (ret.error != kSignOk) - return sign->CheckThrow(ret.error); + if (ret.error != kSignOk) return sign->CheckThrow(ret.error); - MallocedBuffer sig = - std::move(ret.signature); + MallocedBuffer sig = std::move(ret.signature); Local rc = Buffer::New(env, reinterpret_cast(sig.release()), sig.size) - .ToLocalChecked(); + .ToLocalChecked(); args.GetReturnValue().Set(rc); } @@ -4598,18 +4413,18 @@ void Verify::Initialize(Environment* env, Local target) { env->SetProtoMethod(t, "update", VerifyUpdate); env->SetProtoMethod(t, "verify", VerifyFinal); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "Verify"), - t->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "Verify"), + t->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); } - void Verify::New(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); new Verify(env, args.This()); } - void Verify::VerifyInit(const FunctionCallbackInfo& args) { Verify* verify; ASSIGN_OR_RETURN_UNWRAP(&verify, args.Holder()); @@ -4618,7 +4433,6 @@ void Verify::VerifyInit(const FunctionCallbackInfo& args) { verify->CheckThrow(verify->Init(*verify_type)); } - void Verify::VerifyUpdate(const FunctionCallbackInfo& args) { Verify* verify; ASSIGN_OR_RETURN_UNWRAP(&verify, args.Holder()); @@ -4631,30 +4445,26 @@ void Verify::VerifyUpdate(const FunctionCallbackInfo& args) { verify->CheckThrow(err); } - SignBase::Error Verify::VerifyFinal(const ManagedEVPPKey& pkey, const char* sig, int siglen, int padding, int saltlen, bool* verify_result) { - if (!mdctx_) - return kSignNotInitialised; + if (!mdctx_) return kSignNotInitialised; unsigned char m[EVP_MAX_MD_SIZE]; unsigned int m_len; *verify_result = false; EVPMDPointer mdctx = std::move(mdctx_); - if (!EVP_DigestFinal_ex(mdctx.get(), m, &m_len)) - return kSignPublicKey; + if (!EVP_DigestFinal_ex(mdctx.get(), m, &m_len)) return kSignPublicKey; EVPKeyCtxPointer pkctx(EVP_PKEY_CTX_new(pkey.get(), nullptr)); - if (pkctx && - EVP_PKEY_verify_init(pkctx.get()) > 0 && + if (pkctx && EVP_PKEY_verify_init(pkctx.get()) > 0 && ApplyRSAOptions(pkey, pkctx.get(), padding, saltlen) && - EVP_PKEY_CTX_set_signature_md(pkctx.get(), - EVP_MD_CTX_md(mdctx.get())) > 0) { + EVP_PKEY_CTX_set_signature_md(pkctx.get(), EVP_MD_CTX_md(mdctx.get())) > + 0) { const int r = EVP_PKEY_verify(pkctx.get(), reinterpret_cast(sig), siglen, @@ -4666,7 +4476,6 @@ SignBase::Error Verify::VerifyFinal(const ManagedEVPPKey& pkey, return kSignOk; } - void Verify::VerifyFinal(const FunctionCallbackInfo& args) { ClearErrorOnReturn clear_error_on_return; @@ -4686,14 +4495,12 @@ void Verify::VerifyFinal(const FunctionCallbackInfo& args) { int salt_len = args[offset + 2].As()->Value(); bool verify_result; - Error err = verify->VerifyFinal(pkey, hbuf, hlen, padding, salt_len, - &verify_result); - if (err != kSignOk) - return verify->CheckThrow(err); + Error err = + verify->VerifyFinal(pkey, hbuf, hlen, padding, salt_len, &verify_result); + if (err != kSignOk) return verify->CheckThrow(err); args.GetReturnValue().Set(verify_result); } - template @@ -4704,25 +4511,20 @@ bool PublicKeyCipher::Cipher(const ManagedEVPPKey& pkey, unsigned char** out, size_t* out_len) { EVPKeyCtxPointer ctx(EVP_PKEY_CTX_new(pkey.get(), nullptr)); - if (!ctx) - return false; - if (EVP_PKEY_cipher_init(ctx.get()) <= 0) - return false; - if (EVP_PKEY_CTX_set_rsa_padding(ctx.get(), padding) <= 0) - return false; + if (!ctx) return false; + if (EVP_PKEY_cipher_init(ctx.get()) <= 0) return false; + if (EVP_PKEY_CTX_set_rsa_padding(ctx.get(), padding) <= 0) return false; if (EVP_PKEY_cipher(ctx.get(), nullptr, out_len, data, len) <= 0) return false; *out = Malloc(*out_len); - if (EVP_PKEY_cipher(ctx.get(), *out, out_len, data, len) <= 0) - return false; + if (EVP_PKEY_cipher(ctx.get(), *out, out_len, data, len) <= 0) return false; return true; } - template @@ -4731,8 +4533,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo& args) { unsigned int offset = 0; ManagedEVPPKey pkey = GetPublicOrPrivateKeyFromJs(args, &offset, true); - if (!pkey) - return; + if (!pkey) return; THROW_AND_RETURN_IF_NOT_BUFFER(env, args[offset], "Data"); char* buf = Buffer::Data(args[offset]); @@ -4759,20 +4560,18 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo& args) { out_value = nullptr; out_len = 0; if (!r) { - return ThrowCryptoError(env, - ERR_get_error()); + return ThrowCryptoError(env, ERR_get_error()); } } Local vbuf = Buffer::New(env, reinterpret_cast(out_value), out_len) - .ToLocalChecked(); + .ToLocalChecked(); args.GetReturnValue().Set(vbuf); } - void DiffieHellman::Initialize(Environment* env, Local target) { - auto make = [&] (Local name, FunctionCallback callback) { + auto make = [&](Local name, FunctionCallback callback) { Local t = env->NewFunctionTemplate(callback); const PropertyAttribute attributes = @@ -4798,15 +4597,16 @@ void DiffieHellman::Initialize(Environment* env, Local target) { ConstructorBehavior::kThrow, SideEffectType::kHasNoSideEffect); - t->InstanceTemplate()->SetAccessorProperty( - env->verify_error_string(), - verify_error_getter_templ, - Local(), - attributes); + t->InstanceTemplate()->SetAccessorProperty(env->verify_error_string(), + verify_error_getter_templ, + Local(), + attributes); - target->Set(env->context(), - name, - t->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + name, + t->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); }; make(FIXED_ONE_BYTE_STRING(env->isolate(), "DiffieHellman"), New); @@ -4814,22 +4614,18 @@ void DiffieHellman::Initialize(Environment* env, Local target) { DiffieHellmanGroup); } - bool DiffieHellman::Init(int primeLength, int g) { dh_.reset(DH_new()); - if (!DH_generate_parameters_ex(dh_.get(), primeLength, g, 0)) - return false; + if (!DH_generate_parameters_ex(dh_.get(), primeLength, g, 0)) return false; return VerifyContext(); } - bool DiffieHellman::Init(const char* p, int p_len, int g) { dh_.reset(DH_new()); BIGNUM* bn_p = BN_bin2bn(reinterpret_cast(p), p_len, nullptr); BIGNUM* bn_g = BN_new(); - if (!BN_set_word(bn_g, g) || - !DH_set0_pqg(dh_.get(), bn_p, nullptr, bn_g)) { + if (!BN_set_word(bn_g, g) || !DH_set0_pqg(dh_.get(), bn_p, nullptr, bn_g)) { BN_free(bn_p); BN_free(bn_g); return false; @@ -4837,7 +4633,6 @@ bool DiffieHellman::Init(const char* p, int p_len, int g) { return VerifyContext(); } - bool DiffieHellman::Init(const char* p, int p_len, const char* g, int g_len) { dh_.reset(DH_new()); BIGNUM* bn_p = BN_bin2bn(reinterpret_cast(p), p_len, 0); @@ -4850,7 +4645,6 @@ bool DiffieHellman::Init(const char* p, int p_len, const char* g, int g_len) { return VerifyContext(); } - void DiffieHellman::DiffieHellmanGroup( const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -4868,26 +4662,20 @@ void DiffieHellman::DiffieHellmanGroup( for (size_t i = 0; i < arraysize(modp_groups); ++i) { const modp_group* it = modp_groups + i; - if (!StringEqualNoCase(*group_name, it->name)) - continue; + if (!StringEqualNoCase(*group_name, it->name)) continue; - initialized = diffieHellman->Init(it->prime, - it->prime_size, - it->gen, - it->gen_size); - if (!initialized) - env->ThrowError("Initialization failed"); + initialized = + diffieHellman->Init(it->prime, it->prime_size, it->gen, it->gen_size); + if (!initialized) env->ThrowError("Initialization failed"); return; } env->ThrowError("Unknown group"); } - void DiffieHellman::New(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); - DiffieHellman* diffieHellman = - new DiffieHellman(env, args.This()); + DiffieHellman* diffieHellman = new DiffieHellman(env, args.This()); bool initialized = false; if (args.Length() == 2) { @@ -4915,7 +4703,6 @@ void DiffieHellman::New(const FunctionCallbackInfo& args) { } } - void DiffieHellman::GenerateKeys(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -4936,7 +4723,6 @@ void DiffieHellman::GenerateKeys(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(Buffer::New(env, data, size).ToLocalChecked()); } - void DiffieHellman::GetField(const FunctionCallbackInfo& args, const BIGNUM* (*get_field)(const DH*), const char* err_if_null) { @@ -4957,41 +4743,45 @@ void DiffieHellman::GetField(const FunctionCallbackInfo& args, } void DiffieHellman::GetPrime(const FunctionCallbackInfo& args) { - GetField(args, [](const DH* dh) -> const BIGNUM* { - const BIGNUM* p; - DH_get0_pqg(dh, &p, nullptr, nullptr); - return p; - }, "p is null"); + GetField(args, + [](const DH* dh) -> const BIGNUM* { + const BIGNUM* p; + DH_get0_pqg(dh, &p, nullptr, nullptr); + return p; + }, + "p is null"); } - void DiffieHellman::GetGenerator(const FunctionCallbackInfo& args) { - GetField(args, [](const DH* dh) -> const BIGNUM* { - const BIGNUM* g; - DH_get0_pqg(dh, nullptr, nullptr, &g); - return g; - }, "g is null"); + GetField(args, + [](const DH* dh) -> const BIGNUM* { + const BIGNUM* g; + DH_get0_pqg(dh, nullptr, nullptr, &g); + return g; + }, + "g is null"); } - void DiffieHellman::GetPublicKey(const FunctionCallbackInfo& args) { - GetField(args, [](const DH* dh) -> const BIGNUM* { - const BIGNUM* pub_key; - DH_get0_key(dh, &pub_key, nullptr); - return pub_key; - }, "No public key - did you forget to generate one?"); + GetField(args, + [](const DH* dh) -> const BIGNUM* { + const BIGNUM* pub_key; + DH_get0_key(dh, &pub_key, nullptr); + return pub_key; + }, + "No public key - did you forget to generate one?"); } - void DiffieHellman::GetPrivateKey(const FunctionCallbackInfo& args) { - GetField(args, [](const DH* dh) -> const BIGNUM* { - const BIGNUM* priv_key; - DH_get0_key(dh, nullptr, &priv_key); - return priv_key; - }, "No private key - did you forget to generate one?"); + GetField(args, + [](const DH* dh) -> const BIGNUM* { + const BIGNUM* priv_key; + DH_get0_key(dh, nullptr, &priv_key); + return priv_key; + }, + "No private key - did you forget to generate one?"); } - void DiffieHellman::ComputeSecret(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -5006,10 +4796,10 @@ void DiffieHellman::ComputeSecret(const FunctionCallbackInfo& args) { } THROW_AND_RETURN_IF_NOT_BUFFER(env, args[0], "Other party's public key"); - BignumPointer key(BN_bin2bn( - reinterpret_cast(Buffer::Data(args[0])), - Buffer::Length(args[0]), - 0)); + BignumPointer key( + BN_bin2bn(reinterpret_cast(Buffer::Data(args[0])), + Buffer::Length(args[0]), + 0)); MallocedBuffer data(DH_size(diffieHellman->dh_.get())); @@ -5021,9 +4811,8 @@ void DiffieHellman::ComputeSecret(const FunctionCallbackInfo& args) { int checkResult; int checked; - checked = DH_check_pub_key(diffieHellman->dh_.get(), - key.get(), - &checkResult); + checked = + DH_check_pub_key(diffieHellman->dh_.get(), key.get(), &checkResult); if (!checked) { return ThrowCryptoError(env, ERR_get_error(), "Invalid Key"); @@ -5059,7 +4848,8 @@ void DiffieHellman::ComputeSecret(const FunctionCallbackInfo& args) { } void DiffieHellman::SetKey(const FunctionCallbackInfo& args, - int (*set_field)(DH*, BIGNUM*), const char* what) { + int (*set_field)(DH*, BIGNUM*), + const char* what) { Environment* env = Environment::GetCurrent(args); DiffieHellman* dh; @@ -5079,12 +4869,12 @@ void DiffieHellman::SetKey(const FunctionCallbackInfo& args, BIGNUM* num = BN_bin2bn(reinterpret_cast(Buffer::Data(args[0])), - Buffer::Length(args[0]), nullptr); + Buffer::Length(args[0]), + nullptr); CHECK_NOT_NULL(num); CHECK_EQ(1, set_field(dh->dh_.get(), num)); } - void DiffieHellman::SetPublicKey(const FunctionCallbackInfo& args) { SetKey(args, [](DH* dh, BIGNUM* num) { return DH_set0_key(dh, num, nullptr); }, @@ -5092,7 +4882,7 @@ void DiffieHellman::SetPublicKey(const FunctionCallbackInfo& args) { } void DiffieHellman::SetPrivateKey(const FunctionCallbackInfo& args) { -#if OPENSSL_VERSION_NUMBER >= 0x10100000L && \ +#if OPENSSL_VERSION_NUMBER >= 0x10100000L && \ OPENSSL_VERSION_NUMBER < 0x10100070L // Older versions of OpenSSL 1.1.0 have a DH_set0_key which does not work for // Node. See https://github.com/openssl/openssl/pull/4384. @@ -5103,7 +4893,6 @@ void DiffieHellman::SetPrivateKey(const FunctionCallbackInfo& args) { "Private key"); } - void DiffieHellman::VerifyErrorGetter(const FunctionCallbackInfo& args) { HandleScope scope(args.GetIsolate()); @@ -5113,16 +4902,13 @@ void DiffieHellman::VerifyErrorGetter(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(diffieHellman->verifyError_); } - bool DiffieHellman::VerifyContext() { int codes; - if (!DH_check(dh_.get(), &codes)) - return false; + if (!DH_check(dh_.get(), &codes)) return false; verifyError_ = codes; return true; } - void ECDH::Initialize(Environment* env, Local target) { HandleScope scope(env->isolate()); @@ -5137,12 +4923,13 @@ void ECDH::Initialize(Environment* env, Local target) { env->SetProtoMethod(t, "setPublicKey", SetPublicKey); env->SetProtoMethod(t, "setPrivateKey", SetPrivateKey); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "ECDH"), - t->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "ECDH"), + t->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); } - void ECDH::New(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -5154,17 +4941,15 @@ void ECDH::New(const FunctionCallbackInfo& args) { int nid = OBJ_sn2nid(*curve); if (nid == NID_undef) - return THROW_ERR_INVALID_ARG_VALUE(env, - "First argument should be a valid curve name"); + return THROW_ERR_INVALID_ARG_VALUE( + env, "First argument should be a valid curve name"); ECKeyPointer key(EC_KEY_new_by_curve_name(nid)); - if (!key) - return env->ThrowError("Failed to create EC_KEY using curve name"); + if (!key) return env->ThrowError("Failed to create EC_KEY using curve name"); new ECDH(env, args.This(), std::move(key)); } - void ECDH::GenerateKeys(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -5175,7 +4960,6 @@ void ECDH::GenerateKeys(const FunctionCallbackInfo& args) { return env->ThrowError("Failed to generate EC_KEY"); } - ECPointPointer ECDH::BufferToPoint(Environment* env, const EC_GROUP* group, char* data, @@ -5189,18 +4973,12 @@ ECPointPointer ECDH::BufferToPoint(Environment* env, } r = EC_POINT_oct2point( - group, - pub.get(), - reinterpret_cast(data), - len, - nullptr); - if (!r) - return ECPointPointer(); + group, pub.get(), reinterpret_cast(data), len, nullptr); + if (!r) return ECPointPointer(); return pub; } - void ECDH::ComputeSecret(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -5211,18 +4989,13 @@ void ECDH::ComputeSecret(const FunctionCallbackInfo& args) { MarkPopErrorOnReturn mark_pop_error_on_return; - if (!ecdh->IsKeyPairValid()) - return env->ThrowError("Invalid key pair"); + if (!ecdh->IsKeyPairValid()) return env->ThrowError("Invalid key pair"); - ECPointPointer pub( - ECDH::BufferToPoint(env, - ecdh->group_, - Buffer::Data(args[0]), - Buffer::Length(args[0]))); + ECPointPointer pub(ECDH::BufferToPoint( + env, ecdh->group_, Buffer::Data(args[0]), Buffer::Length(args[0]))); if (!pub) { - args.GetReturnValue().Set( - FIXED_ONE_BYTE_STRING(env->isolate(), - "ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY")); + args.GetReturnValue().Set(FIXED_ONE_BYTE_STRING( + env->isolate(), "ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY")); return; } @@ -5241,7 +5014,6 @@ void ECDH::ComputeSecret(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(buf); } - void ECDH::GetPublicKey(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -5253,8 +5025,7 @@ void ECDH::GetPublicKey(const FunctionCallbackInfo& args) { const EC_GROUP* group = EC_KEY_get0_group(ecdh->key_.get()); const EC_POINT* pub = EC_KEY_get0_public_key(ecdh->key_.get()); - if (pub == nullptr) - return env->ThrowError("Failed to get ECDH public key"); + if (pub == nullptr) return env->ThrowError("Failed to get ECDH public key"); CHECK(args[0]->IsUint32()); uint32_t val = args[0].As()->Value(); @@ -5267,7 +5038,6 @@ void ECDH::GetPublicKey(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(buf); } - void ECDH::GetPrivateKey(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -5275,8 +5045,7 @@ void ECDH::GetPrivateKey(const FunctionCallbackInfo& args) { ASSIGN_OR_RETURN_UNWRAP(&ecdh, args.Holder()); const BIGNUM* b = EC_KEY_get0_private_key(ecdh->key_.get()); - if (b == nullptr) - return env->ThrowError("Failed to get ECDH private key"); + if (b == nullptr) return env->ThrowError("Failed to get ECDH private key"); const int size = BN_num_bytes(b); unsigned char* out = node::Malloc(size); @@ -5287,7 +5056,6 @@ void ECDH::GetPrivateKey(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(buf); } - void ECDH::SetPrivateKey(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -5300,8 +5068,7 @@ void ECDH::SetPrivateKey(const FunctionCallbackInfo& args) { reinterpret_cast(Buffer::Data(args[0].As())), Buffer::Length(args[0].As()), nullptr)); - if (!priv) - return env->ThrowError("Failed to convert Buffer to BN"); + if (!priv) return env->ThrowError("Failed to convert Buffer to BN"); if (!ecdh->IsKeyValidForCurve(priv)) { return env->ThrowError("Private key is not valid for specified curve."); @@ -5327,8 +5094,8 @@ void ECDH::SetPrivateKey(const FunctionCallbackInfo& args) { ECPointPointer pub(EC_POINT_new(ecdh->group_)); CHECK(pub); - if (!EC_POINT_mul(ecdh->group_, pub.get(), priv_key, - nullptr, nullptr, nullptr)) { + if (!EC_POINT_mul( + ecdh->group_, pub.get(), priv_key, nullptr, nullptr, nullptr)) { return env->ThrowError("Failed to generate ECDH public key"); } @@ -5336,7 +5103,6 @@ void ECDH::SetPrivateKey(const FunctionCallbackInfo& args) { return env->ThrowError("Failed to set generated public key"); } - void ECDH::SetPublicKey(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -5347,20 +5113,16 @@ void ECDH::SetPublicKey(const FunctionCallbackInfo& args) { MarkPopErrorOnReturn mark_pop_error_on_return; - ECPointPointer pub( - ECDH::BufferToPoint(env, - ecdh->group_, - Buffer::Data(args[0].As()), - Buffer::Length(args[0].As()))); - if (!pub) - return env->ThrowError("Failed to convert Buffer to EC_POINT"); + ECPointPointer pub(ECDH::BufferToPoint(env, + ecdh->group_, + Buffer::Data(args[0].As()), + Buffer::Length(args[0].As()))); + if (!pub) return env->ThrowError("Failed to convert Buffer to EC_POINT"); int r = EC_KEY_set_public_key(ecdh->key_.get(), pub.get()); - if (!r) - return env->ThrowError("Failed to set EC_POINT as the public key"); + if (!r) return env->ThrowError("Failed to set EC_POINT as the public key"); } - bool ECDH::IsKeyValidForCurve(const BignumPointer& private_key) { CHECK(group_); CHECK(private_key); @@ -5375,14 +5137,12 @@ bool ECDH::IsKeyValidForCurve(const BignumPointer& private_key) { BN_cmp(private_key.get(), order.get()) < 0; } - bool ECDH::IsKeyPairValid() { MarkPopErrorOnReturn mark_pop_error_on_return; USE(&mark_pop_error_on_return); return 1 == EC_KEY_check_key(key_.get()); } - // TODO(addaleax): If there is an `AsyncWrap`, it currently has no access to // this object. This makes proper reporting of memory usage impossible. struct CryptoJob : public ThreadPoolWork { @@ -5394,7 +5154,6 @@ struct CryptoJob : public ThreadPoolWork { static inline void Run(std::unique_ptr job, Local wrap); }; - void CryptoJob::AfterThreadPoolWork(int status) { CHECK(status == 0 || status == UV_ECANCELED); std::unique_ptr job(this); @@ -5405,7 +5164,6 @@ void CryptoJob::AfterThreadPoolWork(int status) { AfterThreadPoolWork(); } - void CryptoJob::Run(std::unique_ptr job, Local wrap) { CHECK(wrap->IsObject()); CHECK_EQ(nullptr, job->async_wrap); @@ -5415,13 +5173,11 @@ void CryptoJob::Run(std::unique_ptr job, Local wrap) { job.release(); // Run free, little job! } - inline void CopyBuffer(Local buf, std::vector* vec) { vec->clear(); if (auto p = Buffer::Data(buf)) vec->assign(p, p + Buffer::Length(buf)); } - struct RandomBytesJob : public CryptoJob { unsigned char* data; size_t size; @@ -5448,15 +5204,14 @@ struct RandomBytesJob : public CryptoJob { } }; - void RandomBytes(const FunctionCallbackInfo& args) { CHECK(args[0]->IsArrayBufferView()); // buffer; wrap object retains ref. - CHECK(args[1]->IsUint32()); // offset - CHECK(args[2]->IsUint32()); // size + CHECK(args[1]->IsUint32()); // offset + CHECK(args[2]->IsUint32()); // size CHECK(args[3]->IsObject() || args[3]->IsUndefined()); // wrap object const uint32_t offset = args[1].As()->Value(); const uint32_t size = args[2].As()->Value(); - CHECK_GE(offset + size, offset); // Overflow check. + CHECK_GE(offset + size, offset); // Overflow check. CHECK_LE(offset + size, Buffer::Length(args[0])); // Bounds check. Environment* env = Environment::GetCurrent(args); std::unique_ptr job(new RandomBytesJob(env)); @@ -5468,7 +5223,6 @@ void RandomBytes(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(job->ToResult()); } - struct PBKDF2Job : public CryptoJob { unsigned char* keybuf_data; size_t keybuf_size; @@ -5481,15 +5235,18 @@ struct PBKDF2Job : public CryptoJob { inline explicit PBKDF2Job(Environment* env) : CryptoJob(env), success(Nothing()) {} - inline ~PBKDF2Job() override { - Cleanse(); - } + inline ~PBKDF2Job() override { Cleanse(); } inline void DoThreadPoolWork() override { auto salt_data = reinterpret_cast(salt.data()); - const bool ok = - PKCS5_PBKDF2_HMAC(pass.data(), pass.size(), salt_data, salt.size(), - iteration_count, digest, keybuf_size, keybuf_data); + const bool ok = PKCS5_PBKDF2_HMAC(pass.data(), + pass.size(), + salt_data, + salt.size(), + iteration_count, + digest, + keybuf_size, + keybuf_data); success = Just(ok); Cleanse(); } @@ -5511,15 +5268,14 @@ struct PBKDF2Job : public CryptoJob { } }; - inline void PBKDF2(const FunctionCallbackInfo& args) { auto rv = args.GetReturnValue(); Environment* env = Environment::GetCurrent(args); CHECK(args[0]->IsArrayBufferView()); // keybuf; wrap object retains ref. CHECK(args[1]->IsArrayBufferView()); // pass CHECK(args[2]->IsArrayBufferView()); // salt - CHECK(args[3]->IsUint32()); // iteration_count - CHECK(args[4]->IsString()); // digest_name + CHECK(args[3]->IsUint32()); // iteration_count + CHECK(args[4]->IsString()); // digest_name CHECK(args[5]->IsObject() || args[5]->IsUndefined()); // wrap object std::unique_ptr job(new PBKDF2Job(env)); job->keybuf_data = reinterpret_cast(Buffer::Data(args[0])); @@ -5536,7 +5292,6 @@ inline void PBKDF2(const FunctionCallbackInfo& args) { rv.Set(job->ToResult()); } - #ifndef OPENSSL_NO_SCRYPT struct ScryptJob : public CryptoJob { unsigned char* keybuf_data; @@ -5551,13 +5306,11 @@ struct ScryptJob : public CryptoJob { inline explicit ScryptJob(Environment* env) : CryptoJob(env) {} - inline ~ScryptJob() override { - Cleanse(); - } + inline ~ScryptJob() override { Cleanse(); } inline bool Validate() { - if (1 == EVP_PBE_scrypt(nullptr, 0, nullptr, 0, N, r, p, maxmem, - nullptr, 0)) { + if (1 == + EVP_PBE_scrypt(nullptr, 0, nullptr, 0, N, r, p, maxmem, nullptr, 0)) { return true; } else { // Note: EVP_PBE_scrypt() does not always put errors on the error stack. @@ -5568,8 +5321,16 @@ struct ScryptJob : public CryptoJob { inline void DoThreadPoolWork() override { auto salt_data = reinterpret_cast(salt.data()); - if (1 != EVP_PBE_scrypt(pass.data(), pass.size(), salt_data, salt.size(), - N, r, p, maxmem, keybuf_data, keybuf_size)) { + if (1 != EVP_PBE_scrypt(pass.data(), + pass.size(), + salt_data, + salt.size(), + N, + r, + p, + maxmem, + keybuf_data, + keybuf_size)) { errors.Capture(); } } @@ -5592,16 +5353,15 @@ struct ScryptJob : public CryptoJob { } }; - void Scrypt(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); CHECK(args[0]->IsArrayBufferView()); // keybuf; wrap object retains ref. CHECK(args[1]->IsArrayBufferView()); // pass CHECK(args[2]->IsArrayBufferView()); // salt - CHECK(args[3]->IsUint32()); // N - CHECK(args[4]->IsUint32()); // r - CHECK(args[5]->IsUint32()); // p - CHECK(args[6]->IsUint32()); // maxmem + CHECK(args[3]->IsUint32()); // N + CHECK(args[4]->IsUint32()); // r + CHECK(args[5]->IsUint32()); // p + CHECK(args[6]->IsUint32()); // maxmem CHECK(args[7]->IsObject() || args[7]->IsUndefined()); // wrap object std::unique_ptr job(new ScryptJob(env)); job->keybuf_data = reinterpret_cast(Buffer::Data(args[0])); @@ -5628,20 +5388,17 @@ void Scrypt(const FunctionCallbackInfo& args) { } #endif // OPENSSL_NO_SCRYPT - class KeyPairGenerationConfig { public: virtual EVPKeyCtxPointer Setup() = 0; - virtual bool Configure(const EVPKeyCtxPointer& ctx) { - return true; - } + virtual bool Configure(const EVPKeyCtxPointer& ctx) { return true; } virtual ~KeyPairGenerationConfig() {} }; class RSAKeyPairGenerationConfig : public KeyPairGenerationConfig { public: RSAKeyPairGenerationConfig(unsigned int modulus_bits, unsigned int exponent) - : modulus_bits_(modulus_bits), exponent_(exponent) {} + : modulus_bits_(modulus_bits), exponent_(exponent) {} EVPKeyCtxPointer Setup() override { return EVPKeyCtxPointer(EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, nullptr)); @@ -5671,30 +5428,30 @@ class RSAKeyPairGenerationConfig : public KeyPairGenerationConfig { class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig { public: DSAKeyPairGenerationConfig(unsigned int modulus_bits, int divisor_bits) - : modulus_bits_(modulus_bits), divisor_bits_(divisor_bits) {} + : modulus_bits_(modulus_bits), divisor_bits_(divisor_bits) {} EVPKeyCtxPointer Setup() override { EVPKeyCtxPointer param_ctx(EVP_PKEY_CTX_new_id(EVP_PKEY_DSA, nullptr)); - if (!param_ctx) - return nullptr; + if (!param_ctx) return nullptr; - if (EVP_PKEY_paramgen_init(param_ctx.get()) <= 0) - return nullptr; + if (EVP_PKEY_paramgen_init(param_ctx.get()) <= 0) return nullptr; if (EVP_PKEY_CTX_set_dsa_paramgen_bits(param_ctx.get(), modulus_bits_) <= 0) return nullptr; if (divisor_bits_ != -1) { - if (EVP_PKEY_CTX_ctrl(param_ctx.get(), EVP_PKEY_DSA, EVP_PKEY_OP_PARAMGEN, - EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS, divisor_bits_, + if (EVP_PKEY_CTX_ctrl(param_ctx.get(), + EVP_PKEY_DSA, + EVP_PKEY_OP_PARAMGEN, + EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS, + divisor_bits_, nullptr) <= 0) { return nullptr; } } EVP_PKEY* params = nullptr; - if (EVP_PKEY_paramgen(param_ctx.get(), ¶ms) <= 0) - return nullptr; + if (EVP_PKEY_paramgen(param_ctx.get(), ¶ms) <= 0) return nullptr; param_ctx.reset(); EVPKeyCtxPointer key_ctx(EVP_PKEY_CTX_new(params, nullptr)); @@ -5710,26 +5467,23 @@ class DSAKeyPairGenerationConfig : public KeyPairGenerationConfig { class ECKeyPairGenerationConfig : public KeyPairGenerationConfig { public: ECKeyPairGenerationConfig(int curve_nid, int param_encoding) - : curve_nid_(curve_nid), param_encoding_(param_encoding) {} + : curve_nid_(curve_nid), param_encoding_(param_encoding) {} EVPKeyCtxPointer Setup() override { EVPKeyCtxPointer param_ctx(EVP_PKEY_CTX_new_id(EVP_PKEY_EC, nullptr)); - if (!param_ctx) - return nullptr; + if (!param_ctx) return nullptr; - if (EVP_PKEY_paramgen_init(param_ctx.get()) <= 0) - return nullptr; + if (EVP_PKEY_paramgen_init(param_ctx.get()) <= 0) return nullptr; - if (EVP_PKEY_CTX_set_ec_paramgen_curve_nid(param_ctx.get(), - curve_nid_) <= 0) + if (EVP_PKEY_CTX_set_ec_paramgen_curve_nid(param_ctx.get(), curve_nid_) <= + 0) return nullptr; if (EVP_PKEY_CTX_set_ec_param_enc(param_ctx.get(), param_encoding_) <= 0) return nullptr; EVP_PKEY* params = nullptr; - if (EVP_PKEY_paramgen(param_ctx.get(), ¶ms) <= 0) - return nullptr; + if (EVP_PKEY_paramgen(param_ctx.get(), ¶ms) <= 0) return nullptr; param_ctx.reset(); EVPKeyCtxPointer key_ctx(EVP_PKEY_CTX_new(params, nullptr)); @@ -5748,16 +5502,15 @@ class GenerateKeyPairJob : public CryptoJob { std::unique_ptr config, PublicKeyEncodingConfig public_key_encoding, PrivateKeyEncodingConfig&& private_key_encoding) - : CryptoJob(env), - config_(std::move(config)), - public_key_encoding_(public_key_encoding), - private_key_encoding_(std::forward( - private_key_encoding)), - pkey_(nullptr) {} + : CryptoJob(env), + config_(std::move(config)), + public_key_encoding_(public_key_encoding), + private_key_encoding_( + std::forward(private_key_encoding)), + pkey_(nullptr) {} inline void DoThreadPoolWork() override { - if (!GenerateKey()) - errors_.Capture(); + if (!GenerateKey()) errors_.Capture(); } inline bool GenerateKey() { @@ -5766,21 +5519,17 @@ class GenerateKeyPairJob : public CryptoJob { // Create the key generation context. EVPKeyCtxPointer ctx = config_->Setup(); - if (!ctx) - return false; + if (!ctx) return false; // Initialize key generation. - if (EVP_PKEY_keygen_init(ctx.get()) <= 0) - return false; + if (EVP_PKEY_keygen_init(ctx.get()) <= 0) return false; // Configure key generation. - if (!config_->Configure(ctx)) - return false; + if (!config_->Configure(ctx)) return false; // Generate the key. EVP_PKEY* pkey = nullptr; - if (EVP_PKEY_keygen(ctx.get(), &pkey) != 1) - return false; + if (EVP_PKEY_keygen(ctx.get(), &pkey) != 1) return false; pkey_ = ManagedEVPPKey(pkey); return true; } @@ -5798,8 +5547,7 @@ class GenerateKeyPairJob : public CryptoJob { CHECK(errors_.empty()); *err = Undefined(env->isolate()); } else { - if (errors_.empty()) - errors_.Capture(); + if (errors_.empty()) errors_.Capture(); CHECK(!errors_.empty()); *err = errors_.ToException(env); *pubkey = Undefined(env->isolate()); @@ -5851,11 +5599,12 @@ void GenerateKeyPair(const FunctionCallbackInfo& args, NonCopyableMaybe private_key_encoding = GetPrivateKeyEncodingFromJs(args, &offset, kKeyContextGenerate); - if (private_key_encoding.IsEmpty()) - return; + if (private_key_encoding.IsEmpty()) return; std::unique_ptr job( - new GenerateKeyPairJob(env, std::move(config), public_key_encoding, + new GenerateKeyPairJob(env, + std::move(config), + public_key_encoding, private_key_encoding.Release())); if (args[offset]->IsObject()) return GenerateKeyPairJob::Run(std::move(job), args[offset]); @@ -5899,8 +5648,7 @@ void GenerateKeyPairEC(const FunctionCallbackInfo& args) { CHECK(args[0]->IsString()); String::Utf8Value curve_name(args.GetIsolate(), args[0].As()); int curve_nid = EC_curve_nist2nid(*curve_name); - if (curve_nid == NID_undef) - curve_nid = OBJ_sn2nid(*curve_name); + if (curve_nid == NID_undef) curve_nid = OBJ_sn2nid(*curve_name); // TODO(tniessen): Should we also support OBJ_ln2nid? (Other APIs don't.) if (curve_nid == NID_undef) { Environment* env = Environment::GetCurrent(args); @@ -5915,7 +5663,6 @@ void GenerateKeyPairEC(const FunctionCallbackInfo& args) { GenerateKeyPair(args, 2, std::move(config)); } - void GetSSLCiphers(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -5933,20 +5680,17 @@ void GetSSLCiphers(const FunctionCallbackInfo& args) { const SSL_CIPHER* cipher = sk_SSL_CIPHER_value(ciphers, i); arr->Set(env->context(), i, - OneByteString(args.GetIsolate(), - SSL_CIPHER_get_name(cipher))).FromJust(); + OneByteString(args.GetIsolate(), SSL_CIPHER_get_name(cipher))) + .FromJust(); } args.GetReturnValue().Set(arr); } - class CipherPushContext { public: explicit CipherPushContext(Environment* env) - : arr(Array::New(env->isolate())), - env_(env) { - } + : arr(Array::New(env->isolate())), env_(env) {} inline Environment* env() const { return env_; } @@ -5956,19 +5700,19 @@ class CipherPushContext { Environment* env_; }; - template static void array_push_back(const TypeName* md, const char* from, const char* to, void* arg) { CipherPushContext* ctx = static_cast(arg); - ctx->arr->Set(ctx->env()->context(), - ctx->arr->Length(), - OneByteString(ctx->env()->isolate(), from)).FromJust(); + ctx->arr + ->Set(ctx->env()->context(), + ctx->arr->Length(), + OneByteString(ctx->env()->isolate(), from)) + .FromJust(); } - void GetCiphers(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); CipherPushContext ctx(env); @@ -5976,7 +5720,6 @@ void GetCiphers(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(ctx.arr); } - void GetHashes(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); CipherPushContext ctx(env); @@ -5984,7 +5727,6 @@ void GetHashes(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(ctx.arr); } - void GetCurves(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); const size_t num_curves = EC_get_builtin_curves(nullptr, 0); @@ -5997,8 +5739,8 @@ void GetCurves(const FunctionCallbackInfo& args) { for (size_t i = 0; i < num_curves; i++) { arr->Set(env->context(), i, - OneByteString(env->isolate(), - OBJ_nid2sn(curves[i].nid))).FromJust(); + OneByteString(env->isolate(), OBJ_nid2sn(curves[i].nid))) + .FromJust(); } } } @@ -6006,26 +5748,21 @@ void GetCurves(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(arr); } - bool VerifySpkac(const char* data, unsigned int len) { NetscapeSPKIPointer spki(NETSCAPE_SPKI_b64_decode(data, len)); - if (!spki) - return false; + if (!spki) return false; EVPKeyPointer pkey(X509_PUBKEY_get(spki->spkac->pubkey)); - if (!pkey) - return false; + if (!pkey) return false; return NETSCAPE_SPKI_verify(spki.get(), pkey.get()) > 0; } - void VerifySpkac(const FunctionCallbackInfo& args) { bool verify_result = false; size_t length = Buffer::Length(args[0]); - if (length == 0) - return args.GetReturnValue().Set(verify_result); + if (length == 0) return args.GetReturnValue().Set(verify_result); char* data = Buffer::Data(args[0]); CHECK_NOT_NULL(data); @@ -6035,24 +5772,19 @@ void VerifySpkac(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(verify_result); } - char* ExportPublicKey(const char* data, int len, size_t* size) { char* buf = nullptr; BIOPointer bio(BIO_new(BIO_s_mem())); - if (!bio) - return nullptr; + if (!bio) return nullptr; NetscapeSPKIPointer spki(NETSCAPE_SPKI_b64_decode(data, len)); - if (!spki) - return nullptr; + if (!spki) return nullptr; EVPKeyPointer pkey(NETSCAPE_SPKI_get_pubkey(spki.get())); - if (!pkey) - return nullptr; + if (!pkey) return nullptr; - if (PEM_write_bio_PUBKEY(bio.get(), pkey.get()) <= 0) - return nullptr; + if (PEM_write_bio_PUBKEY(bio.get(), pkey.get()) <= 0) return nullptr; BUF_MEM* ptr; BIO_get_mem_ptr(bio.get(), &ptr); @@ -6064,31 +5796,26 @@ char* ExportPublicKey(const char* data, int len, size_t* size) { return buf; } - void ExportPublicKey(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); size_t length = Buffer::Length(args[0]); - if (length == 0) - return args.GetReturnValue().SetEmptyString(); + if (length == 0) return args.GetReturnValue().SetEmptyString(); char* data = Buffer::Data(args[0]); CHECK_NOT_NULL(data); size_t pkey_size; char* pkey = ExportPublicKey(data, length, &pkey_size); - if (pkey == nullptr) - return args.GetReturnValue().SetEmptyString(); + if (pkey == nullptr) return args.GetReturnValue().SetEmptyString(); Local out = Buffer::New(env, pkey, pkey_size).ToLocalChecked(); args.GetReturnValue().Set(out); } - OpenSSLBuffer ExportChallenge(const char* data, int len) { NetscapeSPKIPointer sp(NETSCAPE_SPKI_b64_decode(data, len)); - if (!sp) - return nullptr; + if (!sp) return nullptr; unsigned char* buf = nullptr; ASN1_STRING_to_UTF8(&buf, sp->spkac->challenge); @@ -6096,20 +5823,17 @@ OpenSSLBuffer ExportChallenge(const char* data, int len) { return OpenSSLBuffer(reinterpret_cast(buf)); } - void ExportChallenge(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); size_t len = Buffer::Length(args[0]); - if (len == 0) - return args.GetReturnValue().SetEmptyString(); + if (len == 0) return args.GetReturnValue().SetEmptyString(); char* data = Buffer::Data(args[0]); CHECK_NOT_NULL(data); OpenSSLBuffer cert = ExportChallenge(data, len); - if (!cert) - return args.GetReturnValue().SetEmptyString(); + if (!cert) return args.GetReturnValue().SetEmptyString(); Local outString = Encode(env->isolate(), cert.get(), strlen(cert.get()), BUFFER); @@ -6117,7 +5841,6 @@ void ExportChallenge(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(outString); } - // Convert the input public key to compressed, uncompressed, or hybrid formats. void ConvertKey(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -6125,25 +5848,18 @@ void ConvertKey(const FunctionCallbackInfo& args) { CHECK_EQ(args.Length(), 3); size_t len = Buffer::Length(args[0]); - if (len == 0) - return args.GetReturnValue().SetEmptyString(); + if (len == 0) return args.GetReturnValue().SetEmptyString(); node::Utf8Value curve(env->isolate(), args[1]); int nid = OBJ_sn2nid(*curve); - if (nid == NID_undef) - return env->ThrowTypeError("Invalid ECDH curve name"); + if (nid == NID_undef) return env->ThrowTypeError("Invalid ECDH curve name"); - ECGroupPointer group( - EC_GROUP_new_by_curve_name(nid)); - if (group == nullptr) - return env->ThrowError("Failed to get EC_GROUP"); + ECGroupPointer group(EC_GROUP_new_by_curve_name(nid)); + if (group == nullptr) return env->ThrowError("Failed to get EC_GROUP"); ECPointPointer pub( - ECDH::BufferToPoint(env, - group.get(), - Buffer::Data(args[0]), - len)); + ECDH::BufferToPoint(env, group.get(), Buffer::Data(args[0]), len)); if (pub == nullptr) return env->ThrowError("Failed to convert Buffer to EC_POINT"); @@ -6159,7 +5875,6 @@ void ConvertKey(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(buf); } - void TimingSafeEqual(const FunctionCallbackInfo& args) { CHECK(Buffer::HasInstance(args[0])); CHECK(Buffer::HasInstance(args[1])); @@ -6209,14 +5924,12 @@ void InitCryptoOnce() { } } if (0 != err) { - fprintf(stderr, - "openssl fips failed: %s\n", - ERR_error_string(err, nullptr)); + fprintf( + stderr, "openssl fips failed: %s\n", ERR_error_string(err, nullptr)); UNREACHABLE(); } #endif // NODE_FIPS_MODE - // Turn off compression. Saves memory and protects against CRIME attacks. // No-op with OPENSSL_NO_COMP builds of OpenSSL. sk_SSL_COMP_zero(SSL_COMP_get_compression_methods()); @@ -6229,7 +5942,6 @@ void InitCryptoOnce() { NodeBIO::GetMethod(); } - #ifndef OPENSSL_NO_ENGINE void SetEngine(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -6246,15 +5958,13 @@ void SetEngine(const FunctionCallbackInfo& args) { if (engine == nullptr) { int err = ERR_get_error(); - if (err == 0) - return args.GetReturnValue().Set(false); + if (err == 0) return args.GetReturnValue().Set(false); return ThrowCryptoError(env, err); } int r = ENGINE_set_default(engine, flags); ENGINE_free(engine); - if (r == 0) - return ThrowCryptoError(env, ERR_get_error()); + if (r == 0) return ThrowCryptoError(env, ERR_get_error()); args.GetReturnValue().Set(true); } @@ -6271,8 +5981,7 @@ void SetFipsCrypto(const FunctionCallbackInfo& args) { const bool enabled = FIPS_mode(); bool enable = args[0]->BooleanValue(env->isolate()); - if (enable == enabled) - return; // No action needed. + if (enable == enabled) return; // No action needed. if (!FIPS_mode_set(enable)) { unsigned long err = ERR_get_error(); // NOLINT(runtime/int) return ThrowCryptoError(env, err); @@ -6280,7 +5989,6 @@ void SetFipsCrypto(const FunctionCallbackInfo& args) { } #endif /* NODE_FIPS_MODE */ - void Initialize(Local target, Local unused, Local context, @@ -6303,8 +6011,8 @@ void Initialize(Local target, env->SetMethodNoSideEffect(target, "certExportPublicKey", ExportPublicKey); env->SetMethodNoSideEffect(target, "certExportChallenge", ExportChallenge); // Exposed for testing purposes only. - env->SetMethodNoSideEffect(target, "isExtraRootCertsFileLoaded", - IsExtraRootCertsFileLoaded); + env->SetMethodNoSideEffect( + target, "isExtraRootCertsFileLoaded", IsExtraRootCertsFileLoaded); env->SetMethodNoSideEffect(target, "ECDHConvertKey", ConvertKey); #ifndef OPENSSL_NO_ENGINE @@ -6337,19 +6045,23 @@ void Initialize(Local target, env->SetMethodNoSideEffect(target, "getCiphers", GetCiphers); env->SetMethodNoSideEffect(target, "getHashes", GetHashes); env->SetMethodNoSideEffect(target, "getCurves", GetCurves); - env->SetMethod(target, "publicEncrypt", + env->SetMethod(target, + "publicEncrypt", PublicKeyCipher::Cipher); - env->SetMethod(target, "privateDecrypt", + env->SetMethod(target, + "privateDecrypt", PublicKeyCipher::Cipher); - env->SetMethod(target, "privateEncrypt", + env->SetMethod(target, + "privateEncrypt", PublicKeyCipher::Cipher); - env->SetMethod(target, "publicDecrypt", + env->SetMethod(target, + "publicDecrypt", PublicKeyCipher::Cipher); diff --git a/src/node_crypto.h b/src/node_crypto.h index 7c346a6c1435d1..ba9425d912667a 100644 --- a/src/node_crypto.h +++ b/src/node_crypto.h @@ -30,28 +30,28 @@ #include "node_buffer.h" -#include "env.h" #include "async_wrap-inl.h" #include "base_object-inl.h" +#include "env.h" #include "v8.h" -#include #include #include +#include #ifndef OPENSSL_NO_ENGINE -# include +#include #endif // !OPENSSL_NO_ENGINE #include #include // TODO(shigeki) Remove this after upgrading to 1.1.1 +#include #include #include +#include +#include #include #include -#include -#include -#include namespace node { namespace crypto { @@ -97,9 +97,7 @@ void InitCryptoOnce(); class SecureContext : public BaseObject { public: - ~SecureContext() override { - Reset(); - } + ~SecureContext() override { Reset(); } static void Initialize(Environment* env, v8::Local target); @@ -208,10 +206,7 @@ class SecureContext : public BaseObject { template class SSLWrap { public: - enum Kind { - kClient, - kServer - }; + enum Kind { kClient, kServer }; SSLWrap(Environment* env, SecureContext* sc, Kind kind) : env_(env), @@ -227,9 +222,7 @@ class SSLWrap { env_->isolate()->AdjustAmountOfExternalAllocatedMemory(kExternalSize); } - virtual ~SSLWrap() { - DestroySSL(); - } + virtual ~SSLWrap() { DestroySSL(); } inline void enable_session_callbacks() { session_callbacks_ = true; } inline bool is_server() const { return kind_ == kServer; } @@ -316,9 +309,7 @@ class SSLWrap { void SetSNIContext(SecureContext* sc); int SetCACerts(SecureContext* sc); - inline Environment* ssl_env() const { - return env_; - } + inline Environment* ssl_env() const { return env_; } Environment* const env_; Kind kind_; @@ -360,8 +351,7 @@ class ByteSource { v8::Local str, bool ntc = false); - static ByteSource FromBuffer(v8::Local buffer, - bool ntc = false); + static ByteSource FromBuffer(v8::Local buffer, bool ntc = false); static ByteSource NullTerminatedCopy(Environment* env, v8::Local value); @@ -392,10 +382,7 @@ enum PKEncodingType { kKeyEncodingSEC1 }; -enum PKFormatType { - kKeyFormatDER, - kKeyFormatPEM -}; +enum PKFormatType { kKeyFormatDER, kKeyFormatPEM }; struct AsymmetricKeyEncodingConfig { bool output_key_object_; @@ -410,11 +397,7 @@ struct PrivateKeyEncodingConfig : public AsymmetricKeyEncodingConfig { ByteSource passphrase_; }; -enum KeyType { - kKeyTypeSecret, - kKeyTypePublic, - kKeyTypePrivate -}; +enum KeyType { kKeyTypeSecret, kKeyTypePublic, kKeyTypePrivate }; // This uses the built-in reference counter of OpenSSL to manage an EVP_PKEY // which is slightly more efficient than using a shared pointer and easier to @@ -481,9 +464,7 @@ class KeyObject : public BaseObject { v8::MaybeLocal ExportPrivateKey( const PrivateKeyEncodingConfig& config) const; - KeyObject(Environment* env, - v8::Local wrap, - KeyType key_type) + KeyObject(Environment* env, v8::Local wrap, KeyType key_type) : BaseObject(env, wrap), key_type_(key_type), symmetric_key_(nullptr, nullptr) { @@ -507,20 +488,9 @@ class CipherBase : public BaseObject { SET_SELF_SIZE(CipherBase) protected: - enum CipherKind { - kCipher, - kDecipher - }; - enum UpdateResult { - kSuccess, - kErrorMessageSize, - kErrorState - }; - enum AuthTagState { - kAuthTagUnknown, - kAuthTagKnown, - kAuthTagPassedToOpenSSL - }; + enum CipherKind { kCipher, kDecipher }; + enum UpdateResult { kSuccess, kErrorMessageSize, kErrorState }; + enum AuthTagState { kAuthTagUnknown, kAuthTagKnown, kAuthTagPassedToOpenSSL }; static const unsigned kNoAuthTagLength = static_cast(-1); void CommonInit(const char* cipher_type, @@ -540,10 +510,13 @@ class CipherBase : public BaseObject { const unsigned char* iv, int iv_len, unsigned int auth_tag_len); - bool InitAuthenticated(const char* cipher_type, int iv_len, + bool InitAuthenticated(const char* cipher_type, + int iv_len, unsigned int auth_tag_len); bool CheckCCMMessageLength(int message_len); - UpdateResult Update(const char* data, int len, unsigned char** out, + UpdateResult Update(const char* data, + int len, + unsigned char** out, int* out_len); bool Final(unsigned char** out, int* out_len); bool SetAutoPadding(bool auto_padding); @@ -563,9 +536,7 @@ class CipherBase : public BaseObject { static void SetAuthTag(const v8::FunctionCallbackInfo& args); static void SetAAD(const v8::FunctionCallbackInfo& args); - CipherBase(Environment* env, - v8::Local wrap, - CipherKind kind) + CipherBase(Environment* env, v8::Local wrap, CipherKind kind) : BaseObject(env, wrap), ctx_(nullptr), kind_(kind), @@ -604,8 +575,7 @@ class Hmac : public BaseObject { static void HmacDigest(const v8::FunctionCallbackInfo& args); Hmac(Environment* env, v8::Local wrap) - : BaseObject(env, wrap), - ctx_(nullptr) { + : BaseObject(env, wrap), ctx_(nullptr) { MakeWeak(); } @@ -631,8 +601,7 @@ class Hash : public BaseObject { static void HashDigest(const v8::FunctionCallbackInfo& args); Hash(Environment* env, v8::Local wrap) - : BaseObject(env, wrap), - mdctx_(nullptr) { + : BaseObject(env, wrap), mdctx_(nullptr) { MakeWeak(); } @@ -653,8 +622,7 @@ class SignBase : public BaseObject { } Error; SignBase(Environment* env, v8::Local wrap) - : BaseObject(env, wrap) { - } + : BaseObject(env, wrap) {} Error Init(const char* sign_type); Error Update(const char* data, int len); @@ -681,13 +649,10 @@ class Sign : public SignBase { explicit SignResult( Error err, MallocedBuffer&& sig = MallocedBuffer()) - : error(err), signature(std::move(sig)) {} + : error(err), signature(std::move(sig)) {} }; - SignResult SignFinal( - const ManagedEVPPKey& pkey, - int padding, - int saltlen); + SignResult SignFinal(const ManagedEVPPKey& pkey, int padding, int saltlen); protected: static void New(const v8::FunctionCallbackInfo& args); @@ -726,13 +691,12 @@ class PublicKeyCipher { public: typedef int (*EVP_PKEY_cipher_init_t)(EVP_PKEY_CTX* ctx); typedef int (*EVP_PKEY_cipher_t)(EVP_PKEY_CTX* ctx, - unsigned char* out, size_t* outlen, - const unsigned char* in, size_t inlen); + unsigned char* out, + size_t* outlen, + const unsigned char* in, + size_t inlen); - enum Operation { - kPublic, - kPrivate - }; + enum Operation { kPublic, kPrivate }; template & args); DiffieHellman(Environment* env, v8::Local wrap) - : BaseObject(env, wrap), - verifyError_(0) { + : BaseObject(env, wrap), verifyError_(0) { MakeWeak(); } @@ -789,7 +752,8 @@ class DiffieHellman : public BaseObject { const BIGNUM* (*get_field)(const DH*), const char* err_if_null); static void SetKey(const v8::FunctionCallbackInfo& args, - int (*set_field)(DH*, BIGNUM*), const char* what); + int (*set_field)(DH*, BIGNUM*), + const char* what); bool VerifyContext(); int verifyError_; @@ -798,9 +762,7 @@ class DiffieHellman : public BaseObject { class ECDH : public BaseObject { public: - ~ECDH() override { - group_ = nullptr; - } + ~ECDH() override { group_ = nullptr; } static void Initialize(Environment* env, v8::Local target); static ECPointPointer BufferToPoint(Environment* env, diff --git a/src/node_crypto_bio.cc b/src/node_crypto_bio.cc index baa90204f2f97a..8d8f401f4fafe3 100644 --- a/src/node_crypto_bio.cc +++ b/src/node_crypto_bio.cc @@ -20,10 +20,10 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. #include "node_crypto_bio.h" -#include "openssl/bio.h" -#include "util-inl.h" #include #include +#include "openssl/bio.h" +#include "util-inl.h" namespace node { namespace crypto { @@ -37,22 +37,18 @@ namespace crypto { #define BIO_get_init(bio) bio->init #endif - BIOPointer NodeBIO::New(Environment* env) { // The const_cast doesn't violate const correctness. OpenSSL's usage of // BIO_METHOD is effectively const but BIO_new() takes a non-const argument. BIOPointer bio(BIO_new(const_cast(GetMethod()))); - if (bio && env != nullptr) - NodeBIO::FromBIO(bio.get())->env_ = env; + if (bio && env != nullptr) NodeBIO::FromBIO(bio.get())->env_ = env; return bio; } - BIOPointer NodeBIO::NewFixed(const char* data, size_t len, Environment* env) { BIOPointer bio = New(env); - if (!bio || - len > INT_MAX || + if (!bio || len > INT_MAX || BIO_write(bio.get(), data, len) != static_cast(len) || BIO_set_mem_eof_return(bio.get(), 0) != 1) { return BIOPointer(); @@ -61,7 +57,6 @@ BIOPointer NodeBIO::NewFixed(const char* data, size_t len, Environment* env) { return bio; } - int NodeBIO::New(BIO* bio) { BIO_set_data(bio, new NodeBIO()); BIO_set_init(bio, 1); @@ -69,10 +64,8 @@ int NodeBIO::New(BIO* bio) { return 1; } - int NodeBIO::Free(BIO* bio) { - if (bio == nullptr) - return 0; + if (bio == nullptr) return 0; if (BIO_get_shutdown(bio)) { if (BIO_get_init(bio) && BIO_get_data(bio) != nullptr) { @@ -84,7 +77,6 @@ int NodeBIO::Free(BIO* bio) { return 1; } - int NodeBIO::Read(BIO* bio, char* out, int len) { BIO_clear_retry_flags(bio); @@ -101,13 +93,11 @@ int NodeBIO::Read(BIO* bio, char* out, int len) { return bytes; } - char* NodeBIO::Peek(size_t* size) { *size = read_head_->write_pos_ - read_head_->read_pos_; return read_head_->data_ + read_head_->read_pos_; } - size_t NodeBIO::PeekMultiple(char** out, size_t* size, size_t* count) { Buffer* pos = read_head_; size_t max = *count; @@ -134,7 +124,6 @@ size_t NodeBIO::PeekMultiple(char** out, size_t* size, size_t* count) { return total; } - int NodeBIO::Write(BIO* bio, const char* data, int len) { BIO_clear_retry_flags(bio); @@ -143,27 +132,22 @@ int NodeBIO::Write(BIO* bio, const char* data, int len) { return len; } - int NodeBIO::Puts(BIO* bio, const char* str) { return Write(bio, str, strlen(str)); } - int NodeBIO::Gets(BIO* bio, char* out, int size) { NodeBIO* nbio = FromBIO(bio); - if (nbio->Length() == 0) - return 0; + if (nbio->Length() == 0) return 0; int i = nbio->IndexOf('\n', size); // Include '\n', if it's there. If not, don't read off the end. - if (i < size && i >= 0 && static_cast(i) < nbio->Length()) - i++; + if (i < size && i >= 0 && static_cast(i) < nbio->Length()) i++; // Shift `i` a bit to nullptr-terminate string later - if (size == i) - i--; + if (size == i) i--; // Flush read data nbio->Read(out, i); @@ -173,8 +157,9 @@ int NodeBIO::Gets(BIO* bio, char* out, int size) { return i; } - -long NodeBIO::Ctrl(BIO* bio, int cmd, long num, // NOLINT(runtime/int) +long NodeBIO::Ctrl(BIO* bio, + int cmd, + long num, // NOLINT(runtime/int) void* ptr) { NodeBIO* nbio; long ret; // NOLINT(runtime/int) @@ -194,8 +179,7 @@ long NodeBIO::Ctrl(BIO* bio, int cmd, long num, // NOLINT(runtime/int) break; case BIO_CTRL_INFO: ret = nbio->Length(); - if (ptr != nullptr) - *reinterpret_cast(ptr) = nullptr; + if (ptr != nullptr) *reinterpret_cast(ptr) = nullptr; break; case BIO_C_SET_BUF_MEM: CHECK(0 && "Can't use SET_BUF_MEM_PTR with NodeBIO"); @@ -229,21 +213,18 @@ long NodeBIO::Ctrl(BIO* bio, int cmd, long num, // NOLINT(runtime/int) return ret; } - const BIO_METHOD* NodeBIO::GetMethod() { #if OPENSSL_VERSION_NUMBER < 0x10100000L - static const BIO_METHOD method = { - BIO_TYPE_MEM, - "node.js SSL buffer", - Write, - Read, - Puts, - Gets, - Ctrl, - New, - Free, - nullptr - }; + static const BIO_METHOD method = {BIO_TYPE_MEM, + "node.js SSL buffer", + Write, + Read, + Puts, + Gets, + Ctrl, + New, + Free, + nullptr}; return &method; #else @@ -266,7 +247,6 @@ const BIO_METHOD* NodeBIO::GetMethod() { #endif } - void NodeBIO::TryMoveReadHead() { // `read_pos_` and `write_pos_` means the position of the reader and writer // inside the buffer, respectively. When they're equal - its safe to reset @@ -280,12 +260,10 @@ void NodeBIO::TryMoveReadHead() { // Move read_head_ forward, just in case if there're still some data to // read in the next buffer. - if (read_head_ != write_head_) - read_head_ = read_head_->next_; + if (read_head_ != write_head_) read_head_ = read_head_->next_; } } - size_t NodeBIO::Read(char* out, size_t size) { size_t bytes_read = 0; size_t expected = Length() > size ? size : Length(); @@ -295,8 +273,7 @@ size_t NodeBIO::Read(char* out, size_t size) { while (bytes_read < expected) { CHECK_LE(read_head_->read_pos_, read_head_->write_pos_); size_t avail = read_head_->write_pos_ - read_head_->read_pos_; - if (avail > left) - avail = left; + if (avail > left) avail = left; // Copy data if (out != nullptr) @@ -319,16 +296,12 @@ size_t NodeBIO::Read(char* out, size_t size) { return bytes_read; } - void NodeBIO::FreeEmpty() { - if (write_head_ == nullptr) - return; + if (write_head_ == nullptr) return; Buffer* child = write_head_->next_; - if (child == write_head_ || child == read_head_) - return; + if (child == write_head_ || child == read_head_) return; Buffer* cur = child->next_; - if (cur == write_head_ || cur == read_head_) - return; + if (cur == write_head_ || cur == read_head_) return; Buffer* prev = child; while (cur != read_head_) { @@ -342,7 +315,6 @@ void NodeBIO::FreeEmpty() { prev->next_ = cur; } - size_t NodeBIO::IndexOf(char delim, size_t limit) { size_t bytes_read = 0; size_t max = Length() > limit ? limit : Length(); @@ -352,8 +324,7 @@ size_t NodeBIO::IndexOf(char delim, size_t limit) { while (bytes_read < max) { CHECK_LE(current->read_pos_, current->write_pos_); size_t avail = current->write_pos_ - current->read_pos_; - if (avail > left) - avail = left; + if (avail > left) avail = left; // Walk through data char* tmp = current->data_ + current->read_pos_; @@ -382,7 +353,6 @@ size_t NodeBIO::IndexOf(char delim, size_t limit) { return max; } - void NodeBIO::Write(const char* data, size_t size) { size_t offset = 0; size_t left = size; @@ -395,13 +365,11 @@ void NodeBIO::Write(const char* data, size_t size) { CHECK_LE(write_head_->write_pos_, write_head_->len_); size_t avail = write_head_->len_ - write_head_->write_pos_; - if (to_write > avail) - to_write = avail; + if (to_write > avail) to_write = avail; // Copy data - memcpy(write_head_->data_ + write_head_->write_pos_, - data + offset, - to_write); + memcpy( + write_head_->data_ + write_head_->write_pos_, data + offset, to_write); // Move pointers left -= to_write; @@ -424,7 +392,6 @@ void NodeBIO::Write(const char* data, size_t size) { CHECK_EQ(left, 0); } - char* NodeBIO::PeekWritable(size_t* size) { TryAllocateForWrite(*size); @@ -437,7 +404,6 @@ char* NodeBIO::PeekWritable(size_t* size) { return write_head_->data_ + write_head_->write_pos_; } - void NodeBIO::Commit(size_t size) { write_head_->write_pos_ += size; length_ += size; @@ -455,18 +421,14 @@ void NodeBIO::Commit(size_t size) { } } - void NodeBIO::TryAllocateForWrite(size_t hint) { Buffer* w = write_head_; Buffer* r = read_head_; // If write head is full, next buffer is either read head or not empty. - if (w == nullptr || - (w->write_pos_ == w->len_ && - (w->next_ == r || w->next_->write_pos_ != 0))) { - size_t len = w == nullptr ? initial_ : - kThroughputBufferLength; - if (len < hint) - len = hint; + if (w == nullptr || (w->write_pos_ == w->len_ && + (w->next_ == r || w->next_->write_pos_ != 0))) { + size_t len = w == nullptr ? initial_ : kThroughputBufferLength; + if (len < hint) len = hint; Buffer* next = new Buffer(env_, len); if (w == nullptr) { @@ -480,10 +442,8 @@ void NodeBIO::TryAllocateForWrite(size_t hint) { } } - void NodeBIO::Reset() { - if (read_head_ == nullptr) - return; + if (read_head_ == nullptr) return; while (read_head_->read_pos_ != read_head_->write_pos_) { CHECK(read_head_->write_pos_ > read_head_->read_pos_); @@ -498,10 +458,8 @@ void NodeBIO::Reset() { CHECK_EQ(length_, 0); } - NodeBIO::~NodeBIO() { - if (read_head_ == nullptr) - return; + if (read_head_ == nullptr) return; Buffer* current = read_head_; do { @@ -514,12 +472,10 @@ NodeBIO::~NodeBIO() { write_head_ = nullptr; } - NodeBIO* NodeBIO::FromBIO(BIO* bio) { CHECK_NOT_NULL(BIO_get_data(bio)); return static_cast(BIO_get_data(bio)); } - } // namespace crypto } // namespace node diff --git a/src/node_crypto_bio.h b/src/node_crypto_bio.h index b7f1d4f169edfe..df33aef9abf74d 100644 --- a/src/node_crypto_bio.h +++ b/src/node_crypto_bio.h @@ -24,9 +24,9 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS +#include "env-inl.h" #include "node_crypto.h" #include "openssl/bio.h" -#include "env-inl.h" #include "util-inl.h" #include "v8.h" @@ -46,7 +46,8 @@ class NodeBIO : public MemoryRetainer { // NewFixed takes a copy of `len` bytes from `data` and returns a BIO that, // when read from, returns those bytes followed by EOF. - static BIOPointer NewFixed(const char* data, size_t len, + static BIOPointer NewFixed(const char* data, + size_t len, Environment* env = nullptr); // Move read head to next buffer if needed @@ -88,23 +89,14 @@ class NodeBIO : public MemoryRetainer { // PeekWritable(). void Commit(size_t size); - // Return size of buffer in bytes - inline size_t Length() const { - return length_; - } + inline size_t Length() const { return length_; } - inline void set_eof_return(int num) { - eof_return_ = num; - } + inline void set_eof_return(int num) { eof_return_ = num; } - inline int eof_return() { - return eof_return_; - } + inline int eof_return() { return eof_return_; } - inline void set_initial(size_t initial) { - initial_ = initial; - } + inline void set_initial(size_t initial) { initial_ = initial; } static NodeBIO* FromBIO(BIO* bio); @@ -122,7 +114,9 @@ class NodeBIO : public MemoryRetainer { static int Write(BIO* bio, const char* data, int len); static int Puts(BIO* bio, const char* str); static int Gets(BIO* bio, char* out, int size); - static long Ctrl(BIO* bio, int cmd, long num, // NOLINT(runtime/int) + static long Ctrl(BIO* bio, + int cmd, + long num, // NOLINT(runtime/int) void* ptr); static const BIO_METHOD* GetMethod(); @@ -133,11 +127,8 @@ class NodeBIO : public MemoryRetainer { class Buffer { public: - Buffer(Environment* env, size_t len) : env_(env), - read_pos_(0), - write_pos_(0), - len_(len), - next_(nullptr) { + Buffer(Environment* env, size_t len) + : env_(env), read_pos_(0), write_pos_(0), len_(len), next_(nullptr) { data_ = new char[len]; if (env_ != nullptr) env_->isolate()->AdjustAmountOfExternalAllocatedMemory(len); diff --git a/src/node_crypto_clienthello-inl.h b/src/node_crypto_clienthello-inl.h index 1262186a9277d2..6fd540564ac703 100644 --- a/src/node_crypto_clienthello-inl.h +++ b/src/node_crypto_clienthello-inl.h @@ -53,8 +53,7 @@ inline void ClientHelloParser::Reset() { inline void ClientHelloParser::Start(ClientHelloParser::OnHelloCb onhello_cb, ClientHelloParser::OnEndCb onend_cb, void* onend_arg) { - if (!IsEnded()) - return; + if (!IsEnded()) return; Reset(); CHECK_NOT_NULL(onhello_cb); @@ -66,8 +65,7 @@ inline void ClientHelloParser::Start(ClientHelloParser::OnHelloCb onhello_cb, } inline void ClientHelloParser::End() { - if (state_ == kEnded) - return; + if (state_ == kEnded) return; state_ = kEnded; if (onend_cb_ != nullptr) { onend_cb_(cb_arg_); diff --git a/src/node_crypto_clienthello.cc b/src/node_crypto_clienthello.cc index b0375755774318..485f4c6552cf5f 100644 --- a/src/node_crypto_clienthello.cc +++ b/src/node_crypto_clienthello.cc @@ -27,8 +27,7 @@ namespace crypto { void ClientHelloParser::Parse(const uint8_t* data, size_t avail) { switch (state_) { case kWaiting: - if (!ParseRecordHeader(data, avail)) - break; + if (!ParseRecordHeader(data, avail)) break; // Fall through case kTLSHeader: ParseHeader(data, avail); @@ -43,16 +42,12 @@ void ClientHelloParser::Parse(const uint8_t* data, size_t avail) { } } - bool ClientHelloParser::ParseRecordHeader(const uint8_t* data, size_t avail) { // >= 5 bytes for header parsing - if (avail < 5) - return false; + if (avail < 5) return false; - if (data[0] == kChangeCipherSpec || - data[0] == kAlert || - data[0] == kHandshake || - data[0] == kApplicationData) { + if (data[0] == kChangeCipherSpec || data[0] == kAlert || + data[0] == kHandshake || data[0] == kApplicationData) { frame_len_ = (data[3] << 8) + data[4]; state_ = kTLSHeader; body_offset_ = 5; @@ -71,13 +66,11 @@ bool ClientHelloParser::ParseRecordHeader(const uint8_t* data, size_t avail) { return true; } - void ClientHelloParser::ParseHeader(const uint8_t* data, size_t avail) { ClientHello hello; // >= 5 + frame size bytes for frame parsing - if (body_offset_ + frame_len_ > avail) - return; + if (body_offset_ + frame_len_ > avail) return; // Check hello protocol version. Protocol tuples that we know about: // @@ -85,24 +78,21 @@ void ClientHelloParser::ParseHeader(const uint8_t* data, size_t avail) { // (3,2) TLS v1.1 // (3,3) TLS v1.2 // - if (data[body_offset_ + 4] != 0x03 || - data[body_offset_ + 5] < 0x01 || + if (data[body_offset_ + 4] != 0x03 || data[body_offset_ + 5] < 0x01 || data[body_offset_ + 5] > 0x03) { return End(); } if (data[body_offset_] == kClientHello) { if (state_ == kTLSHeader) { - if (!ParseTLSClientHello(data, avail)) - return End(); + if (!ParseTLSClientHello(data, avail)) return End(); } else { // We couldn't get here, but whatever return End(); } // Check if we overflowed (do not reply with any private data) - if (session_id_ == nullptr || - session_size_ > 32 || + if (session_id_ == nullptr || session_size_ > 32 || session_id_ + session_size_ > data + avail) { return End(); } @@ -117,7 +107,6 @@ void ClientHelloParser::ParseHeader(const uint8_t* data, size_t avail) { onhello_cb_(cb_arg_, hello); } - void ClientHelloParser::ParseExtension(const uint16_t type, const uint8_t* data, size_t len) { @@ -125,29 +114,22 @@ void ClientHelloParser::ParseExtension(const uint16_t type, // That's because we're heavily relying on OpenSSL to solve any problem with // incoming data. switch (type) { - case kServerName: - { - if (len < 2) - return; - uint32_t server_names_len = (data[0] << 8) + data[1]; - if (server_names_len + 2 > len) - return; - for (size_t offset = 2; offset < 2 + server_names_len; ) { - if (offset + 3 > len) - return; - uint8_t name_type = data[offset]; - if (name_type != kServernameHostname) - return; - uint16_t name_len = (data[offset + 1] << 8) + data[offset + 2]; - offset += 3; - if (offset + name_len > len) - return; - servername_ = data + offset; - servername_size_ = name_len; - offset += name_len; - } + case kServerName: { + if (len < 2) return; + uint32_t server_names_len = (data[0] << 8) + data[1]; + if (server_names_len + 2 > len) return; + for (size_t offset = 2; offset < 2 + server_names_len;) { + if (offset + 3 > len) return; + uint8_t name_type = data[offset]; + if (name_type != kServernameHostname) return; + uint16_t name_len = (data[offset + 1] << 8) + data[offset + 2]; + offset += 3; + if (offset + name_len > len) return; + servername_ = data + offset; + servername_size_ = name_len; + offset += name_len; } - break; + } break; case kTLSSessionTicket: tls_ticket_size_ = len; tls_ticket_ = data + len; @@ -158,15 +140,13 @@ void ClientHelloParser::ParseExtension(const uint16_t type, } } - bool ClientHelloParser::ParseTLSClientHello(const uint8_t* data, size_t avail) { const uint8_t* body; // Skip frame header, hello header, protocol version and random data size_t session_offset = body_offset_ + 4 + 2 + 32; - if (session_offset + 1 >= avail) - return false; + if (session_offset + 1 >= avail) return false; body = data + session_offset; session_size_ = *body; @@ -175,54 +155,44 @@ bool ClientHelloParser::ParseTLSClientHello(const uint8_t* data, size_t avail) { size_t cipher_offset = session_offset + 1 + session_size_; // Session OOB failure - if (cipher_offset + 1 >= avail) - return false; + if (cipher_offset + 1 >= avail) return false; - uint16_t cipher_len = - (data[cipher_offset] << 8) + data[cipher_offset + 1]; + uint16_t cipher_len = (data[cipher_offset] << 8) + data[cipher_offset + 1]; size_t comp_offset = cipher_offset + 2 + cipher_len; // Cipher OOB failure - if (comp_offset >= avail) - return false; + if (comp_offset >= avail) return false; uint8_t comp_len = data[comp_offset]; size_t extension_offset = comp_offset + 1 + comp_len; // Compression OOB failure - if (extension_offset > avail) - return false; + if (extension_offset > avail) return false; // No extensions present - if (extension_offset == avail) - return true; + if (extension_offset == avail) return true; size_t ext_off = extension_offset + 2; // Parse known extensions while (ext_off < avail) { // Extension OOB - if (ext_off + 4 > avail) - return false; + if (ext_off + 4 > avail) return false; uint16_t ext_type = (data[ext_off] << 8) + data[ext_off + 1]; uint16_t ext_len = (data[ext_off + 2] << 8) + data[ext_off + 3]; ext_off += 4; // Extension OOB - if (ext_off + ext_len > avail) - return false; + if (ext_off + ext_len > avail) return false; - ParseExtension(ext_type, - data + ext_off, - ext_len); + ParseExtension(ext_type, data + ext_off, ext_len); ext_off += ext_len; } // Extensions OOB failure - if (ext_off > avail) - return false; + if (ext_off > avail) return false; return true; } diff --git a/src/node_crypto_clienthello.h b/src/node_crypto_clienthello.h index 48f49771fdf401..4b02d82fdaa007 100644 --- a/src/node_crypto_clienthello.h +++ b/src/node_crypto_clienthello.h @@ -72,12 +72,7 @@ class ClientHelloParser { static const uint8_t kServernameHostname = 0; static const size_t kMinStatusRequestSize = 5; - enum ParseState { - kWaiting, - kTLSHeader, - kPaused, - kEnded - }; + enum ParseState { kWaiting, kTLSHeader, kPaused, kEnded }; enum FrameType { kChangeCipherSpec = 20, @@ -87,20 +82,13 @@ class ClientHelloParser { kOther = 255 }; - enum HandshakeType { - kClientHello = 1 - }; + enum HandshakeType { kClientHello = 1 }; - enum ExtensionType { - kServerName = 0, - kTLSSessionTicket = 35 - }; + enum ExtensionType { kServerName = 0, kTLSSessionTicket = 35 }; bool ParseRecordHeader(const uint8_t* data, size_t avail); void ParseHeader(const uint8_t* data, size_t avail); - void ParseExtension(const uint16_t type, - const uint8_t* data, - size_t len); + void ParseExtension(const uint16_t type, const uint8_t* data, size_t len); bool ParseTLSClientHello(const uint8_t* data, size_t avail); ParseState state_; diff --git a/src/node_crypto_groups.h b/src/node_crypto_groups.h index d22fdc7f966f9a..5b07575185c9ac 100644 --- a/src/node_crypto_groups.h +++ b/src/node_crypto_groups.h @@ -31,364 +31,305 @@ They all use 2 as a generator. */ - -static const unsigned char two_generator[] = { 2 }; +static const unsigned char two_generator[] = {2}; static const unsigned char group_modp1[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0x0f, - 0xda, 0xa2, 0x21, 0x68, 0xc2, 0x34, 0xc4, 0xc6, 0x62, 0x8b, - 0x80, 0xdc, 0x1c, 0xd1, 0x29, 0x02, 0x4e, 0x08, 0x8a, 0x67, - 0xcc, 0x74, 0x02, 0x0b, 0xbe, 0xa6, 0x3b, 0x13, 0x9b, 0x22, - 0x51, 0x4a, 0x08, 0x79, 0x8e, 0x34, 0x04, 0xdd, 0xef, 0x95, - 0x19, 0xb3, 0xcd, 0x3a, 0x43, 0x1b, 0x30, 0x2b, 0x0a, 0x6d, - 0xf2, 0x5f, 0x14, 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, - 0xc2, 0x45, 0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, - 0xf4, 0x4c, 0x42, 0xe9, 0xa6, 0x3a, 0x36, 0x20, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0x0f, 0xda, 0xa2, + 0x21, 0x68, 0xc2, 0x34, 0xc4, 0xc6, 0x62, 0x8b, 0x80, 0xdc, 0x1c, 0xd1, + 0x29, 0x02, 0x4e, 0x08, 0x8a, 0x67, 0xcc, 0x74, 0x02, 0x0b, 0xbe, 0xa6, + 0x3b, 0x13, 0x9b, 0x22, 0x51, 0x4a, 0x08, 0x79, 0x8e, 0x34, 0x04, 0xdd, + 0xef, 0x95, 0x19, 0xb3, 0xcd, 0x3a, 0x43, 0x1b, 0x30, 0x2b, 0x0a, 0x6d, + 0xf2, 0x5f, 0x14, 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, 0xc2, 0x45, + 0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, 0xf4, 0x4c, 0x42, 0xe9, + 0xa6, 0x3a, 0x36, 0x20, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; static const unsigned char group_modp2[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0x0f, - 0xda, 0xa2, 0x21, 0x68, 0xc2, 0x34, 0xc4, 0xc6, 0x62, 0x8b, - 0x80, 0xdc, 0x1c, 0xd1, 0x29, 0x02, 0x4e, 0x08, 0x8a, 0x67, - 0xcc, 0x74, 0x02, 0x0b, 0xbe, 0xa6, 0x3b, 0x13, 0x9b, 0x22, - 0x51, 0x4a, 0x08, 0x79, 0x8e, 0x34, 0x04, 0xdd, 0xef, 0x95, - 0x19, 0xb3, 0xcd, 0x3a, 0x43, 0x1b, 0x30, 0x2b, 0x0a, 0x6d, - 0xf2, 0x5f, 0x14, 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, - 0xc2, 0x45, 0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, - 0xf4, 0x4c, 0x42, 0xe9, 0xa6, 0x37, 0xed, 0x6b, 0x0b, 0xff, - 0x5c, 0xb6, 0xf4, 0x06, 0xb7, 0xed, 0xee, 0x38, 0x6b, 0xfb, - 0x5a, 0x89, 0x9f, 0xa5, 0xae, 0x9f, 0x24, 0x11, 0x7c, 0x4b, - 0x1f, 0xe6, 0x49, 0x28, 0x66, 0x51, 0xec, 0xe6, 0x53, 0x81, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0x0f, 0xda, 0xa2, + 0x21, 0x68, 0xc2, 0x34, 0xc4, 0xc6, 0x62, 0x8b, 0x80, 0xdc, 0x1c, 0xd1, + 0x29, 0x02, 0x4e, 0x08, 0x8a, 0x67, 0xcc, 0x74, 0x02, 0x0b, 0xbe, 0xa6, + 0x3b, 0x13, 0x9b, 0x22, 0x51, 0x4a, 0x08, 0x79, 0x8e, 0x34, 0x04, 0xdd, + 0xef, 0x95, 0x19, 0xb3, 0xcd, 0x3a, 0x43, 0x1b, 0x30, 0x2b, 0x0a, 0x6d, + 0xf2, 0x5f, 0x14, 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, 0xc2, 0x45, + 0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, 0xf4, 0x4c, 0x42, 0xe9, + 0xa6, 0x37, 0xed, 0x6b, 0x0b, 0xff, 0x5c, 0xb6, 0xf4, 0x06, 0xb7, 0xed, + 0xee, 0x38, 0x6b, 0xfb, 0x5a, 0x89, 0x9f, 0xa5, 0xae, 0x9f, 0x24, 0x11, + 0x7c, 0x4b, 0x1f, 0xe6, 0x49, 0x28, 0x66, 0x51, 0xec, 0xe6, 0x53, 0x81, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; static const unsigned char group_modp5[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0x0f, - 0xda, 0xa2, 0x21, 0x68, 0xc2, 0x34, 0xc4, 0xc6, 0x62, 0x8b, - 0x80, 0xdc, 0x1c, 0xd1, 0x29, 0x02, 0x4e, 0x08, 0x8a, 0x67, - 0xcc, 0x74, 0x02, 0x0b, 0xbe, 0xa6, 0x3b, 0x13, 0x9b, 0x22, - 0x51, 0x4a, 0x08, 0x79, 0x8e, 0x34, 0x04, 0xdd, 0xef, 0x95, - 0x19, 0xb3, 0xcd, 0x3a, 0x43, 0x1b, 0x30, 0x2b, 0x0a, 0x6d, - 0xf2, 0x5f, 0x14, 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, - 0xc2, 0x45, 0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, - 0xf4, 0x4c, 0x42, 0xe9, 0xa6, 0x37, 0xed, 0x6b, 0x0b, 0xff, - 0x5c, 0xb6, 0xf4, 0x06, 0xb7, 0xed, 0xee, 0x38, 0x6b, 0xfb, - 0x5a, 0x89, 0x9f, 0xa5, 0xae, 0x9f, 0x24, 0x11, 0x7c, 0x4b, - 0x1f, 0xe6, 0x49, 0x28, 0x66, 0x51, 0xec, 0xe4, 0x5b, 0x3d, - 0xc2, 0x00, 0x7c, 0xb8, 0xa1, 0x63, 0xbf, 0x05, 0x98, 0xda, - 0x48, 0x36, 0x1c, 0x55, 0xd3, 0x9a, 0x69, 0x16, 0x3f, 0xa8, - 0xfd, 0x24, 0xcf, 0x5f, 0x83, 0x65, 0x5d, 0x23, 0xdc, 0xa3, - 0xad, 0x96, 0x1c, 0x62, 0xf3, 0x56, 0x20, 0x85, 0x52, 0xbb, - 0x9e, 0xd5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6d, 0x67, 0x0c, - 0x35, 0x4e, 0x4a, 0xbc, 0x98, 0x04, 0xf1, 0x74, 0x6c, 0x08, - 0xca, 0x23, 0x73, 0x27, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff }; + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0x0f, 0xda, 0xa2, + 0x21, 0x68, 0xc2, 0x34, 0xc4, 0xc6, 0x62, 0x8b, 0x80, 0xdc, 0x1c, 0xd1, + 0x29, 0x02, 0x4e, 0x08, 0x8a, 0x67, 0xcc, 0x74, 0x02, 0x0b, 0xbe, 0xa6, + 0x3b, 0x13, 0x9b, 0x22, 0x51, 0x4a, 0x08, 0x79, 0x8e, 0x34, 0x04, 0xdd, + 0xef, 0x95, 0x19, 0xb3, 0xcd, 0x3a, 0x43, 0x1b, 0x30, 0x2b, 0x0a, 0x6d, + 0xf2, 0x5f, 0x14, 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, 0xc2, 0x45, + 0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, 0xf4, 0x4c, 0x42, 0xe9, + 0xa6, 0x37, 0xed, 0x6b, 0x0b, 0xff, 0x5c, 0xb6, 0xf4, 0x06, 0xb7, 0xed, + 0xee, 0x38, 0x6b, 0xfb, 0x5a, 0x89, 0x9f, 0xa5, 0xae, 0x9f, 0x24, 0x11, + 0x7c, 0x4b, 0x1f, 0xe6, 0x49, 0x28, 0x66, 0x51, 0xec, 0xe4, 0x5b, 0x3d, + 0xc2, 0x00, 0x7c, 0xb8, 0xa1, 0x63, 0xbf, 0x05, 0x98, 0xda, 0x48, 0x36, + 0x1c, 0x55, 0xd3, 0x9a, 0x69, 0x16, 0x3f, 0xa8, 0xfd, 0x24, 0xcf, 0x5f, + 0x83, 0x65, 0x5d, 0x23, 0xdc, 0xa3, 0xad, 0x96, 0x1c, 0x62, 0xf3, 0x56, + 0x20, 0x85, 0x52, 0xbb, 0x9e, 0xd5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6d, + 0x67, 0x0c, 0x35, 0x4e, 0x4a, 0xbc, 0x98, 0x04, 0xf1, 0x74, 0x6c, 0x08, + 0xca, 0x23, 0x73, 0x27, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; static const unsigned char group_modp14[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0x0f, - 0xda, 0xa2, 0x21, 0x68, 0xc2, 0x34, 0xc4, 0xc6, 0x62, 0x8b, - 0x80, 0xdc, 0x1c, 0xd1, 0x29, 0x02, 0x4e, 0x08, 0x8a, 0x67, - 0xcc, 0x74, 0x02, 0x0b, 0xbe, 0xa6, 0x3b, 0x13, 0x9b, 0x22, - 0x51, 0x4a, 0x08, 0x79, 0x8e, 0x34, 0x04, 0xdd, 0xef, 0x95, - 0x19, 0xb3, 0xcd, 0x3a, 0x43, 0x1b, 0x30, 0x2b, 0x0a, 0x6d, - 0xf2, 0x5f, 0x14, 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, - 0xc2, 0x45, 0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, - 0xf4, 0x4c, 0x42, 0xe9, 0xa6, 0x37, 0xed, 0x6b, 0x0b, 0xff, - 0x5c, 0xb6, 0xf4, 0x06, 0xb7, 0xed, 0xee, 0x38, 0x6b, 0xfb, - 0x5a, 0x89, 0x9f, 0xa5, 0xae, 0x9f, 0x24, 0x11, 0x7c, 0x4b, - 0x1f, 0xe6, 0x49, 0x28, 0x66, 0x51, 0xec, 0xe4, 0x5b, 0x3d, - 0xc2, 0x00, 0x7c, 0xb8, 0xa1, 0x63, 0xbf, 0x05, 0x98, 0xda, - 0x48, 0x36, 0x1c, 0x55, 0xd3, 0x9a, 0x69, 0x16, 0x3f, 0xa8, - 0xfd, 0x24, 0xcf, 0x5f, 0x83, 0x65, 0x5d, 0x23, 0xdc, 0xa3, - 0xad, 0x96, 0x1c, 0x62, 0xf3, 0x56, 0x20, 0x85, 0x52, 0xbb, - 0x9e, 0xd5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6d, 0x67, 0x0c, - 0x35, 0x4e, 0x4a, 0xbc, 0x98, 0x04, 0xf1, 0x74, 0x6c, 0x08, - 0xca, 0x18, 0x21, 0x7c, 0x32, 0x90, 0x5e, 0x46, 0x2e, 0x36, - 0xce, 0x3b, 0xe3, 0x9e, 0x77, 0x2c, 0x18, 0x0e, 0x86, 0x03, - 0x9b, 0x27, 0x83, 0xa2, 0xec, 0x07, 0xa2, 0x8f, 0xb5, 0xc5, - 0x5d, 0xf0, 0x6f, 0x4c, 0x52, 0xc9, 0xde, 0x2b, 0xcb, 0xf6, - 0x95, 0x58, 0x17, 0x18, 0x39, 0x95, 0x49, 0x7c, 0xea, 0x95, - 0x6a, 0xe5, 0x15, 0xd2, 0x26, 0x18, 0x98, 0xfa, 0x05, 0x10, - 0x15, 0x72, 0x8e, 0x5a, 0x8a, 0xac, 0xaa, 0x68, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0x0f, 0xda, 0xa2, + 0x21, 0x68, 0xc2, 0x34, 0xc4, 0xc6, 0x62, 0x8b, 0x80, 0xdc, 0x1c, 0xd1, + 0x29, 0x02, 0x4e, 0x08, 0x8a, 0x67, 0xcc, 0x74, 0x02, 0x0b, 0xbe, 0xa6, + 0x3b, 0x13, 0x9b, 0x22, 0x51, 0x4a, 0x08, 0x79, 0x8e, 0x34, 0x04, 0xdd, + 0xef, 0x95, 0x19, 0xb3, 0xcd, 0x3a, 0x43, 0x1b, 0x30, 0x2b, 0x0a, 0x6d, + 0xf2, 0x5f, 0x14, 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, 0xc2, 0x45, + 0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, 0xf4, 0x4c, 0x42, 0xe9, + 0xa6, 0x37, 0xed, 0x6b, 0x0b, 0xff, 0x5c, 0xb6, 0xf4, 0x06, 0xb7, 0xed, + 0xee, 0x38, 0x6b, 0xfb, 0x5a, 0x89, 0x9f, 0xa5, 0xae, 0x9f, 0x24, 0x11, + 0x7c, 0x4b, 0x1f, 0xe6, 0x49, 0x28, 0x66, 0x51, 0xec, 0xe4, 0x5b, 0x3d, + 0xc2, 0x00, 0x7c, 0xb8, 0xa1, 0x63, 0xbf, 0x05, 0x98, 0xda, 0x48, 0x36, + 0x1c, 0x55, 0xd3, 0x9a, 0x69, 0x16, 0x3f, 0xa8, 0xfd, 0x24, 0xcf, 0x5f, + 0x83, 0x65, 0x5d, 0x23, 0xdc, 0xa3, 0xad, 0x96, 0x1c, 0x62, 0xf3, 0x56, + 0x20, 0x85, 0x52, 0xbb, 0x9e, 0xd5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6d, + 0x67, 0x0c, 0x35, 0x4e, 0x4a, 0xbc, 0x98, 0x04, 0xf1, 0x74, 0x6c, 0x08, + 0xca, 0x18, 0x21, 0x7c, 0x32, 0x90, 0x5e, 0x46, 0x2e, 0x36, 0xce, 0x3b, + 0xe3, 0x9e, 0x77, 0x2c, 0x18, 0x0e, 0x86, 0x03, 0x9b, 0x27, 0x83, 0xa2, + 0xec, 0x07, 0xa2, 0x8f, 0xb5, 0xc5, 0x5d, 0xf0, 0x6f, 0x4c, 0x52, 0xc9, + 0xde, 0x2b, 0xcb, 0xf6, 0x95, 0x58, 0x17, 0x18, 0x39, 0x95, 0x49, 0x7c, + 0xea, 0x95, 0x6a, 0xe5, 0x15, 0xd2, 0x26, 0x18, 0x98, 0xfa, 0x05, 0x10, + 0x15, 0x72, 0x8e, 0x5a, 0x8a, 0xac, 0xaa, 0x68, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff}; static const unsigned char group_modp15[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0x0f, - 0xda, 0xa2, 0x21, 0x68, 0xc2, 0x34, 0xc4, 0xc6, 0x62, 0x8b, - 0x80, 0xdc, 0x1c, 0xd1, 0x29, 0x02, 0x4e, 0x08, 0x8a, 0x67, - 0xcc, 0x74, 0x02, 0x0b, 0xbe, 0xa6, 0x3b, 0x13, 0x9b, 0x22, - 0x51, 0x4a, 0x08, 0x79, 0x8e, 0x34, 0x04, 0xdd, 0xef, 0x95, - 0x19, 0xb3, 0xcd, 0x3a, 0x43, 0x1b, 0x30, 0x2b, 0x0a, 0x6d, - 0xf2, 0x5f, 0x14, 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, - 0xc2, 0x45, 0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, - 0xf4, 0x4c, 0x42, 0xe9, 0xa6, 0x37, 0xed, 0x6b, 0x0b, 0xff, - 0x5c, 0xb6, 0xf4, 0x06, 0xb7, 0xed, 0xee, 0x38, 0x6b, 0xfb, - 0x5a, 0x89, 0x9f, 0xa5, 0xae, 0x9f, 0x24, 0x11, 0x7c, 0x4b, - 0x1f, 0xe6, 0x49, 0x28, 0x66, 0x51, 0xec, 0xe4, 0x5b, 0x3d, - 0xc2, 0x00, 0x7c, 0xb8, 0xa1, 0x63, 0xbf, 0x05, 0x98, 0xda, - 0x48, 0x36, 0x1c, 0x55, 0xd3, 0x9a, 0x69, 0x16, 0x3f, 0xa8, - 0xfd, 0x24, 0xcf, 0x5f, 0x83, 0x65, 0x5d, 0x23, 0xdc, 0xa3, - 0xad, 0x96, 0x1c, 0x62, 0xf3, 0x56, 0x20, 0x85, 0x52, 0xbb, - 0x9e, 0xd5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6d, 0x67, 0x0c, - 0x35, 0x4e, 0x4a, 0xbc, 0x98, 0x04, 0xf1, 0x74, 0x6c, 0x08, - 0xca, 0x18, 0x21, 0x7c, 0x32, 0x90, 0x5e, 0x46, 0x2e, 0x36, - 0xce, 0x3b, 0xe3, 0x9e, 0x77, 0x2c, 0x18, 0x0e, 0x86, 0x03, - 0x9b, 0x27, 0x83, 0xa2, 0xec, 0x07, 0xa2, 0x8f, 0xb5, 0xc5, - 0x5d, 0xf0, 0x6f, 0x4c, 0x52, 0xc9, 0xde, 0x2b, 0xcb, 0xf6, - 0x95, 0x58, 0x17, 0x18, 0x39, 0x95, 0x49, 0x7c, 0xea, 0x95, - 0x6a, 0xe5, 0x15, 0xd2, 0x26, 0x18, 0x98, 0xfa, 0x05, 0x10, - 0x15, 0x72, 0x8e, 0x5a, 0x8a, 0xaa, 0xc4, 0x2d, 0xad, 0x33, - 0x17, 0x0d, 0x04, 0x50, 0x7a, 0x33, 0xa8, 0x55, 0x21, 0xab, - 0xdf, 0x1c, 0xba, 0x64, 0xec, 0xfb, 0x85, 0x04, 0x58, 0xdb, - 0xef, 0x0a, 0x8a, 0xea, 0x71, 0x57, 0x5d, 0x06, 0x0c, 0x7d, - 0xb3, 0x97, 0x0f, 0x85, 0xa6, 0xe1, 0xe4, 0xc7, 0xab, 0xf5, - 0xae, 0x8c, 0xdb, 0x09, 0x33, 0xd7, 0x1e, 0x8c, 0x94, 0xe0, - 0x4a, 0x25, 0x61, 0x9d, 0xce, 0xe3, 0xd2, 0x26, 0x1a, 0xd2, - 0xee, 0x6b, 0xf1, 0x2f, 0xfa, 0x06, 0xd9, 0x8a, 0x08, 0x64, - 0xd8, 0x76, 0x02, 0x73, 0x3e, 0xc8, 0x6a, 0x64, 0x52, 0x1f, - 0x2b, 0x18, 0x17, 0x7b, 0x20, 0x0c, 0xbb, 0xe1, 0x17, 0x57, - 0x7a, 0x61, 0x5d, 0x6c, 0x77, 0x09, 0x88, 0xc0, 0xba, 0xd9, - 0x46, 0xe2, 0x08, 0xe2, 0x4f, 0xa0, 0x74, 0xe5, 0xab, 0x31, - 0x43, 0xdb, 0x5b, 0xfc, 0xe0, 0xfd, 0x10, 0x8e, 0x4b, 0x82, - 0xd1, 0x20, 0xa9, 0x3a, 0xd2, 0xca, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff }; + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0x0f, 0xda, 0xa2, + 0x21, 0x68, 0xc2, 0x34, 0xc4, 0xc6, 0x62, 0x8b, 0x80, 0xdc, 0x1c, 0xd1, + 0x29, 0x02, 0x4e, 0x08, 0x8a, 0x67, 0xcc, 0x74, 0x02, 0x0b, 0xbe, 0xa6, + 0x3b, 0x13, 0x9b, 0x22, 0x51, 0x4a, 0x08, 0x79, 0x8e, 0x34, 0x04, 0xdd, + 0xef, 0x95, 0x19, 0xb3, 0xcd, 0x3a, 0x43, 0x1b, 0x30, 0x2b, 0x0a, 0x6d, + 0xf2, 0x5f, 0x14, 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, 0xc2, 0x45, + 0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, 0xf4, 0x4c, 0x42, 0xe9, + 0xa6, 0x37, 0xed, 0x6b, 0x0b, 0xff, 0x5c, 0xb6, 0xf4, 0x06, 0xb7, 0xed, + 0xee, 0x38, 0x6b, 0xfb, 0x5a, 0x89, 0x9f, 0xa5, 0xae, 0x9f, 0x24, 0x11, + 0x7c, 0x4b, 0x1f, 0xe6, 0x49, 0x28, 0x66, 0x51, 0xec, 0xe4, 0x5b, 0x3d, + 0xc2, 0x00, 0x7c, 0xb8, 0xa1, 0x63, 0xbf, 0x05, 0x98, 0xda, 0x48, 0x36, + 0x1c, 0x55, 0xd3, 0x9a, 0x69, 0x16, 0x3f, 0xa8, 0xfd, 0x24, 0xcf, 0x5f, + 0x83, 0x65, 0x5d, 0x23, 0xdc, 0xa3, 0xad, 0x96, 0x1c, 0x62, 0xf3, 0x56, + 0x20, 0x85, 0x52, 0xbb, 0x9e, 0xd5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6d, + 0x67, 0x0c, 0x35, 0x4e, 0x4a, 0xbc, 0x98, 0x04, 0xf1, 0x74, 0x6c, 0x08, + 0xca, 0x18, 0x21, 0x7c, 0x32, 0x90, 0x5e, 0x46, 0x2e, 0x36, 0xce, 0x3b, + 0xe3, 0x9e, 0x77, 0x2c, 0x18, 0x0e, 0x86, 0x03, 0x9b, 0x27, 0x83, 0xa2, + 0xec, 0x07, 0xa2, 0x8f, 0xb5, 0xc5, 0x5d, 0xf0, 0x6f, 0x4c, 0x52, 0xc9, + 0xde, 0x2b, 0xcb, 0xf6, 0x95, 0x58, 0x17, 0x18, 0x39, 0x95, 0x49, 0x7c, + 0xea, 0x95, 0x6a, 0xe5, 0x15, 0xd2, 0x26, 0x18, 0x98, 0xfa, 0x05, 0x10, + 0x15, 0x72, 0x8e, 0x5a, 0x8a, 0xaa, 0xc4, 0x2d, 0xad, 0x33, 0x17, 0x0d, + 0x04, 0x50, 0x7a, 0x33, 0xa8, 0x55, 0x21, 0xab, 0xdf, 0x1c, 0xba, 0x64, + 0xec, 0xfb, 0x85, 0x04, 0x58, 0xdb, 0xef, 0x0a, 0x8a, 0xea, 0x71, 0x57, + 0x5d, 0x06, 0x0c, 0x7d, 0xb3, 0x97, 0x0f, 0x85, 0xa6, 0xe1, 0xe4, 0xc7, + 0xab, 0xf5, 0xae, 0x8c, 0xdb, 0x09, 0x33, 0xd7, 0x1e, 0x8c, 0x94, 0xe0, + 0x4a, 0x25, 0x61, 0x9d, 0xce, 0xe3, 0xd2, 0x26, 0x1a, 0xd2, 0xee, 0x6b, + 0xf1, 0x2f, 0xfa, 0x06, 0xd9, 0x8a, 0x08, 0x64, 0xd8, 0x76, 0x02, 0x73, + 0x3e, 0xc8, 0x6a, 0x64, 0x52, 0x1f, 0x2b, 0x18, 0x17, 0x7b, 0x20, 0x0c, + 0xbb, 0xe1, 0x17, 0x57, 0x7a, 0x61, 0x5d, 0x6c, 0x77, 0x09, 0x88, 0xc0, + 0xba, 0xd9, 0x46, 0xe2, 0x08, 0xe2, 0x4f, 0xa0, 0x74, 0xe5, 0xab, 0x31, + 0x43, 0xdb, 0x5b, 0xfc, 0xe0, 0xfd, 0x10, 0x8e, 0x4b, 0x82, 0xd1, 0x20, + 0xa9, 0x3a, 0xd2, 0xca, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; static const unsigned char group_modp16[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0x0f, - 0xda, 0xa2, 0x21, 0x68, 0xc2, 0x34, 0xc4, 0xc6, 0x62, 0x8b, - 0x80, 0xdc, 0x1c, 0xd1, 0x29, 0x02, 0x4e, 0x08, 0x8a, 0x67, - 0xcc, 0x74, 0x02, 0x0b, 0xbe, 0xa6, 0x3b, 0x13, 0x9b, 0x22, - 0x51, 0x4a, 0x08, 0x79, 0x8e, 0x34, 0x04, 0xdd, 0xef, 0x95, - 0x19, 0xb3, 0xcd, 0x3a, 0x43, 0x1b, 0x30, 0x2b, 0x0a, 0x6d, - 0xf2, 0x5f, 0x14, 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, - 0xc2, 0x45, 0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, - 0xf4, 0x4c, 0x42, 0xe9, 0xa6, 0x37, 0xed, 0x6b, 0x0b, 0xff, - 0x5c, 0xb6, 0xf4, 0x06, 0xb7, 0xed, 0xee, 0x38, 0x6b, 0xfb, - 0x5a, 0x89, 0x9f, 0xa5, 0xae, 0x9f, 0x24, 0x11, 0x7c, 0x4b, - 0x1f, 0xe6, 0x49, 0x28, 0x66, 0x51, 0xec, 0xe4, 0x5b, 0x3d, - 0xc2, 0x00, 0x7c, 0xb8, 0xa1, 0x63, 0xbf, 0x05, 0x98, 0xda, - 0x48, 0x36, 0x1c, 0x55, 0xd3, 0x9a, 0x69, 0x16, 0x3f, 0xa8, - 0xfd, 0x24, 0xcf, 0x5f, 0x83, 0x65, 0x5d, 0x23, 0xdc, 0xa3, - 0xad, 0x96, 0x1c, 0x62, 0xf3, 0x56, 0x20, 0x85, 0x52, 0xbb, - 0x9e, 0xd5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6d, 0x67, 0x0c, - 0x35, 0x4e, 0x4a, 0xbc, 0x98, 0x04, 0xf1, 0x74, 0x6c, 0x08, - 0xca, 0x18, 0x21, 0x7c, 0x32, 0x90, 0x5e, 0x46, 0x2e, 0x36, - 0xce, 0x3b, 0xe3, 0x9e, 0x77, 0x2c, 0x18, 0x0e, 0x86, 0x03, - 0x9b, 0x27, 0x83, 0xa2, 0xec, 0x07, 0xa2, 0x8f, 0xb5, 0xc5, - 0x5d, 0xf0, 0x6f, 0x4c, 0x52, 0xc9, 0xde, 0x2b, 0xcb, 0xf6, - 0x95, 0x58, 0x17, 0x18, 0x39, 0x95, 0x49, 0x7c, 0xea, 0x95, - 0x6a, 0xe5, 0x15, 0xd2, 0x26, 0x18, 0x98, 0xfa, 0x05, 0x10, - 0x15, 0x72, 0x8e, 0x5a, 0x8a, 0xaa, 0xc4, 0x2d, 0xad, 0x33, - 0x17, 0x0d, 0x04, 0x50, 0x7a, 0x33, 0xa8, 0x55, 0x21, 0xab, - 0xdf, 0x1c, 0xba, 0x64, 0xec, 0xfb, 0x85, 0x04, 0x58, 0xdb, - 0xef, 0x0a, 0x8a, 0xea, 0x71, 0x57, 0x5d, 0x06, 0x0c, 0x7d, - 0xb3, 0x97, 0x0f, 0x85, 0xa6, 0xe1, 0xe4, 0xc7, 0xab, 0xf5, - 0xae, 0x8c, 0xdb, 0x09, 0x33, 0xd7, 0x1e, 0x8c, 0x94, 0xe0, - 0x4a, 0x25, 0x61, 0x9d, 0xce, 0xe3, 0xd2, 0x26, 0x1a, 0xd2, - 0xee, 0x6b, 0xf1, 0x2f, 0xfa, 0x06, 0xd9, 0x8a, 0x08, 0x64, - 0xd8, 0x76, 0x02, 0x73, 0x3e, 0xc8, 0x6a, 0x64, 0x52, 0x1f, - 0x2b, 0x18, 0x17, 0x7b, 0x20, 0x0c, 0xbb, 0xe1, 0x17, 0x57, - 0x7a, 0x61, 0x5d, 0x6c, 0x77, 0x09, 0x88, 0xc0, 0xba, 0xd9, - 0x46, 0xe2, 0x08, 0xe2, 0x4f, 0xa0, 0x74, 0xe5, 0xab, 0x31, - 0x43, 0xdb, 0x5b, 0xfc, 0xe0, 0xfd, 0x10, 0x8e, 0x4b, 0x82, - 0xd1, 0x20, 0xa9, 0x21, 0x08, 0x01, 0x1a, 0x72, 0x3c, 0x12, - 0xa7, 0x87, 0xe6, 0xd7, 0x88, 0x71, 0x9a, 0x10, 0xbd, 0xba, - 0x5b, 0x26, 0x99, 0xc3, 0x27, 0x18, 0x6a, 0xf4, 0xe2, 0x3c, - 0x1a, 0x94, 0x68, 0x34, 0xb6, 0x15, 0x0b, 0xda, 0x25, 0x83, - 0xe9, 0xca, 0x2a, 0xd4, 0x4c, 0xe8, 0xdb, 0xbb, 0xc2, 0xdb, - 0x04, 0xde, 0x8e, 0xf9, 0x2e, 0x8e, 0xfc, 0x14, 0x1f, 0xbe, - 0xca, 0xa6, 0x28, 0x7c, 0x59, 0x47, 0x4e, 0x6b, 0xc0, 0x5d, - 0x99, 0xb2, 0x96, 0x4f, 0xa0, 0x90, 0xc3, 0xa2, 0x23, 0x3b, - 0xa1, 0x86, 0x51, 0x5b, 0xe7, 0xed, 0x1f, 0x61, 0x29, 0x70, - 0xce, 0xe2, 0xd7, 0xaf, 0xb8, 0x1b, 0xdd, 0x76, 0x21, 0x70, - 0x48, 0x1c, 0xd0, 0x06, 0x91, 0x27, 0xd5, 0xb0, 0x5a, 0xa9, - 0x93, 0xb4, 0xea, 0x98, 0x8d, 0x8f, 0xdd, 0xc1, 0x86, 0xff, - 0xb7, 0xdc, 0x90, 0xa6, 0xc0, 0x8f, 0x4d, 0xf4, 0x35, 0xc9, - 0x34, 0x06, 0x31, 0x99, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff }; + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0x0f, 0xda, 0xa2, + 0x21, 0x68, 0xc2, 0x34, 0xc4, 0xc6, 0x62, 0x8b, 0x80, 0xdc, 0x1c, 0xd1, + 0x29, 0x02, 0x4e, 0x08, 0x8a, 0x67, 0xcc, 0x74, 0x02, 0x0b, 0xbe, 0xa6, + 0x3b, 0x13, 0x9b, 0x22, 0x51, 0x4a, 0x08, 0x79, 0x8e, 0x34, 0x04, 0xdd, + 0xef, 0x95, 0x19, 0xb3, 0xcd, 0x3a, 0x43, 0x1b, 0x30, 0x2b, 0x0a, 0x6d, + 0xf2, 0x5f, 0x14, 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, 0xc2, 0x45, + 0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, 0xf4, 0x4c, 0x42, 0xe9, + 0xa6, 0x37, 0xed, 0x6b, 0x0b, 0xff, 0x5c, 0xb6, 0xf4, 0x06, 0xb7, 0xed, + 0xee, 0x38, 0x6b, 0xfb, 0x5a, 0x89, 0x9f, 0xa5, 0xae, 0x9f, 0x24, 0x11, + 0x7c, 0x4b, 0x1f, 0xe6, 0x49, 0x28, 0x66, 0x51, 0xec, 0xe4, 0x5b, 0x3d, + 0xc2, 0x00, 0x7c, 0xb8, 0xa1, 0x63, 0xbf, 0x05, 0x98, 0xda, 0x48, 0x36, + 0x1c, 0x55, 0xd3, 0x9a, 0x69, 0x16, 0x3f, 0xa8, 0xfd, 0x24, 0xcf, 0x5f, + 0x83, 0x65, 0x5d, 0x23, 0xdc, 0xa3, 0xad, 0x96, 0x1c, 0x62, 0xf3, 0x56, + 0x20, 0x85, 0x52, 0xbb, 0x9e, 0xd5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6d, + 0x67, 0x0c, 0x35, 0x4e, 0x4a, 0xbc, 0x98, 0x04, 0xf1, 0x74, 0x6c, 0x08, + 0xca, 0x18, 0x21, 0x7c, 0x32, 0x90, 0x5e, 0x46, 0x2e, 0x36, 0xce, 0x3b, + 0xe3, 0x9e, 0x77, 0x2c, 0x18, 0x0e, 0x86, 0x03, 0x9b, 0x27, 0x83, 0xa2, + 0xec, 0x07, 0xa2, 0x8f, 0xb5, 0xc5, 0x5d, 0xf0, 0x6f, 0x4c, 0x52, 0xc9, + 0xde, 0x2b, 0xcb, 0xf6, 0x95, 0x58, 0x17, 0x18, 0x39, 0x95, 0x49, 0x7c, + 0xea, 0x95, 0x6a, 0xe5, 0x15, 0xd2, 0x26, 0x18, 0x98, 0xfa, 0x05, 0x10, + 0x15, 0x72, 0x8e, 0x5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e, 0xfc, 0x14, 0x1f, 0xbe, 0xca, 0xa6, + 0x28, 0x7c, 0x59, 0x47, 0x4e, 0x6b, 0xc0, 0x5d, 0x99, 0xb2, 0x96, 0x4f, + 0xa0, 0x90, 0xc3, 0xa2, 0x23, 0x3b, 0xa1, 0x86, 0x51, 0x5b, 0xe7, 0xed, + 0x1f, 0x61, 0x29, 0x70, 0xce, 0xe2, 0xd7, 0xaf, 0xb8, 0x1b, 0xdd, 0x76, + 0x21, 0x70, 0x48, 0x1c, 0xd0, 0x06, 0x91, 0x27, 0xd5, 0xb0, 0x5a, 0xa9, + 0x93, 0xb4, 0xea, 0x98, 0x8d, 0x8f, 0xdd, 0xc1, 0x86, 0xff, 0xb7, 0xdc, + 0x90, 0xa6, 0xc0, 0x8f, 0x4d, 0xf4, 0x35, 0xc9, 0x34, 0x06, 0x31, 0x99, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; static const unsigned char group_modp17[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0x0f, - 0xda, 0xa2, 0x21, 0x68, 0xc2, 0x34, 0xc4, 0xc6, 0x62, 0x8b, - 0x80, 0xdc, 0x1c, 0xd1, 0x29, 0x02, 0x4e, 0x08, 0x8a, 0x67, - 0xcc, 0x74, 0x02, 0x0b, 0xbe, 0xa6, 0x3b, 0x13, 0x9b, 0x22, - 0x51, 0x4a, 0x08, 0x79, 0x8e, 0x34, 0x04, 0xdd, 0xef, 0x95, - 0x19, 0xb3, 0xcd, 0x3a, 0x43, 0x1b, 0x30, 0x2b, 0x0a, 0x6d, - 0xf2, 0x5f, 0x14, 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, - 0xc2, 0x45, 0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, - 0xf4, 0x4c, 0x42, 0xe9, 0xa6, 0x37, 0xed, 0x6b, 0x0b, 0xff, - 0x5c, 0xb6, 0xf4, 0x06, 0xb7, 0xed, 0xee, 0x38, 0x6b, 0xfb, - 0x5a, 0x89, 0x9f, 0xa5, 0xae, 0x9f, 0x24, 0x11, 0x7c, 0x4b, - 0x1f, 0xe6, 0x49, 0x28, 0x66, 0x51, 0xec, 0xe4, 0x5b, 0x3d, - 0xc2, 0x00, 0x7c, 0xb8, 0xa1, 0x63, 0xbf, 0x05, 0x98, 0xda, - 0x48, 0x36, 0x1c, 0x55, 0xd3, 0x9a, 0x69, 0x16, 0x3f, 0xa8, - 0xfd, 0x24, 0xcf, 0x5f, 0x83, 0x65, 0x5d, 0x23, 0xdc, 0xa3, - 0xad, 0x96, 0x1c, 0x62, 0xf3, 0x56, 0x20, 0x85, 0x52, 0xbb, - 0x9e, 0xd5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6d, 0x67, 0x0c, - 0x35, 0x4e, 0x4a, 0xbc, 0x98, 0x04, 0xf1, 0x74, 0x6c, 0x08, - 0xca, 0x18, 0x21, 0x7c, 0x32, 0x90, 0x5e, 0x46, 0x2e, 0x36, - 0xce, 0x3b, 0xe3, 0x9e, 0x77, 0x2c, 0x18, 0x0e, 0x86, 0x03, - 0x9b, 0x27, 0x83, 0xa2, 0xec, 0x07, 0xa2, 0x8f, 0xb5, 0xc5, - 0x5d, 0xf0, 0x6f, 0x4c, 0x52, 0xc9, 0xde, 0x2b, 0xcb, 0xf6, - 0x95, 0x58, 0x17, 0x18, 0x39, 0x95, 0x49, 0x7c, 0xea, 0x95, - 0x6a, 0xe5, 0x15, 0xd2, 0x26, 0x18, 0x98, 0xfa, 0x05, 0x10, - 0x15, 0x72, 0x8e, 0x5a, 0x8a, 0xaa, 0xc4, 0x2d, 0xad, 0x33, - 0x17, 0x0d, 0x04, 0x50, 0x7a, 0x33, 0xa8, 0x55, 0x21, 0xab, - 0xdf, 0x1c, 0xba, 0x64, 0xec, 0xfb, 0x85, 0x04, 0x58, 0xdb, - 0xef, 0x0a, 0x8a, 0xea, 0x71, 0x57, 0x5d, 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61, 0x29, 0x70, - 0xce, 0xe2, 0xd7, 0xaf, 0xb8, 0x1b, 0xdd, 0x76, 0x21, 0x70, - 0x48, 0x1c, 0xd0, 0x06, 0x91, 0x27, 0xd5, 0xb0, 0x5a, 0xa9, - 0x93, 0xb4, 0xea, 0x98, 0x8d, 0x8f, 0xdd, 0xc1, 0x86, 0xff, - 0xb7, 0xdc, 0x90, 0xa6, 0xc0, 0x8f, 0x4d, 0xf4, 0x35, 0xc9, - 0x34, 0x02, 0x84, 0x92, 0x36, 0xc3, 0xfa, 0xb4, 0xd2, 0x7c, - 0x70, 0x26, 0xc1, 0xd4, 0xdc, 0xb2, 0x60, 0x26, 0x46, 0xde, - 0xc9, 0x75, 0x1e, 0x76, 0x3d, 0xba, 0x37, 0xbd, 0xf8, 0xff, - 0x94, 0x06, 0xad, 0x9e, 0x53, 0x0e, 0xe5, 0xdb, 0x38, 0x2f, - 0x41, 0x30, 0x01, 0xae, 0xb0, 0x6a, 0x53, 0xed, 0x90, 0x27, - 0xd8, 0x31, 0x17, 0x97, 0x27, 0xb0, 0x86, 0x5a, 0x89, 0x18, - 0xda, 0x3e, 0xdb, 0xeb, 0xcf, 0x9b, 0x14, 0xed, 0x44, 0xce, - 0x6c, 0xba, 0xce, 0xd4, 0xbb, 0x1b, 0xdb, 0x7f, 0x14, 0x47, - 0xe6, 0xcc, 0x25, 0x4b, 0x33, 0x20, 0x51, 0x51, 0x2b, 0xd7, - 0xaf, 0x42, 0x6f, 0xb8, 0xf4, 0x01, 0x37, 0x8c, 0xd2, 0xbf, - 0x59, 0x83, 0xca, 0x01, 0xc6, 0x4b, 0x92, 0xec, 0xf0, 0x32, - 0xea, 0x15, 0xd1, 0x72, 0x1d, 0x03, 0xf4, 0x82, 0xd7, 0xce, - 0x6e, 0x74, 0xfe, 0xf6, 0xd5, 0x5e, 0x70, 0x2f, 0x46, 0x98, - 0x0c, 0x82, 0xb5, 0xa8, 0x40, 0x31, 0x90, 0x0b, 0x1c, 0x9e, - 0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3a, 0x43, 0x1b, 0x30, 0x2b, 0x0a, 0x6d, + 0xf2, 0x5f, 0x14, 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, 0xc2, 0x45, + 0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, 0xf4, 0x4c, 0x42, 0xe9, + 0xa6, 0x37, 0xed, 0x6b, 0x0b, 0xff, 0x5c, 0xb6, 0xf4, 0x06, 0xb7, 0xed, + 0xee, 0x38, 0x6b, 0xfb, 0x5a, 0x89, 0x9f, 0xa5, 0xae, 0x9f, 0x24, 0x11, + 0x7c, 0x4b, 0x1f, 0xe6, 0x49, 0x28, 0x66, 0x51, 0xec, 0xe4, 0x5b, 0x3d, + 0xc2, 0x00, 0x7c, 0xb8, 0xa1, 0x63, 0xbf, 0x05, 0x98, 0xda, 0x48, 0x36, + 0x1c, 0x55, 0xd3, 0x9a, 0x69, 0x16, 0x3f, 0xa8, 0xfd, 0x24, 0xcf, 0x5f, + 0x83, 0x65, 0x5d, 0x23, 0xdc, 0xa3, 0xad, 0x96, 0x1c, 0x62, 0xf3, 0x56, + 0x20, 0x85, 0x52, 0xbb, 0x9e, 0xd5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6d, + 0x67, 0x0c, 0x35, 0x4e, 0x4a, 0xbc, 0x98, 0x04, 0xf1, 0x74, 0x6c, 0x08, + 0xca, 0x18, 0x21, 0x7c, 0x32, 0x90, 0x5e, 0x46, 0x2e, 0x36, 0xce, 0x3b, + 0xe3, 0x9e, 0x77, 0x2c, 0x18, 0x0e, 0x86, 0x03, 0x9b, 0x27, 0x83, 0xa2, + 0xec, 0x07, 0xa2, 0x8f, 0xb5, 0xc5, 0x5d, 0xf0, 0x6f, 0x4c, 0x52, 0xc9, + 0xde, 0x2b, 0xcb, 0xf6, 0x95, 0x58, 0x17, 0x18, 0x39, 0x95, 0x49, 0x7c, + 0xea, 0x95, 0x6a, 0xe5, 0x15, 0xd2, 0x26, 0x18, 0x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x83, 0xca, 0x01, 0xc6, 0x4b, 0x92, 0xec, 0xf0, 0x32, 0xea, 0x15, + 0xd1, 0x72, 0x1d, 0x03, 0xf4, 0x82, 0xd7, 0xce, 0x6e, 0x74, 0xfe, 0xf6, + 0xd5, 0x5e, 0x70, 0x2f, 0x46, 0x98, 0x0c, 0x82, 0xb5, 0xa8, 0x40, 0x31, + 0x90, 0x0b, 0x1c, 0x9e, 0x59, 0xe7, 0xc9, 0x7f, 0xbe, 0xc7, 0xe8, 0xf3, + 0x23, 0xa9, 0x7a, 0x7e, 0x36, 0xcc, 0x88, 0xbe, 0x0f, 0x1d, 0x45, 0xb7, + 0xff, 0x58, 0x5a, 0xc5, 0x4b, 0xd4, 0x07, 0xb2, 0x2b, 0x41, 0x54, 0xaa, + 0xcc, 0x8f, 0x6d, 0x7e, 0xbf, 0x48, 0xe1, 0xd8, 0x14, 0xcc, 0x5e, 0xd2, + 0x0f, 0x80, 0x37, 0xe0, 0xa7, 0x97, 0x15, 0xee, 0xf2, 0x9b, 0xe3, 0x28, + 0x06, 0xa1, 0xd5, 0x8b, 0xb7, 0xc5, 0xda, 0x76, 0xf5, 0x50, 0xaa, 0x3d, + 0x8a, 0x1f, 0xbf, 0xf0, 0xeb, 0x19, 0xcc, 0xb1, 0xa3, 0x13, 0xd5, 0x5c, + 0xda, 0x56, 0xc9, 0xec, 0x2e, 0xf2, 0x96, 0x32, 0x38, 0x7f, 0xe8, 0xd7, + 0x6e, 0x3c, 0x04, 0x68, 0x04, 0x3e, 0x8f, 0x66, 0x3f, 0x48, 0x60, 0xee, + 0x12, 0xbf, 0x2d, 0x5b, 0x0b, 0x74, 0x74, 0xd6, 0xe6, 0x94, 0xf9, 0x1e, + 0x6d, 0xcc, 0x40, 0x24, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; static const unsigned char group_modp18[] = { - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0x0f, - 0xda, 0xa2, 0x21, 0x68, 0xc2, 0x34, 0xc4, 0xc6, 0x62, 0x8b, - 0x80, 0xdc, 0x1c, 0xd1, 0x29, 0x02, 0x4e, 0x08, 0x8a, 0x67, - 0xcc, 0x74, 0x02, 0x0b, 0xbe, 0xa6, 0x3b, 0x13, 0x9b, 0x22, - 0x51, 0x4a, 0x08, 0x79, 0x8e, 0x34, 0x04, 0xdd, 0xef, 0x95, - 0x19, 0xb3, 0xcd, 0x3a, 0x43, 0x1b, 0x30, 0x2b, 0x0a, 0x6d, - 0xf2, 0x5f, 0x14, 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, - 0xc2, 0x45, 0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, - 0xf4, 0x4c, 0x42, 0xe9, 0xa6, 0x37, 0xed, 0x6b, 0x0b, 0xff, - 0x5c, 0xb6, 0xf4, 0x06, 0xb7, 0xed, 0xee, 0x38, 0x6b, 0xfb, - 0x5a, 0x89, 0x9f, 0xa5, 0xae, 0x9f, 0x24, 0x11, 0x7c, 0x4b, - 0x1f, 0xe6, 0x49, 0x28, 0x66, 0x51, 0xec, 0xe4, 0x5b, 0x3d, - 0xc2, 0x00, 0x7c, 0xb8, 0xa1, 0x63, 0xbf, 0x05, 0x98, 0xda, - 0x48, 0x36, 0x1c, 0x55, 0xd3, 0x9a, 0x69, 0x16, 0x3f, 0xa8, - 0xfd, 0x24, 0xcf, 0x5f, 0x83, 0x65, 0x5d, 0x23, 0xdc, 0xa3, - 0xad, 0x96, 0x1c, 0x62, 0xf3, 0x56, 0x20, 0x85, 0x52, 0xbb, - 0x9e, 0xd5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6d, 0x67, 0x0c, - 0x35, 0x4e, 0x4a, 0xbc, 0x98, 0x04, 0xf1, 0x74, 0x6c, 0x08, - 0xca, 0x18, 0x21, 0x7c, 0x32, 0x90, 0x5e, 0x46, 0x2e, 0x36, - 0xce, 0x3b, 0xe3, 0x9e, 0x77, 0x2c, 0x18, 0x0e, 0x86, 0x03, - 0x9b, 0x27, 0x83, 0xa2, 0xec, 0x07, 0xa2, 0x8f, 0xb5, 0xc5, - 0x5d, 0xf0, 0x6f, 0x4c, 0x52, 0xc9, 0xde, 0x2b, 0xcb, 0xf6, - 0x95, 0x58, 0x17, 0x18, 0x39, 0x95, 0x49, 0x7c, 0xea, 0x95, - 0x6a, 0xe5, 0x15, 0xd2, 0x26, 0x18, 0x98, 0xfa, 0x05, 0x10, - 0x15, 0x72, 0x8e, 0x5a, 0x8a, 0xaa, 0xc4, 0x2d, 0xad, 0x33, - 0x17, 0x0d, 0x04, 0x50, 0x7a, 0x33, 0xa8, 0x55, 0x21, 0xab, - 0xdf, 0x1c, 0xba, 0x64, 0xec, 0xfb, 0x85, 0x04, 0x58, 0xdb, - 0xef, 0x0a, 0x8a, 0xea, 0x71, 0x57, 0x5d, 0x06, 0x0c, 0x7d, - 0xb3, 0x97, 0x0f, 0x85, 0xa6, 0xe1, 0xe4, 0xc7, 0xab, 0xf5, - 0xae, 0x8c, 0xdb, 0x09, 0x33, 0xd7, 0x1e, 0x8c, 0x94, 0xe0, - 0x4a, 0x25, 0x61, 0x9d, 0xce, 0xe3, 0xd2, 0x26, 0x1a, 0xd2, - 0xee, 0x6b, 0xf1, 0x2f, 0xfa, 0x06, 0xd9, 0x8a, 0x08, 0x64, - 0xd8, 0x76, 0x02, 0x73, 0x3e, 0xc8, 0x6a, 0x64, 0x52, 0x1f, - 0x2b, 0x18, 0x17, 0x7b, 0x20, 0x0c, 0xbb, 0xe1, 0x17, 0x57, - 0x7a, 0x61, 0x5d, 0x6c, 0x77, 0x09, 0x88, 0xc0, 0xba, 0xd9, - 0x46, 0xe2, 0x08, 0xe2, 0x4f, 0xa0, 0x74, 0xe5, 0xab, 0x31, - 0x43, 0xdb, 0x5b, 0xfc, 0xe0, 0xfd, 0x10, 0x8e, 0x4b, 0x82, - 0xd1, 0x20, 0xa9, 0x21, 0x08, 0x01, 0x1a, 0x72, 0x3c, 0x12, - 0xa7, 0x87, 0xe6, 0xd7, 0x88, 0x71, 0x9a, 0x10, 0xbd, 0xba, - 0x5b, 0x26, 0x99, 0xc3, 0x27, 0x18, 0x6a, 0xf4, 0xe2, 0x3c, - 0x1a, 0x94, 0x68, 0x34, 0xb6, 0x15, 0x0b, 0xda, 0x25, 0x83, - 0xe9, 0xca, 0x2a, 0xd4, 0x4c, 0xe8, 0xdb, 0xbb, 0xc2, 0xdb, - 0x04, 0xde, 0x8e, 0xf9, 0x2e, 0x8e, 0xfc, 0x14, 0x1f, 0xbe, - 0xca, 0xa6, 0x28, 0x7c, 0x59, 0x47, 0x4e, 0x6b, 0xc0, 0x5d, - 0x99, 0xb2, 0x96, 0x4f, 0xa0, 0x90, 0xc3, 0xa2, 0x23, 0x3b, - 0xa1, 0x86, 0x51, 0x5b, 0xe7, 0xed, 0x1f, 0x61, 0x29, 0x70, - 0xce, 0xe2, 0xd7, 0xaf, 0xb8, 0x1b, 0xdd, 0x76, 0x21, 0x70, - 0x48, 0x1c, 0xd0, 0x06, 0x91, 0x27, 0xd5, 0xb0, 0x5a, 0xa9, - 0x93, 0xb4, 0xea, 0x98, 0x8d, 0x8f, 0xdd, 0xc1, 0x86, 0xff, - 0xb7, 0xdc, 0x90, 0xa6, 0xc0, 0x8f, 0x4d, 0xf4, 0x35, 0xc9, - 0x34, 0x02, 0x84, 0x92, 0x36, 0xc3, 0xfa, 0xb4, 0xd2, 0x7c, - 0x70, 0x26, 0xc1, 0xd4, 0xdc, 0xb2, 0x60, 0x26, 0x46, 0xde, - 0xc9, 0x75, 0x1e, 0x76, 0x3d, 0xba, 0x37, 0xbd, 0xf8, 0xff, - 0x94, 0x06, 0xad, 0x9e, 0x53, 0x0e, 0xe5, 0xdb, 0x38, 0x2f, - 0x41, 0x30, 0x01, 0xae, 0xb0, 0x6a, 0x53, 0xed, 0x90, 0x27, - 0xd8, 0x31, 0x17, 0x97, 0x27, 0xb0, 0x86, 0x5a, 0x89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5d, 0xc1, - 0x64, 0xf3, 0x1c, 0xc5, 0x08, 0x46, 0x85, 0x1d, 0xf9, 0xab, - 0x48, 0x19, 0x5d, 0xed, 0x7e, 0xa1, 0xb1, 0xd5, 0x10, 0xbd, - 0x7e, 0xe7, 0x4d, 0x73, 0xfa, 0xf3, 0x6b, 0xc3, 0x1e, 0xcf, - 0xa2, 0x68, 0x35, 0x90, 0x46, 0xf4, 0xeb, 0x87, 0x9f, 0x92, - 0x40, 0x09, 0x43, 0x8b, 0x48, 0x1c, 0x6c, 0xd7, 0x88, 0x9a, - 0x00, 0x2e, 0xd5, 0xee, 0x38, 0x2b, 0xc9, 0x19, 0x0d, 0xa6, - 0xfc, 0x02, 0x6e, 0x47, 0x95, 0x58, 0xe4, 0x47, 0x56, 0x77, - 0xe9, 0xaa, 0x9e, 0x30, 0x50, 0xe2, 0x76, 0x56, 0x94, 0xdf, - 0xc8, 0x1f, 0x56, 0xe8, 0x80, 0xb9, 0x6e, 0x71, 0x60, 0xc9, - 0x80, 0xdd, 0x98, 0xed, 0xd3, 0xdf, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff }; + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0x0f, 0xda, 0xa2, + 0x21, 0x68, 0xc2, 0x34, 0xc4, 0xc6, 0x62, 0x8b, 0x80, 0xdc, 0x1c, 0xd1, + 0x29, 0x02, 0x4e, 0x08, 0x8a, 0x67, 0xcc, 0x74, 0x02, 0x0b, 0xbe, 0xa6, + 0x3b, 0x13, 0x9b, 0x22, 0x51, 0x4a, 0x08, 0x79, 0x8e, 0x34, 0x04, 0xdd, + 0xef, 0x95, 0x19, 0xb3, 0xcd, 0x3a, 0x43, 0x1b, 0x30, 0x2b, 0x0a, 0x6d, + 0xf2, 0x5f, 0x14, 0x37, 0x4f, 0xe1, 0x35, 0x6d, 0x6d, 0x51, 0xc2, 0x45, + 0xe4, 0x85, 0xb5, 0x76, 0x62, 0x5e, 0x7e, 0xc6, 0xf4, 0x4c, 0x42, 0xe9, + 0xa6, 0x37, 0xed, 0x6b, 0x0b, 0xff, 0x5c, 0xb6, 0xf4, 0x06, 0xb7, 0xed, + 0xee, 0x38, 0x6b, 0xfb, 0x5a, 0x89, 0x9f, 0xa5, 0xae, 0x9f, 0x24, 0x11, + 0x7c, 0x4b, 0x1f, 0xe6, 0x49, 0x28, 0x66, 0x51, 0xec, 0xe4, 0x5b, 0x3d, + 0xc2, 0x00, 0x7c, 0xb8, 0xa1, 0x63, 0xbf, 0x05, 0x98, 0xda, 0x48, 0x36, + 0x1c, 0x55, 0xd3, 0x9a, 0x69, 0x16, 0x3f, 0xa8, 0xfd, 0x24, 0xcf, 0x5f, + 0x83, 0x65, 0x5d, 0x23, 0xdc, 0xa3, 0xad, 0x96, 0x1c, 0x62, 0xf3, 0x56, + 0x20, 0x85, 0x52, 0xbb, 0x9e, 0xd5, 0x29, 0x07, 0x70, 0x96, 0x96, 0x6d, + 0x67, 0x0c, 0x35, 0x4e, 0x4a, 0xbc, 0x98, 0x04, 0xf1, 0x74, 0x6c, 0x08, + 0xca, 0x18, 0x21, 0x7c, 0x32, 0x90, 0x5e, 0x46, 0x2e, 0x36, 0xce, 0x3b, + 0xe3, 0x9e, 0x77, 0x2c, 0x18, 0x0e, 0x86, 0x03, 0x9b, 0x27, 0x83, 0xa2, + 0xec, 0x07, 0xa2, 0x8f, 0xb5, 0xc5, 0x5d, 0xf0, 0x6f, 0x4c, 0x52, 0xc9, + 0xde, 0x2b, 0xcb, 0xf6, 0x95, 0x58, 0x17, 0x18, 0x39, 0x95, 0x49, 0x7c, + 0xea, 0x95, 0x6a, 0xe5, 0x15, 0xd2, 0x26, 0x18, 0x98, 0xfa, 0x05, 0x10, + 0x15, 0x72, 0x8e, 0x5a, 0x8a, 0xaa, 0xc4, 0x2d, 0xad, 0x33, 0x17, 0x0d, + 0x04, 0x50, 0x7a, 0x33, 0xa8, 0x55, 0x21, 0xab, 0xdf,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96, 0x4f, + 0xa0, 0x90, 0xc3, 0xa2, 0x23, 0x3b, 0xa1, 0x86, 0x51, 0x5b, 0xe7, 0xed, + 0x1f, 0x61, 0x29, 0x70, 0xce, 0xe2, 0xd7, 0xaf, 0xb8, 0x1b, 0xdd, 0x76, + 0x21, 0x70, 0x48, 0x1c, 0xd0, 0x06, 0x91, 0x27, 0xd5, 0xb0, 0x5a, 0xa9, + 0x93, 0xb4, 0xea, 0x98, 0x8d, 0x8f, 0xdd, 0xc1, 0x86, 0xff, 0xb7, 0xdc, + 0x90, 0xa6, 0xc0, 0x8f, 0x4d, 0xf4, 0x35, 0xc9, 0x34, 0x02, 0x84, 0x92, + 0x36, 0xc3, 0xfa, 0xb4, 0xd2, 0x7c, 0x70, 0x26, 0xc1, 0xd4, 0xdc, 0xb2, + 0x60, 0x26, 0x46, 0xde, 0xc9, 0x75, 0x1e, 0x76, 0x3d, 0xba, 0x37, 0xbd, + 0xf8, 0xff, 0x94, 0x06, 0xad, 0x9e, 0x53, 0x0e, 0xe5, 0xdb, 0x38, 0x2f, + 0x41, 0x30, 0x01, 0xae, 0xb0, 0x6a, 0x53, 0xed, 0x90, 0x27, 0xd8, 0x31, + 0x17, 0x97, 0x27, 0xb0, 0x86, 0x5a, 0x89, 0x18, 0xda, 0x3e, 0xdb, 0xeb, + 0xcf, 0x9b, 0x14, 0xed, 0x44, 0xce, 0x6c, 0xba, 0xce, 0xd4, 0xbb, 0x1b, + 0xdb, 0x7f, 0x14, 0x47, 0xe6, 0xcc, 0x25, 0x4b, 0x33, 0x20, 0x51, 0x51, + 0x2b, 0xd7, 0xaf, 0x42, 0x6f, 0xb8, 0xf4, 0x01, 0x37, 0x8c, 0xd2, 0xbf, + 0x59, 0x83, 0xca, 0x01, 0xc6, 0x4b, 0x92, 0xec, 0xf0, 0x32, 0xea, 0x15, + 0xd1, 0x72, 0x1d, 0x03, 0xf4, 0x82, 0xd7, 0xce, 0x6e, 0x74, 0xfe, 0xf6, + 0xd5, 0x5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, 0xe4, 0x47, 0x56, 0x77, 0xe9, 0xaa, 0x9e, 0x30, 0x50, 0xe2, + 0x76, 0x56, 0x94, 0xdf, 0xc8, 0x1f, 0x56, 0xe8, 0x80, 0xb9, 0x6e, 0x71, + 0x60, 0xc9, 0x80, 0xdd, 0x98, 0xed, 0xd3, 0xdf, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff}; typedef struct { const char* name; @@ -400,14 +341,14 @@ typedef struct { static const modp_group modp_groups[] = { #define V(var) reinterpret_cast(var) - { "modp1", V(group_modp1), sizeof(group_modp1), V(two_generator), 1 }, - { "modp2", V(group_modp2), sizeof(group_modp2), V(two_generator), 1 }, - { "modp5", V(group_modp5), sizeof(group_modp5), V(two_generator), 1 }, - { "modp14", V(group_modp14), sizeof(group_modp14), V(two_generator), 1 }, - { "modp15", V(group_modp15), sizeof(group_modp15), V(two_generator), 1 }, - { "modp16", V(group_modp16), sizeof(group_modp16), V(two_generator), 1 }, - { "modp17", V(group_modp17), sizeof(group_modp17), V(two_generator), 1 }, - { "modp18", V(group_modp18), sizeof(group_modp18), V(two_generator), 1 } + {"modp1", V(group_modp1), sizeof(group_modp1), V(two_generator), 1}, + {"modp2", V(group_modp2), sizeof(group_modp2), V(two_generator), 1}, + {"modp5", V(group_modp5), sizeof(group_modp5), V(two_generator), 1}, + {"modp14", V(group_modp14), sizeof(group_modp14), V(two_generator), 1}, + {"modp15", V(group_modp15), sizeof(group_modp15), V(two_generator), 1}, + {"modp16", V(group_modp16), sizeof(group_modp16), V(two_generator), 1}, + {"modp17", V(group_modp17), sizeof(group_modp17), V(two_generator), 1}, + {"modp18", V(group_modp18), sizeof(group_modp18), V(two_generator), 1} #undef V }; diff --git a/src/node_domain.cc b/src/node_domain.cc index 9075845442fd4d..da41b65a7293cf 100644 --- a/src/node_domain.cc +++ b/src/node_domain.cc @@ -11,7 +11,6 @@ using v8::Local; using v8::Object; using v8::Value; - void Enable(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); diff --git a/src/node_dtrace.cc b/src/node_dtrace.cc index 0f33f59b338a85..d7726ceb963dfd 100644 --- a/src/node_dtrace.cc +++ b/src/node_dtrace.cc @@ -58,16 +58,18 @@ using v8::Object; using v8::String; using v8::Value; -#define SLURP_STRING(obj, member, valp) \ - if (!(obj)->IsObject()) { \ - return node::THROW_ERR_INVALID_ARG_TYPE(env, \ - "expected object for " #obj " to contain string member " #member); \ - } \ - node::Utf8Value _##member(env->isolate(), \ - obj->Get(env->context(), \ - OneByteString(env->isolate(), #member)).ToLocalChecked()); \ - if ((*(const char **)valp = *_##member) == nullptr) \ - *(const char **)valp = ""; +#define SLURP_STRING(obj, member, valp) \ + if (!(obj)->IsObject()) { \ + return node::THROW_ERR_INVALID_ARG_TYPE( \ + env, \ + "expected object for " #obj " to contain string member " #member); \ + } \ + node::Utf8Value _##member( \ + env->isolate(), \ + obj->Get(env->context(), OneByteString(env->isolate(), #member)) \ + .ToLocalChecked()); \ + if ((*(const char**)valp = *_##member) == nullptr) \ + *(const char**)valp = ""; #define SLURP_INT(obj, member, valp) \ if (!(obj)->IsObject()) { \ @@ -75,81 +77,80 @@ using v8::Value; env, \ "expected object for " #obj " to contain integer member " #member); \ } \ - *valp = obj->Get(env->context(), \ - OneByteString(env->isolate(), #member)).ToLocalChecked() \ + *valp = obj->Get(env->context(), OneByteString(env->isolate(), #member)) \ + .ToLocalChecked() \ ->Int32Value(env->context()) \ .FromJust(); -#define SLURP_OBJECT(obj, member, valp) \ - if (!(obj)->IsObject()) { \ - return node::THROW_ERR_INVALID_ARG_TYPE(env, \ - "expected object for " #obj " to contain object member " #member); \ - } \ - *valp = Local::Cast(obj->Get(env->context(), \ - OneByteString(env->isolate(), #member)).ToLocalChecked()); - -#define SLURP_CONNECTION(arg, conn) \ - if (!(arg)->IsObject()) { \ - return node::THROW_ERR_INVALID_ARG_TYPE(env, \ - "expected argument " #arg " to be a connection object"); \ - } \ - node_dtrace_connection_t conn; \ - Local _##conn = Local::Cast(arg); \ - Local _handle = \ - (_##conn)->Get(env->context(), \ - FIXED_ONE_BYTE_STRING(env->isolate(), "_handle")) \ - .ToLocalChecked(); \ - if (_handle->IsObject()) { \ - SLURP_INT(_handle.As(), fd, &conn.fd); \ - } else { \ - conn.fd = -1; \ - } \ - SLURP_STRING(_##conn, remoteAddress, &conn.remote); \ - SLURP_INT(_##conn, remotePort, &conn.port); \ +#define SLURP_OBJECT(obj, member, valp) \ + if (!(obj)->IsObject()) { \ + return node::THROW_ERR_INVALID_ARG_TYPE( \ + env, \ + "expected object for " #obj " to contain object member " #member); \ + } \ + *valp = Local::Cast( \ + obj->Get(env->context(), OneByteString(env->isolate(), #member)) \ + .ToLocalChecked()); + +#define SLURP_CONNECTION(arg, conn) \ + if (!(arg)->IsObject()) { \ + return node::THROW_ERR_INVALID_ARG_TYPE( \ + env, "expected argument " #arg " to be a connection object"); \ + } \ + node_dtrace_connection_t conn; \ + Local _##conn = Local::Cast(arg); \ + Local _handle = \ + (_##conn) \ + ->Get(env->context(), \ + FIXED_ONE_BYTE_STRING(env->isolate(), "_handle")) \ + .ToLocalChecked(); \ + if (_handle->IsObject()) { \ + SLURP_INT(_handle.As(), fd, &conn.fd); \ + } else { \ + conn.fd = -1; \ + } \ + SLURP_STRING(_##conn, remoteAddress, &conn.remote); \ + SLURP_INT(_##conn, remotePort, &conn.port); \ SLURP_INT(_##conn, bufferSize, &conn.buffered); -#define SLURP_CONNECTION_HTTP_CLIENT(arg, conn) \ - if (!(arg)->IsObject()) { \ - return node::THROW_ERR_INVALID_ARG_TYPE(env, \ - "expected argument " #arg " to be a connection object"); \ - } \ - node_dtrace_connection_t conn; \ - Local _##conn = Local::Cast(arg); \ - SLURP_INT(_##conn, fd, &conn.fd); \ - SLURP_STRING(_##conn, host, &conn.remote); \ - SLURP_INT(_##conn, port, &conn.port); \ +#define SLURP_CONNECTION_HTTP_CLIENT(arg, conn) \ + if (!(arg)->IsObject()) { \ + return node::THROW_ERR_INVALID_ARG_TYPE( \ + env, "expected argument " #arg " to be a connection object"); \ + } \ + node_dtrace_connection_t conn; \ + Local _##conn = Local::Cast(arg); \ + SLURP_INT(_##conn, fd, &conn.fd); \ + SLURP_STRING(_##conn, host, &conn.remote); \ + SLURP_INT(_##conn, port, &conn.port); \ SLURP_INT(_##conn, bufferSize, &conn.buffered); -#define SLURP_CONNECTION_HTTP_CLIENT_RESPONSE(arg0, arg1, conn) \ - if (!(arg0)->IsObject()) { \ - return node::THROW_ERR_INVALID_ARG_TYPE(env, \ - "expected argument " #arg0 " to be a connection object"); \ - } \ - if (!(arg1)->IsObject()) { \ - return node::THROW_ERR_INVALID_ARG_TYPE(env, \ - "expected argument " #arg1 " to be a connection object"); \ - } \ - node_dtrace_connection_t conn; \ - Local _##conn = Local::Cast(arg0); \ - SLURP_INT(_##conn, fd, &conn.fd); \ - SLURP_INT(_##conn, bufferSize, &conn.buffered); \ - _##conn = Local::Cast(arg1); \ - SLURP_STRING(_##conn, host, &conn.remote); \ +#define SLURP_CONNECTION_HTTP_CLIENT_RESPONSE(arg0, arg1, conn) \ + if (!(arg0)->IsObject()) { \ + return node::THROW_ERR_INVALID_ARG_TYPE( \ + env, "expected argument " #arg0 " to be a connection object"); \ + } \ + if (!(arg1)->IsObject()) { \ + return node::THROW_ERR_INVALID_ARG_TYPE( \ + env, "expected argument " #arg1 " to be a connection object"); \ + } \ + node_dtrace_connection_t conn; \ + Local _##conn = Local::Cast(arg0); \ + SLURP_INT(_##conn, fd, &conn.fd); \ + SLURP_INT(_##conn, bufferSize, &conn.buffered); \ + _##conn = Local::Cast(arg1); \ + SLURP_STRING(_##conn, host, &conn.remote); \ SLURP_INT(_##conn, port, &conn.port); - void DTRACE_NET_SERVER_CONNECTION(const FunctionCallbackInfo& args) { - if (!NODE_NET_SERVER_CONNECTION_ENABLED()) - return; + if (!NODE_NET_SERVER_CONNECTION_ENABLED()) return; Environment* env = Environment::GetCurrent(args); SLURP_CONNECTION(args[0], conn); NODE_NET_SERVER_CONNECTION(&conn, conn.remote, conn.port, conn.fd); } - void DTRACE_NET_STREAM_END(const FunctionCallbackInfo& args) { - if (!NODE_NET_STREAM_END_ENABLED()) - return; + if (!NODE_NET_STREAM_END_ENABLED()) return; Environment* env = Environment::GetCurrent(args); SLURP_CONNECTION(args[0], conn); NODE_NET_STREAM_END(&conn, conn.remote, conn.port, conn.fd); @@ -158,8 +159,7 @@ void DTRACE_NET_STREAM_END(const FunctionCallbackInfo& args) { void DTRACE_HTTP_SERVER_REQUEST(const FunctionCallbackInfo& args) { node_dtrace_http_server_request_t req; - if (!NODE_HTTP_SERVER_REQUEST_ENABLED()) - return; + if (!NODE_HTTP_SERVER_REQUEST_ENABLED()) return; Environment* env = Environment::GetCurrent(args); HandleScope scope(env->isolate()); @@ -173,38 +173,34 @@ void DTRACE_HTTP_SERVER_REQUEST(const FunctionCallbackInfo& args) { SLURP_OBJECT(arg0, headers, &headers); if (!(headers)->IsObject()) { - return node::THROW_ERR_INVALID_ARG_TYPE(env, - "expected object for request to contain string member headers"); + return node::THROW_ERR_INVALID_ARG_TYPE( + env, "expected object for request to contain string member headers"); } - Local strfwdfor = headers->Get( - env->context(), env->x_forwarded_string()).ToLocalChecked(); + Local strfwdfor = + headers->Get(env->context(), env->x_forwarded_string()).ToLocalChecked(); node::Utf8Value fwdfor(env->isolate(), strfwdfor); if (!strfwdfor->IsString() || (req.forwardedFor = *fwdfor) == nullptr) req.forwardedFor = const_cast(""); SLURP_CONNECTION(args[1], conn); - NODE_HTTP_SERVER_REQUEST(&req, &conn, conn.remote, conn.port, req.method, \ - req.url, conn.fd); + NODE_HTTP_SERVER_REQUEST( + &req, &conn, conn.remote, conn.port, req.method, req.url, conn.fd); } - void DTRACE_HTTP_SERVER_RESPONSE(const FunctionCallbackInfo& args) { - if (!NODE_HTTP_SERVER_RESPONSE_ENABLED()) - return; + if (!NODE_HTTP_SERVER_RESPONSE_ENABLED()) return; Environment* env = Environment::GetCurrent(args); SLURP_CONNECTION(args[0], conn); NODE_HTTP_SERVER_RESPONSE(&conn, conn.remote, conn.port, conn.fd); } - void DTRACE_HTTP_CLIENT_REQUEST(const FunctionCallbackInfo& args) { node_dtrace_http_client_request_t req; char* header; - if (!NODE_HTTP_CLIENT_REQUEST_ENABLED()) - return; + if (!NODE_HTTP_CLIENT_REQUEST_ENABLED()) return; Environment* env = Environment::GetCurrent(args); HandleScope scope(env->isolate()); @@ -220,48 +216,40 @@ void DTRACE_HTTP_CLIENT_REQUEST(const FunctionCallbackInfo& args) { req.method = header; - while (*header != '\0' && *header != ' ') - header++; + while (*header != '\0' && *header != ' ') header++; - if (*header != '\0') - *header++ = '\0'; + if (*header != '\0') *header++ = '\0'; req.url = header; - while (*header != '\0' && *header != ' ') - header++; + while (*header != '\0' && *header != ' ') header++; *header = '\0'; SLURP_CONNECTION_HTTP_CLIENT(args[1], conn); - NODE_HTTP_CLIENT_REQUEST(&req, &conn, conn.remote, conn.port, req.method, \ - req.url, conn.fd); + NODE_HTTP_CLIENT_REQUEST( + &req, &conn, conn.remote, conn.port, req.method, req.url, conn.fd); } - void DTRACE_HTTP_CLIENT_RESPONSE(const FunctionCallbackInfo& args) { - if (!NODE_HTTP_CLIENT_RESPONSE_ENABLED()) - return; + if (!NODE_HTTP_CLIENT_RESPONSE_ENABLED()) return; Environment* env = Environment::GetCurrent(args); SLURP_CONNECTION_HTTP_CLIENT_RESPONSE(args[0], args[1], conn); NODE_HTTP_CLIENT_RESPONSE(&conn, conn.remote, conn.port, conn.fd); } - void dtrace_gc_start(Isolate* isolate, GCType type, GCCallbackFlags flags) { // Previous versions of this probe point only logged type and flags. // That's why for reasons of backwards compatibility the isolate goes last. NODE_GC_START(type, flags, isolate); } - void dtrace_gc_done(Isolate* isolate, GCType type, GCCallbackFlags flags) { // Previous versions of this probe point only logged type and flags. // That's why for reasons of backwards compatibility the isolate goes last. NODE_GC_DONE(type, flags, isolate); } - void InitDTrace(Environment* env, Local target) { HandleScope scope(env->isolate()); @@ -270,12 +258,12 @@ void InitDTrace(Environment* env, Local target) { void (*func)(const FunctionCallbackInfo&); } tab[] = { #define NODE_PROBE(name) #name, name - { NODE_PROBE(DTRACE_NET_SERVER_CONNECTION) }, - { NODE_PROBE(DTRACE_NET_STREAM_END) }, - { NODE_PROBE(DTRACE_HTTP_SERVER_REQUEST) }, - { NODE_PROBE(DTRACE_HTTP_SERVER_RESPONSE) }, - { NODE_PROBE(DTRACE_HTTP_CLIENT_REQUEST) }, - { NODE_PROBE(DTRACE_HTTP_CLIENT_RESPONSE) } + {NODE_PROBE(DTRACE_NET_SERVER_CONNECTION)}, + {NODE_PROBE(DTRACE_NET_STREAM_END)}, + {NODE_PROBE(DTRACE_HTTP_SERVER_REQUEST)}, + {NODE_PROBE(DTRACE_HTTP_SERVER_RESPONSE)}, + {NODE_PROBE(DTRACE_HTTP_CLIENT_REQUEST)}, + {NODE_PROBE(DTRACE_HTTP_CLIENT_RESPONSE)} #undef NODE_PROBE }; diff --git a/src/node_dtrace.h b/src/node_dtrace.h index ee11cd68aa7630..5a500a865b472e 100644 --- a/src/node_dtrace.h +++ b/src/node_dtrace.h @@ -64,7 +64,7 @@ typedef struct { typedef struct { union { uint32_t version; - uintptr_t unused; /* for compat. with old 64-bit struct */ + uintptr_t unused; /* for compat. with old 64-bit struct */ } _un; char* url; char* method; diff --git a/src/node_errors.cc b/src/node_errors.cc index 42e19f690514ff..0cfe6ec3a7f3ac 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc @@ -167,7 +167,7 @@ void AppendExceptionLine(Environment* env, ABORT_NO_BACKTRACE(); } -[[noreturn]] void Assert(const AssertionInfo& info) { + [[noreturn]] void Assert(const AssertionInfo& info) { char name[1024]; GetHumanReadableProcessName(&name); @@ -717,8 +717,8 @@ void FatalException(Isolate* isolate, Local process_object = env->process_object(); Local fatal_exception_string = env->fatal_exception_string(); Local fatal_exception_function = - process_object->Get(env->context(), - fatal_exception_string).ToLocalChecked(); + process_object->Get(env->context(), fatal_exception_string) + .ToLocalChecked(); if (!fatal_exception_function->IsFunction()) { // Failed before the process._fatalException function was added! diff --git a/src/node_errors.h b/src/node_errors.h index cea7c108c168f3..67bd35d9c8fe74 100644 --- a/src/node_errors.h +++ b/src/node_errors.h @@ -3,9 +3,9 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS +#include "env-inl.h" #include "node.h" #include "util-inl.h" -#include "env-inl.h" #include "v8.h" // Use ostringstream to print exact-width integer types @@ -50,80 +50,80 @@ void FatalException(const v8::FunctionCallbackInfo& args); // `node::ERR_INVALID_ARG_TYPE(isolate, "message")` returning // a `Local` containing the TypeError with proper code and message -#define ERRORS_WITH_CODE(V) \ - V(ERR_BUFFER_CONTEXT_NOT_AVAILABLE, Error) \ - V(ERR_BUFFER_OUT_OF_BOUNDS, RangeError) \ - V(ERR_BUFFER_TOO_LARGE, Error) \ - V(ERR_CANNOT_TRANSFER_OBJECT, TypeError) \ - V(ERR_CLOSED_MESSAGE_PORT, Error) \ - V(ERR_CONSTRUCT_CALL_REQUIRED, Error) \ - V(ERR_INVALID_ARG_VALUE, TypeError) \ - V(ERR_INVALID_ARG_TYPE, TypeError) \ - V(ERR_INVALID_TRANSFER_OBJECT, TypeError) \ - V(ERR_MEMORY_ALLOCATION_FAILED, Error) \ - V(ERR_MISSING_ARGS, TypeError) \ - V(ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST, TypeError) \ - V(ERR_MISSING_MODULE, Error) \ - V(ERR_MISSING_PLATFORM_FOR_WORKER, Error) \ - V(ERR_OUT_OF_RANGE, RangeError) \ - V(ERR_SCRIPT_EXECUTION_INTERRUPTED, Error) \ - V(ERR_SCRIPT_EXECUTION_TIMEOUT, Error) \ - V(ERR_STRING_TOO_LONG, Error) \ - V(ERR_TLS_INVALID_PROTOCOL_METHOD, TypeError) \ - V(ERR_TRANSFERRING_EXTERNALIZED_SHAREDARRAYBUFFER, TypeError) \ - -#define V(code, type) \ - inline v8::Local code(v8::Isolate* isolate, \ - const char* message) { \ - v8::Local js_code = OneByteString(isolate, #code); \ - v8::Local js_msg = OneByteString(isolate, message); \ - v8::Local e = \ - v8::Exception::type(js_msg)->ToObject( \ - isolate->GetCurrentContext()).ToLocalChecked(); \ - e->Set(isolate->GetCurrentContext(), OneByteString(isolate, "code"), \ - js_code).FromJust(); \ - return e; \ - } \ - inline void THROW_ ## code(v8::Isolate* isolate, const char* message) { \ - isolate->ThrowException(code(isolate, message)); \ - } \ - inline void THROW_ ## code(Environment* env, const char* message) { \ - THROW_ ## code(env->isolate(), message); \ +#define ERRORS_WITH_CODE(V) \ + V(ERR_BUFFER_CONTEXT_NOT_AVAILABLE, Error) \ + V(ERR_BUFFER_OUT_OF_BOUNDS, RangeError) \ + V(ERR_BUFFER_TOO_LARGE, Error) \ + V(ERR_CANNOT_TRANSFER_OBJECT, TypeError) \ + V(ERR_CLOSED_MESSAGE_PORT, Error) \ + V(ERR_CONSTRUCT_CALL_REQUIRED, Error) \ + V(ERR_INVALID_ARG_VALUE, TypeError) \ + V(ERR_INVALID_ARG_TYPE, TypeError) \ + V(ERR_INVALID_TRANSFER_OBJECT, TypeError) \ + V(ERR_MEMORY_ALLOCATION_FAILED, Error) \ + V(ERR_MISSING_ARGS, TypeError) \ + V(ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST, TypeError) \ + V(ERR_MISSING_MODULE, Error) \ + V(ERR_MISSING_PLATFORM_FOR_WORKER, Error) \ + V(ERR_OUT_OF_RANGE, RangeError) \ + V(ERR_SCRIPT_EXECUTION_INTERRUPTED, Error) \ + V(ERR_SCRIPT_EXECUTION_TIMEOUT, Error) \ + V(ERR_STRING_TOO_LONG, Error) \ + V(ERR_TLS_INVALID_PROTOCOL_METHOD, TypeError) \ + V(ERR_TRANSFERRING_EXTERNALIZED_SHAREDARRAYBUFFER, TypeError) + +#define V(code, type) \ + inline v8::Local code(v8::Isolate* isolate, \ + const char* message) { \ + v8::Local js_code = OneByteString(isolate, #code); \ + v8::Local js_msg = OneByteString(isolate, message); \ + v8::Local e = v8::Exception::type(js_msg) \ + ->ToObject(isolate->GetCurrentContext()) \ + .ToLocalChecked(); \ + e->Set(isolate->GetCurrentContext(), \ + OneByteString(isolate, "code"), \ + js_code) \ + .FromJust(); \ + return e; \ + } \ + inline void THROW_##code(v8::Isolate* isolate, const char* message) { \ + isolate->ThrowException(code(isolate, message)); \ + } \ + inline void THROW_##code(Environment* env, const char* message) { \ + THROW_##code(env->isolate(), message); \ } - ERRORS_WITH_CODE(V) +ERRORS_WITH_CODE(V) #undef V // Errors with predefined static messages -#define PREDEFINED_ERROR_MESSAGES(V) \ - V(ERR_BUFFER_CONTEXT_NOT_AVAILABLE, \ - "Buffer is not available for the current Context") \ - V(ERR_CANNOT_TRANSFER_OBJECT, "Cannot transfer object of unsupported type")\ - V(ERR_CLOSED_MESSAGE_PORT, "Cannot send data on closed MessagePort") \ - V(ERR_CONSTRUCT_CALL_REQUIRED, "Cannot call constructor without `new`") \ - V(ERR_INVALID_TRANSFER_OBJECT, "Found invalid object in transferList") \ - V(ERR_MEMORY_ALLOCATION_FAILED, "Failed to allocate memory") \ - V(ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST, \ - "MessagePort was found in message but not listed in transferList") \ - V(ERR_MISSING_PLATFORM_FOR_WORKER, \ - "The V8 platform used by this instance of Node does not support " \ - "creating Workers") \ - V(ERR_SCRIPT_EXECUTION_INTERRUPTED, \ - "Script execution was interrupted by `SIGINT`") \ - V(ERR_TRANSFERRING_EXTERNALIZED_SHAREDARRAYBUFFER, \ - "Cannot serialize externalized SharedArrayBuffer") \ - -#define V(code, message) \ - inline v8::Local code(v8::Isolate* isolate) { \ - return code(isolate, message); \ - } \ - inline void THROW_ ## code(v8::Isolate* isolate) { \ - isolate->ThrowException(code(isolate, message)); \ - } \ - inline void THROW_ ## code(Environment* env) { \ - THROW_ ## code(env->isolate()); \ - } - PREDEFINED_ERROR_MESSAGES(V) +#define PREDEFINED_ERROR_MESSAGES(V) \ + V(ERR_BUFFER_CONTEXT_NOT_AVAILABLE, \ + "Buffer is not available for the current Context") \ + V(ERR_CANNOT_TRANSFER_OBJECT, "Cannot transfer object of unsupported type") \ + V(ERR_CLOSED_MESSAGE_PORT, "Cannot send data on closed MessagePort") \ + V(ERR_CONSTRUCT_CALL_REQUIRED, "Cannot call constructor without `new`") \ + V(ERR_INVALID_TRANSFER_OBJECT, "Found invalid object in transferList") \ + V(ERR_MEMORY_ALLOCATION_FAILED, "Failed to allocate memory") \ + V(ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST, \ + "MessagePort was found in message but not listed in transferList") \ + V(ERR_MISSING_PLATFORM_FOR_WORKER, \ + "The V8 platform used by this instance of Node does not support " \ + "creating Workers") \ + V(ERR_SCRIPT_EXECUTION_INTERRUPTED, \ + "Script execution was interrupted by `SIGINT`") \ + V(ERR_TRANSFERRING_EXTERNALIZED_SHAREDARRAYBUFFER, \ + "Cannot serialize externalized SharedArrayBuffer") + +#define V(code, message) \ + inline v8::Local code(v8::Isolate* isolate) { \ + return code(isolate, message); \ + } \ + inline void THROW_##code(v8::Isolate* isolate) { \ + isolate->ThrowException(code(isolate, message)); \ + } \ + inline void THROW_##code(Environment* env) { THROW_##code(env->isolate()); } +PREDEFINED_ERROR_MESSAGES(V) #undef V // Errors with predefined non-static messages @@ -137,32 +137,34 @@ inline void THROW_ERR_SCRIPT_EXECUTION_TIMEOUT(Environment* env, inline v8::Local ERR_BUFFER_TOO_LARGE(v8::Isolate* isolate) { char message[128]; - snprintf(message, sizeof(message), - "Cannot create a Buffer larger than 0x%zx bytes", - v8::TypedArray::kMaxLength); + snprintf(message, + sizeof(message), + "Cannot create a Buffer larger than 0x%zx bytes", + v8::TypedArray::kMaxLength); return ERR_BUFFER_TOO_LARGE(isolate, message); } inline v8::Local ERR_STRING_TOO_LONG(v8::Isolate* isolate) { char message[128]; - snprintf(message, sizeof(message), - "Cannot create a string longer than 0x%x characters", - v8::String::kMaxLength); + snprintf(message, + sizeof(message), + "Cannot create a string longer than 0x%x characters", + v8::String::kMaxLength); return ERR_STRING_TOO_LONG(isolate, message); } -#define THROW_AND_RETURN_IF_NOT_BUFFER(env, val, prefix) \ - do { \ - if (!Buffer::HasInstance(val)) \ - return node::THROW_ERR_INVALID_ARG_TYPE(env, \ - prefix " must be a buffer"); \ +#define THROW_AND_RETURN_IF_NOT_BUFFER(env, val, prefix) \ + do { \ + if (!Buffer::HasInstance(val)) \ + return node::THROW_ERR_INVALID_ARG_TYPE(env, \ + prefix " must be a buffer"); \ } while (0) -#define THROW_AND_RETURN_IF_NOT_STRING(env, val, prefix) \ - do { \ - if (!val->IsString()) \ - return node::THROW_ERR_INVALID_ARG_TYPE(env, \ - prefix " must be a string"); \ +#define THROW_AND_RETURN_IF_NOT_STRING(env, val, prefix) \ + do { \ + if (!val->IsString()) \ + return node::THROW_ERR_INVALID_ARG_TYPE(env, \ + prefix " must be a string"); \ } while (0) namespace errors { diff --git a/src/node_file.cc b/src/node_file.cc index 35c8e01a28c0b5..de5a9d7c79e728 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -33,15 +33,15 @@ #include "string_bytes.h" #include "string_search.h" -#include -#include -#include -#include #include +#include #include +#include +#include +#include #if defined(__MINGW32__) || defined(_MSC_VER) -# include +#include #endif #include @@ -75,11 +75,11 @@ using v8::Undefined; using v8::Value; #ifndef MIN -# define MIN(a, b) ((a) < (b) ? (a) : (b)) +#define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif #ifndef S_ISDIR -# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) +#define S_ISDIR(mode) (((mode)&S_IFMT) == S_IFDIR) #endif #ifdef __POSIX__ @@ -90,22 +90,22 @@ const char* const kPathSeparator = "\\/"; #define GET_OFFSET(a) ((a)->IsNumber() ? (a).As()->Value() : -1) #define TRACE_NAME(name) "fs.sync." #name -#define GET_TRACE_ENABLED \ - (*TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED \ - (TRACING_CATEGORY_NODE2(fs, sync)) != 0) -#define FS_SYNC_TRACE_BEGIN(syscall, ...) \ - if (GET_TRACE_ENABLED) \ - TRACE_EVENT_BEGIN(TRACING_CATEGORY_NODE2(fs, sync), TRACE_NAME(syscall), \ - ##__VA_ARGS__); -#define FS_SYNC_TRACE_END(syscall, ...) \ - if (GET_TRACE_ENABLED) \ - TRACE_EVENT_END(TRACING_CATEGORY_NODE2(fs, sync), TRACE_NAME(syscall), \ - ##__VA_ARGS__); +#define GET_TRACE_ENABLED \ + (*TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED( \ + TRACING_CATEGORY_NODE2(fs, sync)) != 0) +#define FS_SYNC_TRACE_BEGIN(syscall, ...) \ + if (GET_TRACE_ENABLED) \ + TRACE_EVENT_BEGIN( \ + TRACING_CATEGORY_NODE2(fs, sync), TRACE_NAME(syscall), ##__VA_ARGS__); +#define FS_SYNC_TRACE_END(syscall, ...) \ + if (GET_TRACE_ENABLED) \ + TRACE_EVENT_END( \ + TRACING_CATEGORY_NODE2(fs, sync), TRACE_NAME(syscall), ##__VA_ARGS__); // We sometimes need to convert a C++ lambda function to a raw C-style function. // This is helpful, because ReqWrap::Dispatch() does not recognize lambda // functions, and thus does not wrap them properly. -typedef void(*uv_fs_callback_t)(uv_fs_t*); +typedef void (*uv_fs_callback_t)(uv_fs_t*); // The FileHandle object wraps a file descriptor and will close it on garbage // collection if necessary. If that happens, a process warning will be @@ -113,17 +113,21 @@ typedef void(*uv_fs_callback_t)(uv_fs_t*); FileHandle::FileHandle(Environment* env, int fd, Local obj) : AsyncWrap(env, obj.IsEmpty() ? env->fd_constructor_template() - ->NewInstance(env->context()).ToLocalChecked() : obj, + ->NewInstance(env->context()) + .ToLocalChecked() + : obj, AsyncWrap::PROVIDER_FILEHANDLE), StreamBase(env), fd_(fd) { MakeWeak(); v8::PropertyAttribute attr = static_cast(v8::ReadOnly | v8::DontDelete); - object()->DefineOwnProperty(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "fd"), - Integer::New(env->isolate(), fd), - attr).FromJust(); + object() + ->DefineOwnProperty(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "fd"), + Integer::New(env->isolate(), fd), + attr) + .FromJust(); } void FileHandle::New(const FunctionCallbackInfo& args) { @@ -145,7 +149,6 @@ FileHandle::~FileHandle() { CHECK(closed_); // We have to be closed at the point } - // Close the file descriptor if it hasn't already been closed. A process // warning will be emitted using a SetImmediate to avoid calling back to // JS during GC. If closing the fd fails at this point, a fatal exception @@ -157,37 +160,45 @@ inline void FileHandle::Close() { uv_fs_req_cleanup(&req); AfterClose(); - struct err_detail { int ret; int fd; }; + struct err_detail { + int ret; + int fd; + }; - err_detail* detail = new err_detail { ret, fd_ }; + err_detail* detail = new err_detail{ret, fd_}; if (ret < 0) { // Do not unref this - env()->SetImmediate([](Environment* env, void* data) { - char msg[70]; - std::unique_ptr detail(static_cast(data)); - snprintf(msg, arraysize(msg), - "Closing file descriptor %d on garbage collection failed", - detail->fd); - // This exception will end up being fatal for the process because - // it is being thrown from within the SetImmediate handler and - // there is no JS stack to bubble it to. In other words, tearing - // down the process is the only reasonable thing we can do here. - HandleScope handle_scope(env->isolate()); - env->ThrowUVException(detail->ret, "close", msg); - }, detail); + env()->SetImmediate( + [](Environment* env, void* data) { + char msg[70]; + std::unique_ptr detail(static_cast(data)); + snprintf(msg, + arraysize(msg), + "Closing file descriptor %d on garbage collection failed", + detail->fd); + // This exception will end up being fatal for the process because + // it is being thrown from within the SetImmediate handler and + // there is no JS stack to bubble it to. In other words, tearing + // down the process is the only reasonable thing we can do here. + HandleScope handle_scope(env->isolate()); + env->ThrowUVException(detail->ret, "close", msg); + }, + detail); return; } // If the close was successful, we still want to emit a process warning // to notify that the file descriptor was gc'd. We want to be noisy about // this because not explicitly closing the FileHandle is a bug. - env()->SetUnrefImmediate([](Environment* env, void* data) { - std::unique_ptr detail(static_cast(data)); - ProcessEmitWarning(env, - "Closing file descriptor %d on garbage collection", - detail->fd); - }, detail); + env()->SetUnrefImmediate( + [](Environment* env, void* data) { + std::unique_ptr detail(static_cast(data)); + ProcessEmitWarning(env, + "Closing file descriptor %d on garbage collection", + detail->fd); + }, + detail); } void FileHandle::CloseReq::Resolve() { @@ -263,7 +274,6 @@ void FileHandle::Close(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(fd->ClosePromise().ToLocalChecked()); } - void FileHandle::ReleaseFD(const FunctionCallbackInfo& args) { FileHandle* fd; ASSIGN_OR_RETURN_UNWRAP(&fd, args.Holder()); @@ -271,12 +281,10 @@ void FileHandle::ReleaseFD(const FunctionCallbackInfo& args) { fd->AfterClose(); } - void FileHandle::AfterClose() { closing_ = false; closed_ = true; - if (reading_ && !persistent().IsEmpty()) - EmitRead(UV_EOF); + if (reading_ && !persistent().IsEmpty()) EmitRead(UV_EOF); } void FileHandleReadWrap::MemoryInfo(MemoryTracker* tracker) const { @@ -285,17 +293,15 @@ void FileHandleReadWrap::MemoryInfo(MemoryTracker* tracker) const { } FileHandleReadWrap::FileHandleReadWrap(FileHandle* handle, Local obj) - : ReqWrap(handle->env(), obj, AsyncWrap::PROVIDER_FSREQCALLBACK), - file_handle_(handle) {} + : ReqWrap(handle->env(), obj, AsyncWrap::PROVIDER_FSREQCALLBACK), + file_handle_(handle) {} int FileHandle::ReadStart() { - if (!IsAlive() || IsClosing()) - return UV_EOF; + if (!IsAlive() || IsClosing()) return UV_EOF; reading_ = true; - if (current_read_) - return 0; + if (current_read_) return 0; std::unique_ptr read_wrap; @@ -318,8 +324,10 @@ int FileHandle::ReadStart() { read_wrap->AsyncReset(); read_wrap->file_handle_ = this; } else { - Local wrap_obj = env()->filehandlereadwrap_template() - ->NewInstance(env()->context()).ToLocalChecked(); + Local wrap_obj = env() + ->filehandlereadwrap_template() + ->NewInstance(env()->context()) + .ToLocalChecked(); read_wrap.reset(new FileHandleReadWrap(this, wrap_obj)); } } @@ -331,65 +339,63 @@ int FileHandle::ReadStart() { current_read_ = std::move(read_wrap); - current_read_->Dispatch(uv_fs_read, - fd_, - ¤t_read_->buffer_, - 1, - read_offset_, - uv_fs_callback_t{[](uv_fs_t* req) { - FileHandle* handle; - { - FileHandleReadWrap* req_wrap = FileHandleReadWrap::from_req(req); - handle = req_wrap->file_handle_; - CHECK_EQ(handle->current_read_.get(), req_wrap); - } - - // ReadStart() checks whether current_read_ is set to determine whether - // a read is in progress. Moving it into a local variable makes sure that - // the ReadStart() call below doesn't think we're still actively reading. - std::unique_ptr read_wrap = - std::move(handle->current_read_); - - int result = req->result; - uv_buf_t buffer = read_wrap->buffer_; - - uv_fs_req_cleanup(req); + current_read_->Dispatch( + uv_fs_read, + fd_, + ¤t_read_->buffer_, + 1, + read_offset_, + uv_fs_callback_t{[](uv_fs_t* req) { + FileHandle* handle; + { + FileHandleReadWrap* req_wrap = FileHandleReadWrap::from_req(req); + handle = req_wrap->file_handle_; + CHECK_EQ(handle->current_read_.get(), req_wrap); + } - // Push the read wrap back to the freelist, or let it be destroyed - // once we’re exiting the current scope. - constexpr size_t wanted_freelist_fill = 100; - auto& freelist = handle->env()->file_handle_read_wrap_freelist(); - if (freelist.size() < wanted_freelist_fill) { - read_wrap->Reset(); - freelist.emplace_back(std::move(read_wrap)); - } + // ReadStart() checks whether current_read_ is set to determine whether + // a read is in progress. Moving it into a local variable makes sure + // that the ReadStart() call below doesn't think we're still actively + // reading. + std::unique_ptr read_wrap = + std::move(handle->current_read_); + + int result = req->result; + uv_buf_t buffer = read_wrap->buffer_; + + uv_fs_req_cleanup(req); + + // Push the read wrap back to the freelist, or let it be destroyed + // once we’re exiting the current scope. + constexpr size_t wanted_freelist_fill = 100; + auto& freelist = handle->env()->file_handle_read_wrap_freelist(); + if (freelist.size() < wanted_freelist_fill) { + read_wrap->Reset(); + freelist.emplace_back(std::move(read_wrap)); + } - if (result >= 0) { - // Read at most as many bytes as we originally planned to. - if (handle->read_length_ >= 0 && handle->read_length_ < result) - result = handle->read_length_; + if (result >= 0) { + // Read at most as many bytes as we originally planned to. + if (handle->read_length_ >= 0 && handle->read_length_ < result) + result = handle->read_length_; - // If we read data and we have an expected length, decrease it by - // how much we have read. - if (handle->read_length_ >= 0) - handle->read_length_ -= result; + // If we read data and we have an expected length, decrease it by + // how much we have read. + if (handle->read_length_ >= 0) handle->read_length_ -= result; - // If we have an offset, increase it by how much we have read. - if (handle->read_offset_ >= 0) - handle->read_offset_ += result; - } + // If we have an offset, increase it by how much we have read. + if (handle->read_offset_ >= 0) handle->read_offset_ += result; + } - // Reading 0 bytes from a file always means EOF, or that we reached - // the end of the requested range. - if (result == 0) - result = UV_EOF; + // Reading 0 bytes from a file always means EOF, or that we reached + // the end of the requested range. + if (result == 0) result = UV_EOF; - handle->EmitRead(result, buffer); + handle->EmitRead(result, buffer); - // Start over, if EmitRead() didn’t tell us to stop. - if (handle->reading_) - handle->ReadStart(); - }}); + // Start over, if EmitRead() didn’t tell us to stop. + if (handle->reading_) handle->ReadStart(); + }}); return 0; } @@ -408,21 +414,21 @@ ShutdownWrap* FileHandle::CreateShutdownWrap(Local object) { int FileHandle::DoShutdown(ShutdownWrap* req_wrap) { FileHandleCloseWrap* wrap = static_cast(req_wrap); closing_ = true; - wrap->Dispatch(uv_fs_close, fd_, uv_fs_callback_t{[](uv_fs_t* req) { - FileHandleCloseWrap* wrap = static_cast( - FileHandleCloseWrap::from_req(req)); - FileHandle* handle = static_cast(wrap->stream()); - handle->AfterClose(); - - int result = req->result; - uv_fs_req_cleanup(req); - wrap->Done(result); - }}); + wrap->Dispatch( + uv_fs_close, fd_, uv_fs_callback_t{[](uv_fs_t* req) { + FileHandleCloseWrap* wrap = static_cast( + FileHandleCloseWrap::from_req(req)); + FileHandle* handle = static_cast(wrap->stream()); + handle->AfterClose(); + + int result = req->result; + uv_fs_req_cleanup(req); + wrap->Done(result); + }}); return 0; } - void FSReqCallback::Reject(Local reject) { MakeCallback(env()->oncomplete_string(), 1, &reject); } @@ -432,10 +438,7 @@ void FSReqCallback::ResolveStat(const uv_stat_t* stat) { } void FSReqCallback::Resolve(Local value) { - Local argv[2] { - Null(env()->isolate()), - value - }; + Local argv[2]{Null(env()->isolate()), value}; MakeCallback(env()->oncomplete_string(), value->IsUndefined() ? 1 : arraysize(argv), argv); @@ -494,8 +497,7 @@ void AfterNoArgs(uv_fs_t* req) { FSReqBase* req_wrap = FSReqBase::from_req(req); FSReqAfterScope after(req_wrap, req); - if (after.Proceed()) - req_wrap->Resolve(Undefined(req_wrap->env()->isolate())); + if (after.Proceed()) req_wrap->Resolve(Undefined(req_wrap->env()->isolate())); } void AfterStat(uv_fs_t* req) { @@ -575,25 +577,21 @@ void AfterScanDir(uv_fs_t* req) { int r; std::vector> name_v; - for (int i = 0; ; i++) { + for (int i = 0;; i++) { uv_dirent_t ent; r = uv_fs_scandir_next(req, &ent); - if (r == UV_EOF) - break; + if (r == UV_EOF) break; if (r != 0) { - return req_wrap->Reject( - UVException(r, nullptr, req_wrap->syscall(), - static_cast(req->path))); + return req_wrap->Reject(UVException(r, + nullptr, + req_wrap->syscall(), + static_cast(req->path))); } - MaybeLocal filename = - StringBytes::Encode(env->isolate(), - ent.name, - req_wrap->encoding(), - &error); - if (filename.IsEmpty()) - return req_wrap->Reject(error); + MaybeLocal filename = StringBytes::Encode( + env->isolate(), ent.name, req_wrap->encoding(), &error); + if (filename.IsEmpty()) return req_wrap->Reject(error); name_v.push_back(filename.ToLocalChecked()); } @@ -617,43 +615,38 @@ void AfterScanDirWithTypes(uv_fs_t* req) { std::vector> name_v; std::vector> type_v; - for (int i = 0; ; i++) { + for (int i = 0;; i++) { uv_dirent_t ent; r = uv_fs_scandir_next(req, &ent); - if (r == UV_EOF) - break; + if (r == UV_EOF) break; if (r != 0) { - return req_wrap->Reject( - UVException(r, nullptr, req_wrap->syscall(), - static_cast(req->path))); + return req_wrap->Reject(UVException(r, + nullptr, + req_wrap->syscall(), + static_cast(req->path))); } MaybeLocal filename = - StringBytes::Encode(isolate, - ent.name, - req_wrap->encoding(), - &error); - if (filename.IsEmpty()) - return req_wrap->Reject(error); + StringBytes::Encode(isolate, ent.name, req_wrap->encoding(), &error); + if (filename.IsEmpty()) return req_wrap->Reject(error); name_v.push_back(filename.ToLocalChecked()); type_v.push_back(Integer::New(isolate, ent.type)); } Local result = Array::New(isolate, 2); - result->Set(env->context(), - 0, - Array::New(isolate, name_v.data(), - name_v.size())).FromJust(); - result->Set(env->context(), - 1, - Array::New(isolate, type_v.data(), - type_v.size())).FromJust(); + result + ->Set( + env->context(), 0, Array::New(isolate, name_v.data(), name_v.size())) + .FromJust(); + result + ->Set( + env->context(), 1, Array::New(isolate, type_v.data(), type_v.size())) + .FromJust(); req_wrap->Resolve(result); } - // This class is only used on sync fs calls. // For async calls FSReqCallback is used. class FSReqWrapSync { @@ -669,10 +662,15 @@ class FSReqWrapSync { // Returns nullptr if the operation fails from the start. template inline FSReqBase* AsyncDestCall(Environment* env, - FSReqBase* req_wrap, - const FunctionCallbackInfo& args, - const char* syscall, const char* dest, size_t len, - enum encoding enc, uv_fs_cb after, Func fn, Args... fn_args) { + FSReqBase* req_wrap, + const FunctionCallbackInfo& args, + const char* syscall, + const char* dest, + size_t len, + enum encoding enc, + uv_fs_cb after, + Func fn, + Args... fn_args) { CHECK_NOT_NULL(req_wrap); req_wrap->Init(syscall, dest, len, enc); int err = req_wrap->Dispatch(fn, fn_args..., after); @@ -692,13 +690,15 @@ inline FSReqBase* AsyncDestCall(Environment* env, // Returns nullptr if the operation fails from the start. template inline FSReqBase* AsyncCall(Environment* env, - FSReqBase* req_wrap, - const FunctionCallbackInfo& args, - const char* syscall, enum encoding enc, - uv_fs_cb after, Func fn, Args... fn_args) { - return AsyncDestCall(env, req_wrap, args, - syscall, nullptr, 0, enc, - after, fn, fn_args...); + FSReqBase* req_wrap, + const FunctionCallbackInfo& args, + const char* syscall, + enum encoding enc, + uv_fs_cb after, + Func fn, + Args... fn_args) { + return AsyncDestCall( + env, req_wrap, args, syscall, nullptr, 0, enc, after, fn, fn_args...); } // Template counterpart of SYNC_CALL, except that it only puts @@ -706,25 +706,29 @@ inline FSReqBase* AsyncCall(Environment* env, // creating an error in the C++ land. // ctx must be checked using value->IsObject() before being passed. template -inline int SyncCall(Environment* env, Local ctx, FSReqWrapSync* req_wrap, - const char* syscall, Func fn, Args... args) { +inline int SyncCall(Environment* env, + Local ctx, + FSReqWrapSync* req_wrap, + const char* syscall, + Func fn, + Args... args) { env->PrintSyncTrace(); int err = fn(env->event_loop(), &(req_wrap->req), args..., nullptr); if (err < 0) { Local context = env->context(); Local ctx_obj = ctx.As(); Isolate* isolate = env->isolate(); - ctx_obj->Set(context, - env->errno_string(), - Integer::New(isolate, err)).FromJust(); - ctx_obj->Set(context, - env->syscall_string(), - OneByteString(isolate, syscall)).FromJust(); + ctx_obj->Set(context, env->errno_string(), Integer::New(isolate, err)) + .FromJust(); + ctx_obj + ->Set(context, env->syscall_string(), OneByteString(isolate, syscall)) + .FromJust(); } return err; } -inline FSReqBase* GetReqWrap(Environment* env, Local value, +inline FSReqBase* GetReqWrap(Environment* env, + Local value, bool use_bigint = false) { if (value->IsObject()) { return Unwrap(value.As()); @@ -754,8 +758,15 @@ void Access(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[2]); if (req_wrap_async != nullptr) { // access(path, mode, req) - AsyncCall(env, req_wrap_async, args, "access", UTF8, AfterNoArgs, - uv_fs_access, *path, mode); + AsyncCall(env, + req_wrap_async, + args, + "access", + UTF8, + AfterNoArgs, + uv_fs_access, + *path, + mode); } else { // access(path, mode, undefined, ctx) CHECK_EQ(argc, 4); FSReqWrapSync req_wrap_sync; @@ -765,7 +776,6 @@ void Access(const FunctionCallbackInfo& args) { } } - void Close(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -777,8 +787,8 @@ void Close(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[1]); if (req_wrap_async != nullptr) { // close(fd, req) - AsyncCall(env, req_wrap_async, args, "close", UTF8, AfterNoArgs, - uv_fs_close, fd); + AsyncCall( + env, req_wrap_async, args, "close", UTF8, AfterNoArgs, uv_fs_close, fd); } else { // close(fd, undefined, ctx) CHECK_EQ(argc, 3); FSReqWrapSync req_wrap_sync; @@ -788,7 +798,6 @@ void Close(const FunctionCallbackInfo& args) { } } - // Used to speed up module loading. Returns the contents of the file as // a string or undefined when the file cannot be opened or "main" is not found // in the file. @@ -800,8 +809,7 @@ static void InternalModuleReadJSON(const FunctionCallbackInfo& args) { CHECK(args[0]->IsString()); node::Utf8Value path(isolate, args[0]); - if (strlen(*path) != path.length()) - return; // Contains a nul byte. + if (strlen(*path) != path.length()) return; // Contains a nul byte. uv_fs_t open_req; const int fd = uv_fs_open(loop, &open_req, *path, O_RDONLY, 0, nullptr); @@ -811,7 +819,7 @@ static void InternalModuleReadJSON(const FunctionCallbackInfo& args) { return; } - std::shared_ptr defer_close(nullptr, [fd, loop] (...) { + std::shared_ptr defer_close(nullptr, [fd, loop](...) { uv_fs_t close_req; CHECK_EQ(0, uv_fs_close(loop, &close_req, fd, nullptr)); uv_fs_req_cleanup(&close_req); @@ -833,8 +841,7 @@ static void InternalModuleReadJSON(const FunctionCallbackInfo& args) { numchars = uv_fs_read(loop, &read_req, fd, &buf, 1, offset, nullptr); uv_fs_req_cleanup(&read_req); - if (numchars < 0) - return; + if (numchars < 0) return; offset += numchars; } while (static_cast(numchars) == kBlockSize); @@ -849,10 +856,9 @@ static void InternalModuleReadJSON(const FunctionCallbackInfo& args) { return; } else { Local chars_string = - String::NewFromUtf8(isolate, - &chars[start], - v8::NewStringType::kNormal, - size).ToLocalChecked(); + String::NewFromUtf8( + isolate, &chars[start], v8::NewStringType::kNormal, size) + .ToLocalChecked(); args.GetReturnValue().Set(chars_string); } } @@ -889,8 +895,8 @@ static void Stat(const FunctionCallbackInfo& args) { bool use_bigint = args[1]->IsTrue(); FSReqBase* req_wrap_async = GetReqWrap(env, args[2], use_bigint); if (req_wrap_async != nullptr) { // stat(path, use_bigint, req) - AsyncCall(env, req_wrap_async, args, "stat", UTF8, AfterStat, - uv_fs_stat, *path); + AsyncCall( + env, req_wrap_async, args, "stat", UTF8, AfterStat, uv_fs_stat, *path); } else { // stat(path, use_bigint, undefined, ctx) CHECK_EQ(argc, 4); FSReqWrapSync req_wrap_sync; @@ -901,8 +907,8 @@ static void Stat(const FunctionCallbackInfo& args) { return; // error info is in ctx } - Local arr = FillGlobalStatsArray(env, use_bigint, - static_cast(req_wrap_sync.req.ptr)); + Local arr = FillGlobalStatsArray( + env, use_bigint, static_cast(req_wrap_sync.req.ptr)); args.GetReturnValue().Set(arr); } } @@ -919,21 +925,27 @@ static void LStat(const FunctionCallbackInfo& args) { bool use_bigint = args[1]->IsTrue(); FSReqBase* req_wrap_async = GetReqWrap(env, args[2], use_bigint); if (req_wrap_async != nullptr) { // lstat(path, use_bigint, req) - AsyncCall(env, req_wrap_async, args, "lstat", UTF8, AfterStat, - uv_fs_lstat, *path); + AsyncCall(env, + req_wrap_async, + args, + "lstat", + UTF8, + AfterStat, + uv_fs_lstat, + *path); } else { // lstat(path, use_bigint, undefined, ctx) CHECK_EQ(argc, 4); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(lstat); - int err = SyncCall(env, args[3], &req_wrap_sync, "lstat", uv_fs_lstat, - *path); + int err = + SyncCall(env, args[3], &req_wrap_sync, "lstat", uv_fs_lstat, *path); FS_SYNC_TRACE_END(lstat); if (err != 0) { return; // error info is in ctx } - Local arr = FillGlobalStatsArray(env, use_bigint, - static_cast(req_wrap_sync.req.ptr)); + Local arr = FillGlobalStatsArray( + env, use_bigint, static_cast(req_wrap_sync.req.ptr)); args.GetReturnValue().Set(arr); } } @@ -950,8 +962,8 @@ static void FStat(const FunctionCallbackInfo& args) { bool use_bigint = args[1]->IsTrue(); FSReqBase* req_wrap_async = GetReqWrap(env, args[2], use_bigint); if (req_wrap_async != nullptr) { // fstat(fd, use_bigint, req) - AsyncCall(env, req_wrap_async, args, "fstat", UTF8, AfterStat, - uv_fs_fstat, fd); + AsyncCall( + env, req_wrap_async, args, "fstat", UTF8, AfterStat, uv_fs_fstat, fd); } else { // fstat(fd, use_bigint, undefined, ctx) CHECK_EQ(argc, 4); FSReqWrapSync req_wrap_sync; @@ -962,8 +974,8 @@ static void FStat(const FunctionCallbackInfo& args) { return; // error info is in ctx } - Local arr = FillGlobalStatsArray(env, use_bigint, - static_cast(req_wrap_sync.req.ptr)); + Local arr = FillGlobalStatsArray( + env, use_bigint, static_cast(req_wrap_sync.req.ptr)); args.GetReturnValue().Set(arr); } } @@ -985,14 +997,30 @@ static void Symlink(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[3]); if (req_wrap_async != nullptr) { // symlink(target, path, flags, req) - AsyncDestCall(env, req_wrap_async, args, "symlink", *path, path.length(), - UTF8, AfterNoArgs, uv_fs_symlink, *target, *path, flags); + AsyncDestCall(env, + req_wrap_async, + args, + "symlink", + *path, + path.length(), + UTF8, + AfterNoArgs, + uv_fs_symlink, + *target, + *path, + flags); } else { // symlink(target, path, flags, undefinec, ctx) CHECK_EQ(argc, 5); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(symlink); - SyncCall(env, args[4], &req_wrap_sync, "symlink", - uv_fs_symlink, *target, *path, flags); + SyncCall(env, + args[4], + &req_wrap_sync, + "symlink", + uv_fs_symlink, + *target, + *path, + flags); FS_SYNC_TRACE_END(symlink); } } @@ -1012,14 +1040,22 @@ static void Link(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[2]); if (req_wrap_async != nullptr) { // link(src, dest, req) - AsyncDestCall(env, req_wrap_async, args, "link", *dest, dest.length(), UTF8, - AfterNoArgs, uv_fs_link, *src, *dest); + AsyncDestCall(env, + req_wrap_async, + args, + "link", + *dest, + dest.length(), + UTF8, + AfterNoArgs, + uv_fs_link, + *src, + *dest); } else { // link(src, dest) CHECK_EQ(argc, 4); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(link); - SyncCall(env, args[3], &req_wrap_sync, "link", - uv_fs_link, *src, *dest); + SyncCall(env, args[3], &req_wrap_sync, "link", uv_fs_link, *src, *dest); FS_SYNC_TRACE_END(link); } } @@ -1038,14 +1074,20 @@ static void ReadLink(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[2]); if (req_wrap_async != nullptr) { // readlink(path, encoding, req) - AsyncCall(env, req_wrap_async, args, "readlink", encoding, AfterStringPtr, - uv_fs_readlink, *path); + AsyncCall(env, + req_wrap_async, + args, + "readlink", + encoding, + AfterStringPtr, + uv_fs_readlink, + *path); } else { CHECK_EQ(argc, 4); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(readlink); - int err = SyncCall(env, args[3], &req_wrap_sync, "readlink", - uv_fs_readlink, *path); + int err = SyncCall( + env, args[3], &req_wrap_sync, "readlink", uv_fs_readlink, *path); FS_SYNC_TRACE_END(readlink); if (err < 0) { return; // syscall failed, no need to continue, error info is in ctx @@ -1053,10 +1095,8 @@ static void ReadLink(const FunctionCallbackInfo& args) { const char* link_path = static_cast(req_wrap_sync.req.ptr); Local error; - MaybeLocal rc = StringBytes::Encode(isolate, - link_path, - encoding, - &error); + MaybeLocal rc = + StringBytes::Encode(isolate, link_path, encoding, &error); if (rc.IsEmpty()) { Local ctx = args[3].As(); ctx->Set(env->context(), env->error_string(), error).FromJust(); @@ -1081,15 +1121,28 @@ static void Rename(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[2]); if (req_wrap_async != nullptr) { - AsyncDestCall(env, req_wrap_async, args, "rename", *new_path, - new_path.length(), UTF8, AfterNoArgs, uv_fs_rename, - *old_path, *new_path); + AsyncDestCall(env, + req_wrap_async, + args, + "rename", + *new_path, + new_path.length(), + UTF8, + AfterNoArgs, + uv_fs_rename, + *old_path, + *new_path); } else { CHECK_EQ(argc, 4); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(rename); - SyncCall(env, args[3], &req_wrap_sync, "rename", uv_fs_rename, - *old_path, *new_path); + SyncCall(env, + args[3], + &req_wrap_sync, + "rename", + uv_fs_rename, + *old_path, + *new_path); FS_SYNC_TRACE_END(rename); } } @@ -1108,14 +1161,21 @@ static void FTruncate(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[2]); if (req_wrap_async != nullptr) { - AsyncCall(env, req_wrap_async, args, "ftruncate", UTF8, AfterNoArgs, - uv_fs_ftruncate, fd, len); + AsyncCall(env, + req_wrap_async, + args, + "ftruncate", + UTF8, + AfterNoArgs, + uv_fs_ftruncate, + fd, + len); } else { CHECK_EQ(argc, 4); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(ftruncate); - SyncCall(env, args[3], &req_wrap_sync, "ftruncate", uv_fs_ftruncate, fd, - len); + SyncCall( + env, args[3], &req_wrap_sync, "ftruncate", uv_fs_ftruncate, fd, len); FS_SYNC_TRACE_END(ftruncate); } } @@ -1131,8 +1191,14 @@ static void Fdatasync(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[1]); if (req_wrap_async != nullptr) { - AsyncCall(env, req_wrap_async, args, "fdatasync", UTF8, AfterNoArgs, - uv_fs_fdatasync, fd); + AsyncCall(env, + req_wrap_async, + args, + "fdatasync", + UTF8, + AfterNoArgs, + uv_fs_fdatasync, + fd); } else { CHECK_EQ(argc, 3); FSReqWrapSync req_wrap_sync; @@ -1153,8 +1219,8 @@ static void Fsync(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[1]); if (req_wrap_async != nullptr) { - AsyncCall(env, req_wrap_async, args, "fsync", UTF8, AfterNoArgs, - uv_fs_fsync, fd); + AsyncCall( + env, req_wrap_async, args, "fsync", UTF8, AfterNoArgs, uv_fs_fsync, fd); } else { CHECK_EQ(argc, 3); FSReqWrapSync req_wrap_sync; @@ -1175,8 +1241,14 @@ static void Unlink(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[1]); if (req_wrap_async != nullptr) { - AsyncCall(env, req_wrap_async, args, "unlink", UTF8, AfterNoArgs, - uv_fs_unlink, *path); + AsyncCall(env, + req_wrap_async, + args, + "unlink", + UTF8, + AfterNoArgs, + uv_fs_unlink, + *path); } else { CHECK_EQ(argc, 3); FSReqWrapSync req_wrap_sync; @@ -1197,19 +1269,27 @@ static void RMDir(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[1]); // rmdir(path, req) if (req_wrap_async != nullptr) { - AsyncCall(env, req_wrap_async, args, "rmdir", UTF8, AfterNoArgs, - uv_fs_rmdir, *path); + AsyncCall(env, + req_wrap_async, + args, + "rmdir", + UTF8, + AfterNoArgs, + uv_fs_rmdir, + *path); } else { // rmdir(path, undefined, ctx) CHECK_EQ(argc, 3); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(rmdir); - SyncCall(env, args[2], &req_wrap_sync, "rmdir", - uv_fs_rmdir, *path); + SyncCall(env, args[2], &req_wrap_sync, "rmdir", uv_fs_rmdir, *path); FS_SYNC_TRACE_END(rmdir); } } -int MKDirpSync(uv_loop_t* loop, uv_fs_t* req, const std::string& path, int mode, +int MKDirpSync(uv_loop_t* loop, + uv_fs_t* req, + const std::string& path, + int mode, uv_fs_cb cb = nullptr) { FSContinuationData continuation_data(req, mode, cb); continuation_data.PushPath(std::move(path)); @@ -1225,8 +1305,8 @@ int MKDirpSync(uv_loop_t* loop, uv_fs_t* req, const std::string& path, int mode, } break; case UV_ENOENT: { - std::string dirname = next_path.substr(0, - next_path.find_last_of(kPathSeparator)); + std::string dirname = + next_path.substr(0, next_path.find_last_of(kPathSeparator)); if (dirname != next_path) { continuation_data.PushPath(std::move(next_path)); continuation_data.PushPath(std::move(dirname)); @@ -1254,83 +1334,90 @@ int MKDirpSync(uv_loop_t* loop, uv_fs_t* req, const std::string& path, int mode, return 0; } -int MKDirpAsync(uv_loop_t* loop, - uv_fs_t* req, - const char* path, - int mode, - uv_fs_cb cb) { +int MKDirpAsync( + uv_loop_t* loop, uv_fs_t* req, const char* path, int mode, uv_fs_cb cb) { FSReqBase* req_wrap = FSReqBase::from_req(req); // on the first iteration of algorithm, stash state information. if (req_wrap->continuation_data == nullptr) { req_wrap->continuation_data = std::unique_ptr{ - new FSContinuationData(req, mode, cb)}; + new FSContinuationData(req, mode, cb)}; req_wrap->continuation_data->PushPath(std::move(path)); } // on each iteration of algorithm, mkdir directory on top of stack. std::string next_path = req_wrap->continuation_data->PopPath(); - int err = uv_fs_mkdir(loop, req, next_path.c_str(), mode, - uv_fs_callback_t{[](uv_fs_t* req) { - FSReqBase* req_wrap = FSReqBase::from_req(req); - Environment* env = req_wrap->env(); - uv_loop_t* loop = env->event_loop(); - std::string path = req->path; - int err = req->result; - - while (true) { - switch (err) { - case 0: { - if (req_wrap->continuation_data->paths.size() == 0) { - req_wrap->continuation_data->Done(0); - } else { - uv_fs_req_cleanup(req); - MKDirpAsync(loop, req, path.c_str(), - req_wrap->continuation_data->mode, nullptr); - } - break; - } - case UV_ENOENT: { - std::string dirname = path.substr(0, - path.find_last_of(kPathSeparator)); - if (dirname != path) { - req_wrap->continuation_data->PushPath(std::move(path)); - req_wrap->continuation_data->PushPath(std::move(dirname)); - } else if (req_wrap->continuation_data->paths.size() == 0) { - err = UV_EEXIST; - continue; - } - uv_fs_req_cleanup(req); - MKDirpAsync(loop, req, path.c_str(), - req_wrap->continuation_data->mode, nullptr); - break; - } - case UV_EPERM: { - req_wrap->continuation_data->Done(err); - break; - } - default: - if (err == UV_EEXIST && - req_wrap->continuation_data->paths.size() > 0) { - uv_fs_req_cleanup(req); - MKDirpAsync(loop, req, path.c_str(), - req_wrap->continuation_data->mode, nullptr); - } else { - // verify that the path pointed to is actually a directory. - uv_fs_req_cleanup(req); - int err = uv_fs_stat(loop, req, path.c_str(), - uv_fs_callback_t{[](uv_fs_t* req) { - FSReqBase* req_wrap = FSReqBase::from_req(req); - int err = req->result; - if (err == 0 && !S_ISDIR(req->statbuf.st_mode)) err = UV_EEXIST; + int err = uv_fs_mkdir( + loop, req, next_path.c_str(), mode, uv_fs_callback_t{[](uv_fs_t* req) { + FSReqBase* req_wrap = FSReqBase::from_req(req); + Environment* env = req_wrap->env(); + uv_loop_t* loop = env->event_loop(); + std::string path = req->path; + int err = req->result; + + while (true) { + switch (err) { + case 0: { + if (req_wrap->continuation_data->paths.size() == 0) { + req_wrap->continuation_data->Done(0); + } else { + uv_fs_req_cleanup(req); + MKDirpAsync(loop, + req, + path.c_str(), + req_wrap->continuation_data->mode, + nullptr); + } + break; + } + case UV_ENOENT: { + std::string dirname = + path.substr(0, path.find_last_of(kPathSeparator)); + if (dirname != path) { + req_wrap->continuation_data->PushPath(std::move(path)); + req_wrap->continuation_data->PushPath(std::move(dirname)); + } else if (req_wrap->continuation_data->paths.size() == 0) { + err = UV_EEXIST; + continue; + } + uv_fs_req_cleanup(req); + MKDirpAsync(loop, + req, + path.c_str(), + req_wrap->continuation_data->mode, + nullptr); + break; + } + case UV_EPERM: { req_wrap->continuation_data->Done(err); - }}); - if (err < 0) req_wrap->continuation_data->Done(err); + break; + } + default: + if (err == UV_EEXIST && + req_wrap->continuation_data->paths.size() > 0) { + uv_fs_req_cleanup(req); + MKDirpAsync(loop, + req, + path.c_str(), + req_wrap->continuation_data->mode, + nullptr); + } else { + // verify that the path pointed to is actually a directory. + uv_fs_req_cleanup(req); + int err = uv_fs_stat( + loop, req, path.c_str(), uv_fs_callback_t{[](uv_fs_t* req) { + FSReqBase* req_wrap = FSReqBase::from_req(req); + int err = req->result; + if (err == 0 && !S_ISDIR(req->statbuf.st_mode)) + err = UV_EEXIST; + req_wrap->continuation_data->Done(err); + }}); + if (err < 0) req_wrap->continuation_data->Done(err); + } + break; } break; - } - break; - } - }}); + } + }}); return err; } @@ -1352,18 +1439,23 @@ static void MKDir(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[3]); if (req_wrap_async != nullptr) { // mkdir(path, mode, req) - AsyncCall(env, req_wrap_async, args, "mkdir", UTF8, - AfterNoArgs, mkdirp ? MKDirpAsync : uv_fs_mkdir, *path, mode); + AsyncCall(env, + req_wrap_async, + args, + "mkdir", + UTF8, + AfterNoArgs, + mkdirp ? MKDirpAsync : uv_fs_mkdir, + *path, + mode); } else { // mkdir(path, mode, undefined, ctx) CHECK_EQ(argc, 5); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(mkdir); if (mkdirp) { - SyncCall(env, args[4], &req_wrap_sync, "mkdir", - MKDirpSync, *path, mode); + SyncCall(env, args[4], &req_wrap_sync, "mkdir", MKDirpSync, *path, mode); } else { - SyncCall(env, args[4], &req_wrap_sync, "mkdir", - uv_fs_mkdir, *path, mode); + SyncCall(env, args[4], &req_wrap_sync, "mkdir", uv_fs_mkdir, *path, mode); } FS_SYNC_TRACE_END(mkdir); } @@ -1383,14 +1475,20 @@ static void RealPath(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[2]); if (req_wrap_async != nullptr) { // realpath(path, encoding, req) - AsyncCall(env, req_wrap_async, args, "realpath", encoding, AfterStringPtr, - uv_fs_realpath, *path); + AsyncCall(env, + req_wrap_async, + args, + "realpath", + encoding, + AfterStringPtr, + uv_fs_realpath, + *path); } else { // realpath(path, encoding, undefined, ctx) CHECK_EQ(argc, 4); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(realpath); - int err = SyncCall(env, args[3], &req_wrap_sync, "realpath", - uv_fs_realpath, *path); + int err = SyncCall( + env, args[3], &req_wrap_sync, "realpath", uv_fs_realpath, *path); FS_SYNC_TRACE_END(realpath); if (err < 0) { return; // syscall failed, no need to continue, error info is in ctx @@ -1399,10 +1497,8 @@ static void RealPath(const FunctionCallbackInfo& args) { const char* link_path = static_cast(req_wrap_sync.req.ptr); Local error; - MaybeLocal rc = StringBytes::Encode(isolate, - link_path, - encoding, - &error); + MaybeLocal rc = + StringBytes::Encode(isolate, link_path, encoding, &error); if (rc.IsEmpty()) { Local ctx = args[3].As(); ctx->Set(env->context(), env->error_string(), error).FromJust(); @@ -1430,18 +1526,37 @@ static void ReadDir(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[3]); if (req_wrap_async != nullptr) { // readdir(path, encoding, withTypes, req) if (with_types) { - AsyncCall(env, req_wrap_async, args, "scandir", encoding, - AfterScanDirWithTypes, uv_fs_scandir, *path, 0 /*flags*/); + AsyncCall(env, + req_wrap_async, + args, + "scandir", + encoding, + AfterScanDirWithTypes, + uv_fs_scandir, + *path, + 0 /*flags*/); } else { - AsyncCall(env, req_wrap_async, args, "scandir", encoding, - AfterScanDir, uv_fs_scandir, *path, 0 /*flags*/); + AsyncCall(env, + req_wrap_async, + args, + "scandir", + encoding, + AfterScanDir, + uv_fs_scandir, + *path, + 0 /*flags*/); } } else { // readdir(path, encoding, withTypes, undefined, ctx) CHECK_EQ(argc, 5); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(readdir); - int err = SyncCall(env, args[4], &req_wrap_sync, "scandir", - uv_fs_scandir, *path, 0 /*flags*/); + int err = SyncCall(env, + args[4], + &req_wrap_sync, + "scandir", + uv_fs_scandir, + *path, + 0 /*flags*/); FS_SYNC_TRACE_END(readdir); if (err < 0) { return; // syscall failed, no need to continue, error info is in ctx @@ -1452,26 +1567,25 @@ static void ReadDir(const FunctionCallbackInfo& args) { std::vector> name_v; std::vector> type_v; - for (int i = 0; ; i++) { + for (int i = 0;; i++) { uv_dirent_t ent; r = uv_fs_scandir_next(&(req_wrap_sync.req), &ent); - if (r == UV_EOF) - break; + if (r == UV_EOF) break; if (r != 0) { Local ctx = args[4].As(); - ctx->Set(env->context(), env->errno_string(), - Integer::New(isolate, r)).FromJust(); - ctx->Set(env->context(), env->syscall_string(), - OneByteString(isolate, "readdir")).FromJust(); + ctx->Set(env->context(), env->errno_string(), Integer::New(isolate, r)) + .FromJust(); + ctx->Set(env->context(), + env->syscall_string(), + OneByteString(isolate, "readdir")) + .FromJust(); return; } Local error; - MaybeLocal filename = StringBytes::Encode(isolate, - ent.name, - encoding, - &error); + MaybeLocal filename = + StringBytes::Encode(isolate, ent.name, encoding, &error); if (filename.IsEmpty()) { Local ctx = args[4].As(); @@ -1486,15 +1600,15 @@ static void ReadDir(const FunctionCallbackInfo& args) { } } - Local names = Array::New(isolate, name_v.data(), name_v.size()); if (with_types) { Local result = Array::New(isolate, 2); result->Set(env->context(), 0, names).FromJust(); - result->Set(env->context(), - 1, - Array::New(isolate, type_v.data(), - type_v.size())).FromJust(); + result + ->Set(env->context(), + 1, + Array::New(isolate, type_v.data(), type_v.size())) + .FromJust(); args.GetReturnValue().Set(result); } else { args.GetReturnValue().Set(names); @@ -1519,14 +1633,22 @@ static void Open(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[3]); if (req_wrap_async != nullptr) { // open(path, flags, mode, req) - AsyncCall(env, req_wrap_async, args, "open", UTF8, AfterInteger, - uv_fs_open, *path, flags, mode); + AsyncCall(env, + req_wrap_async, + args, + "open", + UTF8, + AfterInteger, + uv_fs_open, + *path, + flags, + mode); } else { // open(path, flags, mode, undefined, ctx) CHECK_EQ(argc, 5); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(open); - int result = SyncCall(env, args[4], &req_wrap_sync, "open", - uv_fs_open, *path, flags, mode); + int result = SyncCall( + env, args[4], &req_wrap_sync, "open", uv_fs_open, *path, flags, mode); FS_SYNC_TRACE_END(open); args.GetReturnValue().Set(result); } @@ -1550,14 +1672,22 @@ static void OpenFileHandle(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[3]); if (req_wrap_async != nullptr) { // openFileHandle(path, flags, mode, req) - AsyncCall(env, req_wrap_async, args, "open", UTF8, AfterOpenFileHandle, - uv_fs_open, *path, flags, mode); + AsyncCall(env, + req_wrap_async, + args, + "open", + UTF8, + AfterOpenFileHandle, + uv_fs_open, + *path, + flags, + mode); } else { // openFileHandle(path, flags, mode, undefined, ctx) CHECK_EQ(argc, 5); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(open); - int result = SyncCall(env, args[4], &req_wrap_sync, "open", - uv_fs_open, *path, flags, mode); + int result = SyncCall( + env, args[4], &req_wrap_sync, "open", uv_fs_open, *path, flags, mode); FS_SYNC_TRACE_END(open); if (result < 0) { return; // syscall failed, no need to continue, error info is in ctx @@ -1586,20 +1716,34 @@ static void CopyFile(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[3]); if (req_wrap_async != nullptr) { // copyFile(src, dest, flags, req) - AsyncDestCall(env, req_wrap_async, args, "copyfile", - *dest, dest.length(), UTF8, AfterNoArgs, - uv_fs_copyfile, *src, *dest, flags); + AsyncDestCall(env, + req_wrap_async, + args, + "copyfile", + *dest, + dest.length(), + UTF8, + AfterNoArgs, + uv_fs_copyfile, + *src, + *dest, + flags); } else { // copyFile(src, dest, flags, undefined, ctx) CHECK_EQ(argc, 5); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(copyfile); - SyncCall(env, args[4], &req_wrap_sync, "copyfile", - uv_fs_copyfile, *src, *dest, flags); + SyncCall(env, + args[4], + &req_wrap_sync, + "copyfile", + uv_fs_copyfile, + *src, + *dest, + flags); FS_SYNC_TRACE_END(copyfile); } } - // Wrapper for write(2). // // bytesWritten = write(fd, buffer, offset, length, position, callback) @@ -1640,20 +1784,28 @@ static void WriteBuffer(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[5]); if (req_wrap_async != nullptr) { // write(fd, buffer, off, len, pos, req) - AsyncCall(env, req_wrap_async, args, "write", UTF8, AfterInteger, - uv_fs_write, fd, &uvbuf, 1, pos); + AsyncCall(env, + req_wrap_async, + args, + "write", + UTF8, + AfterInteger, + uv_fs_write, + fd, + &uvbuf, + 1, + pos); } else { // write(fd, buffer, off, len, pos, undefined, ctx) CHECK_EQ(argc, 7); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(write); - int bytesWritten = SyncCall(env, args[6], &req_wrap_sync, "write", - uv_fs_write, fd, &uvbuf, 1, pos); + int bytesWritten = SyncCall( + env, args[6], &req_wrap_sync, "write", uv_fs_write, fd, &uvbuf, 1, pos); FS_SYNC_TRACE_END(write, "bytesWritten", bytesWritten); args.GetReturnValue().Set(bytesWritten); } } - // Wrapper for writev(2). // // bytesWritten = writev(fd, chunks, position, callback) @@ -1685,20 +1837,35 @@ static void WriteBuffers(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[3]); if (req_wrap_async != nullptr) { // writeBuffers(fd, chunks, pos, req) - AsyncCall(env, req_wrap_async, args, "write", UTF8, AfterInteger, - uv_fs_write, fd, *iovs, iovs.length(), pos); + AsyncCall(env, + req_wrap_async, + args, + "write", + UTF8, + AfterInteger, + uv_fs_write, + fd, + *iovs, + iovs.length(), + pos); } else { // writeBuffers(fd, chunks, pos, undefined, ctx) CHECK_EQ(argc, 5); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(write); - int bytesWritten = SyncCall(env, args[4], &req_wrap_sync, "write", - uv_fs_write, fd, *iovs, iovs.length(), pos); + int bytesWritten = SyncCall(env, + args[4], + &req_wrap_sync, + "write", + uv_fs_write, + fd, + *iovs, + iovs.length(), + pos); FS_SYNC_TRACE_END(write, "bytesWritten", bytesWritten); args.GetReturnValue().Set(bytesWritten); } } - // Wrapper for write(2). // // bytesWritten = write(fd, string, position, enc, callback) @@ -1758,12 +1925,8 @@ static void WriteString(const FunctionCallbackInfo& args) { len = StringBytes::Write(isolate, *stack_buffer, len, args[1], enc); stack_buffer.SetLengthAndZeroTerminate(len); uv_buf_t uvbuf = uv_buf_init(*stack_buffer, len); - int err = req_wrap_async->Dispatch(uv_fs_write, - fd, - &uvbuf, - 1, - pos, - AfterInteger); + int err = + req_wrap_async->Dispatch(uv_fs_write, fd, &uvbuf, 1, pos, AfterInteger); if (err < 0) { uv_fs_t* uv_req = req_wrap_async->req(); uv_req->result = err; @@ -1778,26 +1941,23 @@ static void WriteString(const FunctionCallbackInfo& args) { FSReqWrapSync req_wrap_sync; FSReqBase::FSReqBuffer stack_buffer; if (buf == nullptr) { - if (!StringBytes::StorageSize(isolate, value, enc).To(&len)) - return; + if (!StringBytes::StorageSize(isolate, value, enc).To(&len)) return; stack_buffer.AllocateSufficientStorage(len + 1); // StorageSize may return too large a char, so correct the actual length // by the write size - len = StringBytes::Write(isolate, *stack_buffer, - len, args[1], enc); + len = StringBytes::Write(isolate, *stack_buffer, len, args[1], enc); stack_buffer.SetLengthAndZeroTerminate(len); buf = *stack_buffer; } uv_buf_t uvbuf = uv_buf_init(buf, len); FS_SYNC_TRACE_BEGIN(write); - int bytesWritten = SyncCall(env, args[5], &req_wrap_sync, "write", - uv_fs_write, fd, &uvbuf, 1, pos); + int bytesWritten = SyncCall( + env, args[5], &req_wrap_sync, "write", uv_fs_write, fd, &uvbuf, 1, pos); FS_SYNC_TRACE_END(write, "bytesWritten", bytesWritten); args.GetReturnValue().Set(bytesWritten); } } - /* * Wrapper for read(2). * @@ -1839,20 +1999,28 @@ static void Read(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[5]); if (req_wrap_async != nullptr) { // read(fd, buffer, offset, len, pos, req) - AsyncCall(env, req_wrap_async, args, "read", UTF8, AfterInteger, - uv_fs_read, fd, &uvbuf, 1, pos); + AsyncCall(env, + req_wrap_async, + args, + "read", + UTF8, + AfterInteger, + uv_fs_read, + fd, + &uvbuf, + 1, + pos); } else { // read(fd, buffer, offset, len, pos, undefined, ctx) CHECK_EQ(argc, 7); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(read); - const int bytesRead = SyncCall(env, args[6], &req_wrap_sync, "read", - uv_fs_read, fd, &uvbuf, 1, pos); + const int bytesRead = SyncCall( + env, args[6], &req_wrap_sync, "read", uv_fs_read, fd, &uvbuf, 1, pos); FS_SYNC_TRACE_END(read, "bytesRead", bytesRead); args.GetReturnValue().Set(bytesRead); } } - /* fs.chmod(path, mode); * Wrapper for chmod(1) / EIO_CHMOD */ @@ -1870,19 +2038,24 @@ static void Chmod(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[2]); if (req_wrap_async != nullptr) { // chmod(path, mode, req) - AsyncCall(env, req_wrap_async, args, "chmod", UTF8, AfterNoArgs, - uv_fs_chmod, *path, mode); + AsyncCall(env, + req_wrap_async, + args, + "chmod", + UTF8, + AfterNoArgs, + uv_fs_chmod, + *path, + mode); } else { // chmod(path, mode, undefined, ctx) CHECK_EQ(argc, 4); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(chmod); - SyncCall(env, args[3], &req_wrap_sync, "chmod", - uv_fs_chmod, *path, mode); + SyncCall(env, args[3], &req_wrap_sync, "chmod", uv_fs_chmod, *path, mode); FS_SYNC_TRACE_END(chmod); } } - /* fs.fchmod(fd, mode); * Wrapper for fchmod(1) / EIO_FCHMOD */ @@ -1900,19 +2073,24 @@ static void FChmod(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[2]); if (req_wrap_async != nullptr) { // fchmod(fd, mode, req) - AsyncCall(env, req_wrap_async, args, "fchmod", UTF8, AfterNoArgs, - uv_fs_fchmod, fd, mode); + AsyncCall(env, + req_wrap_async, + args, + "fchmod", + UTF8, + AfterNoArgs, + uv_fs_fchmod, + fd, + mode); } else { // fchmod(fd, mode, undefined, ctx) CHECK_EQ(argc, 4); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(fchmod); - SyncCall(env, args[3], &req_wrap_sync, "fchmod", - uv_fs_fchmod, fd, mode); + SyncCall(env, args[3], &req_wrap_sync, "fchmod", uv_fs_fchmod, fd, mode); FS_SYNC_TRACE_END(fchmod); } } - /* fs.chown(path, uid, gid); * Wrapper for chown(1) / EIO_CHOWN */ @@ -1933,19 +2111,26 @@ static void Chown(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[3]); if (req_wrap_async != nullptr) { // chown(path, uid, gid, req) - AsyncCall(env, req_wrap_async, args, "chown", UTF8, AfterNoArgs, - uv_fs_chown, *path, uid, gid); + AsyncCall(env, + req_wrap_async, + args, + "chown", + UTF8, + AfterNoArgs, + uv_fs_chown, + *path, + uid, + gid); } else { // chown(path, uid, gid, undefined, ctx) CHECK_EQ(argc, 5); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(chown); - SyncCall(env, args[4], &req_wrap_sync, "chown", - uv_fs_chown, *path, uid, gid); + SyncCall( + env, args[4], &req_wrap_sync, "chown", uv_fs_chown, *path, uid, gid); FS_SYNC_TRACE_END(chown); } } - /* fs.fchown(fd, uid, gid); * Wrapper for fchown(1) / EIO_FCHOWN */ @@ -1966,19 +2151,26 @@ static void FChown(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[3]); if (req_wrap_async != nullptr) { // fchown(fd, uid, gid, req) - AsyncCall(env, req_wrap_async, args, "fchown", UTF8, AfterNoArgs, - uv_fs_fchown, fd, uid, gid); + AsyncCall(env, + req_wrap_async, + args, + "fchown", + UTF8, + AfterNoArgs, + uv_fs_fchown, + fd, + uid, + gid); } else { // fchown(fd, uid, gid, undefined, ctx) CHECK_EQ(argc, 5); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(fchown); - SyncCall(env, args[4], &req_wrap_sync, "fchown", - uv_fs_fchown, fd, uid, gid); + SyncCall( + env, args[4], &req_wrap_sync, "fchown", uv_fs_fchown, fd, uid, gid); FS_SYNC_TRACE_END(fchown); } } - static void LChown(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -1996,19 +2188,26 @@ static void LChown(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[3]); if (req_wrap_async != nullptr) { // lchown(path, uid, gid, req) - AsyncCall(env, req_wrap_async, args, "lchown", UTF8, AfterNoArgs, - uv_fs_lchown, *path, uid, gid); + AsyncCall(env, + req_wrap_async, + args, + "lchown", + UTF8, + AfterNoArgs, + uv_fs_lchown, + *path, + uid, + gid); } else { // lchown(path, uid, gid, undefined, ctx) CHECK_EQ(argc, 5); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(lchown); - SyncCall(env, args[4], &req_wrap_sync, "lchown", - uv_fs_lchown, *path, uid, gid); + SyncCall( + env, args[4], &req_wrap_sync, "lchown", uv_fs_lchown, *path, uid, gid); FS_SYNC_TRACE_END(lchown); } } - static void UTimes(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -2026,14 +2225,28 @@ static void UTimes(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[3]); if (req_wrap_async != nullptr) { // utimes(path, atime, mtime, req) - AsyncCall(env, req_wrap_async, args, "utime", UTF8, AfterNoArgs, - uv_fs_utime, *path, atime, mtime); + AsyncCall(env, + req_wrap_async, + args, + "utime", + UTF8, + AfterNoArgs, + uv_fs_utime, + *path, + atime, + mtime); } else { // utimes(path, atime, mtime, undefined, ctx) CHECK_EQ(argc, 5); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(utimes); - SyncCall(env, args[4], &req_wrap_sync, "utime", - uv_fs_utime, *path, atime, mtime); + SyncCall(env, + args[4], + &req_wrap_sync, + "utime", + uv_fs_utime, + *path, + atime, + mtime); FS_SYNC_TRACE_END(utimes); } } @@ -2055,14 +2268,22 @@ static void FUTimes(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[3]); if (req_wrap_async != nullptr) { // futimes(fd, atime, mtime, req) - AsyncCall(env, req_wrap_async, args, "futime", UTF8, AfterNoArgs, - uv_fs_futime, fd, atime, mtime); + AsyncCall(env, + req_wrap_async, + args, + "futime", + UTF8, + AfterNoArgs, + uv_fs_futime, + fd, + atime, + mtime); } else { // futimes(fd, atime, mtime, undefined, ctx) CHECK_EQ(argc, 5); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(futimes); - SyncCall(env, args[4], &req_wrap_sync, "futime", - uv_fs_futime, fd, atime, mtime); + SyncCall( + env, args[4], &req_wrap_sync, "futime", uv_fs_futime, fd, atime, mtime); FS_SYNC_TRACE_END(futimes); } } @@ -2081,20 +2302,24 @@ static void Mkdtemp(const FunctionCallbackInfo& args) { FSReqBase* req_wrap_async = GetReqWrap(env, args[2]); if (req_wrap_async != nullptr) { // mkdtemp(tmpl, encoding, req) - AsyncCall(env, req_wrap_async, args, "mkdtemp", encoding, AfterStringPath, - uv_fs_mkdtemp, *tmpl); + AsyncCall(env, + req_wrap_async, + args, + "mkdtemp", + encoding, + AfterStringPath, + uv_fs_mkdtemp, + *tmpl); } else { // mkdtemp(tmpl, encoding, undefined, ctx) CHECK_EQ(argc, 4); FSReqWrapSync req_wrap_sync; FS_SYNC_TRACE_BEGIN(mkdtemp); - SyncCall(env, args[3], &req_wrap_sync, "mkdtemp", - uv_fs_mkdtemp, *tmpl); + SyncCall(env, args[3], &req_wrap_sync, "mkdtemp", uv_fs_mkdtemp, *tmpl); FS_SYNC_TRACE_END(mkdtemp); const char* path = static_cast(req_wrap_sync.req.path); Local error; - MaybeLocal rc = - StringBytes::Encode(isolate, path, encoding, &error); + MaybeLocal rc = StringBytes::Encode(isolate, path, encoding, &error); if (rc.IsEmpty()) { Local ctx = args[3].As(); ctx->Set(env->context(), env->error_string(), error).FromJust(); @@ -2151,18 +2376,23 @@ void Initialize(Local target, env->SetMethod(target, "mkdtemp", Mkdtemp); - target->Set(context, - FIXED_ONE_BYTE_STRING(isolate, "kFsStatsFieldsNumber"), - Integer::New(isolate, kFsStatsFieldsNumber)) - .FromJust(); + target + ->Set(context, + FIXED_ONE_BYTE_STRING(isolate, "kFsStatsFieldsNumber"), + Integer::New(isolate, kFsStatsFieldsNumber)) + .FromJust(); - target->Set(context, - FIXED_ONE_BYTE_STRING(isolate, "statValues"), - env->fs_stats_field_array()->GetJSArray()).FromJust(); + target + ->Set(context, + FIXED_ONE_BYTE_STRING(isolate, "statValues"), + env->fs_stats_field_array()->GetJSArray()) + .FromJust(); - target->Set(context, - FIXED_ONE_BYTE_STRING(isolate, "bigintStatValues"), - env->fs_stats_field_bigint_array()->GetJSArray()).FromJust(); + target + ->Set(context, + FIXED_ONE_BYTE_STRING(isolate, "bigintStatValues"), + env->fs_stats_field_bigint_array()->GetJSArray()) + .FromJust(); StatWatcher::Initialize(env, target); @@ -2170,11 +2400,11 @@ void Initialize(Local target, Local fst = env->NewFunctionTemplate(NewFSReqCallback); fst->InstanceTemplate()->SetInternalFieldCount(1); fst->Inherit(AsyncWrap::GetConstructorTemplate(env)); - Local wrapString = - FIXED_ONE_BYTE_STRING(isolate, "FSReqCallback"); + Local wrapString = FIXED_ONE_BYTE_STRING(isolate, "FSReqCallback"); fst->SetClassName(wrapString); target - ->Set(context, wrapString, + ->Set(context, + wrapString, fst->GetFunction(env->context()).ToLocalChecked()) .FromJust(); @@ -2186,14 +2416,12 @@ void Initialize(Local target, Local fhWrapString = FIXED_ONE_BYTE_STRING(isolate, "FileHandleReqWrap"); fh_rw->SetClassName(fhWrapString); - env->set_filehandlereadwrap_template( - fst->InstanceTemplate()); + env->set_filehandlereadwrap_template(fst->InstanceTemplate()); // Create Function Template for FSReqPromise Local fpt = FunctionTemplate::New(isolate); fpt->Inherit(AsyncWrap::GetConstructorTemplate(env)); - Local promiseString = - FIXED_ONE_BYTE_STRING(isolate, "FSReqPromise"); + Local promiseString = FIXED_ONE_BYTE_STRING(isolate, "FSReqPromise"); fpt->SetClassName(promiseString); Local fpo = fpt->InstanceTemplate(); fpo->SetInternalFieldCount(1); @@ -2206,32 +2434,32 @@ void Initialize(Local target, env->SetProtoMethod(fd, "releaseFD", FileHandle::ReleaseFD); Local fdt = fd->InstanceTemplate(); fdt->SetInternalFieldCount(1); - Local handleString = - FIXED_ONE_BYTE_STRING(isolate, "FileHandle"); + Local handleString = FIXED_ONE_BYTE_STRING(isolate, "FileHandle"); fd->SetClassName(handleString); StreamBase::AddMethods(env, fd); target - ->Set(context, handleString, + ->Set(context, + handleString, fd->GetFunction(env->context()).ToLocalChecked()) .FromJust(); env->set_fd_constructor_template(fdt); // Create FunctionTemplate for FileHandle::CloseReq Local fdclose = FunctionTemplate::New(isolate); - fdclose->SetClassName(FIXED_ONE_BYTE_STRING(isolate, - "FileHandleCloseReq")); + fdclose->SetClassName(FIXED_ONE_BYTE_STRING(isolate, "FileHandleCloseReq")); fdclose->Inherit(AsyncWrap::GetConstructorTemplate(env)); Local fdcloset = fdclose->InstanceTemplate(); fdcloset->SetInternalFieldCount(1); env->set_fdclose_constructor_template(fdcloset); Local use_promises_symbol = - Symbol::New(isolate, - FIXED_ONE_BYTE_STRING(isolate, "use promises")); + Symbol::New(isolate, FIXED_ONE_BYTE_STRING(isolate, "use promises")); env->set_fs_use_promises_symbol(use_promises_symbol); - target->Set(context, - FIXED_ONE_BYTE_STRING(isolate, "kUsePromises"), - use_promises_symbol).FromJust(); + target + ->Set(context, + FIXED_ONE_BYTE_STRING(isolate, "kUsePromises"), + use_promises_symbol) + .FromJust(); } } // namespace fs diff --git a/src/node_file.h b/src/node_file.h index e2f8bdc55e6ad1..a5cc255cd040e0 100644 --- a/src/node_file.h +++ b/src/node_file.h @@ -4,8 +4,8 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "node.h" -#include "stream_base.h" #include "req_wrap-inl.h" +#include "stream_base.h" namespace node { @@ -25,20 +25,15 @@ namespace fs { class FSContinuationData : public MemoryRetainer { public: FSContinuationData(uv_fs_t* req, int mode, uv_fs_cb done_cb) - : req(req), mode(mode), done_cb(done_cb) { - } + : req(req), mode(mode), done_cb(done_cb) {} uv_fs_t* req; int mode; std::vector paths{}; - void PushPath(std::string&& path) { - paths.emplace_back(std::move(path)); - } + void PushPath(std::string&& path) { paths.emplace_back(std::move(path)); } - void PushPath(const std::string& path) { - paths.push_back(path); - } + void PushPath(const std::string& path) { paths.push_back(path); } std::string PopPath() { CHECK_GT(paths.size(), 0); @@ -68,10 +63,11 @@ class FSReqBase : public ReqWrap { typedef MaybeStackBuffer FSReqBuffer; std::unique_ptr continuation_data = nullptr; - FSReqBase(Environment* env, Local req, AsyncWrap::ProviderType type, + FSReqBase(Environment* env, + Local req, + AsyncWrap::ProviderType type, bool use_bigint) - : ReqWrap(env, req, type), use_bigint_(use_bigint) { - } + : ReqWrap(env, req, type), use_bigint_(use_bigint) {} void Init(const char* syscall, const char* data, @@ -89,8 +85,7 @@ class FSReqBase : public ReqWrap { } } - FSReqBuffer& Init(const char* syscall, size_t len, - enum encoding encoding) { + FSReqBuffer& Init(const char* syscall, size_t len, enum encoding encoding) { syscall_ = syscall; encoding_ = encoding; @@ -130,7 +125,7 @@ class FSReqBase : public ReqWrap { class FSReqCallback : public FSReqBase { public: FSReqCallback(Environment* env, Local req, bool use_bigint) - : FSReqBase(env, req, AsyncWrap::PROVIDER_FSREQCALLBACK, use_bigint) { } + : FSReqBase(env, req, AsyncWrap::PROVIDER_FSREQCALLBACK, use_bigint) {} void Reject(Local reject) override; void Resolve(Local value) override; @@ -152,7 +147,7 @@ class FSReqCallback : public FSReqBase { // Refs: https://www.gnu.org/software/gcc/projects/cxx-status.html#cxx14 // Refs: https://isocpp.org/files/papers/N3652.html #if __cpp_constexpr < 201304 -# define constexpr inline +#define constexpr inline #endif template constexpr void FillStatsArray(AliasedBuffer* fields, - const uv_stat_t* s, const size_t offset = 0) { + const uv_stat_t* s, + const size_t offset = 0) { fields->SetValue(offset + 0, s->st_dev); fields->SetValue(offset + 1, s->st_mode); fields->SetValue(offset + 2, s->st_nlink); @@ -211,7 +207,7 @@ constexpr void FillStatsArray(AliasedBuffer* fields, #else fields->SetValue(offset + 9, 0); #endif -// Dates. + // Dates. fields->SetValue(offset + 10, ToNative(s->st_atim)); fields->SetValue(offset + 11, ToNative(s->st_mtim)); fields->SetValue(offset + 12, ToNative(s->st_ctim)); @@ -240,14 +236,16 @@ class FSReqPromise : public FSReqBase { explicit FSReqPromise(Environment* env, bool use_bigint) : FSReqBase(env, env->fsreqpromise_constructor_template() - ->NewInstance(env->context()).ToLocalChecked(), + ->NewInstance(env->context()) + .ToLocalChecked(), AsyncWrap::PROVIDER_FSREQPROMISE, use_bigint), stats_field_array_(env->isolate(), kFsStatsFieldsNumber) { const auto resolver = - Promise::Resolver::New(env->context()).ToLocalChecked(); - USE(object()->Set(env->context(), env->promise_string(), - resolver).FromJust()); + Promise::Resolver::New(env->context()).ToLocalChecked(); + USE(object() + ->Set(env->context(), env->promise_string(), resolver) + .FromJust()); } ~FSReqPromise() override { @@ -259,9 +257,9 @@ class FSReqPromise : public FSReqBase { finished_ = true; HandleScope scope(env()->isolate()); InternalCallbackScope callback_scope(this); - Local value = - object()->Get(env()->context(), - env()->promise_string()).ToLocalChecked(); + Local value = object() + ->Get(env()->context(), env()->promise_string()) + .ToLocalChecked(); Local resolver = value.As(); USE(resolver->Reject(env()->context(), reject).FromJust()); } @@ -270,9 +268,9 @@ class FSReqPromise : public FSReqBase { finished_ = true; HandleScope scope(env()->isolate()); InternalCallbackScope callback_scope(this); - Local val = - object()->Get(env()->context(), - env()->promise_string()).ToLocalChecked(); + Local val = object() + ->Get(env()->context(), env()->promise_string()) + .ToLocalChecked(); Local resolver = val.As(); USE(resolver->Resolve(env()->context(), value).FromJust()); } @@ -283,9 +281,9 @@ class FSReqPromise : public FSReqBase { } void SetReturnValue(const FunctionCallbackInfo& args) override { - Local val = - object()->Get(env()->context(), - env()->promise_string()).ToLocalChecked(); + Local val = object() + ->Get(env()->context(), env()->promise_string()) + .ToLocalChecked(); Local resolver = val.As(); args.GetReturnValue().Set(resolver->GetPromise()); } @@ -410,12 +408,11 @@ class FileHandle : public AsyncWrap, public StreamBase { class CloseReq : public ReqWrap { public: - CloseReq(Environment* env, - Local promise, - Local ref) + CloseReq(Environment* env, Local promise, Local ref) : ReqWrap(env, env->fdclose_constructor_template() - ->NewInstance(env->context()).ToLocalChecked(), + ->NewInstance(env->context()) + .ToLocalChecked(), AsyncWrap::PROVIDER_FILEHANDLECLOSEREQ) { promise_.Reset(env->isolate(), promise); ref_.Reset(env->isolate(), ref); diff --git a/src/node_http2.cc b/src/node_http2.cc index 4e19432efbd3d6..5cac4985039445 100644 --- a/src/node_http2.cc +++ b/src/node_http2.cc @@ -1,8 +1,8 @@ +#include "node_http2.h" #include "aliased_buffer.h" #include "debug_utils.h" #include "node.h" #include "node_buffer.h" -#include "node_http2.h" #include "node_http2_state.h" #include "node_perf.h" #include "util.h" @@ -37,8 +37,7 @@ inline Http2Stream* GetStream(Http2Session* session, int32_t id, nghttp2_data_source* source) { Http2Stream* stream = static_cast(source->ptr); - if (stream == nullptr) - stream = session->FindStream(id); + if (stream == nullptr) stream = session->FindStream(id); CHECK_NOT_NULL(stream); CHECK_EQ(id, stream->id()); return stream; @@ -50,8 +49,7 @@ inline Http2Stream* GetStream(Http2Session* session, // two sets of callback functions, one that is used if a padding callback // is set, and other that does not include the padding callback. const Http2Session::Callbacks Http2Session::callback_struct_saved[2] = { - Callbacks(false), - Callbacks(true)}; + Callbacks(false), Callbacks(true)}; // The Http2Scope object is used to queue a write to the i/o stream. It is // used whenever any action is take on the underlying nghttp2 API that may @@ -67,11 +65,10 @@ const Http2Session::Callbacks Http2Session::callback_struct_saved[2] = { Http2Scope::Http2Scope(Http2Stream* stream) : Http2Scope(stream->session()) {} Http2Scope::Http2Scope(Http2Session* session) { - if (session == nullptr) - return; + if (session == nullptr) return; - if (session->flags_ & (SESSION_STATE_HAS_SCOPE | - SESSION_STATE_WRITE_SCHEDULED)) { + if (session->flags_ & + (SESSION_STATE_HAS_SCOPE | SESSION_STATE_WRITE_SCHEDULED)) { // There is another scope further below on the stack, or it is already // known that a write is scheduled. In either case, there is nothing to do. return; @@ -86,8 +83,7 @@ Http2Scope::Http2Scope(Http2Session* session) { } Http2Scope::~Http2Scope() { - if (session_ == nullptr) - return; + if (session_ == nullptr) return; session_->flags_ &= ~SESSION_STATE_HAS_SCOPE; session_->MaybeScheduleWrite(); @@ -125,28 +121,24 @@ Http2Options::Http2Options(Environment* env, nghttp2_session_type type) { if (flags & (1 << IDX_OPTIONS_MAX_DEFLATE_DYNAMIC_TABLE_SIZE)) { nghttp2_option_set_max_deflate_dynamic_table_size( - options_, - buffer[IDX_OPTIONS_MAX_DEFLATE_DYNAMIC_TABLE_SIZE]); + options_, buffer[IDX_OPTIONS_MAX_DEFLATE_DYNAMIC_TABLE_SIZE]); } if (flags & (1 << IDX_OPTIONS_MAX_RESERVED_REMOTE_STREAMS)) { nghttp2_option_set_max_reserved_remote_streams( - options_, - buffer[IDX_OPTIONS_MAX_RESERVED_REMOTE_STREAMS]); + options_, buffer[IDX_OPTIONS_MAX_RESERVED_REMOTE_STREAMS]); } if (flags & (1 << IDX_OPTIONS_MAX_SEND_HEADER_BLOCK_LENGTH)) { nghttp2_option_set_max_send_header_block_length( - options_, - buffer[IDX_OPTIONS_MAX_SEND_HEADER_BLOCK_LENGTH]); + options_, buffer[IDX_OPTIONS_MAX_SEND_HEADER_BLOCK_LENGTH]); } // Recommended default nghttp2_option_set_peer_max_concurrent_streams(options_, 100); if (flags & (1 << IDX_OPTIONS_PEER_MAX_CONCURRENT_STREAMS)) { nghttp2_option_set_peer_max_concurrent_streams( - options_, - buffer[IDX_OPTIONS_PEER_MAX_CONCURRENT_STREAMS]); + options_, buffer[IDX_OPTIONS_PEER_MAX_CONCURRENT_STREAMS]); } // The padding strategy sets the mechanism by which we determine how much @@ -154,9 +146,8 @@ Http2Options::Http2Options(Environment* env, nghttp2_session_type type) { // this is set on a per-session basis, but eventually we may switch to // a per-stream setting, giving users greater control if (flags & (1 << IDX_OPTIONS_PADDING_STRATEGY)) { - padding_strategy_type strategy = - static_cast( - buffer.GetValue(IDX_OPTIONS_PADDING_STRATEGY)); + padding_strategy_type strategy = static_cast( + buffer.GetValue(IDX_OPTIONS_PADDING_STRATEGY)); SetPaddingStrategy(strategy); } @@ -206,13 +197,11 @@ void Http2Session::Http2Settings::Init() { size_t n = 0; -#define GRABSETTING(N, trace) \ - if (flags & (1 << IDX_SETTINGS_##N)) { \ - uint32_t val = buffer[IDX_SETTINGS_##N]; \ - if (session_ != nullptr) \ - Debug(session_, "setting " trace ": %d\n", val); \ - entries_[n++] = \ - nghttp2_settings_entry {NGHTTP2_SETTINGS_##N, val}; \ +#define GRABSETTING(N, trace) \ + if (flags & (1 << IDX_SETTINGS_##N)) { \ + uint32_t val = buffer[IDX_SETTINGS_##N]; \ + if (session_ != nullptr) Debug(session_, "setting " trace ": %d\n", val); \ + entries_[n++] = nghttp2_settings_entry{NGHTTP2_SETTINGS_##N, val}; \ } GRABSETTING(HEADER_TABLE_SIZE, "header table size"); @@ -229,26 +218,26 @@ void Http2Session::Http2Settings::Init() { } Http2Session::Http2Settings::Http2Settings(Environment* env, - Http2Session* session, uint64_t start_time) - : AsyncWrap(env, - env->http2settings_constructor_template() - ->NewInstance(env->context()) - .ToLocalChecked(), - PROVIDER_HTTP2SETTINGS), - session_(session), - startTime_(start_time) { + Http2Session* session, + uint64_t start_time) + : AsyncWrap(env, + env->http2settings_constructor_template() + ->NewInstance(env->context()) + .ToLocalChecked(), + PROVIDER_HTTP2SETTINGS), + session_(session), + startTime_(start_time) { Init(); } - Http2Session::Http2Settings::Http2Settings(Environment* env) - : Http2Settings(env, nullptr, 0) {} + : Http2Settings(env, nullptr, 0) {} // The Http2Settings class is used to configure a SETTINGS frame that is // to be sent to the connected peer. The settings are set using a TypedArray // that is shared with the JavaScript side. Http2Session::Http2Settings::Http2Settings(Http2Session* session) - : Http2Settings(session->env(), session, uv_hrtime()) {} + : Http2Settings(session->env(), session, uv_hrtime()) {} // Generates a Buffer that contains the serialized payload of a SETTINGS // frame. This can be used, for instance, to create the Base64-encoded @@ -256,10 +245,8 @@ Http2Session::Http2Settings::Http2Settings(Http2Session* session) Local Http2Session::Http2Settings::Pack() { const size_t len = count_ * 6; Local buf = Buffer::New(env(), len).ToLocalChecked(); - ssize_t ret = - nghttp2_pack_settings_payload( - reinterpret_cast(Buffer::Data(buf)), len, - &entries_[0], count_); + ssize_t ret = nghttp2_pack_settings_payload( + reinterpret_cast(Buffer::Data(buf)), len, &entries_[0], count_); if (ret >= 0) return buf; else @@ -294,39 +281,33 @@ void Http2Session::Http2Settings::RefreshDefaults(Environment* env) { AliasedBuffer& buffer = env->http2_state()->settings_buffer; - buffer[IDX_SETTINGS_HEADER_TABLE_SIZE] = - DEFAULT_SETTINGS_HEADER_TABLE_SIZE; - buffer[IDX_SETTINGS_ENABLE_PUSH] = - DEFAULT_SETTINGS_ENABLE_PUSH; + buffer[IDX_SETTINGS_HEADER_TABLE_SIZE] = DEFAULT_SETTINGS_HEADER_TABLE_SIZE; + buffer[IDX_SETTINGS_ENABLE_PUSH] = DEFAULT_SETTINGS_ENABLE_PUSH; buffer[IDX_SETTINGS_INITIAL_WINDOW_SIZE] = DEFAULT_SETTINGS_INITIAL_WINDOW_SIZE; - buffer[IDX_SETTINGS_MAX_FRAME_SIZE] = - DEFAULT_SETTINGS_MAX_FRAME_SIZE; + buffer[IDX_SETTINGS_MAX_FRAME_SIZE] = DEFAULT_SETTINGS_MAX_FRAME_SIZE; buffer[IDX_SETTINGS_MAX_HEADER_LIST_SIZE] = DEFAULT_SETTINGS_MAX_HEADER_LIST_SIZE; - buffer[IDX_SETTINGS_COUNT] = - (1 << IDX_SETTINGS_HEADER_TABLE_SIZE) | - (1 << IDX_SETTINGS_ENABLE_PUSH) | - (1 << IDX_SETTINGS_INITIAL_WINDOW_SIZE) | - (1 << IDX_SETTINGS_MAX_FRAME_SIZE) | - (1 << IDX_SETTINGS_MAX_HEADER_LIST_SIZE); + buffer[IDX_SETTINGS_COUNT] = (1 << IDX_SETTINGS_HEADER_TABLE_SIZE) | + (1 << IDX_SETTINGS_ENABLE_PUSH) | + (1 << IDX_SETTINGS_INITIAL_WINDOW_SIZE) | + (1 << IDX_SETTINGS_MAX_FRAME_SIZE) | + (1 << IDX_SETTINGS_MAX_HEADER_LIST_SIZE); } - void Http2Session::Http2Settings::Send() { Http2Scope h2scope(session_); - CHECK_EQ(nghttp2_submit_settings(**session_, NGHTTP2_FLAG_NONE, - &entries_[0], count_), 0); + CHECK_EQ(nghttp2_submit_settings( + **session_, NGHTTP2_FLAG_NONE, &entries_[0], count_), + 0); } void Http2Session::Http2Settings::Done(bool ack) { uint64_t end = uv_hrtime(); double duration = (end - startTime_) / 1e6; - Local argv[2] = { - Boolean::New(env()->isolate(), ack), - Number::New(env()->isolate(), duration) - }; + Local argv[2] = {Boolean::New(env()->isolate(), ack), + Number::New(env()->isolate(), duration)}; MakeCallback(env()->ondone_string(), arraysize(argv), argv); delete this; } @@ -342,17 +323,21 @@ Http2Priority::Http2Priority(Environment* env, int32_t parent_ = parent->Int32Value(context).ToChecked(); int32_t weight_ = weight->Int32Value(context).ToChecked(); bool exclusive_ = exclusive->BooleanValue(env->isolate()); - Debug(env, DebugCategory::HTTP2STREAM, + Debug(env, + DebugCategory::HTTP2STREAM, "Http2Priority: parent: %d, weight: %d, exclusive: %d\n", - parent_, weight_, exclusive_); + parent_, + weight_, + exclusive_); nghttp2_priority_spec_init(&spec, parent_, weight_, exclusive_ ? 1 : 0); } - const char* Http2Session::TypeName() const { switch (session_type_) { - case NGHTTP2_SESSION_SERVER: return "server"; - case NGHTTP2_SESSION_CLIENT: return "client"; + case NGHTTP2_SESSION_SERVER: + return "server"; + case NGHTTP2_SESSION_CLIENT: + return "client"; default: // This should never happen ABORT(); @@ -422,7 +407,8 @@ Headers::Headers(Isolate* isolate, Origins::Origins(Isolate* isolate, Local context, Local origin_string, - size_t origin_count) : count_(origin_count) { + size_t origin_count) + : count_(origin_count) { int origin_string_len = origin_string->Length(); if (count_ == 0) { CHECK_EQ(origin_string_len, 0); @@ -437,21 +423,20 @@ Origins::Origins(Isolate* isolate, origin_string_len); // Make sure the start address is aligned appropriately for an nghttp2_nv*. - char* start = reinterpret_cast( - RoundUp(reinterpret_cast(*buf_), - alignof(nghttp2_origin_entry))); + char* start = reinterpret_cast(RoundUp( + reinterpret_cast(*buf_), alignof(nghttp2_origin_entry))); char* origin_contents = start + (count_ * sizeof(nghttp2_origin_entry)); nghttp2_origin_entry* const nva = reinterpret_cast(start); CHECK_LE(origin_contents + origin_string_len, *buf_ + buf_.length()); - CHECK_EQ(origin_string->WriteOneByte( - isolate, - reinterpret_cast(origin_contents), - 0, - origin_string_len, - String::NO_NULL_TERMINATION), - origin_string_len); + CHECK_EQ( + origin_string->WriteOneByte(isolate, + reinterpret_cast(origin_contents), + 0, + origin_string_len, + String::NO_NULL_TERMINATION), + origin_string_len); size_t n = 0; char* p; @@ -476,35 +461,31 @@ Http2Session::Callbacks::Callbacks(bool kHasGetPaddingCallback) { CHECK_EQ(nghttp2_session_callbacks_new(&callbacks), 0); nghttp2_session_callbacks_set_on_begin_headers_callback( - callbacks, OnBeginHeadersCallback); - nghttp2_session_callbacks_set_on_header_callback2( - callbacks, OnHeaderCallback); - nghttp2_session_callbacks_set_on_frame_recv_callback( - callbacks, OnFrameReceive); - nghttp2_session_callbacks_set_on_stream_close_callback( - callbacks, OnStreamClose); + callbacks, OnBeginHeadersCallback); + nghttp2_session_callbacks_set_on_header_callback2(callbacks, + OnHeaderCallback); + nghttp2_session_callbacks_set_on_frame_recv_callback(callbacks, + OnFrameReceive); + nghttp2_session_callbacks_set_on_stream_close_callback(callbacks, + OnStreamClose); nghttp2_session_callbacks_set_on_data_chunk_recv_callback( - callbacks, OnDataChunkReceived); - nghttp2_session_callbacks_set_on_frame_not_send_callback( - callbacks, OnFrameNotSent); - nghttp2_session_callbacks_set_on_invalid_header_callback2( - callbacks, OnInvalidHeader); - nghttp2_session_callbacks_set_error_callback( - callbacks, OnNghttpError); - nghttp2_session_callbacks_set_send_data_callback( - callbacks, OnSendData); - nghttp2_session_callbacks_set_on_invalid_frame_recv_callback( - callbacks, OnInvalidFrame); - nghttp2_session_callbacks_set_on_frame_send_callback( - callbacks, OnFrameSent); + callbacks, OnDataChunkReceived); + nghttp2_session_callbacks_set_on_frame_not_send_callback(callbacks, + OnFrameNotSent); + nghttp2_session_callbacks_set_on_invalid_header_callback2(callbacks, + OnInvalidHeader); + nghttp2_session_callbacks_set_error_callback(callbacks, OnNghttpError); + nghttp2_session_callbacks_set_send_data_callback(callbacks, OnSendData); + nghttp2_session_callbacks_set_on_invalid_frame_recv_callback(callbacks, + OnInvalidFrame); + nghttp2_session_callbacks_set_on_frame_send_callback(callbacks, OnFrameSent); if (kHasGetPaddingCallback) { - nghttp2_session_callbacks_set_select_padding_callback( - callbacks, OnSelectPadding); + nghttp2_session_callbacks_set_select_padding_callback(callbacks, + OnSelectPadding); } } - Http2Session::Callbacks::~Callbacks() { nghttp2_session_callbacks_del(callbacks); } @@ -513,7 +494,7 @@ Http2Session::Callbacks::~Callbacks() { class Http2Session::MemoryAllocatorInfo { public: explicit MemoryAllocatorInfo(Http2Session* session) - : info({ session, H2Malloc, H2Free, H2Calloc, H2Realloc }) {} + : info({session, H2Malloc, H2Free, H2Calloc, H2Realloc}) {} static void* H2Malloc(size_t size, void* user_data) { return H2Realloc(nullptr, size, user_data); @@ -522,8 +503,7 @@ class Http2Session::MemoryAllocatorInfo { static void* H2Calloc(size_t nmemb, size_t size, void* user_data) { size_t real_size = MultiplyWithOverflowCheck(nmemb, size); void* mem = H2Malloc(real_size, user_data); - if (mem != nullptr) - memset(mem, 0, real_size); + if (mem != nullptr) memset(mem, 0, real_size); return mem; } @@ -550,8 +530,7 @@ class Http2Session::MemoryAllocatorInfo { if (previous_size == 0) { // Fall back to the standard Realloc() function. char* ret = UncheckedRealloc(original_ptr, size); - if (ret != nullptr) - ret += sizeof(size_t); + if (ret != nullptr) ret += sizeof(size_t); return ret; } } @@ -580,8 +559,8 @@ class Http2Session::MemoryAllocatorInfo { } static void StopTracking(Http2Session* session, void* ptr) { - size_t* original_ptr = reinterpret_cast( - static_cast(ptr) - sizeof(size_t)); + size_t* original_ptr = + reinterpret_cast(static_cast(ptr) - sizeof(size_t)); session->current_nghttp2_memory_ -= *original_ptr; *original_ptr = 0; } @@ -611,23 +590,21 @@ Http2Session::Http2Session(Environment* env, uint32_t maxHeaderPairs = opts.GetMaxHeaderPairs(); max_header_pairs_ = type == NGHTTP2_SESSION_SERVER - ? std::max(maxHeaderPairs, 4U) // minimum # of request headers - : std::max(maxHeaderPairs, 1U); // minimum # of response headers + ? std::max(maxHeaderPairs, 4U) // minimum # of request headers + : std::max(maxHeaderPairs, 1U); // minimum # of response headers max_outstanding_pings_ = opts.GetMaxOutstandingPings(); max_outstanding_settings_ = opts.GetMaxOutstandingSettings(); padding_strategy_ = opts.GetPaddingStrategy(); - bool hasGetPaddingCallback = - padding_strategy_ != PADDING_STRATEGY_NONE; + bool hasGetPaddingCallback = padding_strategy_ != PADDING_STRATEGY_NONE; - nghttp2_session_callbacks* callbacks - = callback_struct_saved[hasGetPaddingCallback ? 1 : 0].callbacks; + nghttp2_session_callbacks* callbacks = + callback_struct_saved[hasGetPaddingCallback ? 1 : 0].callbacks; - auto fn = type == NGHTTP2_SESSION_SERVER ? - nghttp2_session_server_new3 : - nghttp2_session_client_new3; + auto fn = type == NGHTTP2_SESSION_SERVER ? nghttp2_session_server_new3 + : nghttp2_session_client_new3; MemoryAllocatorInfo allocator_info(this); @@ -645,15 +622,14 @@ Http2Session::Http2Session(Environment* env, Http2Session::~Http2Session() { CHECK_EQ(flags_ & SESSION_STATE_HAS_SCOPE, 0); Debug(this, "freeing nghttp2 session"); - for (const auto& iter : streams_) - iter.second->session_ = nullptr; + for (const auto& iter : streams_) iter.second->session_ = nullptr; nghttp2_session_del(session_); CHECK_EQ(current_nghttp2_memory_, 0); } std::string Http2Session::diagnostic_name() const { return std::string("Http2Session ") + TypeName() + " (" + - std::to_string(static_cast(get_async_id())) + ")"; + std::to_string(static_cast(get_async_id())) + ")"; } inline bool HasHttp2Observer(Environment* env) { @@ -663,86 +639,85 @@ inline bool HasHttp2Observer(Environment* env) { } void Http2Stream::EmitStatistics() { - if (!HasHttp2Observer(env())) - return; + if (!HasHttp2Observer(env())) return; Http2StreamPerformanceEntry* entry = - new Http2StreamPerformanceEntry(env(), id_, statistics_); - env()->SetImmediate([](Environment* env, void* data) { - // This takes ownership, the entry is destroyed at the end of this scope. - std::unique_ptr entry { - static_cast(data) }; - if (!HasHttp2Observer(env)) - return; - HandleScope handle_scope(env->isolate()); - AliasedBuffer& buffer = - env->http2_state()->stream_stats_buffer; - buffer[IDX_STREAM_STATS_ID] = entry->id(); - if (entry->first_byte() != 0) { - buffer[IDX_STREAM_STATS_TIMETOFIRSTBYTE] = - (entry->first_byte() - entry->startTimeNano()) / 1e6; - } else { - buffer[IDX_STREAM_STATS_TIMETOFIRSTBYTE] = 0; - } - if (entry->first_header() != 0) { - buffer[IDX_STREAM_STATS_TIMETOFIRSTHEADER] = - (entry->first_header() - entry->startTimeNano()) / 1e6; - } else { - buffer[IDX_STREAM_STATS_TIMETOFIRSTHEADER] = 0; - } - if (entry->first_byte_sent() != 0) { - buffer[IDX_STREAM_STATS_TIMETOFIRSTBYTESENT] = - (entry->first_byte_sent() - entry->startTimeNano()) / 1e6; - } else { - buffer[IDX_STREAM_STATS_TIMETOFIRSTBYTESENT] = 0; - } - buffer[IDX_STREAM_STATS_SENTBYTES] = entry->sent_bytes(); - buffer[IDX_STREAM_STATS_RECEIVEDBYTES] = entry->received_bytes(); - Local obj; - if (entry->ToObject().ToLocal(&obj)) entry->Notify(obj); - }, static_cast(entry)); + new Http2StreamPerformanceEntry(env(), id_, statistics_); + env()->SetImmediate( + [](Environment* env, void* data) { + // This takes ownership, the entry is destroyed at the end of this + // scope. + std::unique_ptr entry{ + static_cast(data)}; + if (!HasHttp2Observer(env)) return; + HandleScope handle_scope(env->isolate()); + AliasedBuffer& buffer = + env->http2_state()->stream_stats_buffer; + buffer[IDX_STREAM_STATS_ID] = entry->id(); + if (entry->first_byte() != 0) { + buffer[IDX_STREAM_STATS_TIMETOFIRSTBYTE] = + (entry->first_byte() - entry->startTimeNano()) / 1e6; + } else { + buffer[IDX_STREAM_STATS_TIMETOFIRSTBYTE] = 0; + } + if (entry->first_header() != 0) { + buffer[IDX_STREAM_STATS_TIMETOFIRSTHEADER] = + (entry->first_header() - entry->startTimeNano()) / 1e6; + } else { + buffer[IDX_STREAM_STATS_TIMETOFIRSTHEADER] = 0; + } + if (entry->first_byte_sent() != 0) { + buffer[IDX_STREAM_STATS_TIMETOFIRSTBYTESENT] = + (entry->first_byte_sent() - entry->startTimeNano()) / 1e6; + } else { + buffer[IDX_STREAM_STATS_TIMETOFIRSTBYTESENT] = 0; + } + buffer[IDX_STREAM_STATS_SENTBYTES] = entry->sent_bytes(); + buffer[IDX_STREAM_STATS_RECEIVEDBYTES] = entry->received_bytes(); + Local obj; + if (entry->ToObject().ToLocal(&obj)) entry->Notify(obj); + }, + static_cast(entry)); } void Http2Session::EmitStatistics() { - if (!HasHttp2Observer(env())) - return; + if (!HasHttp2Observer(env())) return; Http2SessionPerformanceEntry* entry = - new Http2SessionPerformanceEntry(env(), statistics_, session_type_); - env()->SetImmediate([](Environment* env, void* data) { - // This takes ownership, the entr is destroyed at the end of this scope. - std::unique_ptr entry { - static_cast(data) }; - if (!HasHttp2Observer(env)) - return; - HandleScope handle_scope(env->isolate()); - AliasedBuffer& buffer = - env->http2_state()->session_stats_buffer; - buffer[IDX_SESSION_STATS_TYPE] = entry->type(); - buffer[IDX_SESSION_STATS_PINGRTT] = entry->ping_rtt() / 1e6; - buffer[IDX_SESSION_STATS_FRAMESRECEIVED] = entry->frame_count(); - buffer[IDX_SESSION_STATS_FRAMESSENT] = entry->frame_sent(); - buffer[IDX_SESSION_STATS_STREAMCOUNT] = entry->stream_count(); - buffer[IDX_SESSION_STATS_STREAMAVERAGEDURATION] = - entry->stream_average_duration(); - buffer[IDX_SESSION_STATS_DATA_SENT] = entry->data_sent(); - buffer[IDX_SESSION_STATS_DATA_RECEIVED] = entry->data_received(); - buffer[IDX_SESSION_STATS_MAX_CONCURRENT_STREAMS] = - entry->max_concurrent_streams(); - Local obj; - if (entry->ToObject().ToLocal(&obj)) entry->Notify(obj); - }, static_cast(entry)); + new Http2SessionPerformanceEntry(env(), statistics_, session_type_); + env()->SetImmediate( + [](Environment* env, void* data) { + // This takes ownership, the entr is destroyed at the end of this scope. + std::unique_ptr entry{ + static_cast(data)}; + if (!HasHttp2Observer(env)) return; + HandleScope handle_scope(env->isolate()); + AliasedBuffer& buffer = + env->http2_state()->session_stats_buffer; + buffer[IDX_SESSION_STATS_TYPE] = entry->type(); + buffer[IDX_SESSION_STATS_PINGRTT] = entry->ping_rtt() / 1e6; + buffer[IDX_SESSION_STATS_FRAMESRECEIVED] = entry->frame_count(); + buffer[IDX_SESSION_STATS_FRAMESSENT] = entry->frame_sent(); + buffer[IDX_SESSION_STATS_STREAMCOUNT] = entry->stream_count(); + buffer[IDX_SESSION_STATS_STREAMAVERAGEDURATION] = + entry->stream_average_duration(); + buffer[IDX_SESSION_STATS_DATA_SENT] = entry->data_sent(); + buffer[IDX_SESSION_STATS_DATA_RECEIVED] = entry->data_received(); + buffer[IDX_SESSION_STATS_MAX_CONCURRENT_STREAMS] = + entry->max_concurrent_streams(); + Local obj; + if (entry->ToObject().ToLocal(&obj)) entry->Notify(obj); + }, + static_cast(entry)); } // Closes the session and frees the associated resources void Http2Session::Close(uint32_t code, bool socket_closed) { Debug(this, "closing session"); - if (flags_ & SESSION_STATE_CLOSING) - return; + if (flags_ & SESSION_STATE_CLOSING) return; flags_ |= SESSION_STATE_CLOSING; // Stop reading on the i/o stream - if (stream_ != nullptr) - stream_->ReadStop(); + if (stream_ != nullptr) stream_->ReadStop(); // If the socket is not closed, then attempt to send a closing GOAWAY // frame. There is no guarantee that this GOAWAY will be received by @@ -763,9 +738,11 @@ void Http2Session::Close(uint32_t code, bool socket_closed) { // javascript since this may be called during garbage collection. while (!outstanding_pings_.empty()) { Http2Session::Http2Ping* ping = PopPing(); - env()->SetImmediate([](Environment* env, void* data) { - static_cast(data)->Done(false); - }, static_cast(ping)); + env()->SetImmediate( + [](Environment* env, void* data) { + static_cast(data)->Done(false); + }, + static_cast(ping)); } statistics_.end_time = uv_hrtime(); @@ -780,9 +757,8 @@ inline Http2Stream* Http2Session::FindStream(int32_t id) { } inline bool Http2Session::CanAddStream() { - uint32_t maxConcurrentStreams = - nghttp2_session_get_local_settings( - session_, NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS); + uint32_t maxConcurrentStreams = nghttp2_session_get_local_settings( + session_, NGHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS); size_t maxSize = std::min(streams_.max_size(), static_cast(maxConcurrentStreams)); // We can add a new stream so long as we are less than the current @@ -800,7 +776,6 @@ inline void Http2Session::AddStream(Http2Stream* stream) { IncrementCurrentSessionMemory(sizeof(*stream)); } - inline void Http2Session::RemoveStream(Http2Stream* stream) { if (streams_.empty() || stream == nullptr) return; // Nothing to remove, item was never added? @@ -839,8 +814,7 @@ ssize_t Http2Session::OnMaxFrameSizePadding(size_t frameLen, // to determine the amount of padding for the current frame. This option is // rather more expensive because of the JS boundary cross. It generally should // not be the preferred option. -ssize_t Http2Session::OnCallbackPadding(size_t frameLen, - size_t maxPayloadLen) { +ssize_t Http2Session::OnCallbackPadding(size_t frameLen, size_t maxPayloadLen) { if (frameLen == 0) return 0; Debug(this, "using callback to determine padding"); Isolate* isolate = env()->isolate(); @@ -861,7 +835,6 @@ ssize_t Http2Session::OnCallbackPadding(size_t frameLen, return retval; } - // Write data received from the i/o stream to the underlying nghttp2_session. // On each call to nghttp2_session_mem_recv, nghttp2 will begin calling the // various callback functions. Each of these will typically result in a call @@ -873,17 +846,15 @@ ssize_t Http2Session::Write(const uv_buf_t* bufs, size_t nbufs) { // will trigger a number of other callbacks. Those will, in turn have // multiple side effects. for (size_t n = 0; n < nbufs; n++) { - Debug(this, "receiving %d bytes [wants data? %d]", + Debug(this, + "receiving %d bytes [wants data? %d]", bufs[n].len, nghttp2_session_want_read(session_)); - ssize_t ret = - nghttp2_session_mem_recv(session_, - reinterpret_cast(bufs[n].base), - bufs[n].len); + ssize_t ret = nghttp2_session_mem_recv( + session_, reinterpret_cast(bufs[n].base), bufs[n].len); CHECK_NE(ret, NGHTTP2_ERR_NOMEM); - if (ret < 0) - return ret; + if (ret < 0) return ret; total += ret; } @@ -894,15 +865,13 @@ ssize_t Http2Session::Write(const uv_buf_t* bufs, size_t nbufs) { return total; } - inline int32_t GetFrameID(const nghttp2_frame* frame) { // If this is a push promise, we want to grab the id of the promised stream - return (frame->hd.type == NGHTTP2_PUSH_PROMISE) ? - frame->push_promise.promised_stream_id : - frame->hd.stream_id; + return (frame->hd.type == NGHTTP2_PUSH_PROMISE) + ? frame->push_promise.promised_stream_id + : frame->hd.stream_id; } - // Called by nghttp2 at the start of receiving a HEADERS frame. We use this // callback to determine if a new stream is being created or if we are simply // adding a new block of headers to an existing stream. The header pairs @@ -920,8 +889,8 @@ int Http2Session::OnBeginHeadersCallback(nghttp2_session* handle, if (LIKELY(stream == nullptr)) { if (UNLIKELY(!session->CanAddStream())) { // Too many concurrent streams being opened - nghttp2_submit_rst_stream(**session, NGHTTP2_FLAG_NONE, id, - NGHTTP2_ENHANCE_YOUR_CALM); + nghttp2_submit_rst_stream( + **session, NGHTTP2_FLAG_NONE, id, NGHTTP2_ENHANCE_YOUR_CALM); return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE; } new Http2Stream(session, id, frame->headers.cat); @@ -946,8 +915,7 @@ int Http2Session::OnHeaderCallback(nghttp2_session* handle, // If stream is null at this point, either something odd has happened // or the stream was closed locally while header processing was occurring. // either way, do not proceed and close the stream. - if (UNLIKELY(stream == nullptr)) - return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE; + if (UNLIKELY(stream == nullptr)) return NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE; // If the stream has already been destroyed, ignore. if (!stream->IsDestroyed() && !stream->AddHeader(name, value, flags)) { @@ -959,7 +927,6 @@ int Http2Session::OnHeaderCallback(nghttp2_session* handle, return 0; } - // Called by nghttp2 when a complete HTTP2 frame has been received. There are // only a handful of frame types that we care about handling here. int Http2Session::OnFrameReceive(nghttp2_session* handle, @@ -967,8 +934,7 @@ int Http2Session::OnFrameReceive(nghttp2_session* handle, void* user_data) { Http2Session* session = static_cast(user_data); session->statistics_.frame_count++; - Debug(session, "complete frame received: type: %d", - frame->hd.type); + Debug(session, "complete frame received: type: %d", frame->hd.type); switch (frame->hd.type) { case NGHTTP2_DATA: session->HandleDataFrame(frame); @@ -1036,8 +1002,10 @@ int Http2Session::OnFrameNotSent(nghttp2_session* handle, void* user_data) { Http2Session* session = static_cast(user_data); Environment* env = session->env(); - Debug(session, "frame type %d was not sent, code: %d", - frame->hd.type, error_code); + Debug(session, + "frame type %d was not sent, code: %d", + frame->hd.type, + error_code); // Do not report if the frame was not sent due to the session closing if (error_code == NGHTTP2_ERR_SESSION_CLOSING || @@ -1051,14 +1019,11 @@ int Http2Session::OnFrameNotSent(nghttp2_session* handle, Local context = env->context(); Context::Scope context_scope(context); - Local argv[3] = { - Integer::New(isolate, frame->hd.stream_id), - Integer::New(isolate, frame->hd.type), - Integer::New(isolate, error_code) - }; + Local argv[3] = {Integer::New(isolate, frame->hd.stream_id), + Integer::New(isolate, frame->hd.type), + Integer::New(isolate, error_code)}; session->MakeCallback( - env->http2session_on_frame_error_function(), - arraysize(argv), argv); + env->http2session_on_frame_error_function(), arraysize(argv), argv); return 0; } @@ -1085,8 +1050,7 @@ int Http2Session::OnStreamClose(nghttp2_session* handle, Http2Stream* stream = session->FindStream(id); // Intentionally ignore the callback if the stream does not exist or has // already been destroyed - if (stream == nullptr || stream->IsDestroyed()) - return 0; + if (stream == nullptr || stream->IsDestroyed()) return 0; stream->Close(code); @@ -1094,9 +1058,8 @@ int Http2Session::OnStreamClose(nghttp2_session* handle, // ever passed on to the javascript side. If that happens, the callback // will return false. Local arg = Integer::NewFromUnsigned(isolate, code); - MaybeLocal answer = - stream->MakeCallback(env->http2session_on_stream_close_function(), - 1, &arg); + MaybeLocal answer = stream->MakeCallback( + env->http2session_on_stream_close_function(), 1, &arg); if (answer.IsEmpty() || !(answer.ToLocalChecked()->BooleanValue(env->isolate()))) { // Skip to destroy @@ -1130,15 +1093,18 @@ int Http2Session::OnDataChunkReceived(nghttp2_session* handle, size_t len, void* user_data) { Http2Session* session = static_cast(user_data); - Debug(session, "buffering data chunk for stream %d, size: " - "%d, flags: %d", id, len, flags); + Debug(session, + "buffering data chunk for stream %d, size: " + "%d, flags: %d", + id, + len, + flags); Environment* env = session->env(); HandleScope scope(env->isolate()); // We should never actually get a 0-length chunk so this check is // only a precaution at this point. - if (len == 0) - return 0; + if (len == 0) return 0; // Notify nghttp2 that we've consumed a chunk of data on the connection // so that it can send a WINDOW_UPDATE frame. This is a critical part of @@ -1146,8 +1112,7 @@ int Http2Session::OnDataChunkReceived(nghttp2_session* handle, CHECK_EQ(nghttp2_session_consume_connection(handle, len), 0); Http2Stream* stream = session->FindStream(id); // If the stream has been destroyed, ignore this chunk - if (stream->IsDestroyed()) - return 0; + if (stream->IsDestroyed()) return 0; stream->statistics_.received_bytes += len; @@ -1159,8 +1124,7 @@ int Http2Session::OnDataChunkReceived(nghttp2_session* handle, do { uv_buf_t buf = stream->EmitAlloc(len); ssize_t avail = len; - if (static_cast(buf.len) < avail) - avail = buf.len; + if (static_cast(buf.len) < avail) avail = buf.len; // `buf.base == nullptr` is the default Http2StreamListener's way // of saying that it wants a pointer to the raw original. @@ -1213,9 +1177,10 @@ ssize_t Http2Session::OnSelectPadding(nghttp2_session* handle, return padding; } -#define BAD_PEER_MESSAGE "Remote peer returned unexpected data while we " \ - "expected SETTINGS frame. Perhaps, peer does not " \ - "support HTTP/2 properly." +#define BAD_PEER_MESSAGE \ + "Remote peer returned unexpected data while we " \ + "expected SETTINGS frame. Perhaps, peer does not " \ + "support HTTP/2 properly." // We use this currently to determine when an attempt is made to use the http2 // protocol with a non-http2 peer. @@ -1271,7 +1236,6 @@ void Http2StreamListener::OnStreamRead(ssize_t nread, const uv_buf_t& buf) { stream->CallJSOnreadMethod(nread, session->stream_buf_ab_, offset); } - // Called by OnFrameReceived to notify JavaScript land that a complete // HEADERS frame has been received and processed. This method converts the // received headers into a JavaScript array and pushes those out to JS. @@ -1286,8 +1250,7 @@ void Http2Session::HandleHeadersFrame(const nghttp2_frame* frame) { Http2Stream* stream = FindStream(id); // If the stream has already been destroyed, ignore. - if (stream->IsDestroyed()) - return; + if (stream->IsDestroyed()) return; std::vector headers(stream->move_headers()); @@ -1318,11 +1281,10 @@ void Http2Session::HandleHeadersFrame(const nghttp2_frame* frame) { Integer::New(isolate, stream->headers_category()), Integer::New(isolate, frame->hd.flags), Array::New(isolate, headers_v.data(), headers_size * 2)}; - MakeCallback(env()->http2session_on_headers_function(), - arraysize(args), args); + MakeCallback( + env()->http2session_on_headers_function(), arraysize(args), args); } - // Called by OnFrameReceived when a complete PRIORITY frame has been // received. Notifies JS land about the priority change. Note that priorities // are considered advisory only, so this has no real effect other than to @@ -1339,17 +1301,14 @@ void Http2Session::HandlePriorityFrame(const nghttp2_frame* frame) { // Priority frame stream ID should never be <= 0. nghttp2 handles this for us nghttp2_priority_spec spec = priority_frame.pri_spec; - Local argv[4] = { - Integer::New(isolate, id), - Integer::New(isolate, spec.stream_id), - Integer::New(isolate, spec.weight), - Boolean::New(isolate, spec.exclusive) - }; - MakeCallback(env()->http2session_on_priority_function(), - arraysize(argv), argv); + Local argv[4] = {Integer::New(isolate, id), + Integer::New(isolate, spec.stream_id), + Integer::New(isolate, spec.weight), + Boolean::New(isolate, spec.exclusive)}; + MakeCallback( + env()->http2session_on_priority_function(), arraysize(argv), argv); } - // Called by OnFrameReceived when a complete DATA frame has been received. // If we know that this was the last DATA frame (because the END_STREAM flag // is set), then we'll terminate the readable side of the StreamBase. @@ -1362,7 +1321,6 @@ void Http2Session::HandleDataFrame(const nghttp2_frame* frame) { stream->EmitRead(UV_EOF); } - // Called by OnFrameReceived when a complete GOAWAY frame has been received. void Http2Session::HandleGoawayFrame(const nghttp2_frame* frame) { Isolate* isolate = env()->isolate(); @@ -1374,20 +1332,20 @@ void Http2Session::HandleGoawayFrame(const nghttp2_frame* frame) { Debug(this, "handling goaway frame"); Local argv[3] = { - Integer::NewFromUnsigned(isolate, goaway_frame.error_code), - Integer::New(isolate, goaway_frame.last_stream_id), - Undefined(isolate) - }; + Integer::NewFromUnsigned(isolate, goaway_frame.error_code), + Integer::New(isolate, goaway_frame.last_stream_id), + Undefined(isolate)}; size_t length = goaway_frame.opaque_data_len; if (length > 0) { - argv[2] = Buffer::Copy(isolate, - reinterpret_cast(goaway_frame.opaque_data), - length).ToLocalChecked(); + argv[2] = + Buffer::Copy( + isolate, reinterpret_cast(goaway_frame.opaque_data), length) + .ToLocalChecked(); } - MakeCallback(env()->http2session_on_goaway_data_function(), - arraysize(argv), argv); + MakeCallback( + env()->http2session_on_goaway_data_function(), arraysize(argv), argv); } // Called by OnFrameReceived when a complete ALTSVC frame has been received. @@ -1404,19 +1362,18 @@ void Http2Session::HandleAltSvcFrame(const nghttp2_frame* frame) { Debug(this, "handling altsvc frame"); Local argv[3] = { - Integer::New(isolate, id), - String::NewFromOneByte(isolate, - altsvc->origin, - NewStringType::kNormal, - altsvc->origin_len).ToLocalChecked(), - String::NewFromOneByte(isolate, - altsvc->field_value, - NewStringType::kNormal, - altsvc->field_value_len).ToLocalChecked(), + Integer::New(isolate, id), + String::NewFromOneByte( + isolate, altsvc->origin, NewStringType::kNormal, altsvc->origin_len) + .ToLocalChecked(), + String::NewFromOneByte(isolate, + altsvc->field_value, + NewStringType::kNormal, + altsvc->field_value_len) + .ToLocalChecked(), }; - MakeCallback(env()->http2session_on_altsvc_function(), - arraysize(argv), argv); + MakeCallback(env()->http2session_on_altsvc_function(), arraysize(argv), argv); } void Http2Session::HandleOriginFrame(const nghttp2_frame* frame) { @@ -1471,9 +1428,9 @@ void Http2Session::HandlePingFrame(const nghttp2_frame* frame) { } // Notify the session that a ping occurred - arg = Buffer::Copy(env(), - reinterpret_cast(frame->ping.opaque_data), - 8).ToLocalChecked(); + arg = Buffer::Copy( + env(), reinterpret_cast(frame->ping.opaque_data), 8) + .ToLocalChecked(); MakeCallback(env()->http2session_on_ping_function(), 1, &arg); } @@ -1529,37 +1486,38 @@ void Http2Session::OnStreamAfterWrite(WriteWrap* w, int status) { // queue), but only if a write has not already been scheduled. void Http2Session::MaybeScheduleWrite() { CHECK_EQ(flags_ & SESSION_STATE_WRITE_SCHEDULED, 0); - if (UNLIKELY(session_ == nullptr)) - return; + if (UNLIKELY(session_ == nullptr)) return; if (nghttp2_session_want_write(session_)) { HandleScope handle_scope(env()->isolate()); Debug(this, "scheduling write"); flags_ |= SESSION_STATE_WRITE_SCHEDULED; - env()->SetImmediate([](Environment* env, void* data) { - Http2Session* session = static_cast(data); - if (session->session_ == nullptr || - !(session->flags_ & SESSION_STATE_WRITE_SCHEDULED)) { - // This can happen e.g. when a stream was reset before this turn - // of the event loop, in which case SendPendingData() is called early, - // or the session was destroyed in the meantime. - return; - } - - // Sending data may call arbitrary JS code, so keep track of - // async context. - HandleScope handle_scope(env->isolate()); - InternalCallbackScope callback_scope(session); - session->SendPendingData(); - }, static_cast(this), object()); + env()->SetImmediate( + [](Environment* env, void* data) { + Http2Session* session = static_cast(data); + if (session->session_ == nullptr || + !(session->flags_ & SESSION_STATE_WRITE_SCHEDULED)) { + // This can happen e.g. when a stream was reset before this turn + // of the event loop, in which case SendPendingData() is called + // early, or the session was destroyed in the meantime. + return; + } + + // Sending data may call arbitrary JS code, so keep track of + // async context. + HandleScope handle_scope(env->isolate()); + InternalCallbackScope callback_scope(session); + session->SendPendingData(); + }, + static_cast(this), + object()); } } void Http2Session::MaybeStopReading() { int want_read = nghttp2_session_want_read(session_); Debug(this, "wants read? %d", want_read); - if (want_read == 0) - stream_->ReadStop(); + if (want_read == 0) stream_->ReadStop(); } // Unset the sending state, finish up all current writes, and reset @@ -1595,8 +1553,7 @@ void Http2Session::ClearOutgoing(int status) { for (int32_t stream_id : current_pending_rst_streams) { Http2Stream* stream = FindStream(stream_id); - if (LIKELY(stream != nullptr)) - stream->FlushRstStream(); + if (LIKELY(stream != nullptr)) stream->FlushRstStream(); } } } @@ -1613,9 +1570,8 @@ void Http2Session::CopyDataIntoOutgoing(const uint8_t* src, size_t src_length) { // of the outgoing_buffers_ vector may invalidate the pointer. // The correct base pointers will be set later, before writing to the // underlying socket. - outgoing_buffers_.emplace_back(nghttp2_stream_write { - uv_buf_init(nullptr, src_length) - }); + outgoing_buffers_.emplace_back( + nghttp2_stream_write{uv_buf_init(nullptr, src_length)}); } // Prompts nghttp2 to begin serializing it's pending data and pushes each @@ -1628,13 +1584,11 @@ uint8_t Http2Session::SendPendingData() { // Do not attempt to send data on the socket if the destroying flag has // been set. That means everything is shutting down and the socket // will not be usable. - if (IsDestroyed()) - return 0; + if (IsDestroyed()) return 0; flags_ &= ~SESSION_STATE_WRITE_SCHEDULED; // SendPendingData should not be called recursively. - if (flags_ & SESSION_STATE_SENDING) - return 1; + if (flags_ & SESSION_STATE_SENDING) return 1; // This is cleared by ClearOutgoing(). flags_ |= SESSION_STATE_SENDING; @@ -1700,18 +1654,16 @@ uint8_t Http2Session::SendPendingData() { return 0; } - // This callback is called from nghttp2 when it wants to send DATA frames for a // given Http2Stream, when we set the `NGHTTP2_DATA_FLAG_NO_COPY` flag earlier // in the Http2Stream::Provider::Stream::OnRead callback. // We take the write information directly out of the stream's data queue. -int Http2Session::OnSendData( - nghttp2_session* session_, - nghttp2_frame* frame, - const uint8_t* framehd, - size_t length, - nghttp2_data_source* source, - void* user_data) { +int Http2Session::OnSendData(nghttp2_session* session_, + nghttp2_frame* frame, + const uint8_t* framehd, + size_t length, + nghttp2_data_source* source, + void* user_data) { Http2Session* session = static_cast(user_data); Http2Stream* stream = GetStream(session, frame->hd.stream_id, source); @@ -1739,9 +1691,8 @@ int Http2Session::OnSendData( } // Slice off `length` bytes of the first write in the queue. - session->outgoing_buffers_.emplace_back(nghttp2_stream_write { - uv_buf_init(write.buf.base, length) - }); + session->outgoing_buffers_.emplace_back( + nghttp2_stream_write{uv_buf_init(write.buf.base, length)}); write.buf.base += length; write.buf.len -= length; break; @@ -1749,21 +1700,19 @@ int Http2Session::OnSendData( if (frame->data.padlen > 0) { // Send padding if that was requested. - session->outgoing_buffers_.emplace_back(nghttp2_stream_write { - uv_buf_init(const_cast(zero_bytes_256), frame->data.padlen - 1) - }); + session->outgoing_buffers_.emplace_back(nghttp2_stream_write{uv_buf_init( + const_cast(zero_bytes_256), frame->data.padlen - 1)}); } return 0; } // Creates a new Http2Stream and submits a new http2 request. -Http2Stream* Http2Session::SubmitRequest( - nghttp2_priority_spec* prispec, - nghttp2_nv* nva, - size_t len, - int32_t* ret, - int options) { +Http2Stream* Http2Session::SubmitRequest(nghttp2_priority_spec* prispec, + nghttp2_nv* nva, + size_t len, + int32_t* ret, + int options) { Debug(this, "submitting request"); Http2Scope h2scope(this); Http2Stream* stream = nullptr; @@ -1820,11 +1769,8 @@ void Http2Session::OnStreamRead(ssize_t nread, const uv_buf_t& buf) { // Create an array buffer for the read data. DATA frames will be emitted // as slices of this array buffer to avoid having to copy memory. - stream_buf_ab_ = - ArrayBuffer::New(isolate, - buf.base, - nread, - ArrayBufferCreationMode::kInternalized); + stream_buf_ab_ = ArrayBuffer::New( + isolate, buf.base, nread, ArrayBufferCreationMode::kInternalized); statistics_.data_received += nread; ssize_t ret = Write(&stream_buf_, 1); @@ -1841,8 +1787,7 @@ void Http2Session::OnStreamRead(ssize_t nread, const uv_buf_t& buf) { bool Http2Session::HasWritesOnSocketForStream(Http2Stream* stream) { for (const nghttp2_stream_write& wr : outgoing_buffers_) { - if (wr.req_wrap != nullptr && wr.req_wrap->stream() == stream) - return true; + if (wr.req_wrap != nullptr && wr.req_wrap->stream() == stream) return true; } return false; } @@ -1857,56 +1802,50 @@ void Http2Session::Consume(Local external) { Debug(this, "i/o stream consumed"); } - -Http2Stream::Http2Stream( - Http2Session* session, - int32_t id, - nghttp2_headers_category category, - int options) : AsyncWrap(session->env(), - session->env()->http2stream_constructor_template() - ->NewInstance(session->env()->context()) - .ToLocalChecked(), - AsyncWrap::PROVIDER_HTTP2STREAM), - StreamBase(session->env()), - session_(session), - id_(id), - current_headers_category_(category) { +Http2Stream::Http2Stream(Http2Session* session, + int32_t id, + nghttp2_headers_category category, + int options) + : AsyncWrap(session->env(), + session->env() + ->http2stream_constructor_template() + ->NewInstance(session->env()->context()) + .ToLocalChecked(), + AsyncWrap::PROVIDER_HTTP2STREAM), + StreamBase(session->env()), + session_(session), + id_(id), + current_headers_category_(category) { MakeWeak(); statistics_.start_time = uv_hrtime(); // Limit the number of header pairs max_header_pairs_ = session->GetMaxHeaderPairs(); - if (max_header_pairs_ == 0) - max_header_pairs_ = DEFAULT_MAX_HEADER_LIST_PAIRS; + if (max_header_pairs_ == 0) max_header_pairs_ = DEFAULT_MAX_HEADER_LIST_PAIRS; current_headers_.reserve(max_header_pairs_); // Limit the number of header octets max_header_length_ = - std::min( - nghttp2_session_get_local_settings( - session->session(), - NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE), - MAX_MAX_HEADER_LIST_SIZE); + std::min(nghttp2_session_get_local_settings( + session->session(), NGHTTP2_SETTINGS_MAX_HEADER_LIST_SIZE), + MAX_MAX_HEADER_LIST_SIZE); if (options & STREAM_OPTION_GET_TRAILERS) flags_ |= NGHTTP2_STREAM_FLAG_TRAILERS; PushStreamListener(&stream_listener_); - if (options & STREAM_OPTION_EMPTY_PAYLOAD) - Shutdown(); + if (options & STREAM_OPTION_EMPTY_PAYLOAD) Shutdown(); session->AddStream(this); } - Http2Stream::~Http2Stream() { for (nghttp2_header& header : current_headers_) { nghttp2_rcbuf_decref(header.name); nghttp2_rcbuf_decref(header.value); } - if (session_ == nullptr) - return; + if (session_ == nullptr) return; Debug(this, "tearing down stream"); session_->RemoveStream(this); session_ = nullptr; @@ -1914,8 +1853,8 @@ Http2Stream::~Http2Stream() { std::string Http2Stream::diagnostic_name() const { return "HttpStream " + std::to_string(id()) + " (" + - std::to_string(static_cast(get_async_id())) + ") [" + - session()->diagnostic_name() + "]"; + std::to_string(static_cast(get_async_id())) + ") [" + + session()->diagnostic_name() + "]"; } // Notify the Http2Stream that a new block of HEADERS is being processed. @@ -1927,7 +1866,6 @@ void Http2Stream::StartHeaders(nghttp2_headers_category category) { current_headers_category_ = category; } - nghttp2_stream* Http2Stream::operator*() { return nghttp2_session_find_stream(**session_, id_); } @@ -1940,14 +1878,12 @@ void Http2Stream::Close(int32_t code) { } int Http2Stream::DoShutdown(ShutdownWrap* req_wrap) { - if (IsDestroyed()) - return UV_EPIPE; + if (IsDestroyed()) return UV_EPIPE; { Http2Scope h2scope(this); flags_ |= NGHTTP2_STREAM_FLAG_SHUT; - CHECK_NE(nghttp2_session_resume_data(**session_, id_), - NGHTTP2_ERR_NOMEM); + CHECK_NE(nghttp2_session_resume_data(**session_, id_), NGHTTP2_ERR_NOMEM); Debug(this, "writable side shutdown"); } return 1; @@ -1958,44 +1894,44 @@ int Http2Stream::DoShutdown(ShutdownWrap* req_wrap) { // using the SetImmediate queue. void Http2Stream::Destroy() { // Do nothing if this stream instance is already destroyed - if (IsDestroyed()) - return; - if (session_->HasPendingRstStream(id_)) - FlushRstStream(); + if (IsDestroyed()) return; + if (session_->HasPendingRstStream(id_)) FlushRstStream(); flags_ |= NGHTTP2_STREAM_FLAG_DESTROYED; Debug(this, "destroying stream"); // Wait until the start of the next loop to delete because there // may still be some pending operations queued for this stream. - env()->SetImmediate([](Environment* env, void* data) { - Http2Stream* stream = static_cast(data); - // Free any remaining outgoing data chunks here. This should be done - // here because it's possible for destroy to have been called while - // we still have queued outbound writes. - while (!stream->queue_.empty()) { - nghttp2_stream_write& head = stream->queue_.front(); - if (head.req_wrap != nullptr) - head.req_wrap->Done(UV_ECANCELED); - stream->queue_.pop(); - } - - // We can destroy the stream now if there are no writes for it - // already on the socket. Otherwise, we'll wait for the garbage collector - // to take care of cleaning up. - if (stream->session() == nullptr || - !stream->session()->HasWritesOnSocketForStream(stream)) - delete stream; - }, this, this->object()); + env()->SetImmediate( + [](Environment* env, void* data) { + Http2Stream* stream = static_cast(data); + // Free any remaining outgoing data chunks here. This should be done + // here because it's possible for destroy to have been called while + // we still have queued outbound writes. + while (!stream->queue_.empty()) { + nghttp2_stream_write& head = stream->queue_.front(); + if (head.req_wrap != nullptr) head.req_wrap->Done(UV_ECANCELED); + stream->queue_.pop(); + } + + // We can destroy the stream now if there are no writes for it + // already on the socket. Otherwise, we'll wait for the garbage + // collector to take care of cleaning up. + if (stream->session() == nullptr || + !stream->session()->HasWritesOnSocketForStream(stream)) + delete stream; + }, + this, + this->object()); statistics_.end_time = uv_hrtime(); session_->statistics_.stream_average_duration = ((statistics_.end_time - statistics_.start_time) / - session_->statistics_.stream_count) / 1e6; + session_->statistics_.stream_count) / + 1e6; EmitStatistics(); } - // Initiates a response on the Http2Stream using data provided via the // StreamBase Streams API. int Http2Stream::SubmitResponse(nghttp2_nv* nva, size_t len, int options) { @@ -2005,8 +1941,7 @@ int Http2Stream::SubmitResponse(nghttp2_nv* nva, size_t len, int options) { if (options & STREAM_OPTION_GET_TRAILERS) flags_ |= NGHTTP2_STREAM_FLAG_TRAILERS; - if (!IsWritable()) - options |= STREAM_OPTION_EMPTY_PAYLOAD; + if (!IsWritable()) options |= STREAM_OPTION_EMPTY_PAYLOAD; Http2Stream::Provider::Stream prov(this, options); int ret = nghttp2_submit_response(**session_, id_, nva, len, *prov); @@ -2014,16 +1949,13 @@ int Http2Stream::SubmitResponse(nghttp2_nv* nva, size_t len, int options) { return ret; } - // Submit informational headers for a stream. int Http2Stream::SubmitInfo(nghttp2_nv* nva, size_t len) { CHECK(!this->IsDestroyed()); Http2Scope h2scope(this); Debug(this, "sending %d informational headers", len); - int ret = nghttp2_submit_headers(**session_, - NGHTTP2_FLAG_NONE, - id_, nullptr, - nva, len, nullptr); + int ret = nghttp2_submit_headers( + **session_, NGHTTP2_FLAG_NONE, id_, nullptr, nva, len, nullptr); CHECK_NE(ret, NGHTTP2_ERR_NOMEM); return ret; } @@ -2059,17 +1991,14 @@ int Http2Stream::SubmitTrailers(nghttp2_nv* nva, size_t len) { } // Submit a PRIORITY frame to the connected peer. -int Http2Stream::SubmitPriority(nghttp2_priority_spec* prispec, - bool silent) { +int Http2Stream::SubmitPriority(nghttp2_priority_spec* prispec, bool silent) { CHECK(!this->IsDestroyed()); Http2Scope h2scope(this); Debug(this, "sending priority spec"); - int ret = silent ? - nghttp2_session_change_stream_priority(**session_, - id_, prispec) : - nghttp2_submit_priority(**session_, - NGHTTP2_FLAG_NONE, - id_, prispec); + int ret = + silent ? nghttp2_session_change_stream_priority(**session_, id_, prispec) + : nghttp2_submit_priority( + **session_, NGHTTP2_FLAG_NONE, id_, prispec); CHECK_NE(ret, NGHTTP2_ERR_NOMEM); return ret; } @@ -2092,14 +2021,12 @@ void Http2Stream::SubmitRstStream(const uint32_t code) { } void Http2Stream::FlushRstStream() { - if (IsDestroyed()) - return; + if (IsDestroyed()) return; Http2Scope h2scope(this); - CHECK_EQ(nghttp2_submit_rst_stream(**session_, NGHTTP2_FLAG_NONE, - id_, code_), 0); + CHECK_EQ(nghttp2_submit_rst_stream(**session_, NGHTTP2_FLAG_NONE, id_, code_), + 0); } - // Submit a push promise and create the associated Http2Stream if successful. Http2Stream* Http2Stream::SubmitPushPromise(nghttp2_nv* nva, size_t len, @@ -2108,8 +2035,8 @@ Http2Stream* Http2Stream::SubmitPushPromise(nghttp2_nv* nva, CHECK(!this->IsDestroyed()); Http2Scope h2scope(this); Debug(this, "sending push promise"); - *ret = nghttp2_submit_push_promise(**session_, NGHTTP2_FLAG_NONE, - id_, nva, len, nullptr); + *ret = nghttp2_submit_push_promise( + **session_, NGHTTP2_FLAG_NONE, id_, nva, len, nullptr); CHECK_NE(*ret, NGHTTP2_ERR_NOMEM); Http2Stream* stream = nullptr; if (*ret > 0) @@ -2130,9 +2057,8 @@ int Http2Stream::ReadStart() { // Tell nghttp2 about our consumption of the data that was handed // off to JS land. - nghttp2_session_consume_stream(**session_, - id_, - inbound_consumed_data_while_paused_); + nghttp2_session_consume_stream( + **session_, id_, inbound_consumed_data_while_paused_); inbound_consumed_data_while_paused_ = 0; return 0; @@ -2141,8 +2067,7 @@ int Http2Stream::ReadStart() { // Switch the StreamBase into paused mode. int Http2Stream::ReadStop() { CHECK(!this->IsDestroyed()); - if (!IsReading()) - return 0; + if (!IsReading()) return 0; flags_ |= NGHTTP2_STREAM_FLAG_READ_PAUSED; Debug(this, "reading stopped"); return 0; @@ -2172,10 +2097,8 @@ int Http2Stream::DoWrite(WriteWrap* req_wrap, for (size_t i = 0; i < nbufs; ++i) { // Store the req_wrap on the last write info in the queue, so that it is // only marked as finished once all buffers associated with it are finished. - queue_.emplace(nghttp2_stream_write { - i == nbufs - 1 ? req_wrap : nullptr, - bufs[i] - }); + queue_.emplace( + nghttp2_stream_write{i == nbufs - 1 ? req_wrap : nullptr, bufs[i]}); IncrementAvailableOutboundLength(bufs[i].len); } CHECK_NE(nghttp2_session_resume_data(**session_, id_), NGHTTP2_ERR_NOMEM); @@ -2193,8 +2116,8 @@ bool Http2Stream::AddHeader(nghttp2_rcbuf* name, CHECK(!this->IsDestroyed()); if (this->statistics_.first_header == 0) this->statistics_.first_header = uv_hrtime(); - size_t length = nghttp2_rcbuf_get_buf(name).len + - nghttp2_rcbuf_get_buf(value).len + 32; + size_t length = + nghttp2_rcbuf_get_buf(name).len + nghttp2_rcbuf_get_buf(value).len + 32; // A header can only be added if we have not exceeded the maximum number // of headers and the session has memory available for it. if (!session_->IsAvailableSessionMemory(length) || @@ -2255,7 +2178,7 @@ ssize_t Http2Stream::Provider::Stream::OnRead(nghttp2_session* handle, stream->statistics_.first_byte_sent = uv_hrtime(); CHECK_EQ(id, stream->id()); - size_t amount = 0; // amount of data being sent in this data frame. + size_t amount = 0; // amount of data being sent in this data frame. // Remove all empty chunks from the head of the queue. // This is done here so that .write('', cb) is still a meaningful way to @@ -2264,8 +2187,7 @@ ssize_t Http2Stream::Provider::Stream::OnRead(nghttp2_session* handle, while (!stream->queue_.empty() && stream->queue_.front().buf.len == 0) { WriteWrap* finished = stream->queue_.front().req_wrap; stream->queue_.pop(); - if (finished != nullptr) - finished->Done(0); + if (finished != nullptr) finished->Done(0); } if (!stream->queue_.empty()) { @@ -2314,7 +2236,6 @@ inline void Http2Stream::DecrementAvailableOutboundLength(size_t amount) { session_->DecrementCurrentSessionMemory(amount); } - // Implementation of the JavaScript API // Fetches the string description of a nghttp2 error code and passes that @@ -2326,10 +2247,10 @@ void HttpErrorString(const FunctionCallbackInfo& args) { String::NewFromOneByte( env->isolate(), reinterpret_cast(nghttp2_strerror(val)), - NewStringType::kInternalized).ToLocalChecked()); + NewStringType::kInternalized) + .ToLocalChecked()); } - // Serializes the settings object into a Buffer instance that // would be suitable, for instance, for creating the Base64 // output for an HTTP2-Settings header field. @@ -2407,7 +2328,6 @@ void Http2Session::RefreshState(const FunctionCallbackInfo& args) { nghttp2_session_get_hd_inflate_dynamic_table_size(s); } - // Constructor for new Http2Session instances. void Http2Session::New(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -2419,7 +2339,6 @@ void Http2Session::New(const FunctionCallbackInfo& args) { Debug(session, "session created"); } - // Binds the Http2Session with a StreamBase used for i/o void Http2Session::Consume(const FunctionCallbackInfo& args) { Http2Session* session; @@ -2460,9 +2379,8 @@ void Http2Session::Request(const FunctionCallbackInfo& args) { Debug(session, "request submitted"); int32_t ret = 0; - Http2Stream* stream = - session->Http2Session::SubmitRequest(*priority, *list, list.length(), - &ret, options); + Http2Stream* stream = session->Http2Session::SubmitRequest( + *priority, *list, list.length(), &ret, options); if (ret <= 0) { Debug(session, "could not submit request: %s", nghttp2_strerror(ret)); @@ -2480,16 +2398,15 @@ void Http2Session::Goaway(uint32_t code, int32_t lastStreamID, uint8_t* data, size_t len) { - if (IsDestroyed()) - return; + if (IsDestroyed()) return; Http2Scope h2scope(this); // the last proc stream id is the most recently created Http2Stream. if (lastStreamID <= 0) lastStreamID = nghttp2_session_get_last_proc_stream_id(session_); Debug(this, "submitting goaway"); - nghttp2_submit_goaway(session_, NGHTTP2_FLAG_NONE, - lastStreamID, code, data, len); + nghttp2_submit_goaway( + session_, NGHTTP2_FLAG_NONE, lastStreamID, code, data, len); } // Submits a GOAWAY frame to signal that the Http2Session is in the process @@ -2526,9 +2443,11 @@ void Http2Session::UpdateChunksSent(const FunctionCallbackInfo& args) { uint32_t length = session->chunks_sent_since_last_write_; - session->object()->Set(env->context(), - env->chunks_sent_since_last_write_string(), - Integer::NewFromUnsigned(isolate, length)).FromJust(); + session->object() + ->Set(env->context(), + env->chunks_sent_since_last_write_string(), + Integer::NewFromUnsigned(isolate, length)) + .FromJust(); args.GetReturnValue().Set(length); } @@ -2565,7 +2484,6 @@ void Http2Stream::Respond(const FunctionCallbackInfo& args) { Debug(stream, "response submitted"); } - // Submits informational headers on the Http2Stream void Http2Stream::Info(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -2635,8 +2553,8 @@ void Http2Stream::PushPromise(const FunctionCallbackInfo& args) { Debug(parent, "creating push promise"); int32_t ret = 0; - Http2Stream* stream = parent->SubmitPushPromise(*list, list.length(), - &ret, options); + Http2Stream* stream = + parent->SubmitPushPromise(*list, list.length(), &ret, options); if (ret <= 0) { Debug(parent, "failed to create push stream: %d", ret); return args.GetReturnValue().Set(ret); @@ -2678,14 +2596,12 @@ void Http2Stream::RefreshState(const FunctionCallbackInfo& args) { buffer[IDX_STREAM_STATE] = NGHTTP2_STREAM_STATE_IDLE; buffer[IDX_STREAM_STATE_WEIGHT] = buffer[IDX_STREAM_STATE_SUM_DEPENDENCY_WEIGHT] = - buffer[IDX_STREAM_STATE_LOCAL_CLOSE] = - buffer[IDX_STREAM_STATE_REMOTE_CLOSE] = - buffer[IDX_STREAM_STATE_LOCAL_WINDOW_SIZE] = 0; + buffer[IDX_STREAM_STATE_LOCAL_CLOSE] = + buffer[IDX_STREAM_STATE_REMOTE_CLOSE] = + buffer[IDX_STREAM_STATE_LOCAL_WINDOW_SIZE] = 0; } else { - buffer[IDX_STREAM_STATE] = - nghttp2_stream_get_state(str); - buffer[IDX_STREAM_STATE_WEIGHT] = - nghttp2_stream_get_weight(str); + buffer[IDX_STREAM_STATE] = nghttp2_stream_get_state(str); + buffer[IDX_STREAM_STATE_WEIGHT] = nghttp2_stream_get_weight(str); buffer[IDX_STREAM_STATE_SUM_DEPENDENCY_WEIGHT] = nghttp2_stream_get_sum_dependency_weight(str); buffer[IDX_STREAM_STATE_LOCAL_CLOSE] = @@ -2703,8 +2619,14 @@ void Http2Session::AltSvc(int32_t id, uint8_t* value, size_t value_len) { Http2Scope h2scope(this); - CHECK_EQ(nghttp2_submit_altsvc(session_, NGHTTP2_FLAG_NONE, id, - origin, origin_len, value, value_len), 0); + CHECK_EQ(nghttp2_submit_altsvc(session_, + NGHTTP2_FLAG_NONE, + id, + origin, + origin_len, + value, + value_len), + 0); } void Http2Session::Origin(nghttp2_origin_entry* ov, size_t count) { @@ -2749,11 +2671,7 @@ void Http2Session::Origin(const FunctionCallbackInfo& args) { Local origin_string = args[0].As(); int count = args[1]->IntegerValue(context).ToChecked(); - - Origins origins(env->isolate(), - env->context(), - origin_string, - count); + Origins origins(env->isolate(), env->context(), origin_string, count); session->Origin(*origins, origins.length()); } @@ -2811,7 +2729,6 @@ void Http2Session::Settings(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(true); } - Http2Session::Http2Ping* Http2Session::PopPing() { Http2Ping* ping = nullptr; if (!outstanding_pings_.empty()) { @@ -2823,8 +2740,7 @@ Http2Session::Http2Ping* Http2Session::PopPing() { } bool Http2Session::AddPing(Http2Session::Http2Ping* ping) { - if (outstanding_pings_.size() == max_outstanding_pings_) - return false; + if (outstanding_pings_.size() == max_outstanding_pings_) return false; outstanding_pings_.push(ping); IncrementCurrentSessionMemory(sizeof(*ping)); return true; @@ -2841,22 +2757,21 @@ Http2Session::Http2Settings* Http2Session::PopSettings() { } bool Http2Session::AddSettings(Http2Session::Http2Settings* settings) { - if (outstanding_settings_.size() == max_outstanding_settings_) - return false; + if (outstanding_settings_.size() == max_outstanding_settings_) return false; outstanding_settings_.push(settings); IncrementCurrentSessionMemory(sizeof(*settings)); return true; } -Http2Session::Http2Ping::Http2Ping( - Http2Session* session) - : AsyncWrap(session->env(), - session->env()->http2ping_constructor_template() - ->NewInstance(session->env()->context()) - .ToLocalChecked(), - AsyncWrap::PROVIDER_HTTP2PING), - session_(session), - startTime_(uv_hrtime()) { } +Http2Session::Http2Ping::Http2Ping(Http2Session* session) + : AsyncWrap(session->env(), + session->env() + ->http2ping_constructor_template() + ->NewInstance(session->env()->context()) + .ToLocalChecked(), + AsyncWrap::PROVIDER_HTTP2PING), + session_(session), + startTime_(uv_hrtime()) {} void Http2Session::Http2Ping::Send(uint8_t* payload) { uint8_t data[8]; @@ -2874,28 +2789,24 @@ void Http2Session::Http2Ping::Done(bool ack, const uint8_t* payload) { Local buf = Undefined(env()->isolate()); if (payload != nullptr) { - buf = Buffer::Copy(env()->isolate(), - reinterpret_cast(payload), - 8).ToLocalChecked(); + buf = Buffer::Copy( + env()->isolate(), reinterpret_cast(payload), 8) + .ToLocalChecked(); } - Local argv[3] = { - Boolean::New(env()->isolate(), ack), - Number::New(env()->isolate(), duration), - buf - }; + Local argv[3] = {Boolean::New(env()->isolate(), ack), + Number::New(env()->isolate(), duration), + buf}; MakeCallback(env()->ondone_string(), arraysize(argv), argv); delete this; } - void nghttp2_stream_write::MemoryInfo(MemoryTracker* tracker) const { if (req_wrap != nullptr) tracker->TrackField("req_wrap", req_wrap->GetAsyncWrap()); tracker->TrackField("buf", buf); } - void nghttp2_header::MemoryInfo(MemoryTracker* tracker) const { tracker->TrackFieldWithSize("name", nghttp2_rcbuf_get_buf(name).len); tracker->TrackFieldWithSize("value", nghttp2_rcbuf_get_buf(value).len); @@ -2905,9 +2816,9 @@ void SetCallbackFunctions(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); CHECK_EQ(args.Length(), 12); -#define SET_FUNCTION(arg, name) \ - CHECK(args[arg]->IsFunction()); \ - env->set_http2session_on_ ## name ## _function(args[arg].As()); +#define SET_FUNCTION(arg, name) \ + CHECK(args[arg]->IsFunction()); \ + env->set_http2session_on_##name##_function(args[arg].As()); SET_FUNCTION(0, error) SET_FUNCTION(1, priority) @@ -2936,28 +2847,22 @@ void Initialize(Local target, std::unique_ptr state(new Http2State(isolate)); -#define SET_STATE_TYPEDARRAY(name, field) \ - target->Set(context, \ - FIXED_ONE_BYTE_STRING(isolate, (name)), \ - (field)).FromJust() +#define SET_STATE_TYPEDARRAY(name, field) \ + target->Set(context, FIXED_ONE_BYTE_STRING(isolate, (name)), (field)) \ + .FromJust() // Initialize the buffer used for padding callbacks - SET_STATE_TYPEDARRAY( - "paddingBuffer", state->padding_buffer.GetJSArray()); + SET_STATE_TYPEDARRAY("paddingBuffer", state->padding_buffer.GetJSArray()); // Initialize the buffer used to store the session state - SET_STATE_TYPEDARRAY( - "sessionState", state->session_state_buffer.GetJSArray()); + SET_STATE_TYPEDARRAY("sessionState", + state->session_state_buffer.GetJSArray()); // Initialize the buffer used to store the stream state - SET_STATE_TYPEDARRAY( - "streamState", state->stream_state_buffer.GetJSArray()); - SET_STATE_TYPEDARRAY( - "settingsBuffer", state->settings_buffer.GetJSArray()); - SET_STATE_TYPEDARRAY( - "optionsBuffer", state->options_buffer.GetJSArray()); - SET_STATE_TYPEDARRAY( - "streamStats", state->stream_stats_buffer.GetJSArray()); - SET_STATE_TYPEDARRAY( - "sessionStats", state->session_stats_buffer.GetJSArray()); + SET_STATE_TYPEDARRAY("streamState", state->stream_state_buffer.GetJSArray()); + SET_STATE_TYPEDARRAY("settingsBuffer", state->settings_buffer.GetJSArray()); + SET_STATE_TYPEDARRAY("optionsBuffer", state->options_buffer.GetJSArray()); + SET_STATE_TYPEDARRAY("streamStats", state->stream_stats_buffer.GetJSArray()); + SET_STATE_TYPEDARRAY("sessionStats", + state->session_stats_buffer.GetJSArray()); #undef SET_STATE_TYPEDARRAY env->set_http2_state(std::move(state)); @@ -2970,7 +2875,7 @@ void Initialize(Local target, env->SetMethod(target, "nghttp2ErrorString", HttpErrorString); Local http2SessionClassName = - FIXED_ONE_BYTE_STRING(isolate, "Http2Session"); + FIXED_ONE_BYTE_STRING(isolate, "Http2Session"); Local ping = FunctionTemplate::New(env->isolate()); ping->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), "Http2Ping")); @@ -3003,12 +2908,13 @@ void Initialize(Local target, Local streamt = stream->InstanceTemplate(); streamt->SetInternalFieldCount(1); env->set_http2stream_constructor_template(streamt); - target->Set(context, - FIXED_ONE_BYTE_STRING(env->isolate(), "Http2Stream"), - stream->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(context, + FIXED_ONE_BYTE_STRING(env->isolate(), "Http2Stream"), + stream->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); - Local session = - env->NewFunctionTemplate(Http2Session::New); + Local session = env->NewFunctionTemplate(Http2Session::New); session->SetClassName(http2SessionClassName); session->InstanceTemplate()->SetInternalFieldCount(1); session->Inherit(AsyncWrap::GetConstructorTemplate(env)); @@ -3020,55 +2926,60 @@ void Initialize(Local target, env->SetProtoMethod(session, "goaway", Http2Session::Goaway); env->SetProtoMethod(session, "settings", Http2Session::Settings); env->SetProtoMethod(session, "request", Http2Session::Request); - env->SetProtoMethod(session, "setNextStreamID", - Http2Session::SetNextStreamID); - env->SetProtoMethod(session, "updateChunksSent", - Http2Session::UpdateChunksSent); + env->SetProtoMethod( + session, "setNextStreamID", Http2Session::SetNextStreamID); + env->SetProtoMethod( + session, "updateChunksSent", Http2Session::UpdateChunksSent); env->SetProtoMethod(session, "refreshState", Http2Session::RefreshState); env->SetProtoMethod( - session, "localSettings", + session, + "localSettings", Http2Session::RefreshSettings); env->SetProtoMethod( - session, "remoteSettings", + session, + "remoteSettings", Http2Session::RefreshSettings); - target->Set(context, - http2SessionClassName, - session->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(context, + http2SessionClassName, + session->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); Local constants = Object::New(isolate); Local name_for_error_code = Array::New(isolate); -#define NODE_NGHTTP2_ERROR_CODES(V) \ - V(NGHTTP2_SESSION_SERVER); \ - V(NGHTTP2_SESSION_CLIENT); \ - V(NGHTTP2_STREAM_STATE_IDLE); \ - V(NGHTTP2_STREAM_STATE_OPEN); \ - V(NGHTTP2_STREAM_STATE_RESERVED_LOCAL); \ - V(NGHTTP2_STREAM_STATE_RESERVED_REMOTE); \ - V(NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL); \ - V(NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE); \ - V(NGHTTP2_STREAM_STATE_CLOSED); \ - V(NGHTTP2_NO_ERROR); \ - V(NGHTTP2_PROTOCOL_ERROR); \ - V(NGHTTP2_INTERNAL_ERROR); \ - V(NGHTTP2_FLOW_CONTROL_ERROR); \ - V(NGHTTP2_SETTINGS_TIMEOUT); \ - V(NGHTTP2_STREAM_CLOSED); \ - V(NGHTTP2_FRAME_SIZE_ERROR); \ - V(NGHTTP2_REFUSED_STREAM); \ - V(NGHTTP2_CANCEL); \ - V(NGHTTP2_COMPRESSION_ERROR); \ - V(NGHTTP2_CONNECT_ERROR); \ - V(NGHTTP2_ENHANCE_YOUR_CALM); \ - V(NGHTTP2_INADEQUATE_SECURITY); \ - V(NGHTTP2_HTTP_1_1_REQUIRED); \ - -#define V(name) \ - NODE_DEFINE_CONSTANT(constants, name); \ - name_for_error_code->Set(env->context(), \ - static_cast(name), \ - FIXED_ONE_BYTE_STRING(isolate, \ - #name)).FromJust(); +#define NODE_NGHTTP2_ERROR_CODES(V) \ + V(NGHTTP2_SESSION_SERVER); \ + V(NGHTTP2_SESSION_CLIENT); \ + V(NGHTTP2_STREAM_STATE_IDLE); \ + V(NGHTTP2_STREAM_STATE_OPEN); \ + V(NGHTTP2_STREAM_STATE_RESERVED_LOCAL); \ + V(NGHTTP2_STREAM_STATE_RESERVED_REMOTE); \ + V(NGHTTP2_STREAM_STATE_HALF_CLOSED_LOCAL); \ + V(NGHTTP2_STREAM_STATE_HALF_CLOSED_REMOTE); \ + V(NGHTTP2_STREAM_STATE_CLOSED); \ + V(NGHTTP2_NO_ERROR); \ + V(NGHTTP2_PROTOCOL_ERROR); \ + V(NGHTTP2_INTERNAL_ERROR); \ + V(NGHTTP2_FLOW_CONTROL_ERROR); \ + V(NGHTTP2_SETTINGS_TIMEOUT); \ + V(NGHTTP2_STREAM_CLOSED); \ + V(NGHTTP2_FRAME_SIZE_ERROR); \ + V(NGHTTP2_REFUSED_STREAM); \ + V(NGHTTP2_CANCEL); \ + V(NGHTTP2_COMPRESSION_ERROR); \ + V(NGHTTP2_CONNECT_ERROR); \ + V(NGHTTP2_ENHANCE_YOUR_CALM); \ + V(NGHTTP2_INADEQUATE_SECURITY); \ + V(NGHTTP2_HTTP_1_1_REQUIRED); + +#define V(name) \ + NODE_DEFINE_CONSTANT(constants, name); \ + name_for_error_code \ + ->Set(env->context(), \ + static_cast(name), \ + FIXED_ONE_BYTE_STRING(isolate, #name)) \ + .FromJust(); NODE_NGHTTP2_ERROR_CODES(V) #undef V @@ -3116,30 +3027,30 @@ void Initialize(Local target, NODE_DEFINE_CONSTANT(constants, PADDING_STRATEGY_MAX); NODE_DEFINE_CONSTANT(constants, PADDING_STRATEGY_CALLBACK); -#define STRING_CONSTANT(NAME, VALUE) \ - NODE_DEFINE_STRING_CONSTANT(constants, "HTTP2_HEADER_" # NAME, VALUE); -HTTP_KNOWN_HEADERS(STRING_CONSTANT) +#define STRING_CONSTANT(NAME, VALUE) \ + NODE_DEFINE_STRING_CONSTANT(constants, "HTTP2_HEADER_" #NAME, VALUE); + HTTP_KNOWN_HEADERS(STRING_CONSTANT) #undef STRING_CONSTANT -#define STRING_CONSTANT(NAME, VALUE) \ - NODE_DEFINE_STRING_CONSTANT(constants, "HTTP2_METHOD_" # NAME, VALUE); -HTTP_KNOWN_METHODS(STRING_CONSTANT) +#define STRING_CONSTANT(NAME, VALUE) \ + NODE_DEFINE_STRING_CONSTANT(constants, "HTTP2_METHOD_" #NAME, VALUE); + HTTP_KNOWN_METHODS(STRING_CONSTANT) #undef STRING_CONSTANT #define V(name, _) NODE_DEFINE_CONSTANT(constants, HTTP_STATUS_##name); -HTTP_STATUS_CODES(V) + HTTP_STATUS_CODES(V) #undef V env->SetMethod(target, "refreshDefaultSettings", RefreshDefaultSettings); env->SetMethod(target, "packSettings", PackSettings); env->SetMethod(target, "setCallbackFunctions", SetCallbackFunctions); - target->Set(context, - env->constants_string(), - constants).FromJust(); - target->Set(context, - FIXED_ONE_BYTE_STRING(isolate, "nameForErrorCode"), - name_for_error_code).FromJust(); + target->Set(context, env->constants_string(), constants).FromJust(); + target + ->Set(context, + FIXED_ONE_BYTE_STRING(isolate, "nameForErrorCode"), + name_for_error_code) + .FromJust(); } } // namespace http2 } // namespace node diff --git a/src/node_http2.h b/src/node_http2.h index e6953f6fc19802..efec0707f9564d 100644 --- a/src/node_http2.h +++ b/src/node_http2.h @@ -52,14 +52,9 @@ using performance::PerformanceEntry; #define MAX_BUFFER_COUNT 16 -enum nghttp2_session_type { - NGHTTP2_SESSION_SERVER, - NGHTTP2_SESSION_CLIENT -}; +enum nghttp2_session_type { NGHTTP2_SESSION_SERVER, NGHTTP2_SESSION_CLIENT }; -enum nghttp2_shutdown_flags { - NGHTTP2_SHUTDOWN_FLAG_GRACEFUL -}; +enum nghttp2_shutdown_flags { NGHTTP2_SHUTDOWN_FLAG_GRACEFUL }; enum nghttp2_stream_flags { NGHTTP2_STREAM_FLAG_NONE = 0x0, @@ -91,8 +86,8 @@ struct nghttp2_stream_write : public MemoryRetainer { uv_buf_t buf; inline explicit nghttp2_stream_write(uv_buf_t buf_) : buf(buf_) {} - inline nghttp2_stream_write(WriteWrap* req, uv_buf_t buf_) : - req_wrap(req), buf(buf_) {} + inline nghttp2_stream_write(WriteWrap* req, uv_buf_t buf_) + : req_wrap(req), buf(buf_) {} void MemoryInfo(MemoryTracker* tracker) const override; SET_MEMORY_INFO_NAME(nghttp2_stream_write) @@ -109,130 +104,129 @@ struct nghttp2_header : public MemoryRetainer { SET_SELF_SIZE(nghttp2_header) }; - // Unlike the HTTP/1 implementation, the HTTP/2 implementation is not limited // to a fixed number of known supported HTTP methods. These constants, therefore // are provided strictly as a convenience to users and are exposed via the // require('http2').constants object. -#define HTTP_KNOWN_METHODS(V) \ - V(ACL, "ACL") \ - V(BASELINE_CONTROL, "BASELINE-CONTROL") \ - V(BIND, "BIND") \ - V(CHECKIN, "CHECKIN") \ - V(CHECKOUT, "CHECKOUT") \ - V(CONNECT, "CONNECT") \ - V(COPY, "COPY") \ - V(DELETE, "DELETE") \ - V(GET, "GET") \ - V(HEAD, "HEAD") \ - V(LABEL, "LABEL") \ - V(LINK, "LINK") \ - V(LOCK, "LOCK") \ - V(MERGE, "MERGE") \ - V(MKACTIVITY, "MKACTIVITY") \ - V(MKCALENDAR, "MKCALENDAR") \ - V(MKCOL, "MKCOL") \ - V(MKREDIRECTREF, "MKREDIRECTREF") \ - V(MKWORKSPACE, "MKWORKSPACE") \ - V(MOVE, "MOVE") \ - V(OPTIONS, "OPTIONS") \ - V(ORDERPATCH, "ORDERPATCH") \ - V(PATCH, "PATCH") \ - V(POST, "POST") \ - V(PRI, "PRI") \ - V(PROPFIND, "PROPFIND") \ - V(PROPPATCH, "PROPPATCH") \ - V(PUT, "PUT") \ - V(REBIND, "REBIND") \ - V(REPORT, "REPORT") \ - V(SEARCH, "SEARCH") \ - V(TRACE, "TRACE") \ - V(UNBIND, "UNBIND") \ - V(UNCHECKOUT, "UNCHECKOUT") \ - V(UNLINK, "UNLINK") \ - V(UNLOCK, "UNLOCK") \ - V(UPDATE, "UPDATE") \ - V(UPDATEREDIRECTREF, "UPDATEREDIRECTREF") \ +#define HTTP_KNOWN_METHODS(V) \ + V(ACL, "ACL") \ + V(BASELINE_CONTROL, "BASELINE-CONTROL") \ + V(BIND, "BIND") \ + V(CHECKIN, "CHECKIN") \ + V(CHECKOUT, "CHECKOUT") \ + V(CONNECT, "CONNECT") \ + V(COPY, "COPY") \ + V(DELETE, "DELETE") \ + V(GET, "GET") \ + V(HEAD, "HEAD") \ + V(LABEL, "LABEL") \ + V(LINK, "LINK") \ + V(LOCK, "LOCK") \ + V(MERGE, "MERGE") \ + V(MKACTIVITY, "MKACTIVITY") \ + V(MKCALENDAR, "MKCALENDAR") \ + V(MKCOL, "MKCOL") \ + V(MKREDIRECTREF, "MKREDIRECTREF") \ + V(MKWORKSPACE, "MKWORKSPACE") \ + V(MOVE, "MOVE") \ + V(OPTIONS, "OPTIONS") \ + V(ORDERPATCH, "ORDERPATCH") \ + V(PATCH, "PATCH") \ + V(POST, "POST") \ + V(PRI, "PRI") \ + V(PROPFIND, "PROPFIND") \ + V(PROPPATCH, "PROPPATCH") \ + V(PUT, "PUT") \ + V(REBIND, "REBIND") \ + V(REPORT, "REPORT") \ + V(SEARCH, "SEARCH") \ + V(TRACE, "TRACE") \ + V(UNBIND, "UNBIND") \ + V(UNCHECKOUT, "UNCHECKOUT") \ + V(UNLINK, "UNLINK") \ + V(UNLOCK, "UNLOCK") \ + V(UPDATE, "UPDATE") \ + V(UPDATEREDIRECTREF, "UPDATEREDIRECTREF") \ V(VERSION_CONTROL, "VERSION-CONTROL") // These are provided strictly as a convenience to users and are exposed via the // require('http2').constants objects -#define HTTP_KNOWN_HEADERS(V) \ - V(STATUS, ":status") \ - V(METHOD, ":method") \ - V(AUTHORITY, ":authority") \ - V(SCHEME, ":scheme") \ - V(PATH, ":path") \ - V(PROTOCOL, ":protocol") \ - V(ACCEPT_CHARSET, "accept-charset") \ - V(ACCEPT_ENCODING, "accept-encoding") \ - V(ACCEPT_LANGUAGE, "accept-language") \ - V(ACCEPT_RANGES, "accept-ranges") \ - V(ACCEPT, "accept") \ - V(ACCESS_CONTROL_ALLOW_CREDENTIALS, "access-control-allow-credentials") \ - V(ACCESS_CONTROL_ALLOW_HEADERS, "access-control-allow-headers") \ - V(ACCESS_CONTROL_ALLOW_METHODS, "access-control-allow-methods") \ - V(ACCESS_CONTROL_ALLOW_ORIGIN, "access-control-allow-origin") \ - V(ACCESS_CONTROL_EXPOSE_HEADERS, "access-control-expose-headers") \ - V(ACCESS_CONTROL_MAX_AGE, "access-control-max-age") \ - V(ACCESS_CONTROL_REQUEST_HEADERS, "access-control-request-headers") \ - V(ACCESS_CONTROL_REQUEST_METHOD, "access-control-request-method") \ - V(AGE, "age") \ - V(ALLOW, "allow") \ - V(AUTHORIZATION, "authorization") \ - V(CACHE_CONTROL, "cache-control") \ - V(CONNECTION, "connection") \ - V(CONTENT_DISPOSITION, "content-disposition") \ - V(CONTENT_ENCODING, "content-encoding") \ - V(CONTENT_LANGUAGE, "content-language") \ - V(CONTENT_LENGTH, "content-length") \ - V(CONTENT_LOCATION, "content-location") \ - V(CONTENT_MD5, "content-md5") \ - V(CONTENT_RANGE, "content-range") \ - V(CONTENT_TYPE, "content-type") \ - V(COOKIE, "cookie") \ - V(DATE, "date") \ - V(DNT, "dnt") \ - V(ETAG, "etag") \ - V(EXPECT, "expect") \ - V(EXPIRES, "expires") \ - V(FORWARDED, "forwarded") \ - V(FROM, "from") \ - V(HOST, "host") \ - V(IF_MATCH, "if-match") \ - V(IF_MODIFIED_SINCE, "if-modified-since") \ - V(IF_NONE_MATCH, "if-none-match") \ - V(IF_RANGE, "if-range") \ - V(IF_UNMODIFIED_SINCE, "if-unmodified-since") \ - V(LAST_MODIFIED, "last-modified") \ - V(LINK, "link") \ - V(LOCATION, "location") \ - V(MAX_FORWARDS, "max-forwards") \ - V(PREFER, "prefer") \ - V(PROXY_AUTHENTICATE, "proxy-authenticate") \ - V(PROXY_AUTHORIZATION, "proxy-authorization") \ - V(RANGE, "range") \ - V(REFERER, "referer") \ - V(REFRESH, "refresh") \ - V(RETRY_AFTER, "retry-after") \ - V(SERVER, "server") \ - V(SET_COOKIE, "set-cookie") \ - V(STRICT_TRANSPORT_SECURITY, "strict-transport-security") \ - V(TRAILER, "trailer") \ - V(TRANSFER_ENCODING, "transfer-encoding") \ - V(TE, "te") \ - V(TK, "tk") \ - V(UPGRADE_INSECURE_REQUESTS, "upgrade-insecure-requests") \ - V(UPGRADE, "upgrade") \ - V(USER_AGENT, "user-agent") \ - V(VARY, "vary") \ - V(VIA, "via") \ - V(WARNING, "warning") \ - V(WWW_AUTHENTICATE, "www-authenticate") \ - V(X_CONTENT_TYPE_OPTIONS, "x-content-type-options") \ - V(X_FRAME_OPTIONS, "x-frame-options") \ - V(HTTP2_SETTINGS, "http2-settings") \ - V(KEEP_ALIVE, "keep-alive") \ +#define HTTP_KNOWN_HEADERS(V) \ + V(STATUS, ":status") \ + V(METHOD, ":method") \ + V(AUTHORITY, ":authority") \ + V(SCHEME, ":scheme") \ + V(PATH, ":path") \ + V(PROTOCOL, ":protocol") \ + V(ACCEPT_CHARSET, "accept-charset") \ + V(ACCEPT_ENCODING, "accept-encoding") \ + V(ACCEPT_LANGUAGE, "accept-language") \ + V(ACCEPT_RANGES, "accept-ranges") \ + V(ACCEPT, "accept") \ + V(ACCESS_CONTROL_ALLOW_CREDENTIALS, "access-control-allow-credentials") \ + V(ACCESS_CONTROL_ALLOW_HEADERS, "access-control-allow-headers") \ + V(ACCESS_CONTROL_ALLOW_METHODS, "access-control-allow-methods") \ + V(ACCESS_CONTROL_ALLOW_ORIGIN, "access-control-allow-origin") \ + V(ACCESS_CONTROL_EXPOSE_HEADERS, "access-control-expose-headers") \ + V(ACCESS_CONTROL_MAX_AGE, "access-control-max-age") \ + V(ACCESS_CONTROL_REQUEST_HEADERS, "access-control-request-headers") \ + V(ACCESS_CONTROL_REQUEST_METHOD, "access-control-request-method") \ + V(AGE, "age") \ + V(ALLOW, "allow") \ + V(AUTHORIZATION, "authorization") \ + V(CACHE_CONTROL, "cache-control") \ + V(CONNECTION, "connection") \ + V(CONTENT_DISPOSITION, "content-disposition") \ + V(CONTENT_ENCODING, "content-encoding") \ + V(CONTENT_LANGUAGE, "content-language") \ + V(CONTENT_LENGTH, "content-length") \ + V(CONTENT_LOCATION, "content-location") \ + V(CONTENT_MD5, "content-md5") \ + V(CONTENT_RANGE, "content-range") \ + V(CONTENT_TYPE, "content-type") \ + V(COOKIE, "cookie") \ + V(DATE, "date") \ + V(DNT, "dnt") \ + V(ETAG, "etag") \ + V(EXPECT, "expect") \ + V(EXPIRES, "expires") \ + V(FORWARDED, "forwarded") \ + V(FROM, "from") \ + V(HOST, "host") \ + V(IF_MATCH, "if-match") \ + V(IF_MODIFIED_SINCE, "if-modified-since") \ + V(IF_NONE_MATCH, "if-none-match") \ + V(IF_RANGE, "if-range") \ + V(IF_UNMODIFIED_SINCE, "if-unmodified-since") \ + V(LAST_MODIFIED, "last-modified") \ + V(LINK, "link") \ + V(LOCATION, "location") \ + V(MAX_FORWARDS, "max-forwards") \ + V(PREFER, "prefer") \ + V(PROXY_AUTHENTICATE, "proxy-authenticate") \ + V(PROXY_AUTHORIZATION, "proxy-authorization") \ + V(RANGE, "range") \ + V(REFERER, "referer") \ + V(REFRESH, "refresh") \ + V(RETRY_AFTER, "retry-after") \ + V(SERVER, "server") \ + V(SET_COOKIE, "set-cookie") \ + V(STRICT_TRANSPORT_SECURITY, "strict-transport-security") \ + V(TRAILER, "trailer") \ + V(TRANSFER_ENCODING, "transfer-encoding") \ + V(TE, "te") \ + V(TK, "tk") \ + V(UPGRADE_INSECURE_REQUESTS, "upgrade-insecure-requests") \ + V(UPGRADE, "upgrade") \ + V(USER_AGENT, "user-agent") \ + V(VARY, "vary") \ + V(VIA, "via") \ + V(WARNING, "warning") \ + V(WWW_AUTHENTICATE, "www-authenticate") \ + V(X_CONTENT_TYPE_OPTIONS, "x-content-type-options") \ + V(X_FRAME_OPTIONS, "x-frame-options") \ + V(HTTP2_SETTINGS, "http2-settings") \ + V(KEEP_ALIVE, "keep-alive") \ V(PROXY_CONNECTION, "proxy-connection") enum http_known_headers { @@ -240,75 +234,75 @@ enum http_known_headers { #define V(name, value) HTTP_HEADER_##name, HTTP_KNOWN_HEADERS(V) #undef V - HTTP_KNOWN_HEADER_MAX + HTTP_KNOWN_HEADER_MAX }; // While some of these codes are used within the HTTP/2 implementation in // core, they are provided strictly as a convenience to users and are exposed // via the require('http2').constants object. -#define HTTP_STATUS_CODES(V) \ - V(CONTINUE, 100) \ - V(SWITCHING_PROTOCOLS, 101) \ - V(PROCESSING, 102) \ - V(EARLY_HINTS, 103) \ - V(OK, 200) \ - V(CREATED, 201) \ - V(ACCEPTED, 202) \ - V(NON_AUTHORITATIVE_INFORMATION, 203) \ - V(NO_CONTENT, 204) \ - V(RESET_CONTENT, 205) \ - V(PARTIAL_CONTENT, 206) \ - V(MULTI_STATUS, 207) \ - V(ALREADY_REPORTED, 208) \ - V(IM_USED, 226) \ - V(MULTIPLE_CHOICES, 300) \ - V(MOVED_PERMANENTLY, 301) \ - V(FOUND, 302) \ - V(SEE_OTHER, 303) \ - V(NOT_MODIFIED, 304) \ - V(USE_PROXY, 305) \ - V(TEMPORARY_REDIRECT, 307) \ - V(PERMANENT_REDIRECT, 308) \ - V(BAD_REQUEST, 400) \ - V(UNAUTHORIZED, 401) \ - V(PAYMENT_REQUIRED, 402) \ - V(FORBIDDEN, 403) \ - V(NOT_FOUND, 404) \ - V(METHOD_NOT_ALLOWED, 405) \ - V(NOT_ACCEPTABLE, 406) \ - V(PROXY_AUTHENTICATION_REQUIRED, 407) \ - V(REQUEST_TIMEOUT, 408) \ - V(CONFLICT, 409) \ - V(GONE, 410) \ - V(LENGTH_REQUIRED, 411) \ - V(PRECONDITION_FAILED, 412) \ - V(PAYLOAD_TOO_LARGE, 413) \ - V(URI_TOO_LONG, 414) \ - V(UNSUPPORTED_MEDIA_TYPE, 415) \ - V(RANGE_NOT_SATISFIABLE, 416) \ - V(EXPECTATION_FAILED, 417) \ - V(TEAPOT, 418) \ - V(MISDIRECTED_REQUEST, 421) \ - V(UNPROCESSABLE_ENTITY, 422) \ - V(LOCKED, 423) \ - V(FAILED_DEPENDENCY, 424) \ - V(UNORDERED_COLLECTION, 425) \ - V(UPGRADE_REQUIRED, 426) \ - V(PRECONDITION_REQUIRED, 428) \ - V(TOO_MANY_REQUESTS, 429) \ - V(REQUEST_HEADER_FIELDS_TOO_LARGE, 431) \ - V(UNAVAILABLE_FOR_LEGAL_REASONS, 451) \ - V(INTERNAL_SERVER_ERROR, 500) \ - V(NOT_IMPLEMENTED, 501) \ - V(BAD_GATEWAY, 502) \ - V(SERVICE_UNAVAILABLE, 503) \ - V(GATEWAY_TIMEOUT, 504) \ - V(HTTP_VERSION_NOT_SUPPORTED, 505) \ - V(VARIANT_ALSO_NEGOTIATES, 506) \ - V(INSUFFICIENT_STORAGE, 507) \ - V(LOOP_DETECTED, 508) \ - V(BANDWIDTH_LIMIT_EXCEEDED, 509) \ - V(NOT_EXTENDED, 510) \ +#define HTTP_STATUS_CODES(V) \ + V(CONTINUE, 100) \ + V(SWITCHING_PROTOCOLS, 101) \ + V(PROCESSING, 102) \ + V(EARLY_HINTS, 103) \ + V(OK, 200) \ + V(CREATED, 201) \ + V(ACCEPTED, 202) \ + V(NON_AUTHORITATIVE_INFORMATION, 203) \ + V(NO_CONTENT, 204) \ + V(RESET_CONTENT, 205) \ + V(PARTIAL_CONTENT, 206) \ + V(MULTI_STATUS, 207) \ + V(ALREADY_REPORTED, 208) \ + V(IM_USED, 226) \ + V(MULTIPLE_CHOICES, 300) \ + V(MOVED_PERMANENTLY, 301) \ + V(FOUND, 302) \ + V(SEE_OTHER, 303) \ + V(NOT_MODIFIED, 304) \ + V(USE_PROXY, 305) \ + V(TEMPORARY_REDIRECT, 307) \ + V(PERMANENT_REDIRECT, 308) \ + V(BAD_REQUEST, 400) \ + V(UNAUTHORIZED, 401) \ + V(PAYMENT_REQUIRED, 402) \ + V(FORBIDDEN, 403) \ + V(NOT_FOUND, 404) \ + V(METHOD_NOT_ALLOWED, 405) \ + V(NOT_ACCEPTABLE, 406) \ + V(PROXY_AUTHENTICATION_REQUIRED, 407) \ + V(REQUEST_TIMEOUT, 408) \ + V(CONFLICT, 409) \ + V(GONE, 410) \ + V(LENGTH_REQUIRED, 411) \ + V(PRECONDITION_FAILED, 412) \ + V(PAYLOAD_TOO_LARGE, 413) \ + V(URI_TOO_LONG, 414) \ + V(UNSUPPORTED_MEDIA_TYPE, 415) \ + V(RANGE_NOT_SATISFIABLE, 416) \ + V(EXPECTATION_FAILED, 417) \ + V(TEAPOT, 418) \ + V(MISDIRECTED_REQUEST, 421) \ + V(UNPROCESSABLE_ENTITY, 422) \ + V(LOCKED, 423) \ + V(FAILED_DEPENDENCY, 424) \ + V(UNORDERED_COLLECTION, 425) \ + V(UPGRADE_REQUIRED, 426) \ + V(PRECONDITION_REQUIRED, 428) \ + V(TOO_MANY_REQUESTS, 429) \ + V(REQUEST_HEADER_FIELDS_TOO_LARGE, 431) \ + V(UNAVAILABLE_FOR_LEGAL_REASONS, 451) \ + V(INTERNAL_SERVER_ERROR, 500) \ + V(NOT_IMPLEMENTED, 501) \ + V(BAD_GATEWAY, 502) \ + V(SERVICE_UNAVAILABLE, 503) \ + V(GATEWAY_TIMEOUT, 504) \ + V(HTTP_VERSION_NOT_SUPPORTED, 505) \ + V(VARIANT_ALSO_NEGOTIATES, 506) \ + V(INSUFFICIENT_STORAGE, 507) \ + V(LOOP_DETECTED, 508) \ + V(BANDWIDTH_LIMIT_EXCEEDED, 509) \ + V(NOT_EXTENDED, 510) \ V(NETWORK_AUTHENTICATION_REQUIRED, 511) enum http_status_codes { @@ -343,8 +337,8 @@ enum session_state_flags { SESSION_STATE_SENDING = 0x10, }; -typedef uint32_t(*get_setting)(nghttp2_session* session, - nghttp2_settings_id id); +typedef uint32_t (*get_setting)(nghttp2_session* session, + nghttp2_settings_id id); class Http2Session; class Http2Stream; @@ -371,53 +365,33 @@ class Http2Options { public: Http2Options(Environment* env, nghttp2_session_type type); - ~Http2Options() { - nghttp2_option_del(options_); - } + ~Http2Options() { nghttp2_option_del(options_); } - nghttp2_option* operator*() const { - return options_; - } + nghttp2_option* operator*() const { return options_; } - void SetMaxHeaderPairs(uint32_t max) { - max_header_pairs_ = max; - } + void SetMaxHeaderPairs(uint32_t max) { max_header_pairs_ = max; } - uint32_t GetMaxHeaderPairs() const { - return max_header_pairs_; - } + uint32_t GetMaxHeaderPairs() const { return max_header_pairs_; } void SetPaddingStrategy(padding_strategy_type val) { padding_strategy_ = static_cast(val); } - padding_strategy_type GetPaddingStrategy() const { - return padding_strategy_; - } + padding_strategy_type GetPaddingStrategy() const { return padding_strategy_; } - void SetMaxOutstandingPings(size_t max) { - max_outstanding_pings_ = max; - } + void SetMaxOutstandingPings(size_t max) { max_outstanding_pings_ = max; } - size_t GetMaxOutstandingPings() { - return max_outstanding_pings_; - } + size_t GetMaxOutstandingPings() { return max_outstanding_pings_; } void SetMaxOutstandingSettings(size_t max) { max_outstanding_settings_ = max; } - size_t GetMaxOutstandingSettings() { - return max_outstanding_settings_; - } + size_t GetMaxOutstandingSettings() { return max_outstanding_settings_; } - void SetMaxSessionMemory(uint64_t max) { - max_session_memory_ = max; - } + void SetMaxSessionMemory(uint64_t max) { max_session_memory_ = max; } - uint64_t GetMaxSessionMemory() { - return max_session_memory_; - } + uint64_t GetMaxSessionMemory() { return max_session_memory_; } private: nghttp2_option* options_; @@ -435,9 +409,8 @@ class Http2Priority { Local weight, Local exclusive); - nghttp2_priority_spec* operator*() { - return &spec; - } + nghttp2_priority_spec* operator*() { return &spec; } + private: nghttp2_priority_spec spec; }; @@ -448,8 +421,7 @@ class Http2StreamListener : public StreamListener { void OnStreamRead(ssize_t nread, const uv_buf_t& buf) override; }; -class Http2Stream : public AsyncWrap, - public StreamBase { +class Http2Stream : public AsyncWrap, public StreamBase { public: Http2Stream(Http2Session* session, int32_t id, @@ -467,7 +439,6 @@ class Http2Stream : public AsyncWrap, // Process a Data Chunk void OnDataChunk(uv_buf_t* chunk); - // Required for StreamBase int ReadStart() override; @@ -498,12 +469,10 @@ class Http2Stream : public AsyncWrap, void FlushRstStream(); // Submits a PUSH_PROMISE frame with this stream as the parent. - Http2Stream* SubmitPushPromise( - nghttp2_nv* nva, - size_t len, - int32_t* ret, - int options = 0); - + Http2Stream* SubmitPushPromise(nghttp2_nv* nva, + size_t len, + int32_t* ret, + int options = 0); void Close(int32_t code); @@ -522,9 +491,7 @@ class Http2Stream : public AsyncWrap, return flags_ & NGHTTP2_STREAM_FLAG_READ_PAUSED; } - inline bool IsClosed() const { - return flags_ & NGHTTP2_STREAM_FLAG_CLOSED; - } + inline bool IsClosed() const { return flags_ & NGHTTP2_STREAM_FLAG_CLOSED; } inline bool HasTrailers() const { return flags_ & NGHTTP2_STREAM_FLAG_TRAILERS; @@ -560,18 +527,16 @@ class Http2Stream : public AsyncWrap, void StartHeaders(nghttp2_headers_category category); // Required for StreamBase - bool IsAlive() override { - return true; - } + bool IsAlive() override { return true; } // Required for StreamBase - bool IsClosing() override { - return false; - } + bool IsClosing() override { return false; } AsyncWrap* GetAsyncWrap() override { return this; } - int DoWrite(WriteWrap* w, uv_buf_t* bufs, size_t count, + int DoWrite(WriteWrap* w, + uv_buf_t* bufs, + size_t count, uv_stream_t* send_handle) override; void MemoryInfo(MemoryTracker* tracker) const override { @@ -611,10 +576,10 @@ class Http2Stream : public AsyncWrap, Statistics statistics_ = {}; private: - Http2Session* session_ = nullptr; // The Parent HTTP/2 Session - int32_t id_ = 0; // The Stream Identifier - int32_t code_ = NGHTTP2_NO_ERROR; // The RST_STREAM code (if any) - int flags_ = NGHTTP2_STREAM_FLAG_NONE; // Internal state flags + Http2Session* session_ = nullptr; // The Parent HTTP/2 Session + int32_t id_ = 0; // The Stream Identifier + int32_t code_ = NGHTTP2_NO_ERROR; // The RST_STREAM code (if any) + int flags_ = NGHTTP2_STREAM_FLAG_NONE; // Internal state flags uint32_t max_header_pairs_ = DEFAULT_MAX_HEADER_LIST_PAIRS; uint32_t max_header_length_ = DEFAULT_SETTINGS_MAX_HEADER_LIST_SIZE; @@ -648,12 +613,11 @@ class Http2Stream::Provider { explicit Provider(int options); virtual ~Provider(); - nghttp2_data_provider* operator*() { - return !empty_ ? &provider_ : nullptr; - } + nghttp2_data_provider* operator*() { return !empty_ ? &provider_ : nullptr; } class FD; class Stream; + protected: nghttp2_data_provider provider_; @@ -675,7 +639,6 @@ class Http2Stream::Provider::Stream : public Http2Stream::Provider { void* user_data); }; - class Http2Session : public AsyncWrap, public StreamListener { public: Http2Session(Environment* env, @@ -693,8 +656,7 @@ class Http2Session : public AsyncWrap, public StreamListener { return static_cast(stream_); } - void Close(uint32_t code = NGHTTP2_NO_ERROR, - bool socket_closed = false); + void Close(uint32_t code = NGHTTP2_NO_ERROR, bool socket_closed = false); void Consume(Local external); void Goaway(uint32_t code, int32_t lastStreamID, uint8_t* data, size_t len); void AltSvc(int32_t id, @@ -709,12 +671,11 @@ class Http2Session : public AsyncWrap, public StreamListener { // Submits a new request. If the request is a success, assigned // will be a pointer to the Http2Stream instance assigned. // This only works if the session is a client session. - Http2Stream* SubmitRequest( - nghttp2_priority_spec* prispec, - nghttp2_nv* nva, - size_t len, - int32_t* ret, - int options = 0); + Http2Stream* SubmitRequest(nghttp2_priority_spec* prispec, + nghttp2_nv* nva, + size_t len, + int32_t* ret, + int options = 0); inline nghttp2_session_type type() const { return session_type_; } @@ -800,9 +761,7 @@ class Http2Session : public AsyncWrap, public StreamListener { template static void RefreshSettings(const FunctionCallbackInfo& args); - uv_loop_t* event_loop() const { - return env()->event_loop(); - } + uv_loop_t* event_loop() const { return env()->event_loop(); } Http2Ping* PopPing(); bool AddPing(Http2Ping* ping); @@ -853,12 +812,9 @@ class Http2Session : public AsyncWrap, public StreamListener { private: // Frame Padding Strategies - ssize_t OnDWordAlignedPadding(size_t frameLength, - size_t maxPayloadLen); - ssize_t OnMaxFrameSizePadding(size_t frameLength, - size_t maxPayloadLen); - ssize_t OnCallbackPadding(size_t frameLength, - size_t maxPayloadLen); + ssize_t OnDWordAlignedPadding(size_t frameLength, size_t maxPayloadLen); + ssize_t OnMaxFrameSizePadding(size_t frameLength, size_t maxPayloadLen); + ssize_t OnCallbackPadding(size_t frameLength, size_t maxPayloadLen); // Frame Handler void HandleDataFrame(const nghttp2_frame* frame); @@ -871,71 +827,59 @@ class Http2Session : public AsyncWrap, public StreamListener { void HandleOriginFrame(const nghttp2_frame* frame); // nghttp2 callbacks - static int OnBeginHeadersCallback( - nghttp2_session* session, - const nghttp2_frame* frame, - void* user_data); - static int OnHeaderCallback( - nghttp2_session* session, - const nghttp2_frame* frame, - nghttp2_rcbuf* name, - nghttp2_rcbuf* value, - uint8_t flags, - void* user_data); - static int OnFrameReceive( - nghttp2_session* session, - const nghttp2_frame* frame, - void* user_data); - static int OnFrameNotSent( - nghttp2_session* session, - const nghttp2_frame* frame, - int error_code, - void* user_data); - static int OnFrameSent( - nghttp2_session* session, - const nghttp2_frame* frame, - void* user_data); - static int OnStreamClose( - nghttp2_session* session, - int32_t id, - uint32_t code, - void* user_data); - static int OnInvalidHeader( - nghttp2_session* session, - const nghttp2_frame* frame, - nghttp2_rcbuf* name, - nghttp2_rcbuf* value, - uint8_t flags, - void* user_data); - static int OnDataChunkReceived( - nghttp2_session* session, - uint8_t flags, - int32_t id, - const uint8_t* data, - size_t len, - void* user_data); - static ssize_t OnSelectPadding( - nghttp2_session* session, - const nghttp2_frame* frame, - size_t maxPayloadLen, - void* user_data); - static int OnNghttpError( - nghttp2_session* session, - const char* message, - size_t len, - void* user_data); - static int OnSendData( - nghttp2_session* session, - nghttp2_frame* frame, - const uint8_t* framehd, - size_t length, - nghttp2_data_source* source, - void* user_data); - static int OnInvalidFrame( - nghttp2_session* session, - const nghttp2_frame* frame, - int lib_error_code, - void* user_data); + static int OnBeginHeadersCallback(nghttp2_session* session, + const nghttp2_frame* frame, + void* user_data); + static int OnHeaderCallback(nghttp2_session* session, + const nghttp2_frame* frame, + nghttp2_rcbuf* name, + nghttp2_rcbuf* value, + uint8_t flags, + void* user_data); + static int OnFrameReceive(nghttp2_session* session, + const nghttp2_frame* frame, + void* user_data); + static int OnFrameNotSent(nghttp2_session* session, + const nghttp2_frame* frame, + int error_code, + void* user_data); + static int OnFrameSent(nghttp2_session* session, + const nghttp2_frame* frame, + void* user_data); + static int OnStreamClose(nghttp2_session* session, + int32_t id, + uint32_t code, + void* user_data); + static int OnInvalidHeader(nghttp2_session* session, + const nghttp2_frame* frame, + nghttp2_rcbuf* name, + nghttp2_rcbuf* value, + uint8_t flags, + void* user_data); + static int OnDataChunkReceived(nghttp2_session* session, + uint8_t flags, + int32_t id, + const uint8_t* data, + size_t len, + void* user_data); + static ssize_t OnSelectPadding(nghttp2_session* session, + const nghttp2_frame* frame, + size_t maxPayloadLen, + void* user_data); + static int OnNghttpError(nghttp2_session* session, + const char* message, + size_t len, + void* user_data); + static int OnSendData(nghttp2_session* session, + nghttp2_frame* frame, + const uint8_t* framehd, + size_t length, + nghttp2_data_source* source, + void* user_data); + static int OnInvalidFrame(nghttp2_session* session, + const nghttp2_frame* frame, + int lib_error_code, + void* user_data); struct Callbacks { inline explicit Callbacks(bool kHasGetPaddingCallback); @@ -995,22 +939,20 @@ class Http2Session : public AsyncWrap, public StreamListener { class Http2SessionPerformanceEntry : public PerformanceEntry { public: - Http2SessionPerformanceEntry( - Environment* env, - const Http2Session::Statistics& stats, - nghttp2_session_type type) : - PerformanceEntry(env, "Http2Session", "http2", - stats.start_time, - stats.end_time), - ping_rtt_(stats.ping_rtt), - data_sent_(stats.data_sent), - data_received_(stats.data_received), - frame_count_(stats.frame_count), - frame_sent_(stats.frame_sent), - stream_count_(stats.stream_count), - max_concurrent_streams_(stats.max_concurrent_streams), - stream_average_duration_(stats.stream_average_duration), - session_type_(type) { } + Http2SessionPerformanceEntry(Environment* env, + const Http2Session::Statistics& stats, + nghttp2_session_type type) + : PerformanceEntry( + env, "Http2Session", "http2", stats.start_time, stats.end_time), + ping_rtt_(stats.ping_rtt), + data_sent_(stats.data_sent), + data_received_(stats.data_received), + frame_count_(stats.frame_count), + frame_sent_(stats.frame_sent), + stream_count_(stats.stream_count), + max_concurrent_streams_(stats.max_concurrent_streams), + stream_average_duration_(stats.stream_average_duration), + session_type_(type) {} uint64_t ping_rtt() const { return ping_rtt_; } uint64_t data_sent() const { return data_sent_; } @@ -1040,19 +982,17 @@ class Http2SessionPerformanceEntry : public PerformanceEntry { class Http2StreamPerformanceEntry : public PerformanceEntry { public: - Http2StreamPerformanceEntry( - Environment* env, - int32_t id, - const Http2Stream::Statistics& stats) : - PerformanceEntry(env, "Http2Stream", "http2", - stats.start_time, - stats.end_time), - id_(id), - first_header_(stats.first_header), - first_byte_(stats.first_byte), - first_byte_sent_(stats.first_byte_sent), - sent_bytes_(stats.sent_bytes), - received_bytes_(stats.received_bytes) { } + Http2StreamPerformanceEntry(Environment* env, + int32_t id, + const Http2Stream::Statistics& stats) + : PerformanceEntry( + env, "Http2Stream", "http2", stats.start_time, stats.end_time), + id_(id), + first_header_(stats.first_header), + first_byte_(stats.first_byte), + first_byte_sent_(stats.first_byte_sent), + sent_bytes_(stats.sent_bytes), + received_bytes_(stats.received_bytes) {} int32_t id() const { return id_; } uint64_t first_header() const { return first_header_; } @@ -1120,9 +1060,7 @@ class Http2Session::Http2Settings : public AsyncWrap { static void RefreshDefaults(Environment* env); // Update the local or remote settings for the given session - static void Update(Environment* env, - Http2Session* session, - get_setting fn); + static void Update(Environment* env, Http2Session* session, get_setting fn); private: Http2Settings(Environment* env, Http2Session* session, uint64_t start_time); @@ -1133,12 +1071,10 @@ class Http2Session::Http2Settings : public AsyncWrap { nghttp2_settings_entry entries_[IDX_SETTINGS_COUNT]; }; -class ExternalHeader : - public String::ExternalOneByteStringResource { +class ExternalHeader : public String::ExternalOneByteStringResource { public: explicit ExternalHeader(nghttp2_rcbuf* buf) - : buf_(buf), vec_(nghttp2_rcbuf_get_buf(buf)) { - } + : buf_(buf), vec_(nghttp2_rcbuf_get_buf(buf)) {} ~ExternalHeader() override { nghttp2_rcbuf_decref(buf_); @@ -1149,17 +1085,12 @@ class ExternalHeader : return const_cast(reinterpret_cast(vec_.base)); } - size_t length() const override { - return vec_.len; - } + size_t length() const override { return vec_.len; } - static inline - MaybeLocal GetInternalizedString(Environment* env, - const nghttp2_vec& vec) { - return String::NewFromOneByte(env->isolate(), - vec.base, - v8::NewStringType::kInternalized, - vec.len); + static inline MaybeLocal GetInternalizedString( + Environment* env, const nghttp2_vec& vec) { + return String::NewFromOneByte( + env->isolate(), vec.base, v8::NewStringType::kInternalized, vec.len); } template @@ -1194,8 +1125,7 @@ class ExternalHeader : session->StopTrackingRcbuf(buf); ExternalHeader* h_str = new ExternalHeader(buf); MaybeLocal str = String::NewExternalOneByte(env->isolate(), h_str); - if (str.IsEmpty()) - delete h_str; + if (str.IsEmpty()) delete h_str; return str; } @@ -1210,13 +1140,9 @@ class Headers { Headers(Isolate* isolate, Local context, Local headers); ~Headers() {} - nghttp2_nv* operator*() { - return reinterpret_cast(*buf_); - } + nghttp2_nv* operator*() { return reinterpret_cast(*buf_); } - size_t length() const { - return count_; - } + size_t length() const { return count_; } private: size_t count_; @@ -1235,9 +1161,7 @@ class Origins { return reinterpret_cast(*buf_); } - size_t length() const { - return count_; - } + size_t length() const { return count_; } private: size_t count_; diff --git a/src/node_http2_state.h b/src/node_http2_state.h index d21d0f90096074..c68bf7639a43f9 100644 --- a/src/node_http2_state.h +++ b/src/node_http2_state.h @@ -8,125 +8,117 @@ namespace node { namespace http2 { - enum Http2SettingsIndex { - IDX_SETTINGS_HEADER_TABLE_SIZE, - IDX_SETTINGS_ENABLE_PUSH, - IDX_SETTINGS_INITIAL_WINDOW_SIZE, - IDX_SETTINGS_MAX_FRAME_SIZE, - IDX_SETTINGS_MAX_CONCURRENT_STREAMS, - IDX_SETTINGS_MAX_HEADER_LIST_SIZE, - IDX_SETTINGS_ENABLE_CONNECT_PROTOCOL, - IDX_SETTINGS_COUNT - }; +enum Http2SettingsIndex { + IDX_SETTINGS_HEADER_TABLE_SIZE, + IDX_SETTINGS_ENABLE_PUSH, + IDX_SETTINGS_INITIAL_WINDOW_SIZE, + IDX_SETTINGS_MAX_FRAME_SIZE, + IDX_SETTINGS_MAX_CONCURRENT_STREAMS, + IDX_SETTINGS_MAX_HEADER_LIST_SIZE, + IDX_SETTINGS_ENABLE_CONNECT_PROTOCOL, + IDX_SETTINGS_COUNT +}; - enum Http2SessionStateIndex { - IDX_SESSION_STATE_EFFECTIVE_LOCAL_WINDOW_SIZE, - IDX_SESSION_STATE_EFFECTIVE_RECV_DATA_LENGTH, - IDX_SESSION_STATE_NEXT_STREAM_ID, - IDX_SESSION_STATE_LOCAL_WINDOW_SIZE, - IDX_SESSION_STATE_LAST_PROC_STREAM_ID, - IDX_SESSION_STATE_REMOTE_WINDOW_SIZE, - IDX_SESSION_STATE_OUTBOUND_QUEUE_SIZE, - IDX_SESSION_STATE_HD_DEFLATE_DYNAMIC_TABLE_SIZE, - IDX_SESSION_STATE_HD_INFLATE_DYNAMIC_TABLE_SIZE, - IDX_SESSION_STATE_COUNT - }; +enum Http2SessionStateIndex { + IDX_SESSION_STATE_EFFECTIVE_LOCAL_WINDOW_SIZE, + IDX_SESSION_STATE_EFFECTIVE_RECV_DATA_LENGTH, + IDX_SESSION_STATE_NEXT_STREAM_ID, + IDX_SESSION_STATE_LOCAL_WINDOW_SIZE, + IDX_SESSION_STATE_LAST_PROC_STREAM_ID, + IDX_SESSION_STATE_REMOTE_WINDOW_SIZE, + IDX_SESSION_STATE_OUTBOUND_QUEUE_SIZE, + IDX_SESSION_STATE_HD_DEFLATE_DYNAMIC_TABLE_SIZE, + IDX_SESSION_STATE_HD_INFLATE_DYNAMIC_TABLE_SIZE, + IDX_SESSION_STATE_COUNT +}; - enum Http2StreamStateIndex { - IDX_STREAM_STATE, - IDX_STREAM_STATE_WEIGHT, - IDX_STREAM_STATE_SUM_DEPENDENCY_WEIGHT, - IDX_STREAM_STATE_LOCAL_CLOSE, - IDX_STREAM_STATE_REMOTE_CLOSE, - IDX_STREAM_STATE_LOCAL_WINDOW_SIZE, - IDX_STREAM_STATE_COUNT - }; +enum Http2StreamStateIndex { + IDX_STREAM_STATE, + IDX_STREAM_STATE_WEIGHT, + IDX_STREAM_STATE_SUM_DEPENDENCY_WEIGHT, + IDX_STREAM_STATE_LOCAL_CLOSE, + IDX_STREAM_STATE_REMOTE_CLOSE, + IDX_STREAM_STATE_LOCAL_WINDOW_SIZE, + IDX_STREAM_STATE_COUNT +}; - enum Http2OptionsIndex { - IDX_OPTIONS_MAX_DEFLATE_DYNAMIC_TABLE_SIZE, - IDX_OPTIONS_MAX_RESERVED_REMOTE_STREAMS, - IDX_OPTIONS_MAX_SEND_HEADER_BLOCK_LENGTH, - IDX_OPTIONS_PEER_MAX_CONCURRENT_STREAMS, - IDX_OPTIONS_PADDING_STRATEGY, - IDX_OPTIONS_MAX_HEADER_LIST_PAIRS, - IDX_OPTIONS_MAX_OUTSTANDING_PINGS, - IDX_OPTIONS_MAX_OUTSTANDING_SETTINGS, - IDX_OPTIONS_MAX_SESSION_MEMORY, - IDX_OPTIONS_FLAGS - }; +enum Http2OptionsIndex { + IDX_OPTIONS_MAX_DEFLATE_DYNAMIC_TABLE_SIZE, + IDX_OPTIONS_MAX_RESERVED_REMOTE_STREAMS, + IDX_OPTIONS_MAX_SEND_HEADER_BLOCK_LENGTH, + IDX_OPTIONS_PEER_MAX_CONCURRENT_STREAMS, + IDX_OPTIONS_PADDING_STRATEGY, + IDX_OPTIONS_MAX_HEADER_LIST_PAIRS, + IDX_OPTIONS_MAX_OUTSTANDING_PINGS, + IDX_OPTIONS_MAX_OUTSTANDING_SETTINGS, + IDX_OPTIONS_MAX_SESSION_MEMORY, + IDX_OPTIONS_FLAGS +}; - enum Http2PaddingBufferFields { - PADDING_BUF_FRAME_LENGTH, - PADDING_BUF_MAX_PAYLOAD_LENGTH, - PADDING_BUF_RETURN_VALUE, - PADDING_BUF_FIELD_COUNT - }; +enum Http2PaddingBufferFields { + PADDING_BUF_FRAME_LENGTH, + PADDING_BUF_MAX_PAYLOAD_LENGTH, + PADDING_BUF_RETURN_VALUE, + PADDING_BUF_FIELD_COUNT +}; - enum Http2StreamStatisticsIndex { - IDX_STREAM_STATS_ID, - IDX_STREAM_STATS_TIMETOFIRSTBYTE, - IDX_STREAM_STATS_TIMETOFIRSTHEADER, - IDX_STREAM_STATS_TIMETOFIRSTBYTESENT, - IDX_STREAM_STATS_SENTBYTES, - IDX_STREAM_STATS_RECEIVEDBYTES, - IDX_STREAM_STATS_COUNT - }; +enum Http2StreamStatisticsIndex { + IDX_STREAM_STATS_ID, + IDX_STREAM_STATS_TIMETOFIRSTBYTE, + IDX_STREAM_STATS_TIMETOFIRSTHEADER, + IDX_STREAM_STATS_TIMETOFIRSTBYTESENT, + IDX_STREAM_STATS_SENTBYTES, + IDX_STREAM_STATS_RECEIVEDBYTES, + IDX_STREAM_STATS_COUNT +}; - enum Http2SessionStatisticsIndex { - IDX_SESSION_STATS_TYPE, - IDX_SESSION_STATS_PINGRTT, - IDX_SESSION_STATS_FRAMESRECEIVED, - IDX_SESSION_STATS_FRAMESSENT, - IDX_SESSION_STATS_STREAMCOUNT, - IDX_SESSION_STATS_STREAMAVERAGEDURATION, - IDX_SESSION_STATS_DATA_SENT, - IDX_SESSION_STATS_DATA_RECEIVED, - IDX_SESSION_STATS_MAX_CONCURRENT_STREAMS, - IDX_SESSION_STATS_COUNT - }; +enum Http2SessionStatisticsIndex { + IDX_SESSION_STATS_TYPE, + IDX_SESSION_STATS_PINGRTT, + IDX_SESSION_STATS_FRAMESRECEIVED, + IDX_SESSION_STATS_FRAMESSENT, + IDX_SESSION_STATS_STREAMCOUNT, + IDX_SESSION_STATS_STREAMAVERAGEDURATION, + IDX_SESSION_STATS_DATA_SENT, + IDX_SESSION_STATS_DATA_RECEIVED, + IDX_SESSION_STATS_MAX_CONCURRENT_STREAMS, + IDX_SESSION_STATS_COUNT +}; class Http2State { public: - explicit Http2State(v8::Isolate* isolate) : - root_buffer( - isolate, - sizeof(http2_state_internal)), - session_state_buffer( - isolate, - offsetof(http2_state_internal, session_state_buffer), - IDX_SESSION_STATE_COUNT, - root_buffer), - stream_state_buffer( - isolate, - offsetof(http2_state_internal, stream_state_buffer), - IDX_STREAM_STATE_COUNT, - root_buffer), - stream_stats_buffer( - isolate, - offsetof(http2_state_internal, stream_stats_buffer), - IDX_STREAM_STATS_COUNT, - root_buffer), - session_stats_buffer( - isolate, - offsetof(http2_state_internal, session_stats_buffer), - IDX_SESSION_STATS_COUNT, - root_buffer), - padding_buffer( - isolate, - offsetof(http2_state_internal, padding_buffer), - PADDING_BUF_FIELD_COUNT, - root_buffer), - options_buffer( - isolate, - offsetof(http2_state_internal, options_buffer), - IDX_OPTIONS_FLAGS + 1, - root_buffer), - settings_buffer( - isolate, - offsetof(http2_state_internal, settings_buffer), - IDX_SETTINGS_COUNT + 1, - root_buffer) { - } + explicit Http2State(v8::Isolate* isolate) + : root_buffer(isolate, sizeof(http2_state_internal)), + session_state_buffer( + isolate, + offsetof(http2_state_internal, session_state_buffer), + IDX_SESSION_STATE_COUNT, + root_buffer), + stream_state_buffer(isolate, + offsetof(http2_state_internal, stream_state_buffer), + IDX_STREAM_STATE_COUNT, + root_buffer), + stream_stats_buffer(isolate, + offsetof(http2_state_internal, stream_stats_buffer), + IDX_STREAM_STATS_COUNT, + root_buffer), + session_stats_buffer( + isolate, + offsetof(http2_state_internal, session_stats_buffer), + IDX_SESSION_STATS_COUNT, + root_buffer), + padding_buffer(isolate, + offsetof(http2_state_internal, padding_buffer), + PADDING_BUF_FIELD_COUNT, + root_buffer), + options_buffer(isolate, + offsetof(http2_state_internal, options_buffer), + IDX_OPTIONS_FLAGS + 1, + root_buffer), + settings_buffer(isolate, + offsetof(http2_state_internal, settings_buffer), + IDX_SETTINGS_COUNT + 1, + root_buffer) {} AliasedBuffer root_buffer; AliasedBuffer session_state_buffer; diff --git a/src/node_http_parser_impl.h b/src/node_http_parser_impl.h index 7a955cc1e9eca6..e6831b04157920 100644 --- a/src/node_http_parser_impl.h +++ b/src/node_http_parser_impl.h @@ -51,7 +51,6 @@ // No copying is performed when slicing the buffer, only small reference // allocations. - namespace node { namespace { // NOLINT(build/namespaces) @@ -89,11 +88,7 @@ struct StringPtr { Reset(); } - - ~StringPtr() { - Reset(); - } - + ~StringPtr() { Reset(); } // If str_ does not point to a heap string yet, this function makes it do // so. This is called at the end of each http_parser_execute() so as not @@ -107,7 +102,6 @@ struct StringPtr { } } - void Reset() { if (on_heap_) { delete[] str_; @@ -118,7 +112,6 @@ struct StringPtr { size_ = 0; } - void Update(const char* str, size_t size) { if (str_ == nullptr) { str_ = str; @@ -139,7 +132,6 @@ struct StringPtr { size_ += size; } - Local ToString(Environment* env) const { if (str_) return OneByteString(env->isolate(), str_, size_); @@ -147,13 +139,11 @@ struct StringPtr { return String::Empty(env->isolate()); } - const char* str_; bool on_heap_; size_t size_; }; - class Parser : public AsyncWrap, public StreamListener { public: Parser(Environment* env, Local wrap, parser_type_t type) @@ -163,7 +153,6 @@ class Parser : public AsyncWrap, public StreamListener { Init(type); } - void MemoryInfo(MemoryTracker* tracker) const override { tracker->TrackField("current_buffer", current_buffer_); } @@ -178,7 +167,6 @@ class Parser : public AsyncWrap, public StreamListener { return 0; } - int on_url(const char* at, size_t length) { int rv = TrackHeader(length); if (rv != 0) { @@ -189,7 +177,6 @@ class Parser : public AsyncWrap, public StreamListener { return 0; } - int on_status(const char* at, size_t length) { int rv = TrackHeader(length); if (rv != 0) { @@ -200,7 +187,6 @@ class Parser : public AsyncWrap, public StreamListener { return 0; } - int on_header_field(const char* at, size_t length) { int rv = TrackHeader(length); if (rv != 0) { @@ -227,7 +213,6 @@ class Parser : public AsyncWrap, public StreamListener { return 0; } - int on_header_value(const char* at, size_t length) { int rv = TrackHeader(length); if (rv != 0) { @@ -248,11 +233,10 @@ class Parser : public AsyncWrap, public StreamListener { return 0; } - int on_headers_complete() { #ifdef NODE_EXPERIMENTAL_HTTP header_nread_ = 0; -#endif /* NODE_EXPERIMENTAL_HTTP */ +#endif /* NODE_EXPERIMENTAL_HTTP */ // Arguments for the on-headers-complete javascript callback. This // list needs to be kept in sync with the actual argument list for @@ -272,15 +256,13 @@ class Parser : public AsyncWrap, public StreamListener { Local argv[A_MAX]; Local obj = object(); - Local cb = obj->Get(env()->context(), - kOnHeadersComplete).ToLocalChecked(); + Local cb = + obj->Get(env()->context(), kOnHeadersComplete).ToLocalChecked(); - if (!cb->IsFunction()) - return 0; + if (!cb->IsFunction()) return 0; Local undefined = Undefined(env()->isolate()); - for (size_t i = 0; i < arraysize(argv); i++) - argv[i] = undefined; + for (size_t i = 0; i < arraysize(argv); i++) argv[i] = undefined; if (have_flushed_) { // Slow case, flush remaining headers. @@ -288,8 +270,7 @@ class Parser : public AsyncWrap, public StreamListener { } else { // Fast case, pass headers and URL to JS land. argv[A_HEADERS] = CreateHeaders(); - if (parser_.type == HTTP_REQUEST) - argv[A_URL] = url_.ToString(env()); + if (parser_.type == HTTP_REQUEST) argv[A_URL] = url_.ToString(env()); } num_fields_ = 0; @@ -303,8 +284,7 @@ class Parser : public AsyncWrap, public StreamListener { // STATUS if (parser_.type == HTTP_RESPONSE) { - argv[A_STATUS_CODE] = - Integer::New(env()->isolate(), parser_.status_code); + argv[A_STATUS_CODE] = Integer::New(env()->isolate(), parser_.status_code); argv[A_STATUS_MESSAGE] = status_message_.ToString(env()); } @@ -317,7 +297,7 @@ class Parser : public AsyncWrap, public StreamListener { should_keep_alive = llhttp_should_keep_alive(&parser_); #else /* !NODE_EXPERIMENTAL_HTTP */ should_keep_alive = http_should_keep_alive(&parser_); -#endif /* NODE_EXPERIMENTAL_HTTP */ +#endif /* NODE_EXPERIMENTAL_HTTP */ argv[A_SHOULD_KEEP_ALIVE] = Boolean::New(env()->isolate(), should_keep_alive); @@ -341,59 +321,52 @@ class Parser : public AsyncWrap, public StreamListener { return val; } - int on_body(const char* at, size_t length) { EscapableHandleScope scope(env()->isolate()); Local obj = object(); Local cb = obj->Get(env()->context(), kOnBody).ToLocalChecked(); - if (!cb->IsFunction()) - return 0; + if (!cb->IsFunction()) return 0; // We came from consumed stream if (current_buffer_.IsEmpty()) { // Make sure Buffer will be in parent HandleScope - current_buffer_ = scope.Escape(Buffer::Copy( - env()->isolate(), - current_buffer_data_, - current_buffer_len_).ToLocalChecked()); + current_buffer_ = scope.Escape(Buffer::Copy(env()->isolate(), + current_buffer_data_, + current_buffer_len_) + .ToLocalChecked()); } Local argv[3] = { - current_buffer_, - Integer::NewFromUnsigned(env()->isolate(), at - current_buffer_data_), - Integer::NewFromUnsigned(env()->isolate(), length) - }; + current_buffer_, + Integer::NewFromUnsigned(env()->isolate(), at - current_buffer_data_), + Integer::NewFromUnsigned(env()->isolate(), length)}; - MaybeLocal r = MakeCallback(cb.As(), - arraysize(argv), - argv); + MaybeLocal r = + MakeCallback(cb.As(), arraysize(argv), argv); if (r.IsEmpty()) { got_exception_ = true; #ifdef NODE_EXPERIMENTAL_HTTP llhttp_set_error_reason(&parser_, "HPE_JS_EXCEPTION:JS Exception"); -#endif /* NODE_EXPERIMENTAL_HTTP */ +#endif /* NODE_EXPERIMENTAL_HTTP */ return HPE_USER; } return 0; } - int on_message_complete() { HandleScope scope(env()->isolate()); - if (num_fields_) - Flush(); // Flush trailing HTTP headers. + if (num_fields_) Flush(); // Flush trailing HTTP headers. Local obj = object(); - Local cb = obj->Get(env()->context(), - kOnMessageComplete).ToLocalChecked(); + Local cb = + obj->Get(env()->context(), kOnMessageComplete).ToLocalChecked(); - if (!cb->IsFunction()) - return 0; + if (!cb->IsFunction()) return 0; Environment::AsyncCallbackScope callback_scope(env()); @@ -414,14 +387,12 @@ class Parser : public AsyncWrap, public StreamListener { return 0; } - // Reset nread for the next chunk int on_chunk_complete() { header_nread_ = 0; return 0; } -#endif /* NODE_EXPERIMENTAL_HTTP */ - +#endif /* NODE_EXPERIMENTAL_HTTP */ static void New(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -432,7 +403,6 @@ class Parser : public AsyncWrap, public StreamListener { new Parser(env, args.This(), type); } - static void Close(const FunctionCallbackInfo& args) { Parser* parser; ASSIGN_OR_RETURN_UNWRAP(&parser, args.Holder()); @@ -440,7 +410,6 @@ class Parser : public AsyncWrap, public StreamListener { delete parser; } - static void Free(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); Parser* parser; @@ -452,7 +421,6 @@ class Parser : public AsyncWrap, public StreamListener { parser->EmitDestroy(env, parser->get_async_id()); } - void Save() { url_.Save(); status_message_.Save(); @@ -466,7 +434,6 @@ class Parser : public AsyncWrap, public StreamListener { } } - // var bytesParsed = parser->execute(buffer); static void Execute(const FunctionCallbackInfo& args) { Parser* parser; @@ -487,11 +454,9 @@ class Parser : public AsyncWrap, public StreamListener { Local ret = parser->Execute(buffer_data, buffer_len); - if (!ret.IsEmpty()) - args.GetReturnValue().Set(ret); + if (!ret.IsEmpty()) args.GetReturnValue().Set(ret); } - static void Finish(const FunctionCallbackInfo& args) { Parser* parser; ASSIGN_OR_RETURN_UNWRAP(&parser, args.Holder()); @@ -499,11 +464,9 @@ class Parser : public AsyncWrap, public StreamListener { CHECK(parser->current_buffer_.IsEmpty()); Local ret = parser->Execute(nullptr, 0); - if (!ret.IsEmpty()) - args.GetReturnValue().Set(ret); + if (!ret.IsEmpty()) args.GetReturnValue().Set(ret); } - static void Reinitialize(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -527,7 +490,6 @@ class Parser : public AsyncWrap, public StreamListener { parser->Init(type); } - template static void Pause(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -549,10 +511,9 @@ class Parser : public AsyncWrap, public StreamListener { } #else /* !NODE_EXPERIMENTAL_HTTP */ http_parser_pause(&parser->parser_, should_pause); -#endif /* NODE_EXPERIMENTAL_HTTP */ +#endif /* NODE_EXPERIMENTAL_HTTP */ } - static void Consume(const FunctionCallbackInfo& args) { Parser* parser; ASSIGN_OR_RETURN_UNWRAP(&parser, args.Holder()); @@ -563,27 +524,24 @@ class Parser : public AsyncWrap, public StreamListener { stream->PushStreamListener(parser); } - static void Unconsume(const FunctionCallbackInfo& args) { Parser* parser; ASSIGN_OR_RETURN_UNWRAP(&parser, args.Holder()); // Already unconsumed - if (parser->stream_ == nullptr) - return; + if (parser->stream_ == nullptr) return; parser->stream_->RemoveStreamListener(parser); } - static void GetCurrentBuffer(const FunctionCallbackInfo& args) { Parser* parser; ASSIGN_OR_RETURN_UNWRAP(&parser, args.Holder()); - Local ret = Buffer::Copy( - parser->env(), - parser->current_buffer_data_, - parser->current_buffer_len_).ToLocalChecked(); + Local ret = Buffer::Copy(parser->env(), + parser->current_buffer_data_, + parser->current_buffer_len_) + .ToLocalChecked(); args.GetReturnValue().Set(ret); } @@ -606,7 +564,6 @@ class Parser : public AsyncWrap, public StreamListener { return uv_buf_init(env()->http_parser_buffer(), kAllocBufferSize); } - void OnStreamRead(ssize_t nread, const uv_buf_t& buf) override { HandleScope scope(env()->isolate()); // Once we’re done here, either indicate that the HTTP parser buffer @@ -625,21 +582,18 @@ class Parser : public AsyncWrap, public StreamListener { } // Ignore, empty reads have special meaning in http parser - if (nread == 0) - return; + if (nread == 0) return; current_buffer_.Clear(); Local ret = Execute(buf.base, nread); // Exception - if (ret.IsEmpty()) - return; + if (ret.IsEmpty()) return; Local cb = object()->Get(env()->context(), kOnExecute).ToLocalChecked(); - if (!cb->IsFunction()) - return; + if (!cb->IsFunction()) return; // Hooks for GetCurrentBuffer current_buffer_len_ = nread; @@ -651,7 +605,6 @@ class Parser : public AsyncWrap, public StreamListener { current_buffer_data_ = nullptr; } - Local Execute(char* data, size_t len) { EscapableHandleScope scope(env()->isolate()); @@ -711,11 +664,11 @@ class Parser : public AsyncWrap, public StreamListener { UNREACHABLE(); } - // Regular Execute() + // Regular Execute() } else { Save(); } -#endif /* NODE_EXPERIMENTAL_HTTP */ +#endif /* NODE_EXPERIMENTAL_HTTP */ // Unassign the 'buffer_' variable current_buffer_.Clear(); @@ -723,8 +676,7 @@ class Parser : public AsyncWrap, public StreamListener { current_buffer_data_ = nullptr; // If there was an exception in one of the callbacks - if (got_exception_) - return scope.Escape(Local()); + if (got_exception_) return scope.Escape(Local()); Local nread_obj = Integer::New(env()->isolate(), nread); @@ -732,11 +684,10 @@ class Parser : public AsyncWrap, public StreamListener { // TODO(bnoordhuis) What if there is an error on EOF? if (!parser_.upgrade && err != HPE_OK) { Local e = Exception::Error(env()->parse_error_string()); - Local obj = e->ToObject(env()->isolate()->GetCurrentContext()) - .ToLocalChecked(); - obj->Set(env()->context(), - env()->bytes_parsed_string(), - nread_obj).FromJust(); + Local obj = + e->ToObject(env()->isolate()->GetCurrentContext()).ToLocalChecked(); + obj->Set(env()->context(), env()->bytes_parsed_string(), nread_obj) + .FromJust(); #ifdef NODE_EXPERIMENTAL_HTTP const char* errno_reason = llhttp_get_error_reason(&parser_); @@ -745,8 +696,8 @@ class Parser : public AsyncWrap, public StreamListener { if (err == HPE_USER) { const char* colon = strchr(errno_reason, ':'); CHECK_NE(colon, nullptr); - code = OneByteString(env()->isolate(), errno_reason, - colon - errno_reason); + code = + OneByteString(env()->isolate(), errno_reason, colon - errno_reason); reason = OneByteString(env()->isolate(), colon + 1); } else { code = OneByteString(env()->isolate(), llhttp_errno_name(err)); @@ -758,9 +709,9 @@ class Parser : public AsyncWrap, public StreamListener { #else /* !NODE_EXPERIMENTAL_HTTP */ obj->Set(env()->context(), env()->code_string(), - OneByteString(env()->isolate(), - http_errno_name(err))).FromJust(); -#endif /* NODE_EXPERIMENTAL_HTTP */ + OneByteString(env()->isolate(), http_errno_name(err))) + .FromJust(); +#endif /* NODE_EXPERIMENTAL_HTTP */ return scope.Escape(e); } @@ -783,7 +734,6 @@ class Parser : public AsyncWrap, public StreamListener { return Array::New(env()->isolate(), headers_v, num_values_ * 2); } - // spill headers and request path to JS land void Flush() { HandleScope scope(env()->isolate()); @@ -791,33 +741,26 @@ class Parser : public AsyncWrap, public StreamListener { Local obj = object(); Local cb = obj->Get(env()->context(), kOnHeaders).ToLocalChecked(); - if (!cb->IsFunction()) - return; + if (!cb->IsFunction()) return; - Local argv[2] = { - CreateHeaders(), - url_.ToString(env()) - }; + Local argv[2] = {CreateHeaders(), url_.ToString(env())}; - MaybeLocal r = MakeCallback(cb.As(), - arraysize(argv), - argv); + MaybeLocal r = + MakeCallback(cb.As(), arraysize(argv), argv); - if (r.IsEmpty()) - got_exception_ = true; + if (r.IsEmpty()) got_exception_ = true; url_.Reset(); have_flushed_ = true; } - void Init(parser_type_t type) { #ifdef NODE_EXPERIMENTAL_HTTP llhttp_init(&parser_, type, &settings); header_nread_ = 0; #else /* !NODE_EXPERIMENTAL_HTTP */ http_parser_init(&parser_, type); -#endif /* NODE_EXPERIMENTAL_HTTP */ +#endif /* NODE_EXPERIMENTAL_HTTP */ url_.Reset(); status_message_.Reset(); num_fields_ = 0; @@ -826,7 +769,6 @@ class Parser : public AsyncWrap, public StreamListener { got_exception_ = false; } - int TrackHeader(size_t len) { #ifdef NODE_EXPERIMENTAL_HTTP header_nread_ += len; @@ -834,11 +776,10 @@ class Parser : public AsyncWrap, public StreamListener { llhttp_set_error_reason(&parser_, "HPE_HEADER_OVERFLOW:Header overflow"); return HPE_USER; } -#endif /* NODE_EXPERIMENTAL_HTTP */ +#endif /* NODE_EXPERIMENTAL_HTTP */ return 0; } - int MaybePause() { #ifdef NODE_EXPERIMENTAL_HTTP CHECK_NE(execute_depth_, 0); @@ -852,7 +793,7 @@ class Parser : public AsyncWrap, public StreamListener { return HPE_PAUSED; #else /* !NODE_EXPERIMENTAL_HTTP */ return 0; -#endif /* NODE_EXPERIMENTAL_HTTP */ +#endif /* NODE_EXPERIMENTAL_HTTP */ } parser_t parser_; @@ -871,14 +812,15 @@ class Parser : public AsyncWrap, public StreamListener { unsigned int execute_depth_ = 0; bool pending_pause_ = false; uint64_t header_nread_ = 0; -#endif /* NODE_EXPERIMENTAL_HTTP */ +#endif /* NODE_EXPERIMENTAL_HTTP */ // These are helper functions for filling `http_parser_settings`, which turn // a member function of Parser into a C-style HTTP parser callback. - template struct Proxy; - template + template + struct Proxy; + template struct Proxy { - static int Raw(parser_t* p, Args ... args) { + static int Raw(parser_t* p, Args... args) { Parser* parser = ContainerOf(&Parser::parser_, p); int rv = (parser->*Member)(std::forward(args)...); if (rv == 0) { @@ -895,32 +837,30 @@ class Parser : public AsyncWrap, public StreamListener { }; const parser_settings_t Parser::settings = { - Proxy::Raw, - Proxy::Raw, - Proxy::Raw, - Proxy::Raw, - Proxy::Raw, - Proxy::Raw, - Proxy::Raw, - Proxy::Raw, + Proxy::Raw, + Proxy::Raw, + Proxy::Raw, + Proxy::Raw, + Proxy::Raw, + Proxy::Raw, + Proxy::Raw, + Proxy::Raw, #ifdef NODE_EXPERIMENTAL_HTTP - Proxy::Raw, - Proxy::Raw, + Proxy::Raw, + Proxy::Raw, #else /* !NODE_EXPERIMENTAL_HTTP */ - nullptr, - nullptr, -#endif /* NODE_EXPERIMENTAL_HTTP */ + nullptr, + nullptr, +#endif /* NODE_EXPERIMENTAL_HTTP */ }; - #ifndef NODE_EXPERIMENTAL_HTTP void InitMaxHttpHeaderSizeOnce() { const uint32_t max_http_header_size = per_process::cli_options->max_http_header_size; http_parser_set_max_header_size(max_http_header_size); } -#endif /* NODE_EXPERIMENTAL_HTTP */ - +#endif /* NODE_EXPERIMENTAL_HTTP */ void InitializeHttpParser(Local target, Local unused, @@ -947,14 +887,18 @@ void InitializeHttpParser(Local target, Integer::NewFromUnsigned(env->isolate(), kOnExecute)); Local methods = Array::New(env->isolate()); -#define V(num, name, string) \ - methods->Set(env->context(), \ - num, FIXED_ONE_BYTE_STRING(env->isolate(), #string)).FromJust(); +#define V(num, name, string) \ + methods \ + ->Set( \ + env->context(), num, FIXED_ONE_BYTE_STRING(env->isolate(), #string)) \ + .FromJust(); HTTP_METHOD_MAP(V) #undef V - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "methods"), - methods).FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "methods"), + methods) + .FromJust(); t->Inherit(AsyncWrap::GetConstructorTemplate(env)); env->SetProtoMethod(t, "close", Parser::Close); @@ -968,14 +912,16 @@ void InitializeHttpParser(Local target, env->SetProtoMethod(t, "unconsume", Parser::Unconsume); env->SetProtoMethod(t, "getCurrentBuffer", Parser::GetCurrentBuffer); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "HTTPParser"), - t->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "HTTPParser"), + t->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); #ifndef NODE_EXPERIMENTAL_HTTP static uv_once_t init_once = UV_ONCE_INIT; uv_once(&init_once, InitMaxHttpHeaderSizeOnce); -#endif /* NODE_EXPERIMENTAL_HTTP */ +#endif /* NODE_EXPERIMENTAL_HTTP */ } } // anonymous namespace diff --git a/src/node_http_parser_llhttp.cc b/src/node_http_parser_llhttp.cc index 423fb5e104bc50..212583cbdf77be 100644 --- a/src/node_http_parser_llhttp.cc +++ b/src/node_http_parser_llhttp.cc @@ -7,11 +7,8 @@ namespace node { namespace per_process { const char* const llhttp_version = - NODE_STRINGIFY(LLHTTP_VERSION_MAJOR) - "." - NODE_STRINGIFY(LLHTTP_VERSION_MINOR) - "." - NODE_STRINGIFY(LLHTTP_VERSION_PATCH); + NODE_STRINGIFY(LLHTTP_VERSION_MAJOR) "." NODE_STRINGIFY( + LLHTTP_VERSION_MINOR) "." NODE_STRINGIFY(LLHTTP_VERSION_PATCH); } // namespace per_process } // namespace node diff --git a/src/node_http_parser_traditional.cc b/src/node_http_parser_traditional.cc index 89ef65979ca78b..5ce1580d4a0603 100644 --- a/src/node_http_parser_traditional.cc +++ b/src/node_http_parser_traditional.cc @@ -8,11 +8,8 @@ namespace node { namespace per_process { const char* const http_parser_version = - NODE_STRINGIFY(HTTP_PARSER_VERSION_MAJOR) - "." - NODE_STRINGIFY(HTTP_PARSER_VERSION_MINOR) - "." - NODE_STRINGIFY(HTTP_PARSER_VERSION_PATCH); + NODE_STRINGIFY(HTTP_PARSER_VERSION_MAJOR) "." NODE_STRINGIFY( + HTTP_PARSER_VERSION_MINOR) "." NODE_STRINGIFY(HTTP_PARSER_VERSION_PATCH); } // namespace per_process } // namespace node diff --git a/src/node_i18n.cc b/src/node_i18n.cc index e207ed968892b9..4252d9853b8640 100644 --- a/src/node_i18n.cc +++ b/src/node_i18n.cc @@ -39,7 +39,6 @@ * See: http://bugs.icu-project.org/trac/ticket/10924 */ - #include "node_i18n.h" #if defined(NODE_HAVE_I18N_SUPPORT) @@ -53,25 +52,25 @@ #include "util-inl.h" #include "v8.h" -#include #include +#include #include #include +#include #include #include -#include -#include -#include -#include #include +#include +#include +#include +#include #include #include -#include #ifdef NODE_HAVE_SMALL_ICU /* if this is defined, we have a 'secondary' entry point. compare following to utypes.h defs for U_ICUDATA_ENTRY_POINT */ -#define SMALL_ICUDATA_ENTRY_POINT \ +#define SMALL_ICUDATA_ENTRY_POINT \ SMALL_DEF2(U_ICU_VERSION_MAJOR_NUM, U_LIB_SUFFIX_C_NAME) #define SMALL_DEF2(major, suff) SMALL_DEF(major, suff) #ifndef U_LIB_SUFFIX_C_NAME @@ -104,8 +103,7 @@ namespace { template MaybeLocal ToBufferEndian(Environment* env, MaybeStackBuffer* buf) { MaybeLocal ret = Buffer::New(env, buf); - if (ret.IsEmpty()) - return ret; + if (ret.IsEmpty()) return ret; static_assert(sizeof(T) == 1 || sizeof(T) == 2, "Currently only one- or two-byte buffers are supported"); @@ -128,8 +126,8 @@ struct Converter { } } - explicit Converter(UConverter* converter, - const char* sub = nullptr) : conv(converter) { + explicit Converter(UConverter* converter, const char* sub = nullptr) + : conv(converter) { CHECK_NOT_NULL(conv); UErrorCode status = U_ZERO_ERROR; if (sub != nullptr) { @@ -137,9 +135,7 @@ struct Converter { } } - ~Converter() { - ucnv_close(conv); - } + ~Converter() { ucnv_close(conv); } UConverter* conv; }; @@ -147,8 +143,8 @@ struct Converter { class ConverterObject : public BaseObject, Converter { public: enum ConverterFlags { - CONVERTER_FLAGS_FLUSH = 0x1, - CONVERTER_FLAGS_FATAL = 0x2, + CONVERTER_FLAGS_FLUSH = 0x1, + CONVERTER_FLAGS_FATAL = 0x2, CONVERTER_FLAGS_IGNORE_BOM = 0x4 }; @@ -179,20 +175,18 @@ class ConverterObject : public BaseObject, Converter { CHECK_GE(args.Length(), 2); Utf8Value label(env->isolate(), args[0]); int flags = args[1]->Uint32Value(env->context()).ToChecked(); - bool fatal = - (flags & CONVERTER_FLAGS_FATAL) == CONVERTER_FLAGS_FATAL; + bool fatal = (flags & CONVERTER_FLAGS_FATAL) == CONVERTER_FLAGS_FATAL; bool ignoreBOM = (flags & CONVERTER_FLAGS_IGNORE_BOM) == CONVERTER_FLAGS_IGNORE_BOM; UErrorCode status = U_ZERO_ERROR; UConverter* conv = ucnv_open(*label, &status); - if (U_FAILURE(status)) - return; + if (U_FAILURE(status)) return; if (fatal) { status = U_ZERO_ERROR; - ucnv_setToUCallBack(conv, UCNV_TO_U_CALLBACK_STOP, - nullptr, nullptr, nullptr, &status); + ucnv_setToUCallBack( + conv, UCNV_TO_U_CALLBACK_STOP, nullptr, nullptr, nullptr, &status); } new ConverterObject(env, obj, conv, ignoreBOM); @@ -213,10 +207,8 @@ class ConverterObject : public BaseObject, Converter { UErrorCode status = U_ZERO_ERROR; MaybeStackBuffer result; MaybeLocal ret; - size_t limit = ucnv_getMinCharSize(converter->conv) * - input_obj_length; - if (limit > 0) - result.AllocateSufficientStorage(limit); + size_t limit = ucnv_getMinCharSize(converter->conv) * input_obj_length; + if (limit > 0) result.AllocateSufficientStorage(limit); UBool flush = (flags & CONVERTER_FLAGS_FLUSH) == CONVERTER_FLAGS_FLUSH; OnScopeLeave cleanup([&]() { @@ -240,13 +232,16 @@ class ConverterObject : public BaseObject, Converter { UChar* target = *result; ucnv_toUnicode(converter->conv, - &target, target + (limit * sizeof(UChar)), - &source, source + source_length, - nullptr, flush, &status); + &target, + target + (limit * sizeof(UChar)), + &source, + source + source_length, + nullptr, + flush, + &status); if (U_SUCCESS(status)) { - if (limit > 0) - result.SetLength(target - &result[0]); + if (limit > 0) result.SetLength(target - &result[0]); ret = ToBufferEndian(env, &result); args.GetReturnValue().Set(ret.ToLocalChecked()); return; @@ -264,10 +259,10 @@ class ConverterObject : public BaseObject, Converter { Local wrap, UConverter* converter, bool ignoreBOM, - const char* sub = nullptr) : - BaseObject(env, wrap), - Converter(converter, sub), - ignoreBOM_(ignoreBOM) { + const char* sub = nullptr) + : BaseObject(env, wrap), + Converter(converter, sub), + ignoreBOM_(ignoreBOM) { MakeWeak(); switch (ucnv_getType(converter)) { @@ -282,9 +277,9 @@ class ConverterObject : public BaseObject, Converter { } private: - bool unicode_ = false; // True if this is a Unicode converter - bool ignoreBOM_ = false; // True if the BOM should be ignored on Unicode - bool bomSeen_ = false; // True if the BOM has been seen + bool unicode_ = false; // True if this is a Unicode converter + bool ignoreBOM_ = false; // True if the BOM should be ignored on Unicode + bool bomSeen_ = false; // True if the BOM has been seen }; // One-Shot Converters @@ -322,9 +317,19 @@ MaybeLocal Transcode(Environment* env, const uint32_t limit = source_length * ucnv_getMaxCharSize(to.conv); result.AllocateSufficientStorage(limit); char* target = *result; - ucnv_convertEx(to.conv, from.conv, &target, target + limit, - &source, source + source_length, nullptr, nullptr, - nullptr, nullptr, true, true, status); + ucnv_convertEx(to.conv, + from.conv, + &target, + target + limit, + &source, + source + source_length, + nullptr, + nullptr, + nullptr, + nullptr, + true, + true, + status); if (U_SUCCESS(*status)) { result.SetLength(target - &result[0]); ret = ToBufferEndian(env, &result); @@ -343,10 +348,9 @@ MaybeLocal TranscodeToUcs2(Environment* env, MaybeStackBuffer destbuf(source_length); Converter from(fromEncoding); const size_t length_in_chars = source_length * sizeof(UChar); - ucnv_toUChars(from.conv, *destbuf, length_in_chars, - source, source_length, status); - if (U_SUCCESS(*status)) - ret = ToBufferEndian(env, &destbuf); + ucnv_toUChars( + from.conv, *destbuf, length_in_chars, source, source_length, status); + if (U_SUCCESS(*status)) ret = ToBufferEndian(env, &destbuf); return ret; } @@ -363,8 +367,8 @@ MaybeLocal TranscodeFromUcs2(Environment* env, const size_t length_in_chars = source_length / sizeof(UChar); CopySourceBuffer(&sourcebuf, source, source_length, length_in_chars); MaybeStackBuffer destbuf(length_in_chars); - const uint32_t len = ucnv_fromUChars(to.conv, *destbuf, length_in_chars, - *sourcebuf, length_in_chars, status); + const uint32_t len = ucnv_fromUChars( + to.conv, *destbuf, length_in_chars, *sourcebuf, length_in_chars, status); if (U_SUCCESS(*status)) { destbuf.SetLength(len); ret = ToBufferEndian(env, &destbuf); @@ -381,8 +385,12 @@ MaybeLocal TranscodeUcs2FromUtf8(Environment* env, *status = U_ZERO_ERROR; MaybeStackBuffer destbuf; int32_t result_length; - u_strFromUTF8(*destbuf, destbuf.capacity(), &result_length, - source, source_length, status); + u_strFromUTF8(*destbuf, + destbuf.capacity(), + &result_length, + source, + source_length, + status); MaybeLocal ret; if (U_SUCCESS(*status)) { destbuf.SetLength(result_length); @@ -390,8 +398,8 @@ MaybeLocal TranscodeUcs2FromUtf8(Environment* env, } else if (*status == U_BUFFER_OVERFLOW_ERROR) { *status = U_ZERO_ERROR; destbuf.AllocateSufficientStorage(result_length); - u_strFromUTF8(*destbuf, result_length, &result_length, - source, source_length, status); + u_strFromUTF8( + *destbuf, result_length, &result_length, source, source_length, status); if (U_SUCCESS(*status)) { destbuf.SetLength(result_length); ret = ToBufferEndian(env, &destbuf); @@ -413,16 +421,24 @@ MaybeLocal TranscodeUtf8FromUcs2(Environment* env, MaybeStackBuffer sourcebuf; MaybeStackBuffer destbuf; CopySourceBuffer(&sourcebuf, source, source_length, length_in_chars); - u_strToUTF8(*destbuf, destbuf.capacity(), &result_length, - *sourcebuf, length_in_chars, status); + u_strToUTF8(*destbuf, + destbuf.capacity(), + &result_length, + *sourcebuf, + length_in_chars, + status); if (U_SUCCESS(*status)) { destbuf.SetLength(result_length); ret = ToBufferEndian(env, &destbuf); } else if (*status == U_BUFFER_OVERFLOW_ERROR) { *status = U_ZERO_ERROR; destbuf.AllocateSufficientStorage(result_length); - u_strToUTF8(*destbuf, result_length, &result_length, *sourcebuf, - length_in_chars, status); + u_strToUTF8(*destbuf, + result_length, + &result_length, + *sourcebuf, + length_in_chars, + status); if (U_SUCCESS(*status)) { destbuf.SetLength(result_length); ret = ToBufferEndian(env, &destbuf); @@ -433,11 +449,16 @@ MaybeLocal TranscodeUtf8FromUcs2(Environment* env, const char* EncodingName(const enum encoding encoding) { switch (encoding) { - case ASCII: return "us-ascii"; - case LATIN1: return "iso8859-1"; - case UCS2: return "utf16le"; - case UTF8: return "utf-8"; - default: return nullptr; + case ASCII: + return "us-ascii"; + case LATIN1: + return "iso8859-1"; + case UCS2: + return "utf16le"; + case UTF8: + return "utf-8"; + default: + return nullptr; } } @@ -446,12 +467,14 @@ bool SupportedEncoding(const enum encoding encoding) { case ASCII: case LATIN1: case UCS2: - case UTF8: return true; - default: return false; + case UTF8: + return true; + default: + return false; } } -void Transcode(const FunctionCallbackInfo&args) { +void Transcode(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); Isolate* isolate = env->isolate(); UErrorCode status = U_ZERO_ERROR; @@ -467,12 +490,10 @@ void Transcode(const FunctionCallbackInfo&args) { switch (fromEncoding) { case ASCII: case LATIN1: - if (toEncoding == UCS2) - tfn = &TranscodeToUcs2; + if (toEncoding == UCS2) tfn = &TranscodeToUcs2; break; case UTF8: - if (toEncoding == UCS2) - tfn = &TranscodeUcs2FromUtf8; + if (toEncoding == UCS2) tfn = &TranscodeUcs2FromUtf8; break; case UCS2: switch (toEncoding) { @@ -491,14 +512,17 @@ void Transcode(const FunctionCallbackInfo&args) { ABORT(); } - result = tfn(env, EncodingName(fromEncoding), EncodingName(toEncoding), - ts_obj_data, ts_obj_length, &status); + result = tfn(env, + EncodingName(fromEncoding), + EncodingName(toEncoding), + ts_obj_data, + ts_obj_length, + &status); } else { status = U_ILLEGAL_ARGUMENT_ERROR; } - if (result.IsEmpty()) - return args.GetReturnValue().Set(status); + if (result.IsEmpty()) return args.GetReturnValue().Set(status); return args.GetReturnValue().Set(result.ToLocalChecked()); } @@ -507,10 +531,10 @@ void ICUErrorName(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); CHECK(args[0]->IsInt32()); UErrorCode status = static_cast(args[0].As()->Value()); - args.GetReturnValue().Set( - String::NewFromUtf8(env->isolate(), - u_errorName(status), - NewStringType::kNormal).ToLocalChecked()); + args.GetReturnValue().Set(String::NewFromUtf8(env->isolate(), + u_errorName(status), + NewStringType::kNormal) + .ToLocalChecked()); } } // anonymous namespace @@ -521,7 +545,7 @@ bool InitializeICUDirectory(const std::string& path) { #ifdef NODE_HAVE_SMALL_ICU // install the 'small' data. udata_setCommonData(&SMALL_ICUDATA_ENTRY_POINT, &status); -#else // !NODE_HAVE_SMALL_ICU +#else // !NODE_HAVE_SMALL_ICU // no small data, so nothing to do. #endif // !NODE_HAVE_SMALL_ICU } else { @@ -537,15 +561,11 @@ int32_t ToUnicode(MaybeStackBuffer* buf, UErrorCode status = U_ZERO_ERROR; uint32_t options = UIDNA_NONTRANSITIONAL_TO_UNICODE; UIDNA* uidna = uidna_openUTS46(options, &status); - if (U_FAILURE(status)) - return -1; + if (U_FAILURE(status)) return -1; UIDNAInfo info = UIDNA_INFO_INITIALIZER; - int32_t len = uidna_nameToUnicodeUTF8(uidna, - input, length, - **buf, buf->capacity(), - &info, - &status); + int32_t len = uidna_nameToUnicodeUTF8( + uidna, input, length, **buf, buf->capacity(), &info, &status); // Do not check info.errors like we do with ToASCII since ToUnicode always // returns a string, despite any possible errors that may have occurred. @@ -553,11 +573,8 @@ int32_t ToUnicode(MaybeStackBuffer* buf, if (status == U_BUFFER_OVERFLOW_ERROR) { status = U_ZERO_ERROR; buf->AllocateSufficientStorage(len); - len = uidna_nameToUnicodeUTF8(uidna, - input, length, - **buf, buf->capacity(), - &info, - &status); + len = uidna_nameToUnicodeUTF8( + uidna, input, length, **buf, buf->capacity(), &info, &status); } // info.errors is ignored as UTS #46 ToUnicode always produces a Unicode @@ -579,10 +596,10 @@ int32_t ToASCII(MaybeStackBuffer* buf, size_t length, enum idna_mode mode) { UErrorCode status = U_ZERO_ERROR; - uint32_t options = // CheckHyphens = false; handled later - UIDNA_CHECK_BIDI | // CheckBidi = true - UIDNA_CHECK_CONTEXTJ | // CheckJoiners = true - UIDNA_NONTRANSITIONAL_TO_ASCII; // Nontransitional_Processing + uint32_t options = // CheckHyphens = false; handled later + UIDNA_CHECK_BIDI | // CheckBidi = true + UIDNA_CHECK_CONTEXTJ | // CheckJoiners = true + UIDNA_NONTRANSITIONAL_TO_ASCII; // Nontransitional_Processing if (mode == IDNA_STRICT) { options |= UIDNA_USE_STD3_RULES; // UseSTD3ASCIIRules = beStrict // VerifyDnsLength = beStrict; @@ -590,24 +607,17 @@ int32_t ToASCII(MaybeStackBuffer* buf, } UIDNA* uidna = uidna_openUTS46(options, &status); - if (U_FAILURE(status)) - return -1; + if (U_FAILURE(status)) return -1; UIDNAInfo info = UIDNA_INFO_INITIALIZER; - int32_t len = uidna_nameToASCII_UTF8(uidna, - input, length, - **buf, buf->capacity(), - &info, - &status); + int32_t len = uidna_nameToASCII_UTF8( + uidna, input, length, **buf, buf->capacity(), &info, &status); if (status == U_BUFFER_OVERFLOW_ERROR) { status = U_ZERO_ERROR; buf->AllocateSufficientStorage(len); - len = uidna_nameToASCII_UTF8(uidna, - input, length, - **buf, buf->capacity(), - &info, - &status); + len = uidna_nameToASCII_UTF8( + uidna, input, length, **buf, buf->capacity(), &info, &status); } // In UTS #46 which specifies ToASCII, certain error conditions are @@ -663,10 +673,8 @@ static void ToUnicode(const FunctionCallbackInfo& args) { } args.GetReturnValue().Set( - String::NewFromUtf8(env->isolate(), - *buf, - NewStringType::kNormal, - len).ToLocalChecked()); + String::NewFromUtf8(env->isolate(), *buf, NewStringType::kNormal, len) + .ToLocalChecked()); } static void ToASCII(const FunctionCallbackInfo& args) { @@ -686,10 +694,8 @@ static void ToASCII(const FunctionCallbackInfo& args) { } args.GetReturnValue().Set( - String::NewFromUtf8(env->isolate(), - *buf, - NewStringType::kNormal, - len).ToLocalChecked()); + String::NewFromUtf8(env->isolate(), *buf, NewStringType::kNormal, len) + .ToLocalChecked()); } // This is similar to wcwidth except that it takes the current unicode @@ -710,9 +716,11 @@ static void ToASCII(const FunctionCallbackInfo& args) { // are technically Wide. But many terminals (including Konsole and // VTE/GLib-based) implement all medials and finals as 0-width. // -// Refs: https://eev.ee/blog/2015/09/12/dark-corners-of-unicode/#combining-characters-and-character-width +// Refs: +// https://eev.ee/blog/2015/09/12/dark-corners-of-unicode/#combining-characters-and-character-width // Refs: https://github.com/GNOME/glib/blob/79e4d4c6be/glib/guniprop.c#L388-L420 -// Refs: https://github.com/KDE/konsole/blob/8c6a5d13c0/src/konsole_wcwidth.cpp#L101-L223 +// Refs: +// https://github.com/KDE/konsole/blob/8c6a5d13c0/src/konsole_wcwidth.cpp#L101-L223 static int GetColumnWidth(UChar32 codepoint, bool ambiguous_as_full_width = false) { const auto zero_width_mask = U_GC_CC_MASK | // C0/C1 control code @@ -755,8 +763,7 @@ static int GetColumnWidth(UChar32 codepoint, // Returns the column width for the given String. static void GetStringWidth(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); - if (args.Length() < 1) - return; + if (args.Length() < 1) return; bool ambiguous_as_full_width = args[1]->IsTrue(); bool expand_emoji_sequence = args[2]->IsTrue(); @@ -791,8 +798,8 @@ static void GetStringWidth(const FunctionCallbackInfo& args) { // in advance if a particular sequence is going to be supported. // The expand_emoji_sequence option allows the caller to skip this // check and count each code within an emoji sequence separately. - if (!expand_emoji_sequence && - n > 0 && p == 0x200d && // 0x200d == ZWJ (zero width joiner) + if (!expand_emoji_sequence && n > 0 && + p == 0x200d && // 0x200d == ZWJ (zero width joiner) (u_hasBinaryProperty(c, UCHAR_EMOJI_PRESENTATION) || u_hasBinaryProperty(c, UCHAR_EMOJI_MODIFIER))) { continue; diff --git a/src/node_internals.h b/src/node_internals.h index b34e6f90e7d28c..3acfa13b377af2 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -73,16 +73,14 @@ v8::Local AddressToJS( template void GetSockOrPeerName(const v8::FunctionCallbackInfo& args) { T* wrap; - ASSIGN_OR_RETURN_UNWRAP(&wrap, - args.Holder(), - args.GetReturnValue().Set(UV_EBADF)); + ASSIGN_OR_RETURN_UNWRAP( + &wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); CHECK(args[0]->IsObject()); sockaddr_storage storage; int addrlen = sizeof(storage); sockaddr* const addr = reinterpret_cast(&storage); const int err = F(&wrap->handle_, addr, &addrlen); - if (err == 0) - AddressToJS(wrap->env(), addr, args[0].As()); + if (err == 0) AddressToJS(wrap->env(), addr, args[0].As()); args.GetReturnValue().Set(err); } @@ -106,8 +104,9 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { inline uint32_t* zero_fill_field() { return &zero_fill_field_; } virtual void* Allocate(size_t size); // Defined in src/node.cc - virtual void* AllocateUninitialized(size_t size) - { return node::UncheckedMalloc(size); } + virtual void* AllocateUninitialized(size_t size) { + return node::UncheckedMalloc(size); + } virtual void Free(void* data, size_t) { free(data); } private: @@ -128,17 +127,15 @@ v8::MaybeLocal New(Environment* env, // Mixing operator new and free() is undefined behavior so don't do that. v8::MaybeLocal New(Environment* env, char* data, size_t length); -inline -v8::MaybeLocal New(Environment* env, - v8::Local ab, - size_t byte_offset, - size_t length) { +inline v8::MaybeLocal New(Environment* env, + v8::Local ab, + size_t byte_offset, + size_t length) { v8::Local ui = v8::Uint8Array::New(ab, byte_offset, length); CHECK(!env->buffer_prototype_object().IsEmpty()); v8::Maybe mb = ui->SetPrototype(env->context(), env->buffer_prototype_object()); - if (mb.IsNothing()) - return v8::MaybeLocal(); + if (mb.IsNothing()) return v8::MaybeLocal(); return ui; } @@ -162,11 +159,9 @@ static v8::MaybeLocal New(Environment* env, else if (!buf->IsInvalidated()) ret = Copy(env, src, len_in_bytes); - if (ret.IsEmpty()) - return ret; + if (ret.IsEmpty()) return ret; - if (buf->IsAllocated()) - buf->Release(); + if (buf->IsAllocated()) buf->Release(); return ret; } @@ -246,13 +241,11 @@ int ThreadPoolWork::CancelWork() { } #define TRACING_CATEGORY_NODE "node" -#define TRACING_CATEGORY_NODE1(one) \ - TRACING_CATEGORY_NODE "," \ - TRACING_CATEGORY_NODE "." #one -#define TRACING_CATEGORY_NODE2(one, two) \ - TRACING_CATEGORY_NODE "," \ - TRACING_CATEGORY_NODE "." #one "," \ - TRACING_CATEGORY_NODE "." #one "." #two +#define TRACING_CATEGORY_NODE1(one) \ + TRACING_CATEGORY_NODE "," TRACING_CATEGORY_NODE "." #one +#define TRACING_CATEGORY_NODE2(one, two) \ + TRACING_CATEGORY_NODE "," TRACING_CATEGORY_NODE "." #one \ + "," TRACING_CATEGORY_NODE "." #one "." #two // Functions defined in node.cc that are exposed via the bootstrapper object diff --git a/src/node_main.cc b/src/node_main.cc index 7107aea8c1a455..ef95b76df8388e 100644 --- a/src/node_main.cc +++ b/src/node_main.cc @@ -19,18 +19,19 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "node.h" #include +#include "node.h" #ifdef _WIN32 -#include #include #include +#include int wmain(int argc, wchar_t* wargv[]) { if (!IsWindows7OrGreater()) { - fprintf(stderr, "This application is only supported on Windows 7, " - "Windows Server 2008 R2, or higher."); + fprintf(stderr, + "This application is only supported on Windows 7, " + "Windows Server 2008 R2, or higher."); exit(ERROR_EXE_MACHINE_TYPE_MISMATCH); } @@ -38,14 +39,8 @@ int wmain(int argc, wchar_t* wargv[]) { char** argv = new char*[argc + 1]; for (int i = 0; i < argc; i++) { // Compute the size of the required buffer - DWORD size = WideCharToMultiByte(CP_UTF8, - 0, - wargv[i], - -1, - nullptr, - 0, - nullptr, - nullptr); + DWORD size = WideCharToMultiByte( + CP_UTF8, 0, wargv[i], -1, nullptr, 0, nullptr, nullptr); if (size == 0) { // This should never happen. fprintf(stderr, "Could not convert arguments to utf8."); @@ -53,14 +48,8 @@ int wmain(int argc, wchar_t* wargv[]) { } // Do the actual conversion argv[i] = new char[size]; - DWORD result = WideCharToMultiByte(CP_UTF8, - 0, - wargv[i], - -1, - argv[i], - size, - nullptr, - nullptr); + DWORD result = WideCharToMultiByte( + CP_UTF8, 0, wargv[i], -1, argv[i], size, nullptr, nullptr); if (result == 0) { // This should never happen. fprintf(stderr, "Could not convert arguments to utf8."); @@ -83,8 +72,8 @@ int wmain(int argc, wchar_t* wargv[]) { extern char** environ; #endif // __linux__ #if defined(__POSIX__) && defined(NODE_SHARED_MODE) -#include #include +#include #endif namespace node { @@ -110,7 +99,8 @@ int main(int argc, char* argv[]) { #if defined(__linux__) char** envp = environ; - while (*envp++ != nullptr) {} + while (*envp++ != nullptr) { + } Elf_auxv_t* auxv = reinterpret_cast(envp); for (; auxv->a_type != AT_NULL; auxv++) { if (auxv->a_type == AT_SECURE) { diff --git a/src/node_messaging.cc b/src/node_messaging.cc index 9952043f7b4c34..81a56c3d4a2ac2 100644 --- a/src/node_messaging.cc +++ b/src/node_messaging.cc @@ -58,8 +58,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate { // Currently, only MessagePort hosts objects are supported, so identifying // by the index in the message's MessagePort array is sufficient. uint32_t id; - if (!deserializer->ReadUint32(&id)) - return MaybeLocal(); + if (!deserializer->ReadUint32(&id)) return MaybeLocal(); CHECK_LE(id, message_ports_.size()); return message_ports_[id]->object(isolate); }; @@ -95,14 +94,11 @@ MaybeLocal Message::Deserialize(Environment* env, // Create all necessary MessagePort handles. std::vector ports(message_ports_.size()); for (uint32_t i = 0; i < message_ports_.size(); ++i) { - ports[i] = MessagePort::New(env, - context, - std::move(message_ports_[i])); + ports[i] = MessagePort::New(env, context, std::move(message_ports_[i])); if (ports[i] == nullptr) { for (MessagePort* port : ports) { // This will eventually release the MessagePort object itself. - if (port != nullptr) - port->Close(); + if (port != nullptr) port->Close(); } return MaybeLocal(); } @@ -113,8 +109,9 @@ MaybeLocal Message::Deserialize(Environment* env, // Attach all transferred SharedArrayBuffers to their new Isolate. for (uint32_t i = 0; i < shared_array_buffers_.size(); ++i) { Local sab; - if (!shared_array_buffers_[i]->GetSharedArrayBuffer(env, context) - .ToLocal(&sab)) + if (!shared_array_buffers_[i] + ->GetSharedArrayBuffer(env, context) + .ToLocal(&sab)) return MaybeLocal(); shared_array_buffers.push_back(sab); } @@ -140,8 +137,7 @@ MaybeLocal Message::Deserialize(Environment* env, } array_buffer_contents_.clear(); - if (deserializer.ReadHeader(context).IsNothing()) - return MaybeLocal(); + if (deserializer.ReadHeader(context).IsNothing()) return MaybeLocal(); return handle_scope.Escape( deserializer.ReadValue(context).FromMaybe(Local())); } @@ -164,14 +160,12 @@ namespace { void ThrowDataCloneException(Environment* env, Local message) { Local argv[] = { - message, - FIXED_ONE_BYTE_STRING(env->isolate(), "DataCloneError") - }; + message, FIXED_ONE_BYTE_STRING(env->isolate(), "DataCloneError")}; Local exception; Local domexception_ctor = env->domexception_function(); CHECK(!domexception_ctor.IsEmpty()); if (!domexception_ctor->NewInstance(env->context(), arraysize(argv), argv) - .ToLocal(&exception)) { + .ToLocal(&exception)) { return; } env->isolate()->ThrowException(exception); @@ -199,18 +193,14 @@ class SerializerDelegate : public ValueSerializer::Delegate { } Maybe GetSharedArrayBufferId( - Isolate* isolate, - Local shared_array_buffer) override { + Isolate* isolate, Local shared_array_buffer) override { uint32_t i; for (i = 0; i < seen_shared_array_buffers_.size(); ++i) { - if (seen_shared_array_buffers_[i] == shared_array_buffer) - return Just(i); + if (seen_shared_array_buffers_[i] == shared_array_buffer) return Just(i); } auto reference = SharedArrayBufferMetadata::ForSharedArrayBuffer( - env_, - context_, - shared_array_buffer); + env_, context_, shared_array_buffer); if (!reference) { return Nothing(); } @@ -287,8 +277,7 @@ Maybe Message::Serialize(Environment* env, Local ab = entry.As(); // If we cannot render the ArrayBuffer unusable in this Isolate and // take ownership of its memory, copying the buffer will have to do. - if (!ab->IsNeuterable() || ab->IsExternal()) - continue; + if (!ab->IsNeuterable() || ab->IsExternal()) continue; if (std::find(array_buffers.begin(), array_buffers.end(), ab) != array_buffers.end()) { ThrowDataCloneException( @@ -304,8 +293,7 @@ Maybe Message::Serialize(Environment* env, array_buffers.push_back(ab); serializer.TransferArrayBuffer(id, ab); continue; - } else if (env->message_port_constructor_template() - ->HasInstance(entry)) { + } else if (env->message_port_constructor_template()->HasInstance(entry)) { // Check if the source MessagePort is being transferred. if (!source_port.IsEmpty() && entry == source_port) { ThrowDataCloneException( @@ -352,9 +340,8 @@ Maybe Message::Serialize(Environment* env, // it inaccessible in this Isolate. ArrayBuffer::Contents contents = ab->Externalize(); ab->Neuter(); - array_buffer_contents_.push_back( - MallocedBuffer { static_cast(contents.Data()), - contents.ByteLength() }); + array_buffer_contents_.push_back(MallocedBuffer{ + static_cast(contents.Data()), contents.ByteLength()}); } delegate.Finish(); @@ -368,12 +355,13 @@ Maybe Message::Serialize(Environment* env, void Message::MemoryInfo(MemoryTracker* tracker) const { tracker->TrackField("array_buffer_contents", array_buffer_contents_); - tracker->TrackFieldWithSize("shared_array_buffers", + tracker->TrackFieldWithSize( + "shared_array_buffers", shared_array_buffers_.size() * sizeof(shared_array_buffers_[0])); tracker->TrackField("message_ports", message_ports_); } -MessagePortData::MessagePortData(MessagePort* owner) : owner_(owner) { } +MessagePortData::MessagePortData(MessagePort* owner) : owner_(owner) {} MessagePortData::~MessagePortData() { CHECK_EQ(owner_, nullptr); @@ -411,8 +399,7 @@ void MessagePortData::Entangle(MessagePortData* a, MessagePortData* b) { void MessagePortData::PingOwnerAfterDisentanglement() { Mutex::ScopedLock lock(mutex_); - if (owner_ != nullptr) - owner_->TriggerAsync(); + if (owner_ != nullptr) owner_->TriggerAsync(); } void MessagePortData::Disentangle() { @@ -437,31 +424,27 @@ void MessagePortData::Disentangle() { } MessagePort::~MessagePort() { - if (data_) - data_->owner_ = nullptr; + if (data_) data_->owner_ = nullptr; } MessagePort::MessagePort(Environment* env, Local context, Local wrap) - : HandleWrap(env, - wrap, - reinterpret_cast(new uv_async_t()), - AsyncWrap::PROVIDER_MESSAGEPORT), - data_(new MessagePortData(this)) { + : HandleWrap(env, + wrap, + reinterpret_cast(new uv_async_t()), + AsyncWrap::PROVIDER_MESSAGEPORT), + data_(new MessagePortData(this)) { auto onmessage = [](uv_async_t* handle) { // Called when data has been put into the queue. MessagePort* channel = static_cast(handle->data); channel->OnMessage(); }; - CHECK_EQ(uv_async_init(env->event_loop(), - async(), - onmessage), 0); + CHECK_EQ(uv_async_init(env->event_loop(), async(), onmessage), 0); async()->data = static_cast(this); Local fn; - if (!wrap->Get(context, env->oninit_symbol()).ToLocal(&fn)) - return; + if (!wrap->Get(context, env->oninit_symbol()).ToLocal(&fn)) return; if (fn->IsFunction()) { Local init = fn.As(); @@ -514,20 +497,17 @@ void MessagePort::New(const FunctionCallbackInfo& args) { new MessagePort(env, context, args.This()); } -MessagePort* MessagePort::New( - Environment* env, - Local context, - std::unique_ptr data) { +MessagePort* MessagePort::New(Environment* env, + Local context, + std::unique_ptr data) { Context::Scope context_scope(context); Local ctor; - if (!GetMessagePortConstructor(env, context).ToLocal(&ctor)) - return nullptr; + if (!GetMessagePortConstructor(env, context).ToLocal(&ctor)) return nullptr; // Construct a new instance, then assign the listener instance and possibly // the MessagePortData to it. Local instance; - if (!ctor->NewInstance(context).ToLocal(&instance)) - return nullptr; + if (!ctor->NewInstance(context).ToLocal(&instance)) return nullptr; MessagePort* port = Unwrap(instance); CHECK_NOT_NULL(port); if (data) { @@ -568,13 +548,12 @@ void MessagePort::OnMessage() { break; } - Debug(this, "MessagePort has message, receiving = %d", + Debug(this, + "MessagePort has message, receiving = %d", static_cast(data_->receiving_messages_)); - if (!data_->receiving_messages_) - break; - if (data_->incoming_messages_.empty()) - break; + if (!data_->receiving_messages_) break; + if (data_->incoming_messages_.empty()) break; received = std::move(data_->incoming_messages_.front()); data_->incoming_messages_.pop_front(); } @@ -590,14 +569,12 @@ void MessagePort::OnMessage() { HandleScope handle_scope(env()->isolate()); Context::Scope context_scope(context); Local args[] = { - received.Deserialize(env(), context).FromMaybe(Local()) - }; + received.Deserialize(env(), context).FromMaybe(Local())}; if (args[0].IsEmpty() || MakeCallback(env()->onmessage_string(), 1, args).IsEmpty()) { // Re-schedule OnMessage() execution in case of failure. - if (data_) - TriggerAsync(); + if (data_) TriggerAsync(); return; } } @@ -630,7 +607,6 @@ std::unique_ptr MessagePort::Detach() { return std::move(data_); } - Maybe MessagePort::PostMessage(Environment* env, Local message_v, Local transfer_v) { @@ -660,15 +636,15 @@ Maybe MessagePort::PostMessage(Environment* env, for (const auto& port_data : msg.message_ports()) { if (data_->sibling_ == port_data.get()) { doomed = true; - ProcessEmitWarning(env, "The target port was posted to itself, and " - "the communication channel was lost"); + ProcessEmitWarning(env, + "The target port was posted to itself, and " + "the communication channel was lost"); break; } } } - if (data_->sibling_ == nullptr || doomed) - return Just(true); + if (data_->sibling_ == nullptr || doomed) return Just(true); data_->sibling_->AddToIncomingQueue(std::move(msg)); return Just(true); @@ -677,8 +653,9 @@ Maybe MessagePort::PostMessage(Environment* env, void MessagePort::PostMessage(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); if (args.Length() == 0) { - return THROW_ERR_MISSING_ARGS(env, "Not enough arguments to " - "MessagePort.postMessage"); + return THROW_ERR_MISSING_ARGS(env, + "Not enough arguments to " + "MessagePort.postMessage"); } MessagePort* port = Unwrap(args.This()); @@ -700,8 +677,7 @@ void MessagePort::Start() { Mutex::ScopedLock lock(data_->mutex_); Debug(this, "Start receiving messages"); data_->receiving_messages_ = true; - if (!data_->incoming_messages_.empty()) - TriggerAsync(); + if (!data_->incoming_messages_.empty()) TriggerAsync(); } void MessagePort::Stop() { @@ -755,13 +731,12 @@ void MessagePort::Entangle(MessagePort* a, MessagePortData* b) { MessagePortData::Entangle(a->data_.get(), b); } -MaybeLocal GetMessagePortConstructor( - Environment* env, Local context) { +MaybeLocal GetMessagePortConstructor(Environment* env, + Local context) { // Factor generating the MessagePort JS constructor into its own piece // of code, because it is needed early on in the child environment setup. Local templ = env->message_port_constructor_template(); - if (!templ.IsEmpty()) - return templ->GetFunction(context); + if (!templ.IsEmpty()) return templ->GetFunction(context); { Local m = env->NewFunctionTemplate(MessagePort::New); @@ -796,9 +771,11 @@ static void MessageChannel(const FunctionCallbackInfo& args) { MessagePort* port2 = MessagePort::New(env, context); MessagePort::Entangle(port1, port2); - args.This()->Set(env->context(), env->port1_string(), port1->object()) + args.This() + ->Set(env->context(), env->port1_string(), port1->object()) .FromJust(); - args.This()->Set(env->context(), env->port2_string(), port2->object()) + args.This() + ->Set(env->context(), env->port2_string(), port2->object()) .FromJust(); } @@ -820,15 +797,18 @@ static void InitMessaging(Local target, FIXED_ONE_BYTE_STRING(env->isolate(), "MessageChannel"); Local templ = env->NewFunctionTemplate(MessageChannel); templ->SetClassName(message_channel_string); - target->Set(env->context(), - message_channel_string, - templ->GetFunction(context).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + message_channel_string, + templ->GetFunction(context).ToLocalChecked()) + .FromJust(); } - target->Set(context, - env->message_port_constructor_string(), - GetMessagePortConstructor(env, context).ToLocalChecked()) - .FromJust(); + target + ->Set(context, + env->message_port_constructor_string(), + GetMessagePortConstructor(env, context).ToLocalChecked()) + .FromJust(); env->SetMethod(target, "registerDOMException", RegisterDOMException); } diff --git a/src/node_messaging.h b/src/node_messaging.h index 3c79e24f24b896..8748c0b668aecb 100644 --- a/src/node_messaging.h +++ b/src/node_messaging.h @@ -3,10 +3,10 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS +#include #include "env.h" #include "node_mutex.h" #include "sharedarraybuffer_metadata.h" -#include namespace node { namespace worker { @@ -34,12 +34,12 @@ class Message : public MemoryRetainer { // deserialization. // The source_port parameter, if provided, will make Serialize() throw a // "DataCloneError" DOMException if source_port is found in transfer_list. - v8::Maybe Serialize(Environment* env, - v8::Local context, - v8::Local input, - v8::Local transfer_list, - v8::Local source_port = - v8::Local()); + v8::Maybe Serialize( + Environment* env, + v8::Local context, + v8::Local input, + v8::Local transfer_list, + v8::Local source_port = v8::Local()); // Internal method of Message that is called when a new SharedArrayBuffer // object is encountered in the incoming value's structure. @@ -219,5 +219,4 @@ v8::MaybeLocal GetMessagePortConstructor( #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS - #endif // SRC_NODE_MESSAGING_H_ diff --git a/src/node_metadata.cc b/src/node_metadata.cc index 602115ad4f2590..e8a1468688e361 100644 --- a/src/node_metadata.cc +++ b/src/node_metadata.cc @@ -73,12 +73,9 @@ Metadata::Versions::Versions() { llhttp = per_process::llhttp_version; http_parser = per_process::http_parser_version; - brotli = - std::to_string(BrotliEncoderVersion() >> 24) + - "." + - std::to_string((BrotliEncoderVersion() & 0xFFF000) >> 12) + - "." + - std::to_string(BrotliEncoderVersion() & 0xFFF); + brotli = std::to_string(BrotliEncoderVersion() >> 24) + "." + + std::to_string((BrotliEncoderVersion() & 0xFFF000) >> 12) + "." + + std::to_string(BrotliEncoderVersion() & 0xFFF); #if HAVE_OPENSSL openssl = GetOpenSSLVersion(); @@ -103,8 +100,8 @@ Metadata::Release::Release() : name(NODE_RELEASE) { headers_url = NODE_RELEASE_URLFPFX "-headers.tar.gz"; #ifdef _WIN32 lib_url = strcmp(NODE_ARCH, "ia32") ? NODE_RELEASE_URLPFX "win-" NODE_ARCH - "/node.lib" - : NODE_RELEASE_URLPFX "win-x86/node.lib"; + "/node.lib" + : NODE_RELEASE_URLPFX "win-x86/node.lib"; #endif // _WIN32 #endif // NODE_HAS_RELEASE_URLS diff --git a/src/node_metadata.h b/src/node_metadata.h index c6f379f085de03..c0268d3e0ae204 100644 --- a/src/node_metadata.h +++ b/src/node_metadata.h @@ -31,7 +31,7 @@ namespace node { V(nghttp2) \ V(napi) \ V(llhttp) \ - V(http_parser) \ + V(http_parser) #if HAVE_OPENSSL #define NODE_VERSIONS_KEY_CRYPTO(V) V(openssl) @@ -104,7 +104,7 @@ namespace per_process { extern Metadata metadata; extern const char* const llhttp_version; extern const char* const http_parser_version; -} +} // namespace per_process } // namespace node diff --git a/src/node_mutex.h b/src/node_mutex.h index de62a0d9ff66b7..dfcb863156fd6f 100644 --- a/src/node_mutex.h +++ b/src/node_mutex.h @@ -8,8 +8,10 @@ namespace node { -template class ConditionVariableBase; -template class MutexBase; +template +class ConditionVariableBase; +template +class MutexBase; struct LibuvMutexTraits; using ConditionVariable = ConditionVariableBase; @@ -33,7 +35,8 @@ class MutexBase { inline ~ScopedLock(); private: - template friend class ConditionVariableBase; + template + friend class ConditionVariableBase; friend class ScopedUnlock; const MutexBase& mutex_; DISALLOW_COPY_AND_ASSIGN(ScopedLock); @@ -51,7 +54,8 @@ class MutexBase { }; private: - template friend class ConditionVariableBase; + template + friend class ConditionVariableBase; mutable typename Traits::MutexT mutex_; DISALLOW_COPY_AND_ASSIGN(MutexBase); }; @@ -76,41 +80,25 @@ struct LibuvMutexTraits { using CondT = uv_cond_t; using MutexT = uv_mutex_t; - static inline int cond_init(CondT* cond) { - return uv_cond_init(cond); - } + static inline int cond_init(CondT* cond) { return uv_cond_init(cond); } - static inline int mutex_init(MutexT* mutex) { - return uv_mutex_init(mutex); - } + static inline int mutex_init(MutexT* mutex) { return uv_mutex_init(mutex); } - static inline void cond_broadcast(CondT* cond) { - uv_cond_broadcast(cond); - } + static inline void cond_broadcast(CondT* cond) { uv_cond_broadcast(cond); } - static inline void cond_destroy(CondT* cond) { - uv_cond_destroy(cond); - } + static inline void cond_destroy(CondT* cond) { uv_cond_destroy(cond); } - static inline void cond_signal(CondT* cond) { - uv_cond_signal(cond); - } + static inline void cond_signal(CondT* cond) { uv_cond_signal(cond); } static inline void cond_wait(CondT* cond, MutexT* mutex) { uv_cond_wait(cond, mutex); } - static inline void mutex_destroy(MutexT* mutex) { - uv_mutex_destroy(mutex); - } + static inline void mutex_destroy(MutexT* mutex) { uv_mutex_destroy(mutex); } - static inline void mutex_lock(MutexT* mutex) { - uv_mutex_lock(mutex); - } + static inline void mutex_lock(MutexT* mutex) { uv_mutex_lock(mutex); } - static inline void mutex_unlock(MutexT* mutex) { - uv_mutex_unlock(mutex); - } + static inline void mutex_unlock(MutexT* mutex) { uv_mutex_unlock(mutex); } }; template diff --git a/src/node_native_module.cc b/src/node_native_module.cc index 662aad31d5d159..285c6a42e53dda 100644 --- a/src/node_native_module.cc +++ b/src/node_native_module.cc @@ -49,8 +49,7 @@ Local MapToObject(Local context, return out; } -Local ToJsSet(Local context, - const std::set& in) { +Local ToJsSet(Local context, const std::set& in) { Isolate* isolate = context->GetIsolate(); Local out = Set::New(isolate); for (auto const& x : in) { @@ -305,8 +304,7 @@ void NativeModuleLoader::Initialize(Local target, SideEffectType::kHasNoSideEffect) .FromJust()); - env->SetMethod( - target, "getCacheUsage", NativeModuleLoader::GetCacheUsage); + env->SetMethod(target, "getCacheUsage", NativeModuleLoader::GetCacheUsage); env->SetMethod( target, "compileFunction", NativeModuleLoader::CompileFunction); env->SetMethod(target, "getCodeCache", NativeModuleLoader::GetCodeCache); diff --git a/src/node_native_module.h b/src/node_native_module.h index be1fc92a7672f3..7c259626b820a8 100644 --- a/src/node_native_module.h +++ b/src/node_native_module.h @@ -77,7 +77,7 @@ class NativeModuleLoader { // Generated by tools/generate_code_cache.js as node_code_cache.cc when // the build is configured with --code-cache-path=.... They are noops // in node_code_cache_stub.cc - void LoadCodeCache(); // Loads data into code_cache_ + void LoadCodeCache(); // Loads data into code_cache_ // Compile a script as a NativeModule that can be loaded via // NativeModule.p.require in JS land. diff --git a/src/node_object_wrap.h b/src/node_object_wrap.h index b8ed2f99135a65..ebd25da70f0c77 100644 --- a/src/node_object_wrap.h +++ b/src/node_object_wrap.h @@ -22,28 +22,22 @@ #ifndef SRC_NODE_OBJECT_WRAP_H_ #define SRC_NODE_OBJECT_WRAP_H_ -#include "v8.h" #include - +#include "v8.h" namespace node { class ObjectWrap { public: - ObjectWrap() { - refs_ = 0; - } - + ObjectWrap() { refs_ = 0; } virtual ~ObjectWrap() { - if (persistent().IsEmpty()) - return; + if (persistent().IsEmpty()) return; assert(persistent().IsNearDeath()); persistent().ClearWeak(); persistent().Reset(); } - template static inline T* Unwrap(v8::Local handle) { assert(!handle.IsEmpty()); @@ -55,21 +49,15 @@ class ObjectWrap { return static_cast(wrap); } - inline v8::Local handle() { return handle(v8::Isolate::GetCurrent()); } - inline v8::Local handle(v8::Isolate* isolate) { return v8::Local::New(isolate, persistent()); } - - inline v8::Persistent& persistent() { - return handle_; - } - + inline v8::Persistent& persistent() { return handle_; } protected: inline void Wrap(v8::Local handle) { @@ -80,7 +68,6 @@ class ObjectWrap { MakeWeak(); } - inline void MakeWeak(void) { persistent().SetWeak(this, WeakCallback, v8::WeakCallbackType::kParameter); } @@ -108,15 +95,13 @@ class ObjectWrap { assert(!persistent().IsEmpty()); assert(!persistent().IsWeak()); assert(refs_ > 0); - if (--refs_ == 0) - MakeWeak(); + if (--refs_ == 0) MakeWeak(); } int refs_; // ro private: - static void WeakCallback( - const v8::WeakCallbackInfo& data) { + static void WeakCallback(const v8::WeakCallbackInfo& data) { ObjectWrap* wrap = data.GetParameter(); assert(wrap->refs_ == 0); wrap->handle_.Reset(); diff --git a/src/node_options-inl.h b/src/node_options-inl.h index f482bcd36660ed..a1ee131bc86442 100644 --- a/src/node_options-inl.h +++ b/src/node_options-inl.h @@ -3,9 +3,9 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS +#include #include "node_options.h" #include "util.h" -#include namespace node { @@ -30,7 +30,7 @@ namespace options_parser { template void OptionsParser::AddOption(const std::string& name, const std::string& help_text, - bool Options::* field, + bool Options::*field, OptionEnvvarSettings env_setting) { options_.emplace(name, OptionInfo{kBoolean, @@ -42,7 +42,7 @@ void OptionsParser::AddOption(const std::string& name, template void OptionsParser::AddOption(const std::string& name, const std::string& help_text, - uint64_t Options::* field, + uint64_t Options::*field, OptionEnvvarSettings env_setting) { options_.emplace( name, @@ -55,7 +55,7 @@ void OptionsParser::AddOption(const std::string& name, template void OptionsParser::AddOption(const std::string& name, const std::string& help_text, - int64_t Options::* field, + int64_t Options::*field, OptionEnvvarSettings env_setting) { options_.emplace( name, @@ -68,7 +68,7 @@ void OptionsParser::AddOption(const std::string& name, template void OptionsParser::AddOption(const std::string& name, const std::string& help_text, - std::string Options::* field, + std::string Options::*field, OptionEnvvarSettings env_setting) { options_.emplace( name, @@ -79,23 +79,23 @@ void OptionsParser::AddOption(const std::string& name, } template -void OptionsParser::AddOption( - const std::string& name, - const std::string& help_text, - std::vector Options::* field, - OptionEnvvarSettings env_setting) { - options_.emplace(name, OptionInfo { - kStringList, - std::make_shared>>(field), - env_setting, - help_text - }); +void OptionsParser::AddOption(const std::string& name, + const std::string& help_text, + std::vector Options::*field, + OptionEnvvarSettings env_setting) { + options_.emplace( + name, + OptionInfo{ + kStringList, + std::make_shared>>(field), + env_setting, + help_text}); } template void OptionsParser::AddOption(const std::string& name, const std::string& help_text, - HostPort Options::* field, + HostPort Options::*field, OptionEnvvarSettings env_setting) { options_.emplace( name, @@ -125,7 +125,7 @@ void OptionsParser::AddOption(const std::string& name, template void OptionsParser::AddAlias(const std::string& from, const std::string& to) { - aliases_[from] = { to }; + aliases_[from] = {to}; } template @@ -136,8 +136,7 @@ void OptionsParser::AddAlias(const std::string& from, template void OptionsParser::AddAlias( - const std::string& from, - const std::initializer_list& to) { + const std::string& from, const std::initializer_list& to) { AddAlias(from, std::vector(to)); } @@ -147,9 +146,10 @@ void OptionsParser::Implies(const std::string& from, auto it = options_.find(to); CHECK_NE(it, options_.end()); CHECK_EQ(it->second.type, kBoolean); - implications_.emplace(from, Implication { - std::static_pointer_cast>(it->second.field), true - }); + implications_.emplace( + from, + Implication{std::static_pointer_cast>(it->second.field), + true}); } template @@ -158,16 +158,16 @@ void OptionsParser::ImpliesNot(const std::string& from, auto it = options_.find(to); CHECK_NE(it, options_.end()); CHECK_EQ(it->second.type, kBoolean); - implications_.emplace(from, Implication { - std::static_pointer_cast>(it->second.field), false - }); + implications_.emplace( + from, + Implication{std::static_pointer_cast>(it->second.field), + false}); } template template -auto OptionsParser::Convert( - std::shared_ptr original, - ChildOptions* (Options::* get_child)()) { +auto OptionsParser::Convert(std::shared_ptr original, + ChildOptions* (Options::*get_child)()) { // If we have a field on ChildOptions, and we want to access it from an // Options instance, we call get_child() on the original Options and then // access it, i.e. this class implements a kind of function chaining. @@ -176,13 +176,12 @@ auto OptionsParser::Convert( return original->LookupImpl((options->*get_child)()); } - AdaptedField( - std::shared_ptr original, - ChildOptions* (Options::* get_child)()) - : original(original), get_child(get_child) {} + AdaptedField(std::shared_ptr original, + ChildOptions* (Options::*get_child)()) + : original(original), get_child(get_child) {} std::shared_ptr original; - ChildOptions* (Options::* get_child)(); + ChildOptions* (Options::*get_child)(); }; return std::shared_ptr( @@ -192,7 +191,7 @@ template template auto OptionsParser::Convert( typename OptionsParser::OptionInfo original, - ChildOptions* (Options::* get_child)()) { + ChildOptions* (Options::*get_child)()) { return OptionInfo{original.type, Convert(original.field, get_child), original.env_setting, @@ -203,19 +202,17 @@ template template auto OptionsParser::Convert( typename OptionsParser::Implication original, - ChildOptions* (Options::* get_child)()) { - return Implication { - std::static_pointer_cast>( - Convert(original.target_field, get_child)), - original.target_value - }; + ChildOptions* (Options::*get_child)()) { + return Implication{std::static_pointer_cast>( + Convert(original.target_field, get_child)), + original.target_value}; } template template void OptionsParser::Insert( const OptionsParser* child_options_parser, - ChildOptions* (Options::* get_child)()) { + ChildOptions* (Options::*get_child)()) { aliases_.insert(child_options_parser->aliases_.begin(), child_options_parser->aliases_.end()); @@ -247,9 +244,8 @@ struct ArgsInfo { std::vector* exec_args; - ArgsInfo(std::vector* args, - std::vector* exec_args) - : underlying(args), exec_args(exec_args) {} + ArgsInfo(std::vector* args, std::vector* exec_args) + : underlying(args), exec_args(exec_args) {} size_t remaining() const { // -1 to account for the program name. @@ -270,8 +266,7 @@ struct ArgsInfo { // on the command line (i.e. not generated through alias expansion). // '--' is a special case here since its purpose is to end `exec_argv`, // which is why we do not include it. - if (exec_args != nullptr && ret != "--") - exec_args->push_back(ret); + if (exec_args != nullptr && ret != "--") exec_args->push_back(ret); underlying->erase(underlying->begin() + 1); } else { synthetic_args.erase(synthetic_args.begin()); @@ -293,8 +288,7 @@ void OptionsParser::Parse( // The first entry is the process name. Make sure it ends up in the V8 argv, // since V8::SetFlagsFromCommandLine() expects that to hold true for that // array as well. - if (v8_args->empty()) - v8_args->push_back(args.program_name()); + if (v8_args->empty()) v8_args->push_back(args.program_name()); while (!args.empty() && errors->empty()) { if (args.first().size() <= 1 || args.first()[0] != '-') break; @@ -315,19 +309,17 @@ void OptionsParser::Parse( const std::string::size_type equals_index = arg[0] == '-' && arg[1] == '-' ? arg.find('=') : std::string::npos; std::string name = - equals_index == std::string::npos ? arg : arg.substr(0, equals_index); + equals_index == std::string::npos ? arg : arg.substr(0, equals_index); // Store the 'original name' of the argument. This name differs from // 'name' in that it contains a possible '=' sign and is not affected // by alias expansion. std::string original_name = name; - if (equals_index != std::string::npos) - original_name += '='; + if (equals_index != std::string::npos) original_name += '='; // Normalize by replacing `_` with `-` in options. for (std::string::size_type i = 2; i < name.size(); ++i) { - if (name[i] == '_') - name[i] = '-'; + if (name[i] == '_') name[i] = '-'; } { @@ -340,9 +332,8 @@ void OptionsParser::Parse( while ((it = aliases_.find(name)) != aliases_.end() || (equals_index != std::string::npos && (it = aliases_.find(name + '=')) != aliases_.end()) || - (!args.empty() && - !args.first().empty() && - args.first()[0] != '-' && + (!args.empty() && !args.first().empty() && + args.first()[0] != '-' && (it = aliases_.find(name + " ")) != aliases_.end())) { const std::string prev_name = std::move(name); const std::vector& expansion = it->second; @@ -352,10 +343,9 @@ void OptionsParser::Parse( if (expansion.size() > 1) { // The other arguments, if any, are going to be handled later. - args.synthetic_args.insert( - args.synthetic_args.begin(), - expansion.begin() + 1, - expansion.end()); + args.synthetic_args.insert(args.synthetic_args.begin(), + expansion.begin() + 1, + expansion.end()); } if (name == prev_name) break; @@ -393,8 +383,7 @@ void OptionsParser::Parse( break; } } else { - if (args.empty()) - goto missing_argument; + if (args.empty()) goto missing_argument; value = args.pop_first(); diff --git a/src/node_options.cc b/src/node_options.cc index 86a986521c54b2..e3884edaba9ef9 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -56,8 +56,7 @@ void PerProcessOptions::CheckOptions(std::vector* errors) { void PerIsolateOptions::CheckOptions(std::vector* errors) { per_env->CheckOptions(errors); #ifdef NODE_REPORT - if (per_env->experimental_report) - return; + if (per_env->experimental_report) return; if (!report_directory.empty()) { errors->push_back("--diagnostic-report-directory option is valid only when " @@ -147,25 +146,25 @@ DebugOptionsParser::DebugOptionsParser() { "activate inspector on host:port (default: 127.0.0.1:9229)", &DebugOptions::inspector_enabled, kAllowedInEnvironment); - AddAlias("--inspect=", { "--inspect-port", "--inspect" }); + AddAlias("--inspect=", {"--inspect-port", "--inspect"}); AddOption("--debug", "", &DebugOptions::deprecated_debug); - AddAlias("--debug=", { "--inspect-port", "--debug" }); + AddAlias("--debug=", {"--inspect-port", "--debug"}); AddOption("--inspect-brk", "activate inspector on host:port and break at start of user script", &DebugOptions::break_first_line, kAllowedInEnvironment); Implies("--inspect-brk", "--inspect"); - AddAlias("--inspect-brk=", { "--inspect-port", "--inspect-brk" }); + AddAlias("--inspect-brk=", {"--inspect-port", "--inspect-brk"}); AddOption("--inspect-brk-node", "", &DebugOptions::break_node_first_line); Implies("--inspect-brk-node", "--inspect"); - AddAlias("--inspect-brk-node=", { "--inspect-port", "--inspect-brk-node" }); + AddAlias("--inspect-brk-node=", {"--inspect-port", "--inspect-brk-node"}); AddOption("--debug-brk", "", &DebugOptions::break_first_line); Implies("--debug-brk", "--debug"); - AddAlias("--debug-brk=", { "--inspect-port", "--debug-brk" }); + AddAlias("--debug-brk=", {"--inspect-port", "--debug-brk"}); } EnvironmentOptionsParser::EnvironmentOptionsParser() { @@ -230,7 +229,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { "process V8 profiler output generated using --prof", &EnvironmentOptions::prof_process); // Options after --prof-process are passed through to the prof processor. - AddAlias("--prof-process", { "--prof-process", "--" }); + AddAlias("--prof-process", {"--prof-process", "--"}); AddOption("--redirect-warnings", "write warnings to file instead of stderr", &EnvironmentOptions::redirect_warnings, @@ -271,7 +270,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { &EnvironmentOptions::print_eval); AddAlias("-e", "--eval"); AddAlias("--print ", "-pe"); - AddAlias("-pe", { "--print", "--eval" }); + AddAlias("-pe", {"--print", "--eval"}); AddAlias("-p", "--print"); AddOption("--require", "module to preload (option can be repeated)", @@ -298,8 +297,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { #endif #if HAVE_INSPECTOR - Insert(&DebugOptionsParser::instance, - &EnvironmentOptions::get_debug_options); + Insert(&DebugOptionsParser::instance, &EnvironmentOptions::get_debug_options); #endif // HAVE_INSPECTOR } @@ -374,8 +372,8 @@ PerProcessOptionsParser::PerProcessOptionsParser() { "data, it supports ${rotation} and ${pid}.", &PerProcessOptions::trace_event_file_pattern, kAllowedInEnvironment); - AddAlias("--trace-events-enabled", { - "--trace-event-categories", "v8,node,node.async_hooks" }); + AddAlias("--trace-events-enabled", + {"--trace-event-categories", "v8,node,node.async_hooks"}); AddOption("--max-http-header-size", "set the maximum size of HTTP headers (default: 8KB)", &PerProcessOptions::max_http_header_size, @@ -478,15 +476,15 @@ inline int ParseAndValidatePort(const std::string& port, char* endptr; errno = 0; const long result = strtol(port.c_str(), &endptr, 10); // NOLINT(runtime/int) - if (errno != 0 || *endptr != '\0'|| - (result != 0 && result < 1024) || result > 65535) { + if (errno != 0 || *endptr != '\0' || (result != 0 && result < 1024) || + result > 65535) { errors->push_back(" must be 0 or in range 1024 to 65535."); } return static_cast(result); } HostPort SplitHostPort(const std::string& arg, - std::vector* errors) { + std::vector* errors) { // remove_brackets only works if no port is specified // so if it has an effect only an IPv6 address was specified. std::string host = RemoveBrackets(arg); @@ -502,11 +500,11 @@ HostPort SplitHostPort(const std::string& arg, return HostPort{arg, DebugOptions::kDefaultInspectorPort}; } } - return HostPort { "", ParseAndValidatePort(arg, errors) }; + return HostPort{"", ParseAndValidatePort(arg, errors)}; } // Host and port found: - return HostPort { RemoveBrackets(arg.substr(0, colon)), - ParseAndValidatePort(arg.substr(colon + 1), errors) }; + return HostPort{RemoveBrackets(arg.substr(0, colon)), + ParseAndValidatePort(arg.substr(colon + 1), errors)}; } // Return a map containing all the options and their metadata as well diff --git a/src/node_options.h b/src/node_options.h index e68e1cdfd734ca..61d655dd1a430f 100644 --- a/src/node_options.h +++ b/src/node_options.h @@ -133,7 +133,7 @@ class EnvironmentOptions : public Options { class PerIsolateOptions : public Options { public: - std::shared_ptr per_env { new EnvironmentOptions() }; + std::shared_ptr per_env{new EnvironmentOptions()}; bool track_heap_objects = false; #ifdef NODE_REPORT @@ -151,7 +151,7 @@ class PerIsolateOptions : public Options { class PerProcessOptions : public Options { public: - std::shared_ptr per_isolate { new PerIsolateOptions() }; + std::shared_ptr per_isolate{new PerIsolateOptions()}; std::string title; std::string trace_event_categories; @@ -200,13 +200,10 @@ class PerProcessOptions : public Options { namespace options_parser { HostPort SplitHostPort(const std::string& arg, - std::vector* errors); + std::vector* errors); void GetOptions(const v8::FunctionCallbackInfo& args); -enum OptionEnvvarSettings { - kAllowedInEnvironment, - kDisallowedInEnvironment -}; +enum OptionEnvvarSettings { kAllowedInEnvironment, kDisallowedInEnvironment }; enum OptionType { kNoOp, @@ -238,27 +235,27 @@ class OptionsParser { // sources (i.e. NODE_OPTIONS). void AddOption(const std::string& name, const std::string& help_text, - bool Options::* field, + bool Options::*field, OptionEnvvarSettings env_setting = kDisallowedInEnvironment); void AddOption(const std::string& name, const std::string& help_text, - uint64_t Options::* field, + uint64_t Options::*field, OptionEnvvarSettings env_setting = kDisallowedInEnvironment); void AddOption(const std::string& name, const std::string& help_text, - int64_t Options::* field, + int64_t Options::*field, OptionEnvvarSettings env_setting = kDisallowedInEnvironment); void AddOption(const std::string& name, const std::string& help_text, - std::string Options::* field, + std::string Options::*field, OptionEnvvarSettings env_setting = kDisallowedInEnvironment); void AddOption(const std::string& name, const std::string& help_text, - std::vector Options::* field, + std::vector Options::*field, OptionEnvvarSettings env_setting = kDisallowedInEnvironment); void AddOption(const std::string& name, const std::string& help_text, - HostPort Options::* field, + HostPort Options::*field, OptionEnvvarSettings env_setting = kDisallowedInEnvironment); void AddOption(const std::string& name, const std::string& help_text, @@ -291,7 +288,7 @@ class OptionsParser { // type. template void Insert(const OptionsParser* child_options_parser, - ChildOptions* (Options::* get_child)()); + ChildOptions* (Options::*get_child)()); // Parse a sequence of options into an options struct, a list of // arguments that were parsed as options, a list of unknown/JS engine options, @@ -344,13 +341,13 @@ class OptionsParser { template class SimpleOptionField : public OptionField { public: - explicit SimpleOptionField(T Options::* field) : field_(field) {} + explicit SimpleOptionField(T Options::*field) : field_(field) {} void* LookupImpl(Options* options) const override { return static_cast(&(options->*field_)); } private: - T Options::* field_; + T Options::*field_; }; template @@ -380,17 +377,15 @@ class OptionsParser { // These are helpers that make `Insert()` support properties of other // options structs, if we know how to access them. template - static auto Convert( - std::shared_ptr original, - ChildOptions* (Options::* get_child)()); + static auto Convert(std::shared_ptr original, + ChildOptions* (Options::*get_child)()); template - static auto Convert( - typename OptionsParser::OptionInfo original, - ChildOptions* (Options::* get_child)()); + static auto Convert(typename OptionsParser::OptionInfo original, + ChildOptions* (Options::*get_child)()); template static auto Convert( typename OptionsParser::Implication original, - ChildOptions* (Options::* get_child)()); + ChildOptions* (Options::*get_child)()); std::unordered_map options_; std::unordered_map> aliases_; diff --git a/src/node_os.cc b/src/node_os.cc index 5639453d2c46ed..a351efa746e413 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -23,24 +23,24 @@ #include "string_bytes.h" #include "util.h" -#include #include #include +#include #ifdef __MINGW32__ -# include +#include #endif // __MINGW32__ #ifdef __POSIX__ -# include // PATH_MAX on Solaris. -# include // MAXHOSTNAMELEN on Solaris. -# include // gethostname, sysconf -# include // MAXHOSTNAMELEN on Linux and the BSDs. -#endif // __POSIX__ +#include // PATH_MAX on Solaris. +#include // MAXHOSTNAMELEN on Solaris. +#include // MAXHOSTNAMELEN on Linux and the BSDs. +#include // gethostname, sysconf +#endif // __POSIX__ // Add Windows fallback. #ifndef MAXHOSTNAMELEN -# define MAXHOSTNAMELEN 256 +#define MAXHOSTNAMELEN 256 #endif // MAXHOSTNAMELEN namespace node { @@ -63,7 +63,6 @@ using v8::Object; using v8::String; using v8::Value; - static void GetHostname(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); char buf[MAXHOSTNAMELEN + 1]; @@ -72,15 +71,14 @@ static void GetHostname(const FunctionCallbackInfo& args) { if (r != 0) { CHECK_GE(args.Length(), 1); - env->CollectUVExceptionInfo(args[args.Length() - 1], r, - "uv_os_gethostname"); + env->CollectUVExceptionInfo( + args[args.Length() - 1], r, "uv_os_gethostname"); return args.GetReturnValue().SetUndefined(); } args.GetReturnValue().Set(OneByteString(env->isolate(), buf)); } - static void GetOSType(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); uv_utsname_t info; @@ -95,7 +93,6 @@ static void GetOSType(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(OneByteString(env->isolate(), info.sysname)); } - static void GetOSRelease(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); uv_utsname_t info; @@ -110,7 +107,6 @@ static void GetOSRelease(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(OneByteString(env->isolate(), info.release)); } - static void GetCPUInfo(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); Isolate* isolate = env->isolate(); @@ -119,8 +115,7 @@ static void GetCPUInfo(const FunctionCallbackInfo& args) { int count; int err = uv_cpu_info(&cpu_infos, &count); - if (err) - return; + if (err) return; // It's faster to create an array packed with all the data and // assemble them into objects in JS than to call Object::Set() repeatedly @@ -142,31 +137,24 @@ static void GetCPUInfo(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(Array::New(isolate, result.data(), result.size())); } - static void GetFreeMemory(const FunctionCallbackInfo& args) { double amount = uv_get_free_memory(); - if (amount < 0) - return; + if (amount < 0) return; args.GetReturnValue().Set(amount); } - static void GetTotalMemory(const FunctionCallbackInfo& args) { double amount = uv_get_total_memory(); - if (amount < 0) - return; + if (amount < 0) return; args.GetReturnValue().Set(amount); } - static void GetUptime(const FunctionCallbackInfo& args) { double uptime; int err = uv_uptime(&uptime); - if (err == 0) - args.GetReturnValue().Set(uptime); + if (err == 0) args.GetReturnValue().Set(uptime); } - static void GetLoadAvg(const FunctionCallbackInfo& args) { CHECK(args[0]->IsFloat64Array()); Local array = args[0].As(); @@ -176,7 +164,6 @@ static void GetLoadAvg(const FunctionCallbackInfo& args) { uv_loadavg(loadavg); } - static void GetInterfaceAddresses(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); Isolate* isolate = env->isolate(); @@ -189,13 +176,12 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo& args) { int err = uv_interface_addresses(&interfaces, &count); - if (err == UV_ENOSYS) - return args.GetReturnValue().SetUndefined(); + if (err == UV_ENOSYS) return args.GetReturnValue().SetUndefined(); if (err) { CHECK_GE(args.Length(), 1); - env->CollectUVExceptionInfo(args[args.Length() - 1], errno, - "uv_interface_addresses"); + env->CollectUVExceptionInfo( + args[args.Length() - 1], errno, "uv_interface_addresses"); return args.GetReturnValue().SetUndefined(); } @@ -209,8 +195,8 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo& args) { // to assume UTF8 as the default as well. It’s what people will expect if // they name the interface from any input that uses UTF-8, which should be // the most frequent case by far these days.) - name = String::NewFromUtf8(isolate, raw_name, - v8::NewStringType::kNormal).ToLocalChecked(); + name = String::NewFromUtf8(isolate, raw_name, v8::NewStringType::kNormal) + .ToLocalChecked(); snprintf(mac.data(), mac.size(), @@ -241,7 +227,7 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo& args) { result[i * 7 + 3] = family; result[i * 7 + 4] = FIXED_ONE_BYTE_STRING(isolate, mac); result[i * 7 + 5] = - interfaces[i].is_internal ? True(isolate) : False(isolate); + interfaces[i].is_internal ? True(isolate) : False(isolate); if (interfaces[i].address.address4.sin_family == AF_INET6) { uint32_t scopeid = interfaces[i].address.address6.sin6_scope_id; result[i * 7 + 6] = Integer::NewFromUnsigned(isolate, scopeid); @@ -254,7 +240,6 @@ static void GetInterfaceAddresses(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(Array::New(isolate, result.data(), result.size())); } - static void GetHomeDirectory(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); char buf[PATH_MAX]; @@ -268,14 +253,12 @@ static void GetHomeDirectory(const FunctionCallbackInfo& args) { return args.GetReturnValue().SetUndefined(); } - Local home = String::NewFromUtf8(env->isolate(), - buf, - v8::NewStringType::kNormal, - len).ToLocalChecked(); + Local home = + String::NewFromUtf8(env->isolate(), buf, v8::NewStringType::kNormal, len) + .ToLocalChecked(); args.GetReturnValue().Set(home); } - static void GetUserInfo(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); uv_passwd_t pwd; @@ -283,10 +266,9 @@ static void GetUserInfo(const FunctionCallbackInfo& args) { if (args[0]->IsObject()) { Local options = args[0].As(); - MaybeLocal maybe_encoding = options->Get(env->context(), - env->encoding_string()); - if (maybe_encoding.IsEmpty()) - return; + MaybeLocal maybe_encoding = + options->Get(env->context(), env->encoding_string()); + if (maybe_encoding.IsEmpty()) return; Local encoding_opt = maybe_encoding.ToLocalChecked(); encoding = ParseEncoding(env->isolate(), encoding_opt, UTF8); @@ -298,8 +280,8 @@ static void GetUserInfo(const FunctionCallbackInfo& args) { if (err) { CHECK_GE(args.Length(), 2); - env->CollectUVExceptionInfo(args[args.Length() - 1], err, - "uv_os_get_passwd"); + env->CollectUVExceptionInfo( + args[args.Length() - 1], err, "uv_os_get_passwd"); return args.GetReturnValue().SetUndefined(); } @@ -309,14 +291,10 @@ static void GetUserInfo(const FunctionCallbackInfo& args) { Local uid = Number::New(env->isolate(), pwd.uid); Local gid = Number::New(env->isolate(), pwd.gid); - MaybeLocal username = StringBytes::Encode(env->isolate(), - pwd.username, - encoding, - &error); - MaybeLocal homedir = StringBytes::Encode(env->isolate(), - pwd.homedir, - encoding, - &error); + MaybeLocal username = + StringBytes::Encode(env->isolate(), pwd.username, encoding, &error); + MaybeLocal homedir = + StringBytes::Encode(env->isolate(), pwd.homedir, encoding, &error); MaybeLocal shell; if (pwd.shell == nullptr) @@ -334,20 +312,16 @@ static void GetUserInfo(const FunctionCallbackInfo& args) { entry->Set(env->context(), env->uid_string(), uid).FromJust(); entry->Set(env->context(), env->gid_string(), gid).FromJust(); - entry->Set(env->context(), - env->username_string(), - username.ToLocalChecked()).FromJust(); - entry->Set(env->context(), - env->homedir_string(), - homedir.ToLocalChecked()).FromJust(); - entry->Set(env->context(), - env->shell_string(), - shell.ToLocalChecked()).FromJust(); + entry->Set(env->context(), env->username_string(), username.ToLocalChecked()) + .FromJust(); + entry->Set(env->context(), env->homedir_string(), homedir.ToLocalChecked()) + .FromJust(); + entry->Set(env->context(), env->shell_string(), shell.ToLocalChecked()) + .FromJust(); args.GetReturnValue().Set(entry); } - static void SetPriority(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -367,7 +341,6 @@ static void SetPriority(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(err); } - static void GetPriority(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -387,7 +360,6 @@ static void GetPriority(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(priority); } - void Initialize(Local target, Local unused, Local context, @@ -406,9 +378,11 @@ void Initialize(Local target, env->SetMethod(target, "getUserInfo", GetUserInfo); env->SetMethod(target, "setPriority", SetPriority); env->SetMethod(target, "getPriority", GetPriority); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "isBigEndian"), - Boolean::New(env->isolate(), IsBigEndian())).FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "isBigEndian"), + Boolean::New(env->isolate(), IsBigEndian())) + .FromJust(); } } // namespace os diff --git a/src/node_perf.cc b/src/node_perf.cc index cefd0ff26dbf95..b7e742eac54230 100644 --- a/src/node_perf.cc +++ b/src/node_perf.cc @@ -1,5 +1,5 @@ -#include "node_internals.h" #include "node_perf.h" +#include "node_internals.h" #ifdef __POSIX__ #include // gettimeofday @@ -43,13 +43,12 @@ const double timeOriginTimestamp = GetCurrentTimeInMicroseconds(); uint64_t performance_node_start; uint64_t performance_v8_start; -void performance_state::Mark(enum PerformanceMilestone milestone, - uint64_t ts) { +void performance_state::Mark(enum PerformanceMilestone milestone, uint64_t ts) { this->milestones[milestone] = ts; - TRACE_EVENT_INSTANT_WITH_TIMESTAMP0( - TRACING_CATEGORY_NODE1(bootstrap), - GetPerformanceMilestoneName(milestone), - TRACE_EVENT_SCOPE_THREAD, ts / 1000); + TRACE_EVENT_INSTANT_WITH_TIMESTAMP0(TRACING_CATEGORY_NODE1(bootstrap), + GetPerformanceMilestoneName(milestone), + TRACE_EVENT_SCOPE_THREAD, + ts / 1000); } double GetCurrentTimeInMicroseconds() { @@ -58,8 +57,8 @@ double GetCurrentTimeInMicroseconds() { #define TICKS_TO_UNIX_EPOCH 116444736000000000LL FILETIME ft; GetSystemTimeAsFileTime(&ft); - uint64_t filetime_int = static_cast(ft.dwHighDateTime) << 32 | - ft.dwLowDateTime; + uint64_t filetime_int = + static_cast(ft.dwHighDateTime) << 32 | ft.dwLowDateTime; // FILETIME is measured in terms of 100 ns. Convert that to 1 us (1000 ns). return (filetime_int - TICKS_TO_UNIX_EPOCH) / 10.; #else @@ -76,30 +75,32 @@ inline void InitObject(const PerformanceEntry& entry, Local obj) { Local context = env->context(); PropertyAttribute attr = static_cast(ReadOnly | DontDelete); - obj->DefineOwnProperty(context, - env->name_string(), - String::NewFromUtf8(isolate, - entry.name().c_str(), - NewStringType::kNormal) - .ToLocalChecked(), - attr) + obj->DefineOwnProperty( + context, + env->name_string(), + String::NewFromUtf8( + isolate, entry.name().c_str(), NewStringType::kNormal) + .ToLocalChecked(), + attr) .FromJust(); - obj->DefineOwnProperty(context, - env->entry_type_string(), - String::NewFromUtf8(isolate, - entry.type().c_str(), - NewStringType::kNormal) - .ToLocalChecked(), - attr) + obj->DefineOwnProperty( + context, + env->entry_type_string(), + String::NewFromUtf8( + isolate, entry.type().c_str(), NewStringType::kNormal) + .ToLocalChecked(), + attr) .FromJust(); obj->DefineOwnProperty(context, env->start_time_string(), Number::New(isolate, entry.startTime()), - attr).FromJust(); + attr) + .FromJust(); obj->DefineOwnProperty(context, env->duration_string(), Number::New(isolate, entry.duration()), - attr).FromJust(); + attr) + .FromJust(); } // Create a new PerformanceEntry object @@ -134,12 +135,12 @@ void PerformanceEntry::Notify(Environment* env, Context::Scope scope(env->context()); AliasedBuffer& observers = env->performance_state()->observers; - if (type != NODE_PERFORMANCE_ENTRY_TYPE_INVALID && - observers[type]) { + if (type != NODE_PERFORMANCE_ENTRY_TYPE_INVALID && observers[type]) { node::MakeCallback(env->isolate(), object.As(), env->performance_entry_callback(), - 1, &object, + 1, + &object, node::async_context{0, 0}); } } @@ -154,8 +155,7 @@ void Mark(const FunctionCallbackInfo& args) { (*marks)[*name] = now; TRACE_EVENT_COPY_MARK_WITH_TIMESTAMP( - TRACING_CATEGORY_NODE2(perf, usertiming), - *name, now / 1000); + TRACING_CATEGORY_NODE2(perf, usertiming), *name, now / 1000); PerformanceEntry entry(env, *name, "mark", now, now); Local obj; @@ -211,15 +211,18 @@ void Measure(const FunctionCallbackInfo& args) { endTimestamp = milestones[milestone]; } - if (endTimestamp < startTimestamp) - endTimestamp = startTimestamp; + if (endTimestamp < startTimestamp) endTimestamp = startTimestamp; TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP0( TRACING_CATEGORY_NODE2(perf, usertiming), - *name, *name, startTimestamp / 1000); + *name, + *name, + startTimestamp / 1000); TRACE_EVENT_COPY_NESTABLE_ASYNC_END_WITH_TIMESTAMP0( TRACING_CATEGORY_NODE2(perf, usertiming), - *name, *name, endTimestamp / 1000); + *name, + *name, + endTimestamp / 1000); PerformanceEntry entry(env, *name, "measure", startTimestamp, endTimestamp); Local obj; @@ -232,14 +235,12 @@ void Measure(const FunctionCallbackInfo& args) { void MarkMilestone(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); Local context = env->context(); - PerformanceMilestone milestone = - static_cast( - args[0]->Int32Value(context).ToChecked()); + PerformanceMilestone milestone = static_cast( + args[0]->Int32Value(context).ToChecked()); if (milestone != NODE_PERFORMANCE_MILESTONE_INVALID) env->performance_state()->Mark(milestone); } - void SetupPerformanceObservers(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); CHECK(args[0]->IsFunction()); @@ -263,7 +264,8 @@ void PerformanceGCCallback(Environment* env, void* ptr) { obj->DefineOwnProperty(context, env->kind_string(), Integer::New(env->isolate(), entry->gckind()), - attr).FromJust(); + attr) + .FromJust(); PerformanceEntry::Notify(env, entry->kind(), obj); } } @@ -285,28 +287,29 @@ void MarkGarbageCollectionEnd(Isolate* isolate, Environment* env = static_cast(data); performance_state* state = env->performance_state(); // If no one is listening to gc performance entries, do not create them. - if (!state->observers[NODE_PERFORMANCE_ENTRY_TYPE_GC]) - return; + if (!state->observers[NODE_PERFORMANCE_ENTRY_TYPE_GC]) return; GCPerformanceEntry* entry = new GCPerformanceEntry(env, static_cast(type), state->performance_last_gc_start_mark, PERFORMANCE_NOW()); - env->SetUnrefImmediate(PerformanceGCCallback, - entry); + env->SetUnrefImmediate(PerformanceGCCallback, entry); } - inline void SetupGarbageCollectionTracking(Environment* env) { env->isolate()->AddGCPrologueCallback(MarkGarbageCollectionStart, static_cast(env)); env->isolate()->AddGCEpilogueCallback(MarkGarbageCollectionEnd, static_cast(env)); - env->AddCleanupHook([](void* data) { - Environment* env = static_cast(data); - env->isolate()->RemoveGCPrologueCallback(MarkGarbageCollectionStart, data); - env->isolate()->RemoveGCEpilogueCallback(MarkGarbageCollectionEnd, data); - }, env); + env->AddCleanupHook( + [](void* data) { + Environment* env = static_cast(data); + env->isolate()->RemoveGCPrologueCallback(MarkGarbageCollectionStart, + data); + env->isolate()->RemoveGCEpilogueCallback(MarkGarbageCollectionEnd, + data); + }, + env); } // Gets the name of a function @@ -339,30 +342,26 @@ void TimerFunctionCall(const FunctionCallbackInfo& args) { uint64_t start = PERFORMANCE_NOW(); TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP0( - TRACING_CATEGORY_NODE2(perf, timerify), - *name, *name, start / 1000); + TRACING_CATEGORY_NODE2(perf, timerify), *name, *name, start / 1000); v8::MaybeLocal ret; if (is_construct_call) { ret = fn->NewInstance(context, call_args.length(), call_args.out()) - .FromMaybe(Local()); + .FromMaybe(Local()); } else { ret = fn->Call(context, args.This(), call_args.length(), call_args.out()); } uint64_t end = PERFORMANCE_NOW(); TRACE_EVENT_COPY_NESTABLE_ASYNC_END_WITH_TIMESTAMP0( - TRACING_CATEGORY_NODE2(perf, timerify), - *name, *name, end / 1000); + TRACING_CATEGORY_NODE2(perf, timerify), *name, *name, end / 1000); - if (ret.IsEmpty()) - return; + if (ret.IsEmpty()) return; args.GetReturnValue().Set(ret.ToLocalChecked()); AliasedBuffer& observers = env->performance_state()->observers; - if (!observers[NODE_PERFORMANCE_ENTRY_TYPE_FUNCTION]) - return; + if (!observers[NODE_PERFORMANCE_ENTRY_TYPE_FUNCTION]) return; PerformanceEntry entry(env, *name, "function", start, end); Local obj; @@ -385,7 +384,6 @@ void Timerify(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(wrap); } - void Initialize(Local target, Local unused, Local context, @@ -394,12 +392,16 @@ void Initialize(Local target, Isolate* isolate = env->isolate(); performance_state* state = env->performance_state(); - target->Set(context, - FIXED_ONE_BYTE_STRING(isolate, "observerCounts"), - state->observers.GetJSArray()).FromJust(); - target->Set(context, - FIXED_ONE_BYTE_STRING(isolate, "milestones"), - state->milestones.GetJSArray()).FromJust(); + target + ->Set(context, + FIXED_ONE_BYTE_STRING(isolate, "observerCounts"), + state->observers.GetJSArray()) + .FromJust(); + target + ->Set(context, + FIXED_ONE_BYTE_STRING(isolate, "milestones"), + state->milestones.GetJSArray()) + .FromJust(); Local performanceEntryString = FIXED_ONE_BYTE_STRING(isolate, "PerformanceEntry"); @@ -424,12 +426,12 @@ void Initialize(Local target, NODE_DEFINE_CONSTANT(constants, NODE_PERFORMANCE_GC_INCREMENTAL); NODE_DEFINE_CONSTANT(constants, NODE_PERFORMANCE_GC_WEAKCB); -#define V(name, _) \ +#define V(name, _) \ NODE_DEFINE_HIDDEN_CONSTANT(constants, NODE_PERFORMANCE_ENTRY_TYPE_##name); NODE_PERFORMANCE_ENTRY_TYPES(V) #undef V -#define V(name, _) \ +#define V(name, _) \ NODE_DEFINE_HIDDEN_CONSTANT(constants, NODE_PERFORMANCE_MILESTONE_##name); NODE_PERFORMANCE_MILESTONES(V) #undef V @@ -437,21 +439,23 @@ void Initialize(Local target, PropertyAttribute attr = static_cast(ReadOnly | DontDelete); - target->DefineOwnProperty(context, - FIXED_ONE_BYTE_STRING(isolate, "timeOrigin"), - Number::New(isolate, timeOrigin / 1e6), - attr).ToChecked(); - - target->DefineOwnProperty( - context, - FIXED_ONE_BYTE_STRING(isolate, "timeOriginTimestamp"), - Number::New(isolate, timeOriginTimestamp / MICROS_PER_MILLIS), - attr).ToChecked(); - - target->DefineOwnProperty(context, - env->constants_string(), - constants, - attr).ToChecked(); + target + ->DefineOwnProperty(context, + FIXED_ONE_BYTE_STRING(isolate, "timeOrigin"), + Number::New(isolate, timeOrigin / 1e6), + attr) + .ToChecked(); + + target + ->DefineOwnProperty( + context, + FIXED_ONE_BYTE_STRING(isolate, "timeOriginTimestamp"), + Number::New(isolate, timeOriginTimestamp / MICROS_PER_MILLIS), + attr) + .ToChecked(); + + target->DefineOwnProperty(context, env->constants_string(), constants, attr) + .ToChecked(); SetupGarbageCollectionTracking(env); } diff --git a/src/node_perf.h b/src/node_perf.h index 56140bd62dee51..737041caf047ca 100644 --- a/src/node_perf.h +++ b/src/node_perf.h @@ -3,13 +3,13 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS +#include "base_object-inl.h" +#include "env.h" #include "node.h" #include "node_perf_common.h" -#include "env.h" -#include "base_object-inl.h" -#include "v8.h" #include "uv.h" +#include "v8.h" #include @@ -29,8 +29,10 @@ double GetCurrentTimeInMicroseconds(); static inline const char* GetPerformanceMilestoneName( enum PerformanceMilestone milestone) { switch (milestone) { -#define V(name, label) case NODE_PERFORMANCE_MILESTONE_##name: return label; - NODE_PERFORMANCE_MILESTONES(V) +#define V(name, label) \ + case NODE_PERFORMANCE_MILESTONE_##name: \ + return label; + NODE_PERFORMANCE_MILESTONES(V) #undef V default: UNREACHABLE(); @@ -39,7 +41,7 @@ static inline const char* GetPerformanceMilestoneName( } static inline PerformanceMilestone ToPerformanceMilestoneEnum(const char* str) { -#define V(name, label) \ +#define V(name, label) \ if (strcmp(str, label) == 0) return NODE_PERFORMANCE_MILESTONE_##name; NODE_PERFORMANCE_MILESTONES(V) #undef V @@ -48,7 +50,7 @@ static inline PerformanceMilestone ToPerformanceMilestoneEnum(const char* str) { static inline PerformanceEntryType ToPerformanceEntryTypeEnum( const char* type) { -#define V(name, label) \ +#define V(name, label) \ if (strcmp(type, label) == 0) return NODE_PERFORMANCE_ENTRY_TYPE_##name; NODE_PERFORMANCE_ENTRY_TYPES(V) #undef V @@ -67,13 +69,14 @@ class PerformanceEntry { const char* name, const char* type, uint64_t startTime, - uint64_t endTime) : env_(env), - name_(name), - type_(type), - startTime_(startTime), - endTime_(endTime) { } + uint64_t endTime) + : env_(env), + name_(name), + type_(type), + startTime_(startTime), + endTime_(endTime) {} - virtual ~PerformanceEntry() { } + virtual ~PerformanceEntry() {} virtual v8::MaybeLocal ToObject() const; @@ -115,9 +118,9 @@ class GCPerformanceEntry : public PerformanceEntry { GCPerformanceEntry(Environment* env, PerformanceGCKind gckind, uint64_t startTime, - uint64_t endTime) : - PerformanceEntry(env, "gc", "gc", startTime, endTime), - gckind_(gckind) { } + uint64_t endTime) + : PerformanceEntry(env, "gc", "gc", startTime, endTime), + gckind_(gckind) {} PerformanceGCKind gckind() const { return gckind_; } diff --git a/src/node_perf_common.h b/src/node_perf_common.h index 1c4cf01c871ad3..9317538714cd19 100644 --- a/src/node_perf_common.h +++ b/src/node_perf_common.h @@ -21,55 +21,49 @@ namespace performance { extern uint64_t performance_node_start; extern uint64_t performance_v8_start; -#define NODE_PERFORMANCE_MILESTONES(V) \ - V(ENVIRONMENT, "environment") \ - V(NODE_START, "nodeStart") \ - V(V8_START, "v8Start") \ - V(LOOP_START, "loopStart") \ - V(LOOP_EXIT, "loopExit") \ +#define NODE_PERFORMANCE_MILESTONES(V) \ + V(ENVIRONMENT, "environment") \ + V(NODE_START, "nodeStart") \ + V(V8_START, "v8Start") \ + V(LOOP_START, "loopStart") \ + V(LOOP_EXIT, "loopExit") \ V(BOOTSTRAP_COMPLETE, "bootstrapComplete") - -#define NODE_PERFORMANCE_ENTRY_TYPES(V) \ - V(NODE, "node") \ - V(MARK, "mark") \ - V(MEASURE, "measure") \ - V(GC, "gc") \ - V(FUNCTION, "function") \ +#define NODE_PERFORMANCE_ENTRY_TYPES(V) \ + V(NODE, "node") \ + V(MARK, "mark") \ + V(MEASURE, "measure") \ + V(GC, "gc") \ + V(FUNCTION, "function") \ V(HTTP2, "http2") enum PerformanceMilestone { #define V(name, _) NODE_PERFORMANCE_MILESTONE_##name, NODE_PERFORMANCE_MILESTONES(V) #undef V - NODE_PERFORMANCE_MILESTONE_INVALID + NODE_PERFORMANCE_MILESTONE_INVALID }; enum PerformanceEntryType { #define V(name, _) NODE_PERFORMANCE_ENTRY_TYPE_##name, NODE_PERFORMANCE_ENTRY_TYPES(V) #undef V - NODE_PERFORMANCE_ENTRY_TYPE_INVALID + NODE_PERFORMANCE_ENTRY_TYPE_INVALID }; class performance_state { public: - explicit performance_state(v8::Isolate* isolate) : - root( - isolate, - sizeof(performance_state_internal)), - milestones( - isolate, - offsetof(performance_state_internal, milestones), - NODE_PERFORMANCE_MILESTONE_INVALID, - root), - observers( - isolate, - offsetof(performance_state_internal, observers), - NODE_PERFORMANCE_ENTRY_TYPE_INVALID, - root) { - for (size_t i = 0; i < milestones.Length(); i++) - milestones[i] = -1.; + explicit performance_state(v8::Isolate* isolate) + : root(isolate, sizeof(performance_state_internal)), + milestones(isolate, + offsetof(performance_state_internal, milestones), + NODE_PERFORMANCE_MILESTONE_INVALID, + root), + observers(isolate, + offsetof(performance_state_internal, observers), + NODE_PERFORMANCE_ENTRY_TYPE_INVALID, + root) { + for (size_t i = 0; i < milestones.Length(); i++) milestones[i] = -1.; } AliasedBuffer root; diff --git a/src/node_persistent.h b/src/node_persistent.h index 6126ebc6c20fd5..1bbae0a591eef4 100644 --- a/src/node_persistent.h +++ b/src/node_persistent.h @@ -30,8 +30,7 @@ class PersistentToLocal { // reference to the object. template static inline v8::Local Default( - v8::Isolate* isolate, - const Persistent& persistent) { + v8::Isolate* isolate, const Persistent& persistent) { if (persistent.IsWeak()) { return PersistentToLocal::Weak(isolate, persistent); } else { @@ -53,8 +52,7 @@ class PersistentToLocal { template static inline v8::Local Weak( - v8::Isolate* isolate, - const Persistent& persistent) { + v8::Isolate* isolate, const Persistent& persistent) { return v8::Local::New(isolate, persistent); } }; diff --git a/src/node_platform.cc b/src/node_platform.cc index 797d4d9cbb0dac..247c185971ef0c 100644 --- a/src/node_platform.cc +++ b/src/node_platform.cc @@ -1,20 +1,20 @@ #include "node_platform.h" #include "node_internals.h" -#include "env-inl.h" +#include #include "debug_utils.h" +#include "env-inl.h" #include "util.h" -#include namespace node { +using node::tracing::TracingController; using v8::HandleScope; using v8::Isolate; using v8::Local; using v8::Object; using v8::Platform; using v8::Task; -using node::tracing::TracingController; namespace { @@ -27,12 +27,12 @@ struct PlatformWorkerData { }; static void PlatformWorkerThread(void* data) { - std::unique_ptr - worker_data(static_cast(data)); + std::unique_ptr worker_data( + static_cast(data)); TaskQueue* pending_worker_tasks = worker_data->task_queue; - TRACE_EVENT_METADATA1("__metadata", "thread_name", "name", - "PlatformWorkerThread"); + TRACE_EVENT_METADATA1( + "__metadata", "thread_name", "name", "PlatformWorkerThread"); // Notify the main thread that the platform worker is ready. { @@ -52,13 +52,13 @@ static void PlatformWorkerThread(void* data) { class WorkerThreadsTaskRunner::DelayedTaskScheduler { public: explicit DelayedTaskScheduler(TaskQueue* tasks) - : pending_worker_tasks_(tasks) {} + : pending_worker_tasks_(tasks) {} std::unique_ptr Start() { auto start_thread = [](void* data) { static_cast(data)->Run(); }; - std::unique_ptr t { new uv_thread_t() }; + std::unique_ptr t{new uv_thread_t()}; uv_sem_init(&ready_, 0); CHECK_EQ(0, uv_thread_create(t.get(), start_thread, this)); uv_sem_wait(&ready_); @@ -67,8 +67,8 @@ class WorkerThreadsTaskRunner::DelayedTaskScheduler { } void PostDelayedTask(std::unique_ptr task, double delay_in_seconds) { - tasks_.Push(std::unique_ptr(new ScheduleTask(this, std::move(task), - delay_in_seconds))); + tasks_.Push(std::unique_ptr( + new ScheduleTask(this, std::move(task), delay_in_seconds))); uv_async_send(&flush_tasks_); } @@ -79,7 +79,9 @@ class WorkerThreadsTaskRunner::DelayedTaskScheduler { private: void Run() { - TRACE_EVENT_METADATA1("__metadata", "thread_name", "name", + TRACE_EVENT_METADATA1("__metadata", + "thread_name", + "name", "WorkerThreadsTaskRunner::DelayedTaskScheduler"); loop_.data = this; CHECK_EQ(0, uv_loop_init(&loop_)); @@ -94,26 +96,24 @@ class WorkerThreadsTaskRunner::DelayedTaskScheduler { static void FlushTasks(uv_async_t* flush_tasks) { DelayedTaskScheduler* scheduler = ContainerOf(&DelayedTaskScheduler::loop_, flush_tasks->loop); - while (std::unique_ptr task = scheduler->tasks_.Pop()) - task->Run(); + while (std::unique_ptr task = scheduler->tasks_.Pop()) task->Run(); } class StopTask : public Task { public: - explicit StopTask(DelayedTaskScheduler* scheduler): scheduler_(scheduler) {} + explicit StopTask(DelayedTaskScheduler* scheduler) + : scheduler_(scheduler) {} void Run() override { std::vector timers; - for (uv_timer_t* timer : scheduler_->timers_) - timers.push_back(timer); - for (uv_timer_t* timer : timers) - scheduler_->TakeTimerTask(timer); + for (uv_timer_t* timer : scheduler_->timers_) timers.push_back(timer); + for (uv_timer_t* timer : timers) scheduler_->TakeTimerTask(timer); uv_close(reinterpret_cast(&scheduler_->flush_tasks_), [](uv_handle_t* handle) {}); } private: - DelayedTaskScheduler* scheduler_; + DelayedTaskScheduler* scheduler_; }; class ScheduleTask : public Task { @@ -121,9 +121,9 @@ class WorkerThreadsTaskRunner::DelayedTaskScheduler { ScheduleTask(DelayedTaskScheduler* scheduler, std::unique_ptr task, double delay_in_seconds) - : scheduler_(scheduler), - task_(std::move(task)), - delay_in_seconds_(delay_in_seconds) {} + : scheduler_(scheduler), + task_(std::move(task)), + delay_in_seconds_(delay_in_seconds) {} void Run() override { uint64_t delay_millis = @@ -178,13 +178,14 @@ WorkerThreadsTaskRunner::WorkerThreadsTaskRunner(int thread_pool_size) { threads_.push_back(delayed_task_scheduler_->Start()); for (int i = 0; i < thread_pool_size; i++) { - PlatformWorkerData* worker_data = new PlatformWorkerData{ - &pending_worker_tasks_, &platform_workers_mutex, - &platform_workers_ready, &pending_platform_workers, i - }; - std::unique_ptr t { new uv_thread_t() }; - if (uv_thread_create(t.get(), PlatformWorkerThread, - worker_data) != 0) { + PlatformWorkerData* worker_data = + new PlatformWorkerData{&pending_worker_tasks_, + &platform_workers_mutex, + &platform_workers_ready, + &pending_platform_workers, + i}; + std::unique_ptr t{new uv_thread_t()}; + if (uv_thread_create(t.get(), PlatformWorkerThread, worker_data) != 0) { break; } threads_.push_back(std::move(t)); @@ -222,9 +223,9 @@ int WorkerThreadsTaskRunner::NumberOfWorkerThreads() const { return threads_.size(); } -PerIsolatePlatformData::PerIsolatePlatformData( - v8::Isolate* isolate, uv_loop_t* loop) - : loop_(loop) { +PerIsolatePlatformData::PerIsolatePlatformData(v8::Isolate* isolate, + uv_loop_t* loop) + : loop_(loop) { flush_tasks_ = new uv_async_t(); CHECK_EQ(0, uv_async_init(loop, flush_tasks_, FlushTasks)); flush_tasks_->data = static_cast(this); @@ -246,8 +247,8 @@ void PerIsolatePlatformData::PostTask(std::unique_ptr task) { uv_async_send(flush_tasks_); } -void PerIsolatePlatformData::PostDelayedTask( - std::unique_ptr task, double delay_in_seconds) { +void PerIsolatePlatformData::PostDelayedTask(std::unique_ptr task, + double delay_in_seconds) { CHECK_NE(flush_tasks_, nullptr); std::unique_ptr delayed(new DelayedTask()); delayed->task = std::move(task); @@ -262,8 +263,7 @@ PerIsolatePlatformData::~PerIsolatePlatformData() { } void PerIsolatePlatformData::Shutdown() { - if (flush_tasks_ == nullptr) - return; + if (flush_tasks_ == nullptr) return; CHECK_NULL(foreground_delayed_tasks_.Pop()); CHECK_NULL(foreground_tasks_.Pop()); @@ -271,8 +271,8 @@ void PerIsolatePlatformData::Shutdown() { uv_close(reinterpret_cast(flush_tasks_), [](uv_handle_t* handle) { - delete reinterpret_cast(handle); - }); + delete reinterpret_cast(handle); + }); flush_tasks_ = nullptr; } @@ -334,8 +334,8 @@ void PerIsolatePlatformData::RunForegroundTask(std::unique_ptr task) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); Environment* env = Environment::GetCurrent(isolate); - InternalCallbackScope cb_scope(env, Local(), { 0, 0 }, - InternalCallbackScope::kAllowEmptyResource); + InternalCallbackScope cb_scope( + env, Local(), {0, 0}, InternalCallbackScope::kAllowEmptyResource); task->Run(); } @@ -343,8 +343,8 @@ void PerIsolatePlatformData::DeleteFromScheduledTasks(DelayedTask* task) { auto it = std::find_if(scheduled_delayed_tasks_.begin(), scheduled_delayed_tasks_.end(), [task](const DelayedTaskPointer& delayed) -> bool { - return delayed.get() == task; - }); + return delayed.get() == task; + }); CHECK_NE(it, scheduled_delayed_tasks_.end()); scheduled_delayed_tasks_.erase(it); } @@ -372,7 +372,7 @@ bool PerIsolatePlatformData::FlushForegroundTasksInternal() { bool did_work = false; while (std::unique_ptr delayed = - foreground_delayed_tasks_.Pop()) { + foreground_delayed_tasks_.Pop()) { did_work = true; uint64_t delay_millis = static_cast(delayed->timeout + 0.5) * 1000; @@ -383,13 +383,13 @@ bool PerIsolatePlatformData::FlushForegroundTasksInternal() { uv_timer_start(&delayed->timer, RunForegroundTask, delay_millis, 0); uv_unref(reinterpret_cast(&delayed->timer)); - scheduled_delayed_tasks_.emplace_back(delayed.release(), - [](DelayedTask* delayed) { - uv_close(reinterpret_cast(&delayed->timer), - [](uv_handle_t* handle) { - delete static_cast(handle->data); - }); - }); + scheduled_delayed_tasks_.emplace_back( + delayed.release(), [](DelayedTask* delayed) { + uv_close(reinterpret_cast(&delayed->timer), + [](uv_handle_t* handle) { + delete static_cast(handle->data); + }); + }); } // Move all foreground tasks into a separate queue and flush that queue. // This way tasks that are posted while flushing the queue will be run on the @@ -414,9 +414,8 @@ void NodePlatform::CallDelayedOnWorkerThread(std::unique_ptr task, delay_in_seconds); } - -std::shared_ptr -NodePlatform::ForIsolate(Isolate* isolate) { +std::shared_ptr NodePlatform::ForIsolate( + Isolate* isolate) { Mutex::ScopedLock lock(per_isolate_mutex_); std::shared_ptr data = per_isolate_[isolate]; CHECK(data); @@ -430,8 +429,8 @@ void NodePlatform::CallOnForegroundThread(Isolate* isolate, Task* task) { void NodePlatform::CallDelayedOnForegroundThread(Isolate* isolate, Task* task, double delay_in_seconds) { - ForIsolate(isolate)->PostDelayedTask( - std::unique_ptr(task), delay_in_seconds); + ForIsolate(isolate)->PostDelayedTask(std::unique_ptr(task), + delay_in_seconds); } bool NodePlatform::FlushForegroundTasks(v8::Isolate* isolate) { @@ -442,10 +441,12 @@ void NodePlatform::CancelPendingDelayedTasks(v8::Isolate* isolate) { ForIsolate(isolate)->CancelPendingDelayedTasks(); } -bool NodePlatform::IdleTasksEnabled(Isolate* isolate) { return false; } +bool NodePlatform::IdleTasksEnabled(Isolate* isolate) { + return false; +} -std::shared_ptr -NodePlatform::GetForegroundTaskRunner(Isolate* isolate) { +std::shared_ptr NodePlatform::GetForegroundTaskRunner( + Isolate* isolate) { return ForIsolate(isolate); } @@ -464,8 +465,12 @@ TracingController* NodePlatform::GetTracingController() { template TaskQueue::TaskQueue() - : lock_(), tasks_available_(), tasks_drained_(), - outstanding_tasks_(0), stopped_(false), task_queue_() { } + : lock_(), + tasks_available_(), + tasks_drained_(), + outstanding_tasks_(0), + stopped_(false), + task_queue_() {} template void TaskQueue::Push(std::unique_ptr task) { diff --git a/src/node_platform.h b/src/node_platform.h index 1308d4df6aa249..21eb62517a3dd5 100644 --- a/src/node_platform.h +++ b/src/node_platform.h @@ -3,10 +3,10 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS +#include #include #include #include -#include #include "libplatform/libplatform.h" #include "node.h" @@ -51,9 +51,9 @@ struct DelayedTask { }; // This acts as the foreground task runner for a given Isolate. -class PerIsolatePlatformData : - public v8::TaskRunner, - public std::enable_shared_from_this { +class PerIsolatePlatformData + : public v8::TaskRunner, + public std::enable_shared_from_this { public: PerIsolatePlatformData(v8::Isolate* isolate, uv_loop_t* loop); ~PerIsolatePlatformData(); @@ -102,8 +102,7 @@ class WorkerThreadsTaskRunner { explicit WorkerThreadsTaskRunner(int thread_pool_size); void PostTask(std::unique_ptr task); - void PostDelayedTask(std::unique_ptr task, - double delay_in_seconds); + void PostDelayedTask(std::unique_ptr task, double delay_in_seconds); void BlockingDrain(); void Shutdown(); @@ -135,7 +134,8 @@ class NodePlatform : public MultiIsolatePlatform { void CallDelayedOnWorkerThread(std::unique_ptr task, double delay_in_seconds) override; void CallOnForegroundThread(v8::Isolate* isolate, v8::Task* task) override; - void CallDelayedOnForegroundThread(v8::Isolate* isolate, v8::Task* task, + void CallDelayedOnForegroundThread(v8::Isolate* isolate, + v8::Task* task, double delay_in_seconds) override; bool IdleTasksEnabled(v8::Isolate* isolate) override; double MonotonicallyIncreasingTime() override; @@ -153,8 +153,8 @@ class NodePlatform : public MultiIsolatePlatform { std::shared_ptr ForIsolate(v8::Isolate* isolate); Mutex per_isolate_mutex_; - std::unordered_map> per_isolate_; + std::unordered_map> + per_isolate_; node::tracing::TracingController* tracing_controller_; std::shared_ptr worker_thread_task_runner_; diff --git a/src/node_postmortem_metadata.cc b/src/node_postmortem_metadata.cc index 527bfb623e65de..7ce5a14943a73d 100644 --- a/src/node_postmortem_metadata.cc +++ b/src/node_postmortem_metadata.cc @@ -1,46 +1,60 @@ -#include "env.h" #include "base_object-inl.h" +#include "env.h" #include "handle_wrap.h" -#include "util-inl.h" +#include "node_context_data.h" #include "req_wrap.h" +#include "util-inl.h" #include "v8abbr.h" -#include "node_context_data.h" -#define NODEDBG_SYMBOL(Name) nodedbg_ ## Name +#define NODEDBG_SYMBOL(Name) nodedbg_##Name // nodedbg_offset_CLASS__MEMBER__TYPE: Describes the offset to a class member. -#define NODEDBG_OFFSET(Class, Member, Type) \ - NODEDBG_SYMBOL(offset_ ## Class ## __ ## Member ## __ ## Type) +#define NODEDBG_OFFSET(Class, Member, Type) \ + NODEDBG_SYMBOL(offset_##Class##__##Member##__##Type) // These are the constants describing Node internal structures. Every constant // should use the format described above. These constants are declared as // global integers so that they'll be present in the generated node binary. They // also need to be declared outside any namespace to avoid C++ name-mangling. -#define NODE_OFFSET_POSTMORTEM_METADATA(V) \ - V(BaseObject, persistent_handle_, v8_Persistent_v8_Object, \ - BaseObject::persistent_handle_) \ - V(Environment, handle_wrap_queue_, Environment_HandleWrapQueue, \ - Environment::handle_wrap_queue_) \ - V(Environment, req_wrap_queue_, Environment_ReqWrapQueue, \ - Environment::req_wrap_queue_) \ - V(HandleWrap, handle_wrap_queue_, ListNode_HandleWrap, \ - HandleWrap::handle_wrap_queue_) \ - V(Environment_HandleWrapQueue, head_, ListNode_HandleWrap, \ - Environment::HandleWrapQueue::head_) \ - V(ListNode_HandleWrap, next_, uintptr_t, ListNode::next_) \ - V(ReqWrap, req_wrap_queue_, ListNode_ReqWrapQueue, \ - ReqWrap::req_wrap_queue_) \ - V(Environment_ReqWrapQueue, head_, ListNode_ReqWrapQueue, \ - Environment::ReqWrapQueue::head_) \ +#define NODE_OFFSET_POSTMORTEM_METADATA(V) \ + V(BaseObject, \ + persistent_handle_, \ + v8_Persistent_v8_Object, \ + BaseObject::persistent_handle_) \ + V(Environment, \ + handle_wrap_queue_, \ + Environment_HandleWrapQueue, \ + Environment::handle_wrap_queue_) \ + V(Environment, \ + req_wrap_queue_, \ + Environment_ReqWrapQueue, \ + Environment::req_wrap_queue_) \ + V(HandleWrap, \ + handle_wrap_queue_, \ + ListNode_HandleWrap, \ + HandleWrap::handle_wrap_queue_) \ + V(Environment_HandleWrapQueue, \ + head_, \ + ListNode_HandleWrap, \ + Environment::HandleWrapQueue::head_) \ + V(ListNode_HandleWrap, next_, uintptr_t, ListNode::next_) \ + V(ReqWrap, \ + req_wrap_queue_, \ + ListNode_ReqWrapQueue, \ + ReqWrap::req_wrap_queue_) \ + V(Environment_ReqWrapQueue, \ + head_, \ + ListNode_ReqWrapQueue, \ + Environment::ReqWrapQueue::head_) \ V(ListNode_ReqWrap, next_, uintptr_t, ListNode>::next_) extern "C" { int nodedbg_const_ContextEmbedderIndex__kEnvironment__int; uintptr_t nodedbg_offset_ExternalString__data__uintptr_t; -#define V(Class, Member, Type, Accessor) \ +#define V(Class, Member, Type, Accessor) \ NODE_EXTERN uintptr_t NODEDBG_OFFSET(Class, Member, Type); - NODE_OFFSET_POSTMORTEM_METADATA(V) +NODE_OFFSET_POSTMORTEM_METADATA(V) #undef V } @@ -52,10 +66,10 @@ int GenDebugSymbols() { nodedbg_offset_ExternalString__data__uintptr_t = NODE_OFF_EXTSTR_DATA; - #define V(Class, Member, Type, Accessor) \ - NODEDBG_OFFSET(Class, Member, Type) = OffsetOf(&Accessor); - NODE_OFFSET_POSTMORTEM_METADATA(V) - #undef V +#define V(Class, Member, Type, Accessor) \ + NODEDBG_OFFSET(Class, Member, Type) = OffsetOf(&Accessor); + NODE_OFFSET_POSTMORTEM_METADATA(V) +#undef V return 1; } diff --git a/src/node_process_methods.cc b/src/node_process_methods.cc index a6d2c252e77ac5..eb762a961d33d1 100644 --- a/src/node_process_methods.cc +++ b/src/node_process_methods.cc @@ -26,7 +26,7 @@ typedef int mode_t; #else #include #include // getrlimit, setrlimit -#include // tcgetattr, tcsetattr +#include // tcgetattr, tcsetattr #endif namespace node { @@ -52,7 +52,7 @@ using v8::Value; namespace per_process { Mutex umask_mutex; -} // namespace per_process +} // namespace per_process // Microseconds in a second, as a float, used in CPUUsage() below #define MICROS_PER_SEC 1e6 @@ -121,17 +121,14 @@ static void Cwd(const FunctionCallbackInfo& args) { char buf[CHDIR_BUFSIZE]; size_t cwd_len = sizeof(buf); int err = uv_cwd(buf, &cwd_len); - if (err) - return env->ThrowUVException(err, "uv_cwd"); + if (err) return env->ThrowUVException(err, "uv_cwd"); - Local cwd = String::NewFromUtf8(env->isolate(), - buf, - NewStringType::kNormal, - cwd_len).ToLocalChecked(); + Local cwd = + String::NewFromUtf8(env->isolate(), buf, NewStringType::kNormal, cwd_len) + .ToLocalChecked(); args.GetReturnValue().Set(cwd); } - // Hrtime exposes libuv's uv_hrtime() high-resolution timer. // This is the legacy version of hrtime before BigInt was introduced in @@ -164,8 +161,7 @@ static void Kill(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); Local context = env->context(); - if (args.Length() != 2) - return env->ThrowError("Bad argument."); + if (args.Length() != 2) return env->ThrowError("Bad argument."); int pid; if (!args[0]->Int32Value(context).To(&pid)) return; @@ -180,8 +176,7 @@ static void MemoryUsage(const FunctionCallbackInfo& args) { size_t rss; int err = uv_resident_set_memory(&rss); - if (err) - return env->ThrowUVException(err, "uv_resident_set_memory"); + if (err) return env->ThrowUVException(err, "uv_resident_set_memory"); Isolate* isolate = env->isolate(); // V8 memory usage @@ -252,8 +247,7 @@ static void GetActiveRequests(const FunctionCallbackInfo& args) { std::vector> request_v; for (auto w : *env->req_wrap_queue()) { - if (w->persistent().IsEmpty()) - continue; + if (w->persistent().IsEmpty()) continue; request_v.push_back(w->GetOwner()); } @@ -268,8 +262,7 @@ void GetActiveHandles(const FunctionCallbackInfo& args) { std::vector> handle_v; for (auto w : *env->handle_wrap_queue()) { - if (!HandleWrap::HasRef(w)) - continue; + if (!HandleWrap::HasRef(w)) continue; handle_v.push_back(w->GetOwner()); } args.GetReturnValue().Set( diff --git a/src/node_process_object.cc b/src/node_process_object.cc index 159d9fdc40795f..15fe1e24bfacaf 100644 --- a/src/node_process_object.cc +++ b/src/node_process_object.cc @@ -2,8 +2,8 @@ #include "env-inl.h" #include "node_internals.h" -#include "node_options-inl.h" #include "node_metadata.h" +#include "node_options-inl.h" #include "node_process.h" #include "node_revert.h" #include "util-inl.h" @@ -99,9 +99,8 @@ MaybeLocal CreateProcessObject( .FromJust()); // process.version - READONLY_PROPERTY(process, - "version", - FIXED_ONE_BYTE_STRING(env->isolate(), NODE_VERSION)); + READONLY_PROPERTY( + process, "version", FIXED_ONE_BYTE_STRING(env->isolate(), NODE_VERSION)); // process.versions Local versions = Object::New(env->isolate()); @@ -141,15 +140,18 @@ MaybeLocal CreateProcessObject( #endif // NODE_HAS_RELEASE_URLS // process.argv - process->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "argv"), - ToV8Value(env->context(), args).ToLocalChecked()).FromJust(); + process + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "argv"), + ToV8Value(env->context(), args).ToLocalChecked()) + .FromJust(); // process.execArgv - process->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "execArgv"), - ToV8Value(env->context(), exec_args) - .ToLocalChecked()).FromJust(); + process + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "execArgv"), + ToV8Value(env->context(), exec_args).ToLocalChecked()) + .FromJust(); Local env_var_proxy; if (!CreateEnvVarProxy(context, isolate, env->as_external()) @@ -163,12 +165,14 @@ MaybeLocal CreateProcessObject( env_var_proxy) .FromJust(); - READONLY_PROPERTY(process, "pid", - Integer::New(env->isolate(), uv_os_getpid())); + READONLY_PROPERTY( + process, "pid", Integer::New(env->isolate(), uv_os_getpid())); - CHECK(process->SetAccessor(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "ppid"), - GetParentProcessId).FromJust()); + CHECK(process + ->SetAccessor(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "ppid"), + GetParentProcessId) + .FromJust()); // TODO(joyeecheung): the following process properties that are set using // parsed CLI flags should be migrated to `internal/options` in JS land. @@ -178,10 +182,10 @@ MaybeLocal CreateProcessObject( if (env->options()->has_eval_string) { READONLY_PROPERTY(process, "_eval", - String::NewFromUtf8( - env->isolate(), - env->options()->eval_string.c_str(), - NewStringType::kNormal).ToLocalChecked()); + String::NewFromUtf8(env->isolate(), + env->options()->eval_string.c_str(), + NewStringType::kNormal) + .ToLocalChecked()); } // -p, --print @@ -207,10 +211,10 @@ MaybeLocal CreateProcessObject( const std::vector& preload_modules = env->options()->preload_modules; if (!preload_modules.empty()) { - READONLY_PROPERTY(process, - "_preload_modules", - ToV8Value(env->context(), preload_modules) - .ToLocalChecked()); + READONLY_PROPERTY( + process, + "_preload_modules", + ToV8Value(env->context(), preload_modules).ToLocalChecked()); } // --no-deprecation @@ -251,22 +255,22 @@ MaybeLocal CreateProcessObject( // --inspect-brk if (env->options()->debug_options().wait_for_connect()) { - READONLY_DONT_ENUM_PROPERTY(process, - "_breakFirstLine", True(env->isolate())); + READONLY_DONT_ENUM_PROPERTY( + process, "_breakFirstLine", True(env->isolate())); } // --inspect-brk-node if (env->options()->debug_options().break_node_first_line) { - READONLY_DONT_ENUM_PROPERTY(process, - "_breakNodeFirstLine", True(env->isolate())); + READONLY_DONT_ENUM_PROPERTY( + process, "_breakNodeFirstLine", True(env->isolate())); } // --security-revert flags -#define V(code, _, __) \ - do { \ - if (IsReverted(SECURITY_REVERT_ ## code)) { \ - READONLY_PROPERTY(process, "REVERT_" #code, True(env->isolate())); \ - } \ +#define V(code, _, __) \ + do { \ + if (IsReverted(SECURITY_REVERT_##code)) { \ + READONLY_PROPERTY(process, "REVERT_" #code, True(env->isolate())); \ + } \ } while (0); SECURITY_REVERSIONS(V) #undef V @@ -280,14 +284,19 @@ MaybeLocal CreateProcessObject( exec_path_value = String::NewFromUtf8(env->isolate(), exec_path.data(), NewStringType::kInternalized, - exec_path_len).ToLocalChecked(); + exec_path_len) + .ToLocalChecked(); } else { - exec_path_value = String::NewFromUtf8(env->isolate(), args[0].c_str(), - NewStringType::kInternalized).ToLocalChecked(); + exec_path_value = + String::NewFromUtf8( + env->isolate(), args[0].c_str(), NewStringType::kInternalized) + .ToLocalChecked(); } - process->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "execPath"), - exec_path_value).FromJust(); + process + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "execPath"), + exec_path_value) + .FromJust(); } // process.debugPort diff --git a/src/node_report.cc b/src/node_report.cc index d10db1c97bc8b1..11e0488a17305d 100644 --- a/src/node_report.cc +++ b/src/node_report.cc @@ -48,12 +48,12 @@ extern char** environ; #endif #ifdef __POSIX__ -# include // MAXHOSTNAMELEN on Solaris. -# include // MAXHOSTNAMELEN on Linux and the BSDs. -#endif // __POSIX__ +#include // MAXHOSTNAMELEN on Solaris. +#include // MAXHOSTNAMELEN on Linux and the BSDs. +#endif // __POSIX__ #ifndef MAXHOSTNAMELEN -# define MAXHOSTNAMELEN 256 +#define MAXHOSTNAMELEN 256 #endif // MAXHOSTNAMELEN namespace report { @@ -458,30 +458,27 @@ static void PrintGCStatistics(JSONWriter* writer, Isolate* isolate) { isolate->GetHeapSpaceStatistics(&v8_heap_space_stats, i); writer->json_objectstart(v8_heap_space_stats.space_name()); writer->json_keyvalue("memorySize", v8_heap_space_stats.space_size()); - writer->json_keyvalue( - "committedMemory", - v8_heap_space_stats.physical_space_size()); - writer->json_keyvalue( - "capacity", - v8_heap_space_stats.space_used_size() + - v8_heap_space_stats.space_available_size()); + writer->json_keyvalue("committedMemory", + v8_heap_space_stats.physical_space_size()); + writer->json_keyvalue("capacity", + v8_heap_space_stats.space_used_size() + + v8_heap_space_stats.space_available_size()); writer->json_keyvalue("used", v8_heap_space_stats.space_used_size()); - writer->json_keyvalue( - "available", v8_heap_space_stats.space_available_size()); + writer->json_keyvalue("available", + v8_heap_space_stats.space_available_size()); writer->json_objectend(); } isolate->GetHeapSpaceStatistics(&v8_heap_space_stats, i); writer->json_objectstart(v8_heap_space_stats.space_name()); writer->json_keyvalue("memorySize", v8_heap_space_stats.space_size()); - writer->json_keyvalue( - "committedMemory", v8_heap_space_stats.physical_space_size()); - writer->json_keyvalue( - "capacity", - v8_heap_space_stats.space_used_size() + - v8_heap_space_stats.space_available_size()); + writer->json_keyvalue("committedMemory", + v8_heap_space_stats.physical_space_size()); + writer->json_keyvalue("capacity", + v8_heap_space_stats.space_used_size() + + v8_heap_space_stats.space_available_size()); writer->json_keyvalue("used", v8_heap_space_stats.space_used_size()); - writer->json_keyvalue( - "available", v8_heap_space_stats.space_available_size()); + writer->json_keyvalue("available", + v8_heap_space_stats.space_available_size()); writer->json_objectend(); writer->json_objectend(); writer->json_objectend(); diff --git a/src/node_report.h b/src/node_report.h index 9b67dcf1c5b305..8802eaa676b26e 100644 --- a/src/node_report.h +++ b/src/node_report.h @@ -18,8 +18,8 @@ #include #include #include -#include #include +#include #ifdef _WIN32 #include diff --git a/src/node_report_module.cc b/src/node_report_module.cc index d13eb61c83820a..055cc56bc97d57 100644 --- a/src/node_report_module.cc +++ b/src/node_report_module.cc @@ -229,8 +229,7 @@ void SyncConfig(const FunctionCallbackInfo& info) { Local path_value; std::string signal = options->report_signal; if (signal.empty()) signal = "SIGUSR2"; - if (!node::ToV8Value(context, signal).ToLocal(&signal_value)) - return; + if (!node::ToV8Value(context, signal).ToLocal(&signal_value)) return; if (!obj->Set(context, signalkey, signal_value).FromJust()) return; if (!node::ToV8Value(context, options->report_filename) diff --git a/src/node_report_utils.cc b/src/node_report_utils.cc index d013eb91677323..7ee0fe1b2abc05 100644 --- a/src/node_report_utils.cc +++ b/src/node_report_utils.cc @@ -218,19 +218,19 @@ template std::string ValueToHexString(T value) { std::stringstream hex; - hex << "0x" << std::setfill('0') << std::setw(sizeof(T) * 2) << std::hex << - value; + hex << "0x" << std::setfill('0') << std::setw(sizeof(T) * 2) << std::hex + << value; return hex.str(); } std::string EscapeJsonChars(const std::string& str) { const std::string control_symbols[0x20] = { "\\u0000", "\\u0001", "\\u0002", "\\u0003", "\\u0004", "\\u0005", - "\\u0006", "\\u0007", "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", - "\\u000e", "\\u000f", "\\u0010", "\\u0011", "\\u0012", "\\u0013", - "\\u0014", "\\u0015", "\\u0016", "\\u0017", "\\u0018", "\\u0019", - "\\u001a", "\\u001b", "\\u001c", "\\u001d", "\\u001e", "\\u001f" - }; + "\\u0006", "\\u0007", "\\b", "\\t", "\\n", "\\v", + "\\f", "\\r", "\\u000e", "\\u000f", "\\u0010", "\\u0011", + "\\u0012", "\\u0013", "\\u0014", "\\u0015", "\\u0016", "\\u0017", + "\\u0018", "\\u0019", "\\u001a", "\\u001b", "\\u001c", "\\u001d", + "\\u001e", "\\u001f"}; std::string ret = ""; size_t last_pos = 0; diff --git a/src/node_revert.h b/src/node_revert.h index 38e2ba71053691..8c7a73b8cd4e25 100644 --- a/src/node_revert.h +++ b/src/node_revert.h @@ -29,7 +29,9 @@ extern unsigned int reverted_cve; } inline const char* RevertMessage(const reversion cve) { -#define V(code, label, msg) case SECURITY_REVERT_##code: return label ": " msg; +#define V(code, label, msg) \ + case SECURITY_REVERT_##code: \ + return label ": " msg; switch (cve) { SECURITY_REVERSIONS(V) default: @@ -44,7 +46,7 @@ inline void Revert(const reversion cve) { } inline void Revert(const char* cve, std::string* error) { -#define V(code, label, _) \ +#define V(code, label, _) \ if (strcmp(cve, label) == 0) return Revert(SECURITY_REVERT_##code); SECURITY_REVERSIONS(V) #undef V @@ -58,7 +60,7 @@ inline bool IsReverted(const reversion cve) { } inline bool IsReverted(const char* cve) { -#define V(code, label, _) \ +#define V(code, label, _) \ if (strcmp(cve, label) == 0) return IsReverted(SECURITY_REVERT_##code); SECURITY_REVERSIONS(V) return false; diff --git a/src/node_root_certs.h b/src/node_root_certs.h index 15f8ac35145122..e9b4aebefcc9d3 100644 --- a/src/node_root_certs.h +++ b/src/node_root_certs.h @@ -2,3392 +2,3392 @@ /* GlobalSign Root CA */ "-----BEGIN CERTIFICATE-----\n" -"MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMC\n" -"QkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNV\n" -"BAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBa\n" -"MFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdS\n" -"b290IENBMRswGQYDVQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUA\n" -"A4IBDwAwggEKAoIBAQDaDuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtI\n" -"K+6NiY6arymAZavpxy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCO\n" -"XkNz8kHp1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG\n" -"snUOhugZit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ggEBAKbPJA6+Lm8o\n" -"mUVCxKs+IVSbC9N/hHD6ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7\n" -"SqbKSaZeqKeMWhG8eoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQ\n" -"BoZfXklqtTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd\n" -"C9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feq\n" -"CapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6CygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8E\n" -"BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUm+IHV2ccHsBqBt5ZtJot39wZhi4w\n" -"NgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9iYWxzaWduLm5ldC9yb290LXIyLmNy\n" -"bDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEA\n" -"mYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkI\n" -"k7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRD\n" -"LenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd\n" -"AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7TBj0/VLZ\n" -"jmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg==\n" -"-----END CERTIFICATE-----\n", - -/* Verisign Class 3 Public Primary Certification Authority - G3 */ -"-----BEGIN CERTIFICATE-----\n"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O5lMkdBte\n" -"HRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAERSWwauSCPc/L8my\n" -"/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5fj267Cz3qWhMe\n" -"DGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC/Y4wjylG\n" -"sB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0xuKh\n" -"XFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa\n" -"t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ==\n" -"-----END CERTIFICATE-----\n", - -/* Entrust.net Premium 2048 Secure Server CA */ -"-----BEGIN CERTIFICATE-----\n" -"MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVz\n" -"dC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJl\n" -"Zi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0\n" -"ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4\n" -"KTAeFw05OTEyMjQxNzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0\n" -"Lm5ldDFAMD4GA1UECxQ3d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVm\n" -"LiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRl\n" -"ZDEzMDEGA1UEAxMqRW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pJ5OCBRLbf1wbWsaY71k5h+3zvDyny67\n" -"G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS\n" -"R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp\n" -"-----END CERTIFICATE-----\n", - -/* AddTrust External Root */ -"-----BEGIN CERTIFICATE-----\n" -"MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UE\n" -"ChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3Jr\n" -"MSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoX\n" -"DTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYw\n" -"JAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1\n" -"c3QgRXh0ZXJuYWwgQ0EgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3\n" -"GjPm8gAELTngTlvtH7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCw\n" -"SXrbLpX9uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX\n" -"mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63u\n" -"bUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5\n" -"aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0WicCAwEAAaOB3DCB2TAdBgNV\n" -"HQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMB\n" -"Af8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYT\n" -"AlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwg\n" -"VFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJ\n" -"KoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH\n" -"YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw56wwCURQt\n" -"jr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355e6cJ\n" -"DUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u\n" -"G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49O\n" -"hgQ=\n" -"-----END CERTIFICATE-----\n", - -/* Entrust Root Certification Authority */ -"-----BEGIN CERTIFICATE-----\n" -"MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAU\n" -"BgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMg\n" -"aW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMWKGMpIDIwMDYgRW50cnVzdCwg\n" -"SW5jLjEtMCsGA1UEAxMkRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X\n" -"DTA2MTEyNzIwM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ERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRk\n" -"eSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJ\n" -"KoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wimPQoZ+YeAEW5p5JYX\n" -"MP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P\n" -"TMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQHmyW74cN\n" -"xA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VILs9R\n" -"aRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b\n" -"vZ8=\n" -"-----END CERTIFICATE-----\n", - -/* Starfield Class 2 CA */ -"-----BEGIN CERTIFICATE-----\n" -"MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UE\n" -"ChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENs\n" -"YXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5\n" -"MTczOTE2WjBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2ll\n" -"cywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRo\n" -"b3JpdHkwggEgMA0GCSqGSIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N\n" -"78gDGIc/oav7PKaf8MOh2tTYbitTkPskpD6E8J7oX+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YYwDwYD\n" -"VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm8KPiGxvDl7I90VUwHwYDVR0jBBgw\n" -"FoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1E\n" -"nE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDi\n" -"qw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBA\n" -"I+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls\n" -"YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQkCAUw7C29\n" -"C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\n" -"-----END CERTIFICATE-----\n", - -/* DigiCert High Assurance EV Root CA */ -"-----BEGIN CERTIFICATE-----\n" -"MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYD\n" -"VQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQu\n" -"Y29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2\n" -"MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERp\n" -"Z2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNl\n" -"cnQgSGlnaCBBc3N1cmFuY2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC\n" -"AQoCggEBAMbM5XPm+9S75S0tMqbf5Y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DrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH\n" -"z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA==\n" -"-----END CERTIFICATE-----\n", - -/* VeriSign Class 3 Public Primary Certification Authority - G5 */ -"-----BEGIN CERTIFICATE-----\n" -"MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkG\n" -"A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU\n" -"cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh\n" -"dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQ\n" -"cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcN\n" -"MzYwNzE2MjM1OTU5WjCByjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMu\n" -"MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBW\n" -"ZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp\n" -"U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0g\n" -"RzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8\n" -"RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKzj/i5Vbext0uz/o9+B1fs70PbZmIVYc9g\n" -"DaTY3vjgw2IIPVQT60nKWVSFJ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AJBgNVBAYTAlJPMREwDwYDVQQKEwhjZXJ0U0lH\n" -"TjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC\n" -"AQoCggEBALczuX7IJUqOtdu0KBuqV5Do0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oq\n" -"rl0Hj0rDKH/v+yv6efHHrfAQUySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsA\n" -"fsT8AzNXDe3i+s5dRdY4zTW2ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUo\n" -"Se1b16kQOA7+j0xbm0bqQfWwCHTD0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwv\n" -"JoIQ4uNllAoEwF73XVv4EOLQunpL+943AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08CAwEAAaNC\n" -"MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAcYwHQYDVR0OBBYEFOCMm9slSbPx\n" -"fIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IBAQA+0hyJLjX8+HXd5n9liPRyTMks1zJO\n" -"890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6\n" -"IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0x2DEW8xXjrJ1/RsCCdtZb3KT\n" -"afcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIltvBTjD4au8as+x6AJzKNI\n" -"0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7NzTogVZ96edhBiIL5V\n" -"aZVDADlN9u6wWk5JRFRYX0KD\n" -"-----END CERTIFICATE-----\n", - -/* GeoTrust Primary Certification Authority - G3 */ -"-----BEGIN CERTIFICATE-----\n" -"MIID/j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\n" -"SIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9cr5HqQ6XErhK8WTT\n" -"Od8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbEAp7aDHdlDkQN\n" -"kv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGDAWh9jUGh\n" -"lBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33st/3L\n" -"jWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt\n" -"-----END CERTIFICATE-----\n", - -/* thawte Primary Root CA - G2 */ -"-----BEGIN CERTIFICATE-----\n" -"MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UE\n" -"BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3Rl\n" -"LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmlt\n" -"YXJ5IFJvb3QgQ0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQsw\n" -"CQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0\n" -"aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3Rl\n" -"IFByaW1hcnkgUm9vdCBDQSAtIEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFS\n" -"eIf+iha/BebfowJPDQfGAFG6DAJSLSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6\n" -"papu+7q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bnndmgcs+vHyu\n" -"86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2AtP0LMqmsywCPLLEHd5N/8YZzic7IilRFDGF/E\n" -"th9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC+BsUa0Lfb1+6a4KinVvnSr0eAXLbS3To\n" -"O39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS99irY7CFJXJv2eul/VTV+lmuNk5Mny5K7\n" -"6qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2SzhkGcuYMXDhpxwTWvGzOW/b3aJzcJRVIiKHpqfiY\n" -"nODz1TEoYRFsZ5aNOZnLwkUkOQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB\n" -"/wQEAwIBBjAdBgNVHQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJKoZIhvcNAQELBQAD\n" -"ggEBABpA2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweKA3rD6z8KLFIW\n" -"oCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1but8jLZ8HJ\n" -"nBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7cKUGRIjxpp7sC8rZc\n" -"JwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fMm7v/OeZWYdMKp8RcTGB7BXcm\n" -"er/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A=\n" -"-----END CERTIFICATE-----\n", - -/* GeoTrust Primary Certification Authority - G2 */ -"-----BEGIN CERTIFICATE-----\n" -"MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UE\n" -"BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1Ry\n" -"dXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3Qg\n" -"UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoX\n" -"DTM4MDExODIzNTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMu\n" -"MTkwNwYDVQQLEzAoYykgMjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl\n" -"IG9ubHkxNjA0BgNVBAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp\n" -"dHkgLSBHMjB2MBAGByqGSM49AgEGBSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcL\n" -"So17VDs6bl8VAsBQps8lL33KSLjHUGMcKiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf\n" -"691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\n" -"AQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSW\n" -"WaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7mndwxHLKgpxgceeHHNgIwOlavmnRs\n" -"9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2npaqBA+K\n" -"-----END CERTIFICATE-----\n", - -/* VeriSign Universal Root Certification Authority */ -"-----BEGIN CERTIFICATE-----\n" -"MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkG\n" -"A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU\n" -"cnVz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NnLsak3c78QA3xMYV18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208\n" -"o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNVHRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQE\n" -"AwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7ih9legYsCmEEIjEy82tvuJxuC52pF7BaL\n" -"T4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37piol7Yutmcn1KZJ/RyTZXaeQi/cImya\n" -"T/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5LmeiIAQ32pwL0xch4I+XeTRvhEgC\n" -"IDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88psT/oROhUVRsPNH4NbLUES\n" -"7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilTc4afU9hDDl3WY4Jx\n" -"HYB0yvbiAmvZWg==\n" -"-----END CERTIFICATE-----\n", - -/* SecureSign RootCA11 */ -"-----BEGIN CERTIFICATE-----\n" -"MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UE\n" -"ChMiSmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoGA1UEAxMTU2VjdXJl\n" -"U2lnbiBSb290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0MDgwNDU2NDdaMFgxCzAJBgNV\n" -"BAYTAkpQMSswKQYDVQQKEyJKYXBhbiBDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzLCBJbmMuMRww\n" -"GgYDVQQDExNTZWN1cmVTaWduIFJvb3RDQTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\n" -"CgKCAQEA/XeqpRyQBTvLTJszi1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1y\n" -"fIw/XwFndBWW4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EB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0G\n" -"CSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7lgAJQayzE4aGKAczymvmdLm6AC2u\n" -"pArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdW\n" -"PoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0\n" -"095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJr\n" -"lAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH\n" -"WD9f\n" -"-----END CERTIFICATE-----\n", - -/* Autoridad de Certificacion Firmaprofesional CIF A62634068 */ -"-----BEGIN CERTIFICATE-----\n" -"MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMx\n" -"QjBABgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwg\n" -"Q0lGIEE2MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNV\n" -"BAYTAkVTMUIwQAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zl\n" -"c2lvbmFsIENJRiBBNjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDK\n" -"lmuO6vj78aI14H9M2uDDUtd9thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOS\n" -"L/UR5GLXMnE42QQMcas9UX4PB99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9\n" -"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J7AoMXOLQusxI0zcKzBIKinmwPQN/aUv0NCB9szTq\n" -"jktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvGnrDQWzilm1DefhiYtUU7\n" -"9nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRgOGcEMeyP84LG3rlV\n" -"8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZd0jQ\n" -"-----END CERTIFICATE-----\n", - -/* Global Chambersign Root - 2008 */ -"-----BEGIN CERTIFICATE-----\n" -"MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJF\n" -"VTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZp\n" -"cm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1l\n" -"cmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODAe\n" -"Fw0wODA4MDExMjMxNDBaFw0zODA3MzExMjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UE\n" -"BxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9h\n" -"ZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu\n" -"QS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZI\n" -"hvcNAQEBBQADggIPADCCAgoCggIBAMDfVtPkOpt2RbQT2//BthmLN0EYlVJH6xedKYiONWwG\n" -"Mi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXfXjaOcNFccUMd2drvXNL7G706tcuto8xE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wPQYDVR0gBDYwNDAyBgRVHSAAMCow\n" -"KAYIKwYBBQUHAgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEF\n" -"BQADggIBAICIf3DekijZBZRG/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZUohwEurdPfWbU1Rv\n" -"4WCiqAm57OtZfMY18dwY6fFn5a+6ReAJ3spED8IXDneRRXozX1+WLGiLwUePmJs9wOzL9dWC\n" -"koQ10b42OFZyMVtHLaoXpGNR6woBrX/sdZ7LoR/xfxKxueRkf2fWIyr0uDldmOghp+G9PUIa\n" -"dJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVza2Mg9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJ\n" -"jUhjxsYjV5KTXjXBjfkK9yydYhz2rXzdpjEetrHHfoUm+qRqtdpjMNHvkzeyZi99Bffnt0uY\n" -"lDXA2TopwZ2yUDMdSqlapskD7+3056huirRXhOukP9DuqqqHW2Pok+JrqNS4cnhrG+055F3L\n" -"m6qH1U9OAP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETrP3iZ8ntxPjzxmKfFGBI/5rso\n" -"M0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVqc5iJWzouE4gev8CSlDQb\n" -"4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z09gwzxMNTxXJhLyn\n" -"SC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B\n" -"-----END CERTIFICATE-----\n", - -/* Go Daddy Root Certificate Authority - G2 */ -"-----BEGIN CERTIFICATE-----\n" -"MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMxEDAOBgNV\n" -"BAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29t\n" -"LCBJbmMuMT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LH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPOLPAvTK33\n" -"sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1\n" -"-----END CERTIFICATE-----\n", - -/* Starfield Root Certificate Authority - G2 */ -"-----BEGIN CERTIFICATE-----\n" -"MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMxEDAOBgNV\n" -"BAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBU\n" -"ZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVsZCBSb290IENlcnRpZmljYXRl\n" -"IEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJ\n" -"BgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYD\n" -"VQQKExxTdGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQg\n" -"Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEP\n" -"ADCCAQoCggEBAL3twQP89o/8ArFvW59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMg\n" -"nLRJdzIpVv257IzdIvpy3Cdhl+72WoTsbhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1HOZ/5FSu\n" -"S/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNkN3mSwOxGXn/hbVNMYq/NHwtjuzqd+/x5AJhh\n" -"dM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7NfZTD4p7dNdloedl40wOiWVpmKs/B/pM29\n" -"3DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0HZbUJtQIBFnQmA4O5t78w+wfkPECAwEA\n" -"AaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFHwMMh+n\n" -"2TB/xH1oo2Kooc6rB1snMA0GCSqGSIb3DQEBCwUAA4IBAQARWfolTwNvlJk7mh+ChTnUdgWU\n" -"XuEok21iXQnCoKjUsHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx4mcujJUDJi5DnUox\n" -"9g61DLu34jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUwF5okxBDgBPfg\n" -"8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/KpL/QlwVK\n" -"vOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZc2T5\n" -"NnReJaH1ZgUufzkVqSr7UIuOhWn0\n" -"-----END CERTIFICATE-----\n", - -/* Starfield Services Root Certificate Authority - G2 */ -"-----BEGIN CERTIFICATE-----\n" -"MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNV\n" -"BAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBU\n" -"ZWNobm9sb2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENl\n" -"cnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1\n" -"OVowgZgxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNk\n" -"YWxlMSUwIwYDVQQKExxTdGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEz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lyk+otZrWyuOQ9PLLvTIzq6we/\n" -"qzWaVYa8GKa1qF60g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaO\n" -"RtGdFNrHF+QFlozEJLUbzxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6eKeC2uAlo\n" -"GRwYQw==\n" -"-----END CERTIFICATE-----\n", - -/* AffirmTrust Premium ECC */ -"-----BEGIN CERTIFICATE-----\n" -"MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDAS\n" -"BgNVBAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAe\n" -"Fw0xMDAxMjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQK\n" -"DAtBZmZpcm1UcnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcq\n" -"hkjOPQIBBgUrgQQAIgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQU\n" -"X+iOGasvLkjmrBhDeKzQN8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR\n" -"4ptlKymjQjBAMB0GA1UdDgQWBBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTAD\n" -"AQH/MA4GA1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/Vs\n" -"aobgxCd05DhT1wV/GzTjxi+zygk8N53X57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9C\n" -"a/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKMeQ==\n" -"-----END CERTIFICATE-----\n", - -/* Certum Trusted Network CA */ -"-----BEGIN CERTIFICATE-----\n" -"MIIDuz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O7eDDd5QVsi\n" -"srCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1mS1FhIrlQgnXdAIv\n" -"94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5ajZt3hrvJBW8qY\n" -"VoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI03YnnZot\n" -"BqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw=\n" -"-----END CERTIFICATE-----\n", - -/* TWCA Root Certification Authority */ -"-----BEGIN CERTIFICATE-----\n" -"MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzESMBAGA1UE\n" -"CgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2Vy\n" -"dGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMzWhcNMzAxMjMxMTU1OTU5WjBf\n" -"MQswCQYDVQQGEwJUVzESMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSow\n" -"KAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3\n" -"DQEBAQUAA4IBDwAwggEKAoIBAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bi\n" -"hSX0NXIP+FPQQeFEAcK0HMMxQhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQ\n" -"sIBct+HHK3XLfJ+utdGdIzdjp9xCoi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeX\n" -"RfwZVzsrb+RH9JlF/h3x+JejiB03HFyP4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/zrX2SYgJb\n" -"KdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1ry+UPizgN7gr8/g+YnzAx3WxSZfmLgb4i4RxY\n" -"A7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud\n" -"DgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkqhkiG9w0BAQUFAAOCAQEAPNV3PdrfibqH\n" -"DAhUaiBQkr6wQT25JmSDCi/oQMCXKCeCMErJk/9q56YAf4lCmtYR5VPOL8zy2gXE/uJQxDqG\n" -"fczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlWQtNoURi+VJq/REG6Sb4g\n" -"umlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVYT0bf+215WfKEIlKu\n" -"D8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocnyYh0igzyXxfkZ\n" -"YiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw==\n" -"-----END CERTIFICATE-----\n", - -/* Security Communication RootCA2 */ -"-----BEGIN CERTIFICATE-----\n" -"MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDElMCMGA1UE\n" -"ChMcU0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMeU2VjdXJpdHkgQ29t\n" -"bXVuaWNhdGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoXDTI5MDUyOTA1MDAzOVowXTEL\n" -"MAkGA1UEBhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xJzAl\n" -"BgNVBAsTHlNlY3VyaXR5IENvbW11bmljYXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEB\n" -"BQADggEPADCCAQoCggEBANAVOVKxUrO6xVmCxF1SrjpDZY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wFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7dIsXRSZMFpGD/md9\n" -"zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8AcysNnq/onN694/BtZqhFLKPM58N\n" -"7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXIl7WdmplNsDz4SgCbZN2fOUvRJ9e4\n" -"-----END CERTIFICATE-----\n", - -/* Actalis Authentication Root CA */ -"-----BEGIN CERTIFICATE-----\n" -"MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UEBhMCSVQx\n" -"DjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1ODUyMDk2NzEn\n" -"MCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENBMB4XDTExMDkyMjExMjIw\n" -"MloXDTMwMDkyMjExMjIwMlowazELMAkGA1UEBhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYD\n" -"VQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRo\n" -"ZW50aWNhdGlvbiBSb290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bE\n" -"pSmkLO/lGMWwUKNvUTufClrJwkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW\n" -"1V8IbInX4ay8IMKx4INRimlNAJZaby/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9\n" -"KK3giq0itFZljoZUj5NDKd45RnijMCO6zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/gCczWw63\n" -"igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1fYVEiVRvjRuPjPdA1YprbrxTIW6HMiRvhMCb8\n" -"oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2oxgkg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oBmpj\n" -"IXUDgIiKboHGhfKppC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmcke\n" -"jkk9u+UJueBPSZI9FoJAzMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yLS0Zj/gA0\n" -"QHDBw7mh3aZw4gSzQbzpgJHqZJx64SIDqZxubw5lT2yHh17zbqD5daWbQOhTsiedSrnAdyGN\n" -"/4fy3ryM7xfft0kL0fJuMAsaDk527RH89elWsn2/x20Kk4yl0MC2Hb46TpSi125sC8KKfPog\n" -"88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7ILaZRfyHBNVOFBkpdn627G190\n" -"-----END CERTIFICATE-----\n", - -/* USERTrust RSA Certification Authority */ -"-----BEGIN CERTIFICATE-----\n" -"MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCBiDELMAkG\n" -"A1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4w\n" -"HAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0Eg\n" -"Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5\n" -"WjCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNl\n" -"eSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJU\n" -"cnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4IC\n" -"DwAwggIKAoICAQCAEmUXNg7D2wiz0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B\n" -"3PHTsdZ7NygRK0faOca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BAMCA0gAMEUCIQDckqGgE6bPA7DmxCGX\n" -"kPoUVy0D7O48027KqGx2vKLeuwIgJ6iFJzWbVsaj8kfSt24bAgAXqmemFZHe+pTsewv4n4Q=\n" -"-----END CERTIFICATE-----\n", - -/* GlobalSign ECC Root CA - R5 */ -"-----BEGIN CERTIFICATE-----\n" -"MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEkMCIGA1UE\n" -"CxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMw\n" -"EQYDVQQDEwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEk\n" -"MCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxT\n" -"aWduMRMwEQYDVQQDEwpHbG9iYWxTaWduMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9\n" -"Xb/pOdEh+J8LttV7HpI6SFkc8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwz\n" -"ocWdTaRvQZU4f8kehOvRnkmSh5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMC\n" -"AQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYI\n" -"KoZIzj0EAwMDaAAwZQIxAOVpEslu28YxuglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg515dTguD\n" -"nFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7yFz9SO8NdCKoCOJuxUnOxwy8p2Fp8fc74SrL\n" -"+SvzZpA3\n" -"-----END CERTIFICATE-----\n", - -/* Staat der Nederlanden Root CA - G3 */ -"-----BEGIN CERTIFICATE-----\n" -"MIIFdDCCA1ygAwIBAgIEAJiiOTAN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nQW3IV5B4Jaj0z8yGa5hV+rVHVDRDtfULAj+7AmgjV\n" -"QdZcDiFpboBhDhXAuM/FSRJSzL46zNQuOAXeNf0fb7iAaJg9TaDKQGXSc3z1i9kKlT/YPyNt\n" -"GtEqJBnZhbMX73huqVjRI9PHE+1yJX9dsXNw0H8GlwmEKYBhHfpe/3OsoOOJuBxxFcbeMX8S\n" -"3OFtm6/n6J91eEyrRjuazr8FGF1NFTwWmhlQBJqymm9li1JfPFgEKCXAZmExfrngdbkaqIHW\n" -"chezxQMxNRF4eKLg6TCMf4DfWN88uieW4oA0beOY02QnrEh+KHdcxiVhJfiFDGX6xDIvpZgF\n" -"5PgLZxYWxoK4Mhn5+bl53B/N66+rDt0b20XkeucC4pVd/GnwU2lhlXV5C15V5jgclKlZM57I\n" -"cXR5f1GJtshquDDIajjDbp7hNxbqBWJMWxJH7ae0s1hWx0nzfxJoCTFx8G34Tkf71oXuxVhA\n" -"GaQdp/lLQzfcaFpPz+vCZHTetBXZ9FRUGi8c15dxVJCO2SCdUyt/q4/i6jC8UDfv8Ue1fXws\n" -"BOxonbRJRBD0ckscZOf85muQ3Wl9af0AVqW3rLatt8o+Ae+c\n" -"-----END CERTIFICATE-----\n", - -/* Entrust Root Certification Authority - G2 */ -"-----BEGIN CERTIFICATE-----\n" -"MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMCVVMxFjAU\n" -"BgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVn\n" -"YWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9y\n" -"aXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0\n" -"aG9yaXR5IC0gRzIwHhcNMDkwNzA3MTcyNTU0WhcNMzAxMjA3MTc1NTU0WjCBvjEL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bCzB428Hch0P+\n" -"vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmHVHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ\n" -"19xOe4pIb4tF9g==\n" -"-----END CERTIFICATE-----\n", - -/* Entrust Root Certification Authority - EC1 */ -"-----BEGIN CERTIFICATE-----\n" -"MIIC+TCCAoCgAwIBAgINAKaLeSkAAAAAUNCR+TAKBggqhkjOPQQDAzCBvzELMAkGA1UEBhMC\n" -"VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5u\n" -"ZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEyIEVudHJ1c3QsIEluYy4gLSBmb3Ig\n" -"YXV0aG9yaXplZCB1c2Ugb25seTEzMDEGA1UEAxMqRW50cnVzdCBSb290IENlcnRpZmljYXRp\n" -"b24gQXV0aG9yaXR5IC0gRUMxMB4XDTEyMTIxODE1MjUzNloXDTM3MTIxODE1NTUzNlowgb8x\n" -"CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3\n" -"LmVudHJ1c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxMiBFbnRydXN0LCBJ\n" -"bmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMzAxBgNVBAMTKkVudHJ1c3QgUm9vdCBD\n" -"ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEVDMTB2MBAGByqGSM49AgEGBSuBBAAiA2IABIQT\n" -"ydC6bUF74mzQ61VfZgIaJPRbiWlH47jCffHyAsWfoPZb1YsGGYZPUxBtByQnoaD41UcZYUx9\n" -"ypMn6nQM72+WCf5j7HBdNq1nd67JnXxVRDqiY1Ef9eNi1KlHBz7MIKNCMEAwDgYDVR0PAQH/\n" -"BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQY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RQ8ow7bkrH\n" -"xuaAKzyBvBGAFhAn1/DNP3nMcyrDflOR1m749fPH0FFNjkulW+YZFzvWgQncItzujrnEj1Ph\n" -"Z7szuIgVRs/taTX/dQ1G885x4cVrhkIGuUE=\n" -"-----END CERTIFICATE-----\n", - -/* OISTE WISeKey Global Root GB CA */ -"-----BEGIN CERTIFICATE-----\n" -"MIIDtTCCAp2gAwIBAgIQdrEgUnTwhYdGs/gjGvbCwDANBgkqhkiG9w0BAQsFADBtMQswCQYD\n" -"VQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBF\n" -"bmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQiBDQTAeFw0x\n" -"NDEyMDExNTAwMzJaFw0zOTEyMDExNTEwMzFaMG0xCzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdX\n" -"SVNlS2V5MSIwIAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9P\n" -"SVNURSBXSVNlS2V5IEdsb2JhbCBSb290IEdCIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A\n" -"MIIBCgKCAQEA2Be3HEokKtaXscriHvt9OO+Y9bI5mE4nuBFde9IllIiCFSZqGzG7qFshISvY\n" -"D06fWvGxWuR51jIjK+FTzJlFXHtPrby/h0oLS5daqPZI7H17Dc0hBt+eFf1Biki3IPShehtX\n" -"1F1Q/7pn2COZH8g/497/b1t3sWtuuMlk9+HKQUYOKXHQuSP8yYFfTvdv37+ErXNku7dCjmn2\n" -"1HYdfp2nuFeKUWdy19SouJVUQHMD9ur06/4oQnc/nSMbsrY9gBQHTC5P99UKFg29ZkM3fiND\n" -"ecNAhvVMKdqOmq0NpQSHiB6F4+lT1ZvIiwNjeOvgGUpuuy9rM2RYk61pv48b74JIxwIDAQAB\n" -"o1EwTzALBgNVHQ8EBAMCAYYwDwYD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5AsOgP46KvPrU+Bym0ToO/TAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcN\n" -"AQENBQADggIBAHGlDs7k6b8/ONWJWsQCYftMxRQXLYtPU2sQF/xlhMcQSZDe28cmk4gmb3DW\n" -"Al45oPePq5a1pRNcgRRtDoGCERuKTsZPpd1iHkTfCVn0W3cLN+mLIMb4Ck4uWBzrM9DPhmDJ\n" -"2vuAL55MYIR4PSFk1vtBHxgP58l1cb29XN40hz5BsA72udY/CROWFC/emh1auVbONTqwX3BN\n" -"XuMp8SMoclm2q8KMZiYcdywmdjWLKKdpoPk79SPdhRB0yZADVpHnr7pH1BKXESLjokmUbOe3\n" -"lEu6LaTaM4tMpkT/WjzGHWTYtTHkpjx6qFcL2+1hGsvxznN3Y6SHb0xRONbkX8eftoEq5IVI\n" -"eVheO/jbAoJnwTnbw3RLPTYe+SmTiGhbqEQZIfCn6IENLOiTNrQ3ssqwGyZ6miUfmpqAnksq\n" -"P/ujmv5zMnHCnsZy4YpoJ/HkD7TETKVhk/iXEAcqMCWpuchxuO9ozC1+9eB+D4Kob7a6bIND\n" -"d82Kkhehnlt4Fj1F4jNy3eFmypnTycUm/Q1oBEauttmbjL4ZvrHG8hnjXALKLNhvSgfZyTXa\n" -"QHXyxKcZb55CEJh15pWLYLztxRLXis7VmFxWlgPF7ncGNf/P5O4/E2Hu29othfDNrp2yGAlF\n" -"w5Khchf8R7agCyzxxN5DaAhqXzvwdmP7zAYspsbiDrW5viSP\n" -"-----END CERTIFICATE-----\n", - -/* Hellenic Academic and Research Institutions RootCA 2015 */ -"-----BEGIN CERTIFICATE-----\n" -"MIIGCzCCA/OgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBpjELMAkGA1UEBhMCR1IxDzANBgNV\n" -"BAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIElu\n" -"c3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+B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E3izEjR8EJCOtu93ib14L8hCCZSRm2Ekax+0VVFqmjZaycBw/qa9wf\n" -"LgZy7IaIEuQt218FL+TwA9MmM+eAws1CoRc0CwIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/\n" -"MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUcRVnyMjJvXVdctA4GGqd83EkVAswDQYJKoZI\n" -"hvcNAQELBQADggIBAHW7bVRLqhBYRjTyYtcWNl0IXtVsyIe9tC5G8jH4fOpCtZMWVdyhDBKg\n" -"2mF+D1hYc2Ryx+hFjtyp8iY/xnmMsVMIM4GwVhO+5lFc2JsKT0ucVlMC6U/2DWDqTUJV6Hwb\n" -"ISHTGzrMd/K4kPFox/la/vot9L/J9UUbzjgQKjeKeaO04wlshYaT/4mWJ3iBj2fjRnRUjtkN\n" -"aeJK9E10A/+yd+2VZ5fkscWrv2oj6NSU4kQoYsRL4vDY4ilrGnB+JGGTe08DMiUNRSQrlrRG\n" -"ar9KC/eaj8GsGsVn82800vpzY4zvFrCopEYq+OsS7HK07/grfoxSwIuEVPkvPuNVqNxmsdnh\n" -"X9izjFk0WaSrT2y7HxjbdavYy5LNlDhhDgcGH0tGEPEVvo2FXDtKK4F5D7Rpn0lQl033DlZd\n" -"wJVqwjbDG2jJ9SrcR5q+ss7FJej6A7na+RZukYT1HCjI/CbM1xyQVqdfbzoEvM14iQuODy+j\n" -"qk+iGxI9FghAD/FGTNeqewjBCvVtJ94Cj8rDtSvK6evIIVM4pcw72Hc3MKJP2W/R8kCtQXoX\n" -"xdZKNYm3QdV8hn9VTYNKpXMgwDqvkPGaJI7ZjnHKe7iG2rKPmT4dEw0SEe7Uq/DpFXYC5ODf\n" -"qiAeW2GFZECpkJcNrVPSWh2HagCXZWK0vm9qp/UsQu0yrbYhnr68\n" -"-----END CERTIFICATE-----\n", - -/* Hellenic Academic and Research Institutions ECC RootCA 2015 */ -"-----BEGIN CERTIFICATE-----\n" -"MIICwzCCAkqgAwIBAgIBADAKB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wJPt8bYBVCpk+gA0z5Wajs6O7pdWLjwkspl1+4vAHCGht\n" -"0nxpbl/f5Wpl\n" -"-----END CERTIFICATE-----\n", - -/* SSL.com EV Root Certification Authority RSA R2 */ -"-----BEGIN CERTIFICATE-----\n" -"MIIF6zCCA9OgAwIBAgIIVrYpzTS8ePYwDQYJKoZIhvcNAQELBQAwgYIxCzAJBgNVBAYTAlVT\n" -"MQ4wDAYDVQQIDAVUZXhhczEQMA4GA1UEBwwHSG91c3RvbjEYMBYGA1UECgwPU1NMIENvcnBv\n" -"cmF0aW9uMTcwNQYDVQQDDC5TU0wuY29tIEVWIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3Jp\n" -"dHkgUlNBIFIyMB4XDTE3MDUzMTE4MTQzN1oXDTQyMDUzMDE4MTQzN1owgYIxCzAJBgNVBAYT\n" -"AlVTMQ4wDAYDVQQIDAVUZXhhczEQMA4GA1UEBwwHSG91c3RvbjEYMBYGA1UECgwPU1NMIENv\n" -"cnBvcmF0aW9uMTcwNQYDVQQDDC5TU0wuY29tIEVWIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRo\n" -"b3JpdHkgUlNBIFIyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAjzZlQOHWTcDX\n" -"tOlG2mvqM0fNTPl9fb69LT3w23jhhqXZuglXaO1XPqDQCEGD5yhBJB/jchXQARr7XnAjssuf\n" -"OePPxU7Gkm0mxnu7s9onnQqG6YE3Bf7wcXHswxzpY6IXFJ3vG2fThVUCAtZJycxa4bH3bzKf\n" -"ydQ7iEGonL3Lq9ttewkfokxykNorCPzPPFTOZw+oz12WGQvE43LrrdF9HSfvkusQv1vrO6/P\n" -"gN3B0pYEW3p+pKk8OHakYo6gOV7qd89dAFmPZiw+B6KjBSYRaZfqhbcPlgtLyEDhULouisv3\n" -"D5oi53+aNxPN8k0TayHRwMwi8qFG9kRpnMphNQcAb9ZhCBHqurj26bNg5U257J8UZslXWNvN\n" -"h2n4io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PZytRrJPOwPYdGWBrssd9v+1a6\n" -"cGvHOMzosYxPD/fxZ3YOg9AeUY8CMD32IygmTMZgh5Mmm7I1HrrW9zzRHM76JTymGoEVW/MS\n" -"D2zuZYrJh6j5B+BimoxcSg==\n" -"-----END CERTIFICATE-----\n", - -/* GlobalSign Root CA - R6 */ -"-----BEGIN CERTIFICATE-----\n" -"MIIFgzCCA2ugAwIBAgIORea7A4Mzw4VlSOb/RVEwDQYJKoZIhvcNAQEMBQAwTDEgMB4GA1UE\n" -"CxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjYxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNV\n" -"BAMTCkdsb2JhbFNpZ24wHhcNMTQxMjEwMDAwMDAwWhcNMzQxMjEwMDAwMDAwWjBMMSAwHgYD\n" -"VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSNjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEG\n" -"A1UEAxMKR2xvYmFsU2lnbjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJUH6HPK\n" -"ZvnsFMp7PPcNCPG0RQssgrRIxutbPK6DuEGSMxSkb3/pKszGsIhrxbaJ0cay/xTOURQh7Erd\n" -"G1rG1ofuTToVBu1kZguSgMpE3nOUTvOniX9PeGMIyBJQbUJmL025eShNUhqKGoC3GYEOfsSK\n" -"vGRMIRxDaNc9PIrFsmbVkJq3MQbFvuJtMgamHvm566qjuL++gmNQ0PAYid/kD3n16qIfKtJw\n" -"LnvnvJO7bVPiSHyMEAc4/2ayd2F+4OqMPKq0pPbzlUoSB239jLKJz9CgYXfIWHSw1CM69106\n" -"yqLbnQneXUQtkPGBzVeS+n68UARjNN9rkxi+azayOeSsJDa38O+2HBNXk7besvjihbdzorg1\n" -"qkXy4J02oW9UivFyVm4uiMVRQkQVlO6jxTiWm05OWgtH8wY2SXcwvHE35absIQh1/OZhFj93\n" -"1dmRl4QKbNQCTXTAFO39OfuD8l4UoQSwC+n+7o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iwmcUVhAn21klJwGW45hpxbqCo8YLoRT5s\n" -"1gLXCmeDBVrJpBA=\n" -"-----END CERTIFICATE-----\n", - -/* OISTE WISeKey Global Root GC CA */ -"-----BEGIN CERTIFICATE-----\n" -"MIICaTCCAe+gAwIBAgIQISpWDK7aDKtARb8roi066jAKBggqhkjOPQQDAzBtMQswCQYDVQQG\n" -"EwJDSDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRv\n" -"cnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQyBDQTAeFw0xNzA1\n" -"MDkwOTQ4MzRaFw00MjA1MDkwOTU4MzNaMG0xCzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNl\n" -"S2V5MSIwIAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNU\n" -"RSBXSVNlS2V5IEdsb2JhbCBSb290IEdDIENBMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAETOlQ\n" -"wMYPchi82PG6s4nieUqjFqdrVCTbUf/q9Akkwwsin8tqJ4KBDdLArzHkdIJuyiXZjHWd8dvQ\n" -"mqJLIX4Wp2OQ0jnUsYd4XxiWD1AbNTcPasbc2RNNpI6QN+a9WzGRo1QwUjAOBgNVHQ8BAf8E\n" -"BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUSIcUrOPDnpBgOtfKie7TrYy0UGYw\n" -"EAYJKwYBBAGCNxUBBAMCAQAwCgYIKoZIzj0EAwMDaAAwZQIwJsdpW9zV57LnyAyMjMPdeYwb\n" -"Y9XJUpROTYJKcx6ygISpJcBMWm1JKWB4E+J+SOtkAjEA2zQgMgj/mkkCtojeFK9dbJlxjRo/\n" -"i9fgojaGHAeCOnZT/cKi7e97sIBPWA9LUzm9\n" -"-----END CERTIFICATE-----\n", - -/* GTS Root R1 */ -"-----BEGIN CER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Af8EBTADAQH/MB0GA1UdDgQWBBRg\n" + "e2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUFAAOCAQEA1nPnfE920I2/7LqivjTF\n" + "KDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY7\n" + "76BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9\n" + "LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr\n" + "+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME\n" + "HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==\n" + "-----END CERTIFICATE-----\n", + + /* GlobalSign Root CA - R2 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMX\n" + "R2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMT\n" + "Ckdsb2JhbFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQL\n" + "ExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UE\n" + "AxMKR2xvYmFsU2lnbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8o\n" + "mUVCxKs+IVSbC9N/hHD6ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7\n" + "SqbKSaZeqKeMWhG8eoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQ\n" + "BoZfXklqtTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd\n" + "C9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feq\n" + "CapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6CygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8E\n" + "BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUm+IHV2ccHsBqBt5ZtJot39wZhi4w\n" + "NgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9iYWxzaWduLm5ldC9yb290LXIyLmNy\n" + "bDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEA\n" + "mYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkI\n" + "k7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRD\n" + "LenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd\n" + "AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7TBj0/VLZ\n" + "jmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg==\n" + "-----END CERTIFICATE-----\n", + + /* Verisign Class 3 Public Primary Certification Authority - G3 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQG\n" + "EwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0\n" + "IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOT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dela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC/Y4wjylG\n" + "sB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0xuKh\n" + "XFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa\n" + "t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ==\n" + "-----END CERTIFICATE-----\n", + + /* Entrust.net Premium 2048 Secure Server CA */ + "-----BEGIN CERTIFICATE-----\n" + "MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVz\n" + "dC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJl\n" + "Zi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0\n" + "ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4\n" + "KTAeFw05OTEyMjQxNzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0\n" + "Lm5ldDFAMD4GA1UECxQ3d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVm\n" + "LiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRl\n" + "ZDEzMDEGA1UEAxMqRW50cnVzdC5uZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgp\n" + "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtK\n" + "TY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOLGp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/EC\n" + "DNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSrhRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ\n" + "/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzWnLLPKQP5L6RQstRIzgUyVYr9smRM\n" + "DuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUiVBcAkCaTvA5JaJG/+EfTnZVC\n" + "wQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/\n" + "BAUwAwEB/zAdBgNVHQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJKoZIhvcNAQEFBQAD\n" + "ggEBADubj1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPyT/4xmf3IDExo\n" + "U8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6YfzX1XEC+b\n" + "BAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5bu/8j72gZyxKTJ1wD\n" + "LW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+bYQLCIt+jerXmCHG8+c8eS9e\n" + "nNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/ErfF6adulZkMV8gzURZVE=\n" + "-----END CERTIFICATE-----\n", + + /* Baltimore CyberTrust Root */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAG\n" + "A1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1v\n" + "cmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjEL\n" + "MAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEi\n" + "MCAGA1UEAxMZQmFsdGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQAD\n" + "ggEPADCCAQoCggEBAKMEuyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2ygu\n" + "zmKiYv60iNoS6zjrIZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo\n" + "6vWrJYeKmpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu\n" + "XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3z\n" + "yZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkC\n" + "AwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1BE3wMBIGA1UdEwEB/wQIMAYB\n" + "Af8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27\n" + "TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukM\n" + "JY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhS\n" + "NzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67\n" + "G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS\n" + "R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp\n" + "-----END CERTIFICATE-----\n", + + /* AddTrust External Root */ + "-----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QWRkVHJ1c3QgRXh0ZXJuYWwg\n" + "VFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJ\n" + "KoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH\n" + "YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw56wwCURQt\n" + "jr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355e6cJ\n" + "DUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u\n" + "G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49O\n" + "hgQ=\n" + "-----END CERTIFICATE-----\n", + + /* Entrust Root Certification Authority */ + "-----BEGIN CERTIFICATE-----\n" + "MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAU\n" + "BgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMg\n" + "aW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMWKGMpIDIwMDYgRW50cnVzdCwg\n" + "SW5jLjEtMCsGA1UEAxMkRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X\n" + "DTA2MTEyNzIwMjM0MloXDTI2MTEyNzIwNTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQK\n" + "Ew1FbnRydXN0LCBJbmMuMTkwNwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29y\n" + "cG9yYXRlZCBieSByZWZlcmVuY2UxHzAdBgNVBAsTFihjKSA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H2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPc\n" + "j2A781q0tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8\n" + "-----END CERTIFICATE-----\n", + + /* GeoTrust Global CA */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVTMRYwFAYD\n" + "VQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9iYWwgQ0EwHhcNMDIw\n" + "NTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2Vv\n" + "VHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0B\n" + "AQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEH\n" + "CIjaWC9mOSm9BXiLnTjoBbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIu\n" + "T8rxh0PBFpVXLVDviS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386D\n" + "GXHKTubU1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+\n" + "bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoWMPRfwCvo\n" + "cWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTAephojYn7qwVkDBF9\n" + "qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1luMrMTjANBgkqhkiG9w0BAQUF\n" + "AAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKInZ57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VS\n" + "syShNwrrZHYqLizz/Tt1kL/6cdjHPTfStQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfO\n" + "EVEiIuCl6rYVSAlk6l5PdPcFPseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQd\n" + "tqvmlKXBx4Ot2/Unhw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeX\n" + "xx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw==\n" + "-----END CERTIFICATE-----\n", + + /* GeoTrust Universal CA */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEWMBQGA1UE\n" + "ChMNR2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTA0\n" + "MDMwNDA1MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdl\n" + "b1RydXN0IEluYy4xHjAcBgNVBAMTFUdlb1RydXN0IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZI\n" + "hvcNAQEBBQADggIPADCCAgoCggIBAKYVVaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckU\n" + "HUWCq8YdgNY96xCcOq9tJPi8cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDg\n" + "FgDgEB8rMQ7XlFTTQjOgNB0eRXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEY\n" + "fyh3peFhF7em6fgemdtzbvQKoiFs7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2v\n" + "c7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d8Lsrlh/eezJS/R27tQahsiFepdaVaH/wmZ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02LIFkD\n" + "MBmhLMi9ER/frslKxfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQt\n" + "DF4JbAiXfKM9fJP/P6EUp8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/SfuvmbJxPgWp6\n" + "ZKy7PtXny3YuxadIwVyQD8vIP/rmMuGNG2+k5o7Y+SlIis5z/iw=\n" + "-----END CERTIFICATE-----\n", + + /* GeoTrust Universal CA 2 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEWMBQGA1UE\n" + "ChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwHhcN\n" + "MDQwMzA0MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN\n" + "R2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwggIiMA0G\n" + "CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6Gq\n" + "dHtXr0om/Nj1XqduGdt0DE81WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSC\n" + "egx2oG9NzkEtoBUGFF+3Qs17j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O\n" + "64ceJHdqXbboW0W63MOhBW9Wjo8QJqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxL\n" + "se4YuU6W3Nx2/zu+z18DwPw76L5GG//aQMJS9/7jOvdqdzXQ2o3rXhhqMcceujwbKNZrVMaq\n" + "W9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2WP0+GfPtDCapkzj4T8FdIgbQl+rhrcZV4IEr\n" + "KIM6+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RK34B7vCAas+YWH\n" + "6aLcr34YEoP9VhdBLtUpgn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwXQMAJKOSL\n" + "akhT2+zNVVXxxvjpoixMptEmX36vWkzaH6byHCx+rgIW0lbQL1dTR+iS\n" + "-----END CERTIFICATE-----\n", + + /* Comodo AAA Services root */ + "-----BEGIN CERTIFICATE-----\n" + "MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UE\n" + "CAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21v\n" + "ZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0\n" + "MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdy\n" + "ZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENB\n" + "IExpbWl0ZWQxITAfBgNVBAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZI\n" + "hvcNAQEBBQADggEPADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686td\n" + "UIoWMQuaBtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe\n" + "3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8Ioa\n" + "E+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULi\n" + "mAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7S\n" + "w4ScD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A6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3TKbkGGew5Oanwl4Rqy+/fMIGu\n" + "BgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rqy+/foYGEpIGBMH8xCzAJBgNVBAYTAkJN\n" + "MRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRp\n" + "b24gQXV0aG9yaXR5MS4wLAYDVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0\n" + "aG9yaXR5ggQ6tlCLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70\n" + "mpKnGdSkfnIYj9lofFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf8\n" + "7C9TqnN7Az10buYWnuulLsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1RcHhXHTMe\n" + "/QKZnAzNCgVPx7uOpHX6Sm2xgI4JVrmcGmD+XcHXetwReNDWXcG31a0ymQM6isxUJTkxgXsT\n" + "IlG6Rmyhu576BGxJJnSP0nPrzDCi5upZIof4l/UO/erMkqQWxFIY6iHOsfHmhIHluqmGKPJD\n" + "Wl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi5nrQNiOKSnQ2+Q==\n" + "-----END CERTIFICATE-----\n", + + /* QuoVadis Root CA 2 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNV\n" + "BAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMjAeFw0w\n" + "NjExMjQxODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBR\n" + "dW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDEx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MmfXK4SVhM7JZG+Ju1zdXtg2pEto=\n" + "-----END CERTIFICATE-----\n", + + /* Security Communication Root CA */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UE\n" + "ChMPU0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJv\n" + "b3RDQTEwHhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEY\n" + "MBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0\n" + "aW9uIFJvb3RDQTEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8\n" + "V6UMbXaKL0u/ZPtM7orw8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzG\n" + "jGdnSj74cbAZJ6kJDKaVv0uMDPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1ae\n" + "V+7AwFb9Ms+k2Y7CI9eNqPPYJayX5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/N\n" + "QV3Is00qVUarH9oe4kA92819uZKAnDfdDJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OV\n" + "YNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZ\n" + "aNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG\n" + "9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g0dNq/vu+m22/xwVtWSDEHPC32oRY\n" + "AmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+amCoQQTlSxN3Zmw7vkwGusi7K\n" + "aEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJs58+OmJYxUmtYg5xpTKq\n" + "L8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ6rBK+1YWc26sTfci\n" + "oU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAiFL39vmwLAw==\n" + "-----END CERTIFICATE-----\n", + + /* Sonera Class 2 Root CA */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UE\n" + "ChMGU29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoX\n" + "DTIxMDQwNjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UE\n" + "AxMQU29uZXJhIENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAX\n" + "SjWdyvANlsdE+hY3/Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gX\n" + "GM2RX/uJ4+q/Tl18GybTdXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7\n" + "Jp12W5dCsv+u8E7s3TmVToMGf+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCW\n" + "ctRUz2EjvOr7nQKV0ba5cTppCD8PtOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu\n" + "8nYybieDwnPz3BjotJPqdURrBGAgcVeHnfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0T\n" + "AQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITTXjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEB\n" + "BQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt0jSv9zilzqsWuasvfDXLrNAPtEwr/IDv\n" + "a4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEIcbCdjdY0RzKQxmUk96BKfARzjzlv\n" + "F4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavphOe9r5yF1BgfYErQhIHBCcYHa\n" + "PJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSxEtzKO6gunRRaBXW37Ndj\n" + "4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLHllpwrN9M\n" + "-----END CERTIFICATE-----\n", + + /* XRamp Global CA Root */ + "-----BEGIN CERTIFICATE-----\n" + "MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCBgjELMAkG\n" + "A1UEBhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJh\n" + "bXAgU2VjdXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlm\n" + "aWNhdGlvbiBBdXRob3JpdHkwHhcNMDQxMTAxMTcxNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjEL\n" + "MAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMb\n" + "WFJhbXAgU2VjdXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2Vy\n" + "dGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCY\n" + "JB69FbS638eMpSe2OAtp87ZOqCwuIR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCP\n"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+YeAEW5p5JYX\n" + "MP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P\n" + "TMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQHmyW74cN\n" + "xA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VILs9R\n" + "aRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b\n" + "vZ8=\n" + "-----END CERTIFICATE-----\n", + + /* Starfield Class 2 CA */ + "-----BEGIN CERTIFICATE-----\n" + "MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UE\n" + "ChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENs\n" + "YXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5\n" + "MTczOTE2WjBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2ll\n" + "cywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRo\n" + "b3JpdHkwggEgMA0GCSqGSIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N\n" + "78gDGIc/oav7PKaf8MOh2tTYbitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMe\n" + "j2YcOadN+lq2cwQlZut3f+dZxkqZJRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0\n" + "X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVmepsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4Umkhyn\n" + "ArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSNF4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W\n" + "93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HFMIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRb\n" + "Vazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0fhvRbVazc1xDCDqmI56FspGowaDEL\n" + "MAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAw\n" + "BgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG\n" + "A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGsafPzWdqbAYcaT1ep\n" + "oXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLMPUxA2IGvd56D\n" + "eruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJlxy16paq8\n" + "U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJDKVtH\n" + "CN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3\n" + "QBFGmh95DmK/D5fs4C8fF5Q=\n" + "-----END CERTIFICATE-----\n", + + /* Taiwan GRCA */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/MQswCQYD\n" + "VQQGEwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmljYXRpb24gQXV0aG9y\n" + "aXR5MB4XDTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1owPzELMAkGA1UEBhMCVFcxMDAu\n" + "B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srhMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDi\n" + "qw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBA\n" + "I+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls\n" + "YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQkCAUw7C29\n" + "C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=\n" + "-----END CERTIFICATE-----\n", + + /* DigiCert High Assurance EV Root CA */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYD\n" + "VQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQu\n" + "Y29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2\n" + "MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERp\n" + "Z2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNl\n" + "cnQgSGlnaCBBc3N1cmFuY2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC\n" + "AQoCggEBAMbM5XPm+9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlB\n" + "WTrT3JTWPNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM\n" + "xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeB\n" + "QVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5\n" + "OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsgEsxBu24LUTi4S8sCAwEAAaNj\n" + "MGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9H\n" + "AdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3\n" + "DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1\n" + "ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VH\n" + "MWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2\n" + "Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCevEsXCS+0\n" + "yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K\n" + "-----END CERTIFICATE-----\n", + + /* Certplus Class 2 Primary CA */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkG\n" + "A1UEBhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkg\n" + "Q0EwHhcNOTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8G\n" + "A1UEChMIQ2VydHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZI\n" + "hvcNAQEBBQADggEPADCCAQoCggEBANxQltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxv\n" + "c0NXYKwzCkTsA18cgCSR5aiRVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLR\n" + "YE2+L0ER4/YXJQyLkcAbmXuZVg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v\n" + "0lPubNCdEgETjdyAYveVqUSISnFOYFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yas\n" + "H7WLO7dDWWuwJKZtkIvEcupdM5i3y95ee++U8Rs+yskhwcWYAqqi9lt3m/V+llU0HGdpwPFC\n" + "40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRMECDAGAQH/AgEKMAsGA1UdDwQEAwIBBjAdBgNV\n" + "HQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJYIZIAYb4QgEBBAQDAgEGMDcGA1UdHwQw\n" + "MC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMuY29tL0NSTC9jbGFzczIuY3JsMA0GCSqG\n" + "SIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/AN9WM2K191EBkOvDP9GIROkkXe/nFL0gt5o8AP5t\n" + "n9uQ3Nf0YtaLcF3n5QRIqWh8yfFC82x/xXp8HVGIutIKPidd3i1RTtMTZGnkLuPT55sJmabg\n" + "lZvOGtd/vjzOUrMRFcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+7UCmnYR0ObncHoUW\n" + "2ikbhiMAybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW//1IMwrh3KWB\n" + "kJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7l7+ijrRU\n" + "-----END CERTIFICATE-----\n", + + /* DST Root CA X3 */ + "-----BEGIN CERTIFICATE-----\n" + "M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\n" + "/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06Xyx\n" + "V3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ\n" + "-----END CERTIFICATE-----\n", + + /* SwissSign Gold CA - G2 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkNI\n" + "MRUwEwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0g\n" + "RzIwHhcNMDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBFMQswCQYDVQQGEwJDSDEVMBMG\n" + "A1UEChMMU3dpc3NTaWduIEFHMR8wHQYDVQQDExZTd2lzc1NpZ24gR29sZCBDQSAtIEcyMIIC\n" + "IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJC\n" + "Eyq8ZVeCQD5XJM1QiyUqt2/876LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcf\n" + "DmJlD909Vopz2q5+bbqBHH5CjCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpi\n" + "kJKVyh+c6bM8K8vzARO/Ws/BtQpgvd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqE\n" + "emA8atufK+ze3gE/bk3lUIbLtK/tREDFylqM2tIrfKjuvqblCqoOpd8FUrdVxyJdMmqXl2MT\n" + "28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvRAiTysybUa9oEVeXBCsdtMDeQKuSeFDNeFhdV\n" + "xVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuendjIj3o02yMszYF9rNt85mndT9Xv+9lz4p\n" + "ded+p2JYryU0pUHHPbw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iATIgHQv2ieY2BrNU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/Y\n" + "YPIvSbjkQuE4NRb0yG5P94FW6LqjviOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkk\n" + "W8mw0FfB+j564ZfJ\n" + "-----END CERTIFICATE-----\n", + + /* SwissSign Silver CA - G2 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gx\n" + "FTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAt\n" + "IEcyMB4XDTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0NlowRzELMAkGA1UEBhMCQ0gxFTAT\n" + "BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcy\n" + "MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dO\n" + "cbpLj6VzHVxumK4DV644N0MvFz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGi\n" + "TSf5YXu6t+WiE7brYT7QbNHm+/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi\n" + "0R86TieFnbAVlDLaYQ1HTWBCrpJH6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH\n" + "6ATK72oxh9TAtvmUcXtnZLi2kUpCe2UuMGoM9ZDulebyzYLs2aFK7PayS+VFheZteJMELpyC\n" + "bTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5hqAaEuSh6XzjZG6k4sIN/c8HDO0gqgg8hm7jM\n" + "qDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5FZGkECwJMoBgs5PAKrYYC51+jUnyE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pXEA29\n" + "MC/HpeZBoNquBYeaoKRlbEwJDIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI\n" + "4NSA5QC9qvNOBqN6avlicuMJT+ubDgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s\n" + "5Aq7KkzrCWA5zspi2C5u\n" + "-----END CERTIFICATE-----\n", + + /* GeoTrust Primary Certification Authority */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYD\n" + "VQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJp\n" + "bWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYy\n" + "MzU5NTlaMFgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQD\n" + "EyhHZW9UcnVzdCBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG\n" + "9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92\n" + "/ZV+zmEwu3qDXwK9AWbK7hWNb6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa\n" + "9OBesYjAZIVcFU2Ix7e64HXprQU9nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE0\n" + "7e9GceBrAqg1cmuXm2bgyxx5X9gaBGgeRwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0\n" + "EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGttm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s\n" + "0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EB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m9yIGF1dGhvcml6\n" + "ZWQgdXNlIG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqG\n" + "SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsoPD7gFnUnMekz52hWXMJEEUMDSxuaPFsW0hoSVk3\n" + "/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ1CRfBsDMRJSUjQJib+ta3RGNKJpchJAQeg29\n" + "dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGcq/gcfomk6KHYcWUNo1F77rzSImANuVud\n" + "37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6Sk/KaAcdHJ1KxtUvkcx8cXIcxcBn6zL9\n" + "yZJclNqFwJu/U30rCfSMnZEfl2pSy94JNqR32HuHUETVPm4pafs5SSYeCaWAe0At6+gnhcn+\n" + "Yf1+5nyXHdWdAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G\n" + "A1UdDgQWBBR7W0XPr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUFAAOCAQEAeRHAS7OR\n" + "tvzw6WfUDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeEuzLlQRHAd9mz\n" + "YJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAXxPcW6cTY\n" + "cvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2/qxAeeWsEG89jxt5\n" + "dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH\n" + "z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA==\n" + "-----END CERTIFICATE-----\n", + + /* VeriSign Class 3 Public Primary Certification Authority - G5 */ + "-----BEGIN CERTIFICATE-----\n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SqGSIb3DQEBBQUAA4IB\n" + "AQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+OYo68+aCiV0BN7OrJKQV\n" + "DpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cnCDpOGR86p1hcF895\n" + "P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/53CYNv6ZHdAbY\n" + "iNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xcf8LDmBxr\n" + "ThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW\n" + "-----END CERTIFICATE-----\n", + + /* COMODO Certification Authority */ + "-----BEGIN CERTIFICATE-----\n" + "MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkG\n" + "A1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9y\n" + "ZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZp\n" + "Y2F0aW9uIEF1dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQsw\n" + "CQYDVQQGEwJHQjEbMBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxm\n" + "b3JkMRowGAYDVQQKExFDT01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRp\n" + "ZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECL\n" + "i3LjkRv3UcEbVASY06m/weaKXTuH+7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI\n" + "2GqGd0S7WWaXUF601CxwRM/aN5VCaTwwxHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7eu\n" + "NJH+1GImGEaaP+vB+fGQV+useg2L23IwambV4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC\n" + "8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQF\n" + "ZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVIrLsm9wIDAQABo4GOMIGLMB0GA1Ud\n" + "DgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw\n" + "AwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9D\n" + "ZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOCAQEAPpiem/Yb6dc5\n" + "t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CPOGEIqB6BCsAv\n" + "IC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/RxdMosIG\n" + "lgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmcIGfE\n" + "7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN\n" + "+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ==\n" + "-----END CERTIFICATE-----\n", + + /* Network Solutions Certificate Authority */ + "-----BEGIN CERTIFICATE-----\n" + "MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYD\n" + "VQQGEwJVUzEhMB8GA1UEChM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ZVR\n" + "DuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/GGUsyfJj4akH\n" + "/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3HtvwKeI8lN3\n" + "s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxDydi8\n" + "NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey\n" + "-----END CERTIFICATE-----\n", + + /* COMODO ECC Certification Authority */ + "-----BEGIN CERTIFICATE-----\n" + "MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UE\n" + "BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEa\n" + "MBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlm\n" + "aWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTEL\n" + "MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2Fs\n" + "Zm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0Mg\n" + "Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmC\n" + "FYX7deSRFtSrYpn1PlILBs5BAH+X4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0J\n" + "cfRK9ChQtP6IHG4/bC8vCVlbpVsLM5niwz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZ\n" + "SBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggq\n" + "hkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VGFAkK+qDmfQjGGoe9GKhzvSbKYAydzpmf\n" + "z1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeAU/7dIOA1mjbRxwG55tzd8/8dLDoW\n" + "V9mSOdY=\n" + "-----END CERTIFICATE-----\n", + + /* OISTE WISeKey Global Root GA CA */ + "-----BEGIN CERTIFICATE-----\n" + "MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkG\n" + "A1UEBhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAw\n" + "NTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUg\n" + "V0lTZUtleSBHbG9iYWwgUm9vdCBHQSBDQTAeFw0wNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5\n" + "NTFaMIGKMQswCQYDVQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJp\n" + "Z2h0IChjKSAyMDA1MSIwIAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYD\n" + "VQQDEx9PSVNURSBXSVNlS2V5IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEF\n" + "AAOCAQ8AMIIBCgKCAQEAy0+zAJs9Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxR\n" + "VVuuk+g3/ytr6dTqvirdqFEr12bDYVxgAsj1znJ7O7jyTmUIms2kahnBAbtzptf2w93NvKSL\n" + "tZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbDd50kc3vkDIzh2TbhmYsFmQvtRTEJysIA2/dy\n" + "oJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ/yxViJGg4E8HsChWjBgbl0SOid3gF27n\n" + "Ku+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t94B3RLoGbw9ho972WG6xwsRYUC9tguSYB\n" + "BQIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUswN+\n" + "rja8sHnR3JQmthG+IbJphpQwEAYJKwYBBAGCNxUBBAMCAQAwDQYJKoZIhvcNAQEFBQADggEB\n" + "AEuh/wuHbrP5wUOxSPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vImMMkQyh2I+3QZH4VF\n" + "vbBsUfk2ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4+vg1YFkCExh8\n" + "vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXahNVQA7bi\n" + "hKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEYokxS\n" + "dsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0=\n" + "-----END CERTIFICATE-----\n", + + /* Certigna */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNVBAYTAkZS\n" + "MRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4XDTA3MDYyOTE1MTMw\n" + "NVoXDTI3MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczER\n" + "MA8GA1UEAwwIQ2VydGlnbmEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ\n" + "1tazNHUmgh7stL7qXOEm7RFHYeGifBZ4QCHkYJ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LMdiNlXiItiJVbSY\n" + "SKpk+tYcNthEeFpaIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8rZ7/gFnkm0W09juw\n" + "zTkZmDLl6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4Gdyd1Lx+4ivn+\n" + "xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mUCm26OWMo\n" + "hpLzGITY+9HPBVZkVw==\n" + "-----END CERTIFICATE-----\n", + + /* Cybertrust Global Root */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMP\n" + "Q3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2\n" + "MTIxNTA4MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5j\n" + "MR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOC\n" + "AQ8AMIIBCgKCAQEA+Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO2\n" + "1O1fWLE3TdVJDm71aofW0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2O\n" + "lTEQXO2iLb3VOm2yHLtgwEZLAfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeW\n" + "P032a7iPt3sMpTjr3kfb1V05/Iin89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNz\n" + "FtApD0mpSPCzqrdsxacwOUBdrsTiXSZT8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQID\n" + "AQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2\n" + "CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJs\n" + "aWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8GA1UdIwQYMBaAFLYIew16zKwgTIZW\n" + "Ml7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFROlZfJ+InaRcHUowAl9B8Tq7ej\n" + "hVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi5MXzLqXZI+O4Tkogp24C\n" + "JJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2hO0j9n0Hq0V+09+z\n" + "v+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+TX3EJIrduPuoc\n" + "A06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jWWL1WMRJO\n" + "Ecgh4LMRkWXbtKaIOM5V\n" + "-----END CERTIFICATE-----\n", + + /* ePKI Root Certification Authority */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYD\n" + "VQQGEwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsM\n" + "IWVQS0kgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0z\n" + "NDEyMjAwMjMxMjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29t\n" + "IENvLiwgTHRkLjEqMCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5\n" + "MIICIjANBg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ypzq\n" + "KOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnV\n" + "vwdVxrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltab\n" + "rNMdjmEPNXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc\n" + "7b3jajWvY9+rGNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8\n" + "GrBQAuUBo2M3IUxExJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS\n" + "/jQ6fbjpKdx2qcgw+BRxgMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C\n" + "6pSe3VkQw63d4k3jMdXH7OjysP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yI\n" + "VMUWbuF6aC74Or8NpDyJO3inTmODBCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4\n" + "EZw=\n" + "-----END CERTIFICATE-----\n", + + /* certSIGN ROOT CA */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYTAlJPMREw\n" + "DwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTAeFw0wNjA3MDQx\n" + "NzIwMDRaFw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJPMREwDwYDVQQKEwhjZXJ0U0lH\n" + "TjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC\n" + "AQoCggEBALczuX7IJUqOtdu0KBuqV5Do0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oq\n" + "rl0Hj0rDKH/v+yv6efHHrfAQUySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsA\n" + "fsT8AzNXDe3i+s5dRdY4zTW2ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUo\n" + "Se1b16kQOA7+j0xbm0bqQfWwCHTD0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwv\n" + "JoIQ4uNllAoEwF73XVv4EOLQunpL+943AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08CAwEAAaNC\n" + "MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAcYwHQYDVR0OBBYEFOCMm9slSbPx\n" + "fIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IBAQA+0hyJLjX8+HXd5n9liPRyTMks1zJO\n" + "890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6\n" + "IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0x2DEW8xXjrJ1/RsCCdtZb3KT\n" + "afcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIltvBTjD4au8as+x6AJzKNI\n" + "0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7NzTogVZ96edhBiIL5V\n" + "aZVDADlN9u6wWk5JRFRYX0KD\n" + "-----END CERTIFICATE-----\n", + + /* GeoTrust Primary Certification Authority - G3 */ + "-----BEGIN CERTIFICATE-----\n" + "MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkG\n" + "A1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdl\n" + "b1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ug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XqxNT2I7BQMXXExZacse3aQHEerGDAWh9jUGh\n" + "lBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33st/3L\n" + "jWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt\n" + "-----END CERTIFICATE-----\n", + + /* thawte Primary Root CA - G2 */ + "-----BEGIN CERTIFICATE-----\n" + "MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UE\n" + "BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3Rl\n" + "LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmlt\n" + "YXJ5IFJvb3QgQ0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQsw\n" + "CQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0\n" + "aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3Rl\n" + "IFByaW1hcnkgUm9vdCBDQSAtIEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFS\n" + "eIf+iha/BebfowJPDQfGAFG6DAJSLSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6\n" + "papu+7qzcMBniKI11KOasf2twu8x+qi58/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/\n" + "MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUmtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZI\n" + "zj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUNG4k8V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jXsCZSKAExQGbY2SS99irY7CFJXJv2eul/VTV+lmuNk5Mny5K7\n" + "6qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2SzhkGcuYMXDhpxwTWvGzOW/b3aJzcJRVIiKHpqfiY\n" + "nODz1TEoYRFsZ5aNOZnLwkUkOQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB\n" + "/wQEAwIBBjAdBgNVHQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJKoZIhvcNAQELBQAD\n" + "ggEBABpA2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweKA3rD6z8KLFIW\n" + "oCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1but8jLZ8HJ\n" + "nBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7cKUGRIjxpp7sC8rZc\n" + "JwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fMm7v/OeZWYdMKp8RcTGB7BXcm\n" + "er/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A=\n" + "-----END CERTIFICATE-----\n", + + /* GeoTrust Primary Certification Authority - G2 */ + "-----BEGIN CERTIFICATE-----\n" + "MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UE\n" + "BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1Ry\n" + "dXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3Qg\n" + "UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoX\n" + "DTM4MDExODIzNTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMu\n" + "MTkwNwYDVQQLEzAoYykgMjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl\n" + "IG9ubHkxNjA0BgNVBAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp\n" + "dHkgLSBHMjB2MBAGByqGSM49AgEGBSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcL\n" + "So17VDs6bl8VAsBQps8lL33KSLjHUGMcKiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf\n" + "691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\n" + "AQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSW\n" + "WaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7mndwxHLKgpxgceeHHNgIwOlavmnRs\n" + "9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2npaqBA+K\n" + "-----END CERTIFICATE-----\n", + + /* VeriSign Universal Root Certification Authority */ + "-----BEGIN CERTIFICATE-----\n" + "MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkG\n" + "A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU\n" + "cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBh\n" + "dXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBD\n" + "ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0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PY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx\n" + "Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahf\n" + "YtTxP/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tew\n" + "XDpPaj+PwGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WI\n" + "g0vvBZIGcfK4mJO37M2CYfE45k+XmCpajQ==\n" + "-----END CERTIFICATE-----\n", + + /* VeriSign Class 3 Public Primary Certification Authority - G4 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UE\n" + "BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz\n" + "dCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo\n" + "b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt\n" + "YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgw\n" + "MTE4MjM1OTU5WjCByjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8w\n" + "HQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJp\n" + "U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2ln\n" + "biBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQw\n" + "djAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmD\n" + "iWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGzrl0Bp3vefLK+ymVhAIau2o970ImtTR1Z\n" + "mkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYI\n" + "KwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAHBgUrDgMCGgQUj+XTGoas\n" + "jY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24uY29tL3ZzbG9nby5naWYw\n" + "HQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMDA2gAMGUCMGYhDBgm\n" + "YFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIxAJw9SDkjOVga\n" + "FRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA==\n" + "-----END CERTIFICATE-----\n", + + /* NetLock Arany (Class Gold) FÅ‘tanúsítvány */ + "-----BEGIN CERTIFICATE-----\n" + "MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTER\n" + "MA8GA1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFu\n" + "w7pzw610dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwws\n" + "TmV0TG9jayBBcmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjEx\n" + "MTUwODIxWhcNMjgxMjA2MTUwODIxW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wUA\n" + "SZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu\n" + "dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E=\n" + "-----END CERTIFICATE-----\n", + + /* Staat der Nederlanden Root CA - G2 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwG\n" + "A1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJs\n" + "YW5kZW4gUm9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oXDTIwMDMyNTExMDMxMFowWjEL\n" + "MAkGA1UEBhMCTkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwi\n" + "U3RhYXQgZGVyIE5lZGVybGFuZGVuIFJvb3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQAD\n" + "ggIPADCCAgoCggIBAMVZ5291qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZ\n" + "qhQlEq0i6ABtQ8SpuOUfiUtnvWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU2\n" + "54DBtvPUZ5uW6M7XxgpT0GtJlvOjCwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvE\n" + "pMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiile7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp5Rbn3JBV\n" + "3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCROME4HYYEhLoaJXhena/MUGDWE4dS7WMfbWV9\n" + "whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpICT0ugpTNGmXZK4iambwYfp/ufWZ8Pr2U\n" + "uIHOzZgweMFvZ9C+X+Bo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4hoKOKwJCcaNpQ5kUQR3i2TtJlycM33+FCY7BXN0Ute4qcvwXq\n" + "ZVUz9zkQxSgqIXobisQk+T8VyJoVIPVVYpbtbZNQvOSqeK3Zywplh6ZmwcSBo3c6WB4L7oOL\n" + "nR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm66+KAQ==\n" + "-----END CERTIFICATE-----\n", + + /* Hongkong Post Root CA 1 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNV\n" + "BAoTDUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4X\n" + "DTAzMDUxNTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT\n" + "DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjAN\n" + "BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSS\n" + "HSL22oVyaf7XPwnU3ZG1ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8g\n" + "PW2iNr4joLFutbEnPzlTCeqrauh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7j\n" + "EAaPIpjhZY4bXSNmO7ilMlHIhqqhqZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9\n" + "nnV0ttgCXjqQesBCNnLsak3c78QA3xMYV18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208\n" + "o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNVHRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQE\n" + "AwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7ih9legYsCmEEIjEy82tvuJxuC52pF7BaL\n" + "T4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37piol7Yutmcn1KZJ/RyTZXaeQi/cImya\n" + "T/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5LmeiIAQ32pwL0xch4I+XeTRvhEgC\n" + "IDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88psT/oROhUVRsPNH4NbLUES\n" + "7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilTc4afU9hDDl3WY4Jx\n" + "HYB0yvbiAmvZWg==\n" + "-----END CERTIFICATE-----\n", + + /* SecureSign RootCA11 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UE\n" + "ChMiSmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoGA1UEAxMTU2VjdXJl\n" + "U2lnbiBSb290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0MDgwNDU2NDdaMFgxCzAJBgNV\n" + "BAYTAkpQMSswKQYDVQQKEyJKYXBhbiBDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzLCBJbmMuMRww\n" + "GgYDVQQDExNTZWN1cmVTaWduIFJvb3RDQTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB\n" + "CgKCAQEA/XeqpRyQBTvLTJszi1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1y\n" + "fIw/XwFndBWW4wI8h9uuywGOwvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyK\n" + "yiyhFTOVMdrAG/LuYpmGYz+/3ZMqg6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9\n" + "UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rPO7AxmjVuyIsG0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yYIi\n" + "LXpUq3DDfSJlgnCW\n" + "-----END CERTIFICATE-----\n", + + /* GlobalSign Root CA - R3 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UECxMX\n" + "R2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMT\n" + "Ckdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4MTAwMDAwWjBMMSAwHgYDVQQL\n" + "ExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UE\n" + "AxMKR2xvYmFsU2lnbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5Bngi\n" + "FvXAg7aEyiie/QV2EcWtiHL8RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0M\n" + "K66X17YUhhB5uzsTgHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL\n" + "0gRgykmmKPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd\n" + "QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZXriX7613\n" + "t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAwDgYDVR0PAQH/BAQD\n" + "AgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0G\n" + "CSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7lgAJQayzE4aGKAczymvmdLm6AC2u\n" + "pArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdW\n" + "PoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0\n" + "095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJr\n" + "lAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH\n" + "WD9f\n" + "-----END CERTIFICATE-----\n", + + /* Autoridad de Certificacion Firmaprofesional CIF A62634068 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMx\n" + "QjBABgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwg\n" + "Q0lGIEE2MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNV\n" + "BAYTAkVTMUIwQAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zl\n" + "c2lvbmFsIENJRiBBNjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDK\n" + "lmuO6vj78aI14H9M2uDDUtd9thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOS\n" + "L/UR5GLXMnE42QQMcas9UX4PB99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9\n" + "qFD0sefGL9ItWY16Ck6WaVICqjaY7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15i\n" + "NA9wBj4gGFrO93IbJWyTdBSTo3OxDqqHECNZXyAFGUftaI6SEspd/NYrspI8IM/hX68gvqB2\n" + "f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyIplD9am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N7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5k\n" + "SeTy36LssUzAKh3ntLFlosS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF3dvd6qJ2\n" + "gHN99ZwExEWN57kci57q13XRcrHedUTnQn3iV2t93Jm8PYMo6oCTjcVMZcFwgbg4/EMxsvYD\n" + "NEeyrPsiBsse3RdHHF9mudMaotoRsaS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhr\n" + "JKyXWERHrVkY8SFlcN7ONGCoQPHzPKTDKCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIyS\n" + "xZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi6Et8Vcad+qMUu2WFbm5PEn4KPJ2V\n" + "-----END CERTIFICATE-----\n", + + /* Izenpe.com */ + "-----BEGIN CERTIFICATE-----\n" + "MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4MQswCQYD\n" + "VQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wHhcN\n" + "MDcxMjEzMTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYDVQQGEwJFUzEUMBIGA1UECgwL\n" + "SVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4IC\n" + "DwAwggIKAoICAQDJ03rKDx6sp4boFmVqscIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5Tz\n" + "cqQsRNiekpsUOqHnJJAKClaOxdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpz\n" + "bm3benhB6QiIEn6HLmYRY2xU+zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJ\n" + "GjMxCrFXuaOKmMPsOzTFlUFpfnXCPCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUm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ViH5ULy617uHjAimcs30cQhbIHsvm0m\n" + "5hzkQiCeR7Csg1lwLDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Py\n" + "e6kfLqCTVyvehQP5aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGk\n" + "LhObNA5me0mrZJfQRsN5nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJbUjWumDqt\n" + "ujWTI6cfSN01RpiyEGjkpTHCClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/QnMFlEPVjjxOAToZ\n" + "pR9GTnfQXeWBIiGH/pR9hNiTrdZoQ0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6i\n" + "SNnpn86CcDaTmjvfliHjWbcM2pE38P1ZWrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE4\n" + "1V4tC5h9Pmzb/CaIxw==\n" + "-----END CERTIFICATE-----\n", + + /* Chambers of Commerce Root - 2008 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYDVQQGEwJF\n" + "VTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZp\n" + "cm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1l\n" + "cmZpcm1hIFMuQS4xKTAnBgNVBAMTIENoYW1iZXJzIG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4\n" + "MB4XDTA4MDgwMTEyMjk1MFoXDTM4MDczMTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYD\n" + "VQQHEzpNYWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29t\n" + "L2FkZHJlc3MpMRIwEAY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\n" + "8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZd0jQ\n" + "-----END CERTIFICATE-----\n", + + /* Global Chambersign Root - 2008 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJF\n" + "VTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZp\n" + "cm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1l\n" + "cmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODAe\n" + "Fw0wODA4MDExMjMxNDBaFw0zODA3MzExMjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UE\n" + "BxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9h\n" + "ZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu\n" + "QS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZI\n" + "hvcNAQEBBQADggIPADCCAgoCggIBAMDfVtPkOpt2RbQT2//BthmLN0EYlVJH6xedKYiONWwG\n" + "Mi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXfXjaOcNFccUMd2drvXNL7G706tcuto8xEpw2u\n" + "IRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0ZJJ0YPP2zxhPYLIj0Mc7zmFLmY/CDNBA\n" + "spjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4ddPB/gBVsIdU6CeQNR1MM62X/JcumIS/\n" + "LMmjv9GYERTtY/jKmIhYF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WCiqAm57OtZfMY18dwY6fFn5a+6ReAJ3spED8IXDneRRXozX1+WLGiLwUePmJs9wOzL9dWC\n" + "koQ10b42OFZyMVtHLaoXpGNR6woBrX/sdZ7LoR/xfxKxueRkf2fWIyr0uDldmOghp+G9PUIa\n" + "dJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVza2Mg9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJ\n" + "jUhjxsYjV5KTXjXBjfkK9yydYhz2rXzdpjEetrHHfoUm+qRqtdpjMNHvkzeyZi99Bffnt0uY\n" + "lDXA2TopwZ2yUDMdSqlapskD7+3056huirRXhOukP9DuqqqHW2Pok+JrqNS4cnhrG+055F3L\n" + "m6qH1U9OAP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETrP3iZ8ntxPjzxmKfFGBI/5rso\n" + "M0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVqc5iJWzouE4gev8CSlDQb\n" + "4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z09gwzxMNTxXJhLyn\n" + "SC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B\n" + "-----END CERTIFICATE-----\n", + + /* Go Daddy Root Certificate Authority - G2 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMxEDAOBgNV\n" + "BAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29t\n" + "LCBJbmMuMTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAt\n" + "IEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAw\n" + "DgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5\n" + "LmNvbSwgSW5jLjExMC8GA1UEAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3Jp\n" + "dHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3\n" + "gElY6SKDE6bFIEMBO4Tx5oVJnyfq9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH\n" + "/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD+qK+ihVqf94Lw7YZFAXK6sOoBJQ7RnwyDfMAZiLI\n" + "jWltNowRGLfTshxgtDj6AozO091GB94KPutdfMh8+7ArU6SSYmlRJQVhGkSBjCypQ5Yj36w6\n" + "gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMlNAJWJwGRtDtwKj9useiciAF9n9T521Nt\n" + "YJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO\n" + "BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFDqahQcQZyi27/a9BUFuIMGU2g/eMA0GCSqGSIb3\n" + "DQEBCwUAA4IBAQCZ21151fmXWWcDYfF+OwYxdS2hII5PZYe096acvNjpL9DbWu7PdIxztDhC\n" + "2gV7+AJ1uP2lsdeu9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r5N9ss4UXnT3ZJE95\n" + "kTXWXwTrgIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYVN8Gb5DKj7Tjo\n" + "2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPOLPAvTK33\n" + "sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1\n" + "-----END CERTIFICATE-----\n", + + /* Starfield Root Certificate Authority - G2 */ + "-----BEGI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TwNvlJk7mh+ChTnUdgWU\n" + "XuEok21iXQnCoKjUsHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx4mcujJUDJi5DnUox\n" + "9g61DLu34jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUwF5okxBDgBPfg\n" + "8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/KpL/QlwVK\n" + "vOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZc2T5\n" + "NnReJaH1ZgUufzkVqSr7UIuOhWn0\n" + "-----END CERTIFICATE-----\n", + + /* Starfield Services Root Certificate Authority - G2 */ + "-----BEGIN CERTIFICATE-----\n" + "MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNV\n" + "BAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBU\n" + "ZWNobm9sb2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENl\n" + "cnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1\n" + "OVowgZgxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNk\n" + "YWxlMSUwIwYDVQQKExxTdGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJT\n" + "dGFyZmllbGQgU2VydmljZXMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIw\n" + "DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20p\n" + "OsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm28xpWriu2\n" + "dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4PahHQUw2eeBGg6345AWh1KTs9DkTvnVtYAcMtS\n" + "7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLPLJGmpufehRhJfGZOozptqbXuNC66DQO4\n" + "M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk6mFBrMnUVN+HL8cisibMn1lUaJ/8viov\n" + "xFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\n" + "AQYwHQYDVR0OBBYEFJxfAN+qAdcwKziIorhtSpzyEZGDMA0GCSqGSIb3DQEBCwUAA4IBAQBL\n" + "NqaEd2ndOxmfZyMIbw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPPE95Dz+I0swSdHynV\n" + "v/heyNXBve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTyxQGjhdByPq1z\n" + "qwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkdiEDPfUYd\n" + "/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn0q23KXB56jzaYyWf\n" + "/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCNsSi6\n" + "-----END CERTIFICATE-----\n", + + /* AffirmTrust Commercial */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCVVMx\n" + "FDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFs\n" + "MB4XDTEwMDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDELMAkGA1UEBhMCVVMxFDASBgNV\n" + "BAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMIIBIjAN\n" + "BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTW\n" + "zsO3qyxPxkEylFf6EqdbDuKPHx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U\n" + "6Mje+SJIZMblq8Yrba0F8PrVC8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNA\n" + "FxHUdPALMeIrJmqbTFeurCA+ukV6BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1\n" + "yHp52UKqK39c/s4mT6NmgTWvRLpUHhwwMmWd5jyTXlBOeuM61G7MGvv50jeuJCqrVwMiKA1J\n" + "dX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNVHQ4EFgQUnZPGU4teyq8/nx4P5ZmVvCT2lI8w\n" + "DwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQELBQADggEBAFis\n" + "9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYGXUPGhi4+c7ImfU+TqbbEKpqrIZcUsd6M\n" + "06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNjvbz4YYCanrHOQnDiqX0GJX0nof5v7LMeJNrjS1Ua\n" + "ADs1tDvZ110w/YETifLCBivtZ8SOyUOyXGsViQK8YvxO8rUzqrJv0wqiUOP2O+guRMLbZjip\n" + "M1ZI8W0bM40NjD9gN53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0khsUlHRUe072o0EclN\n" + "msxZt9YCnlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8=\n" + "-----END CERTIFICATE-----\n", + + /* AffirmTrust Networking */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDTDCCAjSg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w==\n" + "-----END CERTIFICATE-----\n", + + /* AffirmTrust Premium ECC */ + "-----BEGIN CERTIFICATE-----\n" + "MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDAS\n" + "BgNVBAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAe\n" + "Fw0xMDAxMjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQK\n" + "DAtBZmZpcm1UcnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcq\n" + "hkjOPQIBBgUrgQQAIgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQU\n" + "X+iOGasvLkjmrBhDeKzQN8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR\n" + "4ptlKymjQjBAMB0GA1UdDgQWBBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTAD\n" + "AQH/MA4GA1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/Vs\n" + "aobgxCd05DhT1wV/GzTjxi+zygk8N53X57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9C\n" + "a/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKMeQ==\n" + "-----END CERTIFICATE-----\n", + + /* Certum Trusted Network CA */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYD\n" + "VQQKExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlm\n" + "aWNhdGlvbiBBdXRob3JpdHkxIjAgBgNVBAMTG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0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI03YnnZot\n" + "BqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw=\n" + "-----END CERTIFICATE-----\n", + + /* TWCA Root Certification Authority */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzESMBAGA1UE\n" + "CgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2Vy\n" + "dGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMzWhcNMzAxMjMxMTU1OTU5WjBf\n" + "MQswCQYDVQQGEwJUVzESMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSow\n" + "KAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3\n" + "DQEBAQUAA4IBDwAwggEKAoIBAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bi\n" + "hSX0NXIP+FPQQeFEAcK0HMMxQhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQ\n" + "sIBct+HHK3XLfJ+utdGdIzdjp9xCoi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeX\n" + "RfwZVzsrb+RH9JlF/h3x+JejiB03HFyP4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/zrX2SYgJb\n" + "KdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1ry+UPizgN7gr8/g+YnzAx3WxSZfmLgb4i4RxY\n" + "A7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud\n" + "DgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkqhkiG9w0BAQUFAAOCAQEAPNV3PdrfibqH\n" + "DAhUaiBQkr6wQT25JmSDCi/oQMCXKCeCMErJk/9q56YAf4lCmtYR5VPOL8zy2gXE/uJQxDqG\n" + "fczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlWQtNoURi+VJq/REG6Sb4g\n" + "umlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVYT0bf+215WfKEIlKu\n" + "D8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocnyYh0igzyXxfkZ\n" + "YiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw==\n" + "-----END CERTIFICATE-----\n", + + /* Security Communication RootCA2 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDElMCMGA1UE\n" + "ChMcU0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMeU2VjdXJpdHkgQ29t\n" + "bXVuaWNhdGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoXDTI5MDUyOTA1MDAzOVowXTEL\n" + "MAkGA1UEBhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xJzAl\n" + "BgNVBAsTHlNlY3VyaXR5IENvbW11bmljYXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEB\n" + "BQADggEPADCCAQoCggEBANAVOVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz3\n" + "35c9S672XewhtUGrzbl+dp+++T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonC\n" + "v/Q4EpVMVAX3NuRFg3sUZdbcDE3R3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQ\n" + "hNBqyjoGAD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AQMBCjBlMCwGCCsGAQUFBwIBFiBodHRwczovL3d3dy5jYXRjZXJ0\n" + "Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0\n" + "Lm5ldC92ZXJhcnJlbCAwDQYJKoZIhvcNAQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/\n" + "sXE7zDkJlF7W2u++AVtd0x7Y/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPp\n" + "qojlNcAZQmNaAl6kSBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7Awa\n" + "boMMPOhyRp/7SNVel+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOS\n" + "Agu+TGbrIP65y7WZf+a2E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xlnJ2lYJU6\n" + "Un/10asIbvPuW/mIPX64b24D5EI=\n" + "-----END CERTIFICATE-----\n", + + /* Hellenic Academic and Research Institutions RootCA 2011 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1IxRDBCBgNV\n" + "BAoTO0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4g\n" + "QXV0aG9yaXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5z\n" + "dGl0dXRpb25zIFJvb3RDQSAyMDExMB4XDTExMTIwNjEzNDk1MloXDTMxMTIwMTEzNDk1Mlow\n" + "gZUxCzAJBgNVBAYTAkdSMUQwQgYDVQQKEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFy\n" + "Y2ggSW5zdGl0dXRpb25zIENlcnQuIEF1dGhvcml0eTFAMD4GA1UEA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bZN2fOUvRJ9e4\n" + "-----END CERTIFICATE-----\n", + + /* Actalis Authentication Root CA */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UEBhMCSVQx\n" + "DjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1ODUyMDk2NzEn\n" + "MCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENBMB4XDTExMDkyMjExMjIw\n" + "MloXDTMwMDkyMjExMjIwMlowazELMAkGA1UEBhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYD\n" + "VQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRo\n" + "ZW50aWNhdGlvbiBSb290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bE\n" + "pSmkLO/lGMWwUKNvUTufClrJwkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW\n" + "1V8IbInX4ay8IMKx4INRimlNAJZaby/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9\n" + "KK3giq0itFZljoZUj5NDKd45RnijMCO6zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/gCczWw63\n" + "igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1fYVEiVRvjRuPjPdA1YprbrxTIW6HMiRvhMCb8\n" + "oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2oxgkg4YQ51Q+qDp2JE+BIcXjDwL4k5RH\n" + "ILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2Fbe8lEfKXGkJh90qX6IuxEAf6ZYGyojnP\n" + "9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxeKF+w6D9Fz8+vm2/7hNN3WpVvrJSEnu68wEqPSpP4\n" +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CPLy64Lo7y\n" + "FIrM6bV8+2ydDKXhlg==\n" + "-----END CERTIFICATE-----\n", + + /* Trustis FPS Root CA */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBFMQswCQYD\n" + "VQQGEwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQLExNUcnVzdGlzIEZQ\n" + "UyBSb290IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTExMzY1NFowRTELMAkGA1UEBhMC\n" + "R0IxGDAWBgNVBAoTD1RydXN0aXMgTGltaXRlZDEcMBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9v\n" + "dCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2\n" + "mfRC6qc+gIMPpqdZh8mQRUN+AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkc\n" + "hU59j9WvezX2fihHiTHcDnlkH5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE\n" + "2gfmHhjjvSkCqPoc4Vu5g6hBSLwacY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA\n" + "0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zto3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlBOrTh4/L6\n" + "8MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEAAaNTMFEwDwYDVR0TAQH/BAUwAwEB/zAfBgNV\n" + "HSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAdBgNVHQ4EFgQUuvpxJXmLV0ElIYYLceuy\n" + "ZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01GX2cGE+esCu8jowU/yyg2kdbw++BLa8F\n" + "6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmWzaD+vkAMXBJV+J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CwWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h\n" + "3PFaTWwyI0PurKju7koSCTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPzY11aWOIv\n" + "4x3kqdbQCtCev9eBCfHJxyYNrJgWVqA=\n" + "-----END CERTIFICATE-----\n", + + /* Buypass Class 3 Root CA */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UE\n" + "CgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMyBSb290\n" + "IENBMB4XDTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFowTjELMAkGA1UEBhMCTk8xHTAb\n" + "BgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDMg\n" + "Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEG\n" + "Mnqb8RB2uACatVI2zSRHsJ8YZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fk\n" + "oF0LXOBXByow9c3EN3coTRiR5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOo\n" + "TyrvYLs9tznDDgFHmV0ST9tD+leh7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX\n" + "0DJq1l1sDPGzbjniazEuOQAnFN44wOwZZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c/3ATAOux\n" + "9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH2xc519woe2v1n/MuwU8XKhDzzMro6/1rqy6a\n" + "ny2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV/afmiSTYzIw0bOIjL9kSGiG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ahoq0Tj0Itq4/g7u9xN\n" + "12TyUb7mqqta6THuBrxzvxNiCp/HuZc=\n" + "-----END CERTIFICATE-----\n", + + /* T-TeleSec GlobalRoot Class 3 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNV\n" + "BAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lz\n" + "dGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNz\n" + "IDMwHhcNMDgxMDAxMTAyOTU2WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzAp\n" + "BgNVBAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQt\n" + "U3lzdGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENs\n" + "YXNzIDMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3Z\n" + "JNW4t/zN8ELg63iIVl6bmlQdTQyK9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/\n" + "RLyTPWGrTs0NvvAgJ1gORH8EGoel15YUNpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4hqX2iys5\n" + "2qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZFiP0Zf3WHHx+xGwpzJFu5ZeAsVMhg02YXP+HM\n" + "VDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W0eDrXltMEnAMbEQgqxHY9Bn20pxSN+f6\n" + "tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYD\n" + "VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1A/d2O2GCahKqGFPrAyGUv/7OyjANBgkqhkiG9w0B\n" + "AQsFAAOCAQEAVj3vlNW92nOyWL6ukK2YJ5f+AbGwUgC4TeQbIXQbfsDuXmkqJa9c1h3a0nnJ\n" + "85cp4IaH3gRZD/FZ1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzTucpH9sry9uetuUg/\n" + "vBa3wW306gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7hP0HHRwA11fXT\n" + "91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuImle9eiPZaG\n" + "zPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4pTpPDpFQUWw==\n" + "-----END CERTIFICATE-----\n", + + /* EE Certification Centre Root CA */ + "-----BEGIN CERTIFICATE-----\n" + "MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1MQswCQYD\n" + "VQQGEwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1czEoMCYGA1UEAwwf\n" + "RUUgQ2VydGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYGCSqGSIb3DQEJARYJcGtpQHNr\n" + "LmVlMCIYDzIwMTAxMDMwMTAxMDMwWhgPMjAzMDEyMTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVF\n" + "MSIwIAYDVQQKDBlBUyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0\n" + "aWZpY2F0aW9uIENlbnRyZSBSb290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEi\n" + "MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLq\n" + "I9iroWUyeuuOF0+W2Ap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cmwwDQYJKoZI\n" + "hvcNAQELBQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm2H6NMLVwMeni\n" + "acfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0o3/U37CY\n" + "Aqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4KzCUqNQT4YJEVdT1B\n" + "/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8PIWmawomDeCTmGCufsYkl4ph\n" + "X5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3YJohw1+qRzT65ysCQblrGXnRl11z+o+I=\n" + "-----END CERTIFICATE-----\n", + + /* D-TRUST Root Class 3 CA 2 EV 2009 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRFMRUwEwYD\n" + "VQQKDAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIg\n" + "RVYgMjAwOTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUwNDZaMFAxCzAJBgNVBAYTAkRF\n" + "MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAz\n" + "IENBIDIgRVYgMjAwOTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3\n" + "MKCOvXwEz75ivJn9gpfSegpnljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut\n" + "8Mxk2og+KbgPCdM03TP1YtHhzRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsT\n" + "l28So/6ZqQTMFexgaDbtCHu39b+T7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3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nYx5nQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/\n" + "MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUtZn4r7CU9eMg1gqtzk5WpC5uQu0wDQYJKoZI\n" + "hvcNAQELBQADggIBACYGXnDnZTPIgm7ZnBc6G3pmsgH2eDtpXi/q/075KMOYKmFMtCQSin1t\n" + "ERT3nLXK5ryeJ45MGcipvXrA1zYObYVybqjGom32+nNjf7xueQgcnYqfGopTpti72TVVsRHF\n" + "qQOzVju5hJMiXn7B9hJSi+osZ7z+Nkz1uM/Rs0mSO9MpDpkblvdhuDvEK7Z4bLQjb/D907Je\n" + "dR+Zlais9trhxTF7+9FGs9K8Z7RiVLoJ92Owk6Ka+elSLotgEqv89WBW7xBci8QaQtyDW2QO\n" + "y7W81k/BfDxujRNt+3vrMNDcTa/F1balTFtxyegxvug4BkihGuLq0t4SOVga/4AOgnXmt8kH\n" + "bA7v/zjxmHHEt38OFdAlab0inSvtBfZGR6ztwPDUO+Ls7pZbkBNOHlY667DvlruWIxG68kOG\n" + "dGSVyCh13x01utI3gzhTODY7z2zp+WsO0PsE6E9312UBeIYMej4hYvF/Y3EMyZ9E26gnonW+\n" + "boE+18DrG5gPcFw0sorMwIUY6256s/daoQe/qUKS82Ail+QUoQebTnbAjn39pCXHR+3/H3Os\n" + "zMOl6W8KjptlwlCFtaOgUxLMVYdh84GuEEZhvUQhuMI9dM9+JDX6HAcOmz0iyu8xL4ysEr3v\n" + "QCj8KWefshNPZiTEUxnpHikV7+ZtsH8tZ/3zbBt1RqPlShfppNcL\n" + "-----END CERTIFICATE-----\n", + + /* ACCVRAIZ1 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIH0zCCBbugAwIBAgIIXsO3pkN/pOAwDQYJKoZIhvcNAQEFBQAwQjESMBAGA1UEAwwJQUND\n" + "VlJBSVoxMRAwDgYDVQQLDAdQS0lBQ0NWMQ0wCwYDVQQKDARBQ0NWMQswCQYDVQQGEwJFUzAe\n" +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uJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+nile98FRYB/e2guyLXW3Q0iT5/Z5xoRd\n" + "gFlglPx4mI88k1HtQJAH32RjJMtOcQWh15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92\n" + "a6O2JryPA9gK8kxkRr05YuWW6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/Zuepi\n" + "iI7E8UuDEq3mi4TWnsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZz\n" + "JBPqpK5jwa19hAM8EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWz\n" + "aGHQRiapIVJpLesux+t3zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmyKwbQBM0=\n" + "-----END CERTIFICATE-----\n", + + /* TeliaSonera Root CA v1 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAwNzEUMBIG\n" + "A1UECgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlRlbGlhU29uZXJhIFJvb3QgQ0EgdjEwHhcN\n" + "MDcxMDE4MTIwMDUwWhcNMzIxMDE4MTIwMDUwWjA3MRQwEgYDVQQKDAtUZWxpYVNvbmVyYTEf\n" + "MB0GA1UEAwwWVGVsaWFTb25lcmEgUm9vdCBDQSB2MTCCAiIwDQYJKoZIhvcNAQEBBQADggIP\n" + "ADCCAgoCggIBAMK+6yfwIaPzaSZVfp3FVRaRXP3vIb9TgHot0pGMYzHw7CTww6XScnwQbfQ3\n" + "t+XmfHnqjLWCi65ItqwA3GV17CpNX8GH9SBlK4GoRz6JI5UwFpB/6FcHSOcZrr9FZ7E3GwYq\n" + "/t75rH2D+1665I+XZ75Ljo1kB1c4VWk0Nj0TSO9P4tNmHqTPGrdeNjPUtAa9GAH9d4RQAEX1\n" + "jF3oI7x+/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" + "gUy7onOTJsjrDNYmiLbAJM+7vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQ\n" + "mz1wHiRszYd2qReWt88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfuj\n" + "uLpwQMcnHL/EVlP6Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVx\n" + "SK236thZiNSQvxaz2emsWWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY=\n" + "-----END CERTIFICATE-----\n", + + /* E-Tugra Certification Authority */ + "-----BEGIN CERTIFICATE-----\n" + "MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNVBAYTAlRS\n" + "MQ8wDQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtu\n" + "b2xvamlsZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlm\n" + "aWthc3lvbiBNZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9y\n" + "aXR5MB4XDTEzMDMwNTEyMDk0OFoXDTIzMDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8w\n" + "DQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xv\n" + "amlsZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWth\n" + "c3lvbiBNZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5\n" + "MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA4vU/kwVRHoViVF56C/UYB4Oufq98\n" + "99SKa6VjQzm5S/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+ "Q9Jauz1c77NCR807VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3\n" + "+GbHeJAAFS6LrVE1Uweoa2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WKvJUawSg5\n" + "TB9D0pH0clmKuVb8P7Sd2nCcdlqMQ1DujjByTd//SffGqWfZbawCEeI6FiWnWAjLb1NBnEg4\n" + "R2gz0dfHj9R0IdTDBZB6/86WiLEVKV0jq9BgoRJP3vQXzTLlyb/IQ639Lo7xr+L0mPoSHyDY\n" + "wKcMhcWQ9DstliaxLL5Mq+ux0orJ23gTDx4JnW2PAJ8C2sH6H3p6CcRK5ogql5+Ji/03X186\n" + "zjhZhkuvcQu02PJwT58yE+Owp1fl2tpDy4Q08ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9\n" + "I2cNE3X7z2VnIp2usAnRCf8dNL/+I5c30jn6PQ0GC7TbO6Orb1wdtn7os4I07QZcJA==\n" + "-----END CERTIFICATE-----\n", + + /* T-TeleSec GlobalRoot Class 2 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNV\n" + "BAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lz\n" + "dGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNz\n" + "IDIwHhcNMDgxMDAxMTA0MDE0WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzAp\n" + "BgNVBAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQt\n" + "U3lzdGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENs\n" + "YXNzIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl\n" + "82hVYAUdAqSzm1nzHoqvNK38DcLZSBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiC\n" + "FoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/FvudocP05l03Sx5iRUKrERLMjfTlH6VJi1hKTXrcx\n" + "lkIF+3anHqP1wvzpesVsqXFP6st4vGCvx9702cu+fjOlbpSD8DT6IavqjnKgP6TeMFvvhk1q\n" + "lVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGVWOHAD3bZwI18gfNycJ5v/hqO2V81xrJv\n" + "NHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYD\n" + "VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/WSA2AHmgoCJrjNXyYdK4LMuCSjANBgkqhkiG9w0B\n" + "AQsFAAOCAQEAMQOiYQsfdOhyNsZt+U2e+iKo4YFWz827n+qrkRk4r6p8FU3ztqONpfSO9kSp\n" + "p+ghla0+AGIWiPACuvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNfvNoBYimipidx5joi\n" + "fsFvHZVwIEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR3p1m0IvVVGb6\n" + "g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN9noHV8ci\n" + "gwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlPBSeOE6Fuwg==\n" + "-----END CERTIFICATE-----\n", + + /* Atos TrustedRoot 2011 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UEAwwVQXRv\n" + "cyBUcnVzdGVkUm9v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klmOVhMJKzRwuJIczYOXD\n" + "-----END CERTIFICATE-----\n", + + /* QuoVadis Root CA 2 G3 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQELBQAwSDEL\n" + "MAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAcBgNVBAMTFVF1b1Zh\n" + "ZGlzIFJvb3QgQ0EgMiBHMzAeFw0xMjAxMTIxODU5MzJaFw00MjAxMTIxODU5MzJaMEgxCzAJ\n" + "BgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMR4wHAYDVQQDExVRdW9WYWRp\n" + "cyBSb290IENBIDIgRzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQChriWyARjc\n" + "V4g/Ruv5r+LrI3HimtFhZiFfqq8nUeVuGxbULX1QsFN3vXg6YOJkApt8hpvWGo6t/x8Vf9WV\n" + "HhLL5hSEBMHfNrMWn4rjyduYNM7YMxcoRvynyfDStNVNCXJJ+fKH46nafaF9a7I6JaltUkSs\n" + "+L5u+9ymc5GQYaYDFCDy54ejiK2toIz/pgslUiXnFgHVy7g1gQyjO/Dh4fxaXc6AcW34Sas+\n" + "O7q414AB+6XrW7PFXmAqMaCvN+ggOp+oMiwMzAkd056OXbxMmO7FGmh77FOm6RQ1o9/NgJ8M\n" + "SPsc9PG/Srj61YxxSscfrf5BmrODXfKEVu+lV0POKa2Mq1W/xPtbAd0jIaFYAI7D0GoT7RPj\n" + "EiuA3GfmlbLNHiJuKvhB1PLKFAeNilUSxmn1uIZoL1NesNKqIcGY5jDjZ1XHm26sGahVpkUG\n" + "0CM62+tlXSoREfA7T8pt9DTEceT/AFr2XK4jYIVz8eQQsSWu1ZK7E8EM4DnatDlXtas1qnIh\n" + "O4M15zHfeiFuuDIIfR0ykRVKYnLP43ehvNURG3YBZwjgQQvD6xVu+KQZ2aKrr+InUlYrAoos\n" + "FCT5v0ICvybIxo/gbjh9Uy3l7ZizlWNof/k19N+IxWA1ksB8aRxhlRbQ694Lrz4EEEVlWFA4\n" + "r0jyWbYW8jwNkALGcC4BrTwV1wIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB\n" + "/wQEAwIBBjAdBgNVHQ4EFgQU7edvdlq/YOxJW8ald7tyFnGbxD0wDQYJKoZIhvcNAQELBQAD\n" + "ggIBAJHfgD9DCX5xwvfrs4iP4VGyvD11+ShdyLyZm3tdquXK4Qr36LLTn91nMX66AarHakE7\n" + "kNQIXLJgapDwyM4DYvmL7ftuKtwGTTwpD4kWilhMSA/ohGHqPHKmd+RCroijQ1h5fq7KpVMN\n" + "qT1wvSAZYaRsOPxDMuHBR//47PERIjKWnML2W2mWeyAMQ0GaW/ZZGYjeVYg3UQt4XAoeo0L9\n" + "x52ID8DyeAIkVJOviYeIyUqAHerQbj5hLja7NQ4nlv1mNDthcnPxFlxHBlRJAHpYErAK74X9\n" + "sbgzdWqTHBLmYF5vHX/JHyPLhGGfHoJE+V+tYlUkmlKY7VHnoX6XOuYvHxHaU4AshZ6rNRDb\n" + "Il9qxV6XU/IyAgkwo1jwDQHVcsaxfGl7w/U2Rcxhbl5MlMVerugOXou/983g7aEOGzPuVBj+\n" + "D77vfoRrQ+NwmNtddbINWQeFFSM51vHfqSYP1kjHs6Yi9TM3WpVHn3u6GBVv/9YUZINJ0gpn\n" + "IdsPNWNgKCLjsZWDzYWm3S8P52dSbrsvhXz1SnPnxT7AvSESBT/8twNJAlvIJebiVDj1eYeM\n" + "HVOyToV7BjjHLPj4sHKNJeV3UvQDHEimUF+IIDBu8oJDqz2XhOdT+yHBTw8imoa4WSr2Rz0Z\n" + "iC3oheGe7IUIarFsNMkd7EgrO3jtZsSOeWmD3n+M\n" + "-----END CERTIFICATE-----\n", + + /* QuoVadis Root CA 3 G3 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFYDCCA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TcHdDrEcDcRjvq30FPuJ7KJBDkzMyFdA0G4Dqs0MjomZmWzwPDCv\n" + "ON9vvKO+KSAnq3T/EyJ43pdSVR6DtVQgA+6uwE9W3jfMw3+qBCe703e4YtsXfJwoIhNzbM8m\n" + "9Yop5w==\n" + "-----END CERTIFICATE-----\n", + + /* DigiCert Assured ID Root G3 */ + "-----BEGIN CERTIFICATE-----\n" + "MIICRjCCAc2gAwIBAgIQC6Fa+h3foLVJRK/NJKBs7DAKBggqhkjOPQQDAzBlMQswCQYDVQQG\n" + "EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29t\n" + "MSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwHhcNMTMwODAxMTIwMDAw\n" + "WhcNMzgwMTE1MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5j\n" + "MRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVk\n" + "IElEIFJvb3QgRzMwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQZ57ysRGXtzbg/WPuNsVepRC0F\n" + "FfLvC/8QdJ+1YlJfZn4f5dwbRXkLzMZTCp2NXQLZqVneAlr2lSoOjThKiknGvMYDOAdfVdp+\n" + "CW7if17QRSAPWXYQ1qAk8C3eNvJsKTmjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/\n" + "BAQDAgGGMB0GA1UdDgQWBBTL0L2p4ZgFUaFNN6KDec6NHSrkhDAKBggqhkjOPQQDAwNnADBk\n" + "AjAlpIFFAmsSS3V0T8gj43DydXLefInwz5FyYZ5eEJJZVrmDxxDnOOlYJjZ91eQ0hjkCMHw2\n" + "U/Aw5WJjOpnitqM7mzT6HtoQknFekROn3aRukswy1vUhZscv6pZjamVFkpUBtA==\n" + "-----END CERTIFICATE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MNKSuIEyExtv4NeF22d+mQrvHRAiGfzZ0JFrabA0UWTW98kndth/Jsw1HKj2Z\n" + "L7tcu7XUIOGZX1NGFdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBHQRFXGU7Aj64GxJUT\n" + "Fy8bJZ918rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/iyK5S9kJRaTe\n" + "pLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTflMrY=\n" + "-----END CERTIFICATE-----\n", + + /* DigiCert Global Root G3 */ + "-----BEGIN CERTIFICATE-----\n" + "MIICPzCCAcWgAwIBAgIQBVVWvPJepDU1w6QP1atFcjAKBggqhkjOPQQDAzBhMQswCQYDVQQG\n" + "EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29t\n" + "MSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMzAeFw0xMzA4MDExMjAwMDBaFw0z\n" + "ODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAX\n" + "BgNVBAsTEHd3dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290\n" + "IEczMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAE3afZu4q4C/sLfyHS8L6+c/MzXRq8NOrexpu8\n" + "0JX28MzQC7phW1FGfp4tn+6OYwwX7Adw9c+ELkCDnOg/QW07rdOkFFk2eJ0DQ+4QE2xy3q6I\n" + "p6FrtUPOZ9wj/wMco+I+o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAd\n" + "BgNVHQ4EFgQUs9tIpPmhxdiuNkHMEWNpYim8S8YwCgYIKoZIzj0EAwMDaAAwZQIxAK288mw/\n" + "EkrRLTnDCgmXc/SIN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SIDqZxubw5lT2yHh17zbqD5daWbQOhTsiedSrnAdyGN\n" + "/4fy3ryM7xfft0kL0fJuMAsaDk527RH89elWsn2/x20Kk4yl0MC2Hb46TpSi125sC8KKfPog\n" + "88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7ILaZRfyHBNVOFBkpdn627G190\n" + "-----END CERTIFICATE-----\n", + + /* USERTrust RSA Certification Authority */ + "-----BEGIN CERTIFICATE-----\n" + "MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCBiDELMAkG\n" + "A1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4w\n" + "HAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0Eg\n" + "Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5\n" + "WjCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNl\n" + "eSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJU\n" + "cnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4IC\n" + "DwAwggIKAoICAQCAEmUXNg7D2wiz0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B\n" + "3PHTsdZ7NygRK0faOca8Ohm0X6a9fZ2jY0K2dvKpOyuR+OJv0OwWIJAJPuLodMkYtJHUYmTb\n" + "f6MG8YgYapAiPLz+E/CHFHv25B+O1ORRxhFnRghRy4YUVD+8M/5+bJz/Fp0YvVGONaanZshy\n" + "Z9shZrHUm3gDwFA66Mzw3LyeTP6vBZY1H1dat//O+T23LLb2VN3I5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gNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB\n" + "/zAKBggqhkjOPQQDAwNoADBlAjA2Z6EWCNzklwBBHU6+4WMBzzuqQhFkoJ2UOQIReVx7Hfpk\n" + "ue4WQrO/isIJxOzksU0CMQDpKmFHjFJKS04YcPbWRNZu9YO6bVi9JNlWSOrvxKJGgYhqOkbR\n" + "qZtNyWHa0V1Xahg=\n" + "-----END CERTIFICATE-----\n", + + /* GlobalSign ECC Root CA - R4 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIB4TCCAYegAwIBAgIRKjikHJYKBN5CsiilC+g0mAIwCgYIKoZIzj0EAwIwUDEkMCIGA1UE\n" + "CxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMw\n" + "EQYDVQQDEwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEk\n" + "MCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxT\n" + "aWduMRMwEQYDVQQDEwpHbG9iYWxTaWduMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuMZ5\n" + "049sJQ6fLjkZHAOkrprlOQcJFspjsbmG+IpXwVfOQvpzofdlQv8ewQCybnMO/8ch5Rikqtlx\n" + "P6jUuc6MHaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE\n" + "FFSwe61FuOJAf/sKbvu+M8k8o4TVMAoGCCqGSM49BAMCA0gAMEUCIQDckqGgE6bPA7DmxCGX\n" + "kPoUVy0D7O48027KqGx2vKLeuwIgJ6iFJzWbVsaj8kfSt24bAgAXqmemFZHe+pTsewv4n4Q=\n" + "-----END CERTIFICATE-----\n", + + /* GlobalSign ECC Root CA - R5 */ + "-----BEGIN CERTIFICATE-----\n" + "MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEkMCIGA1UE\n" + "CxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMw\n" + "EQYDVQQDEwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEk\n" + "MCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxT\n" + "aWduMRMwEQYDVQQDEwpHbG9iYWxTaWduMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9\n" + "Xb/pOdEh+J8LttV7HpI6SFkc8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwz\n" + "ocWdTaRvQZU4f8kehOvRnkmSh5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMC\n" + "AQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYI\n" + "KoZIzj0EAwMDaAAwZQIxAOVpEslu28YxuglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg515dTguD\n" + "nFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7yFz9SO8NdCKoCOJuxUnOxwy8p2Fp8fc74SrL\n" + "+SvzZpA3\n" + "-----END CERTIFICATE-----\n", + + /* Staat der Nederlanden Root CA - G3 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFdDCCA1ygAwIBAgIEAJiiOTANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwG\n" + "A1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJs\n" + "YW5kZW4gUm9vdCBDQSAtIEczMB4XDTEzMTExNDExMjg0MloXDTI4MTExMzIzMDAwM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pEyVa/m6irn0F3H3zbPB+po3u2dfOWBfoqSmuc0iH\n" + "55vKbimhZF8ZE/euBhD/UcabTVUlT5OZEAFTdfETzsemQUHSv4ilf0X8rLiltTMMgsT7B/Zq\n" + "5SWEXwbKwYY5EdtYzXc7LMJMD16a4/CrPmEbUCTCwPTxGfARKbalGAKb12NMcIxHowNDXLld\n" + "RqANb/9Zjr7dn3LDWyvfjFvO5QxGbJKyCqNMVEIYFRIYvdr8unRu/8G2oGTYqV9Vrp9canaW\n" + "2HNnh/tNf1zuacpzEPuKqf2evTY4SUmH9A4U8OmHuD+nT3pajnnUk+S7aFKErGzp85hwVXIy\n" + "+TSrK0m1zSBi5Dp6Z2Orltxtrpfs/J92VoguZs9btsmksNcFuuEnL5O7Jiqik7Ab846+HUCj\n" + "uTaPPoIaGl6I6lD4WeKDRikL40Rc4ZW2aZCaFG+XroHPaO+Zmr615+F/+PoTRxZMzG0IQOeL\n" + "eG9QgkRQP2YGiqtDhFZKDyAthg710tvSeopLzaXoTvFeJiUBWSOgftL2fiFX1ye8FVdMpEbB\n" + "4IMeDExNH08GGeL5qPQ6gqGyeUN51q1veieQA6TqJIc/2b3Z6fJfUEkc7uzXLg==\n" + "-----END CERTIFICATE-----\n", + + /* IdenTrust Commercial Root CA 1 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFYDCCA0igAwIBAgIQCgFCgAAAAUUjyES1AAAAAjANBgkqhkiG9w0BAQsFADBKMQswCQYD\n" + "VQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVy\n" + "Y2lhbCBSb290IENBIDEwHhcNMTQwMTE2MTgxMjIzWhcNMzQwMTE2MTgxMjIzWjBKMQswCQYD\n" + "VQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVy\n" + "Y2lhbCBSb290IENBIDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwgg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cj7oV+wh93nAbowacYXVKV7cndJZ5t+qnt\n" + "ozo00Fl72u1Q8zW/7esUTTHHYPTa8Yec4kjixsU3+wYQ+nVZZjFHKdp2mhzpgq7vmrlR94gj\n" + "mmmVYjzlVYA211QC//G5Xc7UI2/YRYRKW2XviQzdFKcgyxilJbQN+QHwotL0AMh0jqEqSI5l\n" + "2xPE4iUXfeu+h1sXIFRRk0pTAwvsXcoz7WL9RccvW9xYoIA55vrX/hMUpu09lEpCdNTDd1lz\n" + "zY9GvlU47/rokTLql1gEIt44w8y8bckzOmoKaT+gyOpyj4xjhiO9bTyWnpXgSUyqorkqG5w2\n" + "gXjtw+hG4iZZRHUe2XWJUc0QhJ1hYMtd+ZciTY6Y5uN/9lu7rs3KSoFrXgvzUeF0K+l+J6fZ\n" + "mUlO+KWA2yUPHGNiiskzZ2s8EIPGrd6ozRaOjfAHN3Gf8qv8QfXBi+wAN10J5U6A7/qxXDgG\n" + "pRtK4dw4LTzcqx+QGtVKnO7RcGzM7vRX+Bi6hG6H\n" + "-----END CERTIFICATE-----\n", + + /* IdenTrust Public Sector Root CA 1 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBNMQswCQYD\n" + "VQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGlj\n" + "IFNlY3RvciBSb290IENBIDEwHhcNMTQwMTE2MTc1MzMyWhcNMzQwMTE2MTc1MzMyWjBNMQsw\n" + "CQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVi\n" + "bGljIFNlY3RvciBSb290IENBIDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2\n" + "IpT8pEiv6EdrCvsnduTyP4o7ekosMSqMjbCpwzFrqHd2hCa2rIFCDQjrVVi7evi8ZX3yoG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BxxFcbeMX8S\n" + "3OFtm6/n6J91eEyrRjuazr8FGF1NFTwWmhlQBJqymm9li1JfPFgEKCXAZmExfrngdbkaqIHW\n" + "chezxQMxNRF4eKLg6TCMf4DfWN88uieW4oA0beOY02QnrEh+KHdcxiVhJfiFDGX6xDIvpZgF\n" + "5PgLZxYWxoK4Mhn5+bl53B/N66+rDt0b20XkeucC4pVd/GnwU2lhlXV5C15V5jgclKlZM57I\n" + "cXR5f1GJtshquDDIajjDbp7hNxbqBWJMWxJH7ae0s1hWx0nzfxJoCTFx8G34Tkf71oXuxVhA\n" + "GaQdp/lLQzfcaFpPz+vCZHTetBXZ9FRUGi8c15dxVJCO2SCdUyt/q4/i6jC8UDfv8Ue1fXws\n" + "BOxonbRJRBD0ckscZOf85muQ3Wl9af0AVqW3rLatt8o+Ae+c\n" + "-----END CERTIFICATE-----\n", + + /* Entrust Root Certification Authority - G2 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMCVVMxFjAU\n" + "BgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVn\n" + "YWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9y\n" + "aXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0\n" + "aG9yaXR5IC0gRzIwHhcNMDkwNzA3MTcyNTU0WhcNMzAxMjA3MTc1NTU0WjCBvjELMAkGA1UE\n" + "BhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVz\n" + "dC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBm\n" + "b3IgYXV0aG9yaXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmlj\n" + "YXRpb24gQXV0aG9yaXR5IC0gRzIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6\n" + "hLZy254Ma+KZ6TABp3bqMriVQRrJ2mFOWHLP/vaCeb9zYQYKpSfYs1/TRU4cctZOMvJyig/3\n" + "gxnQaoCAAEUesMfnmr8SVycco2gvCoe9amsOXmXzHHfV1IWNcCG0szLni6LVhjkCsbjSR87k\n" + "yUnEO6fe+1R9V77w6G7CebI6C1XiUJgWMhNcL3hWwcKUs/Ja5CeanyTXxuzQmyWC48zCxEXF\n" + "jJd6BmsqEZ+pCm5IO2/b1BEZQvePB7/1U1+cPvQXLOZprE4yTGJ36rfo5bs0vBmLrpxR57d+\n" + "tVOxMyLlbc9wPBr64ptntoP0jaWvYkxN4FisZDQSA/i2jZRjJKRxAgMBAAGjQjBAMA4GA1Ud\n" + "DwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqciZ60B7vfec7aVHUbI2f\n" + "kBJmqzANBgkqhkiG9w0BAQsFAAOCAQEAeZ8dlsa2eT8ijYfThwMEYGprmi5ZiXMRrEPR9RP/\n" + "jTkrwPK9T3CMqS/qF8QLVJ7UG5aYMzyorWKiAHarWWluBh1+xLlEjZivEtRh2woZRkfz6/dj\n" + "wUAFQKXSt/S1mja/qYh2iARVBCuch38aNzx+LaUa2NSJXsq9rD1s2G2v1fN2D807iDginWyT\n" + "msQ9v4IbZT+mD12q/OWyFcq1rca8PdCE6OoGcrBNOTJ4vz4RnAuknZoh8/CbCzB428Hch0P+\n" + "vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmHVHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ\n" + "19xOe4pIb4tF9g==\n" + "-----END CERTIFICATE-----\n", + + /* Entrust Root Certification Authority - EC1 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIC+TCCAoC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n" + "WyVgrtBIGu4G\n" + "-----END CERTIFICATE-----\n", + + /* CFCA EV ROOT */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFjTCCA3WgAwIBAgIEGErM1jANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJDTjEwMC4G\n" + "A1UECgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQD\n" + "DAxDRkNBIEVWIFJPT1QwHhcNMTIwODA4MDMwNzAxWhcNMjkxMjMxMDMwNzAxWjBWMQswCQYD\n" + "VQQGEwJDTjEwMC4GA1UECgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9y\n" + "aXR5MRUwEwYDVQQDDAxDRkNBIEVWIFJPT1QwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK\n" + "AoICAQDXXWvNED8fBVnVBU03sQ7smCuOFR36k0sXgiFxEFLXUWRwFsJVaU2OFW2fvwwbwuCj\n" + "Z9YMrM8irq93VCpLTIpTUnrD7i7es3ElweldPe6hL6P3KjzJIx1qqx2hp/Hz7KDVRM8Vz3Iv\n" + "HWOX6Jn5/ZOkVIBMUtRSqy5J35DNuF++P96hyk0g1CXohClTt7GIH//62pCfCqktQT+x8Rgp\n" + "7hZZLDRJGqgG16iI0gNyejLi6mhNbiyWZXvKWfry4t3uMCz7zEasxGPrb382KzRzEpR/38wm\n" + "nvFyXVBlWY9ps4deMm/DGIq1lY+wejfeWkU7xzbh72fROdOXW3NiGUgthxwG+3SYIElz8AXS\n" + "G7Ggo7cbcNOIabla1jj0Ytwli3i/+Oh+uFzJlU9fpy25IGvPa931DfSCt/SyZi4QKPaXWnuW\n" + "Fo8BGS1sbn85WAZkgwGDg8NNkt0yxoekN+kWzqotaK8KgWU6cMGbrU1tVMoqLUuFG7OA5nBF\n" + "DWteNfB/O7ic5ARwiRIlk9oKmSJgamNgTnYGmE69g60dWIolhdLHZR4tjsbftsbhf4oEIRUp\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+ + /* Certinomis - Root CA */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFkjCCA3qgAwIBAgIBATANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJGUjETMBEGA1UE\n" + "ChMKQ2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxHTAbBgNVBAMTFENlcnRp\n" + "bm9taXMgLSBSb290IENBMB4XDTEzMTAyMTA5MTcxOFoXDTMzMTAyMTA5MTcxOFowWjELMAkG\n" + "A1UEBhMCRlIxEzARBgNVBAoTCkNlcnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAz\n" + "MR0wGwYDVQQDExRDZXJ0aW5vbWlzIC0gUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIP\n" + "ADCCAgoCggIBANTMCQosP5L2fxSeC5yaah1AMGT9qt8OHgZbn1CF6s2Nq0Nn3rD6foCWnoR4\n" + "kkjW4znuzuRZWJflLieY6pOod5tK8O90gC3rMB+12ceAnGInkYjwSond3IjmFPnVAy//ldu9\n" + "n+ws+hQVWZUKxkd8aRi5pwP5ynapz8dvtF4F/u7BUrJ1Mofs7SlmO/NKFoL21prbcpjp3vDF\n" + "TKWrteoB4owuZH9kb/2jJZOLyKIOSY008B/sWEUuNKqEUL3nskoTuLAPrjhdsKkb5nPJWqHZ\n" + "ZkCqqU2mNAKthH6yI8H7KsZn9DS2sJVqM09xRLWtwHkziOC/7aOgFLScCbAK42C++PhmiM1b\n" + "8XcF4LVzbsF9Ri6OSyemzTUK/eVNfaoqoynHWmgE6OXWk6RiwsXm9E/G+Z8ajYJJGYrKWUM6\n" + "6A0ywfRMEwNvbqY/kXPLynNvEiCL7sCCeN5LLsJJwx3tFvYk9CcbXFcx3FXuqB5vbKziRcxX\n" + "V4p1VxngtViZSTYxPDMBbRZKzbgqg4SGm/lg0h9tkQPTYKbVPZrdd5A9NaSfD171UkRpucC6\n" + "3M9933zZxKyGIjK8e2uR73r4F2iw4lNVYC2vPsKD2NkJK/DAZNuHi5HMkesE/Xa0lZrmFAYb\n" + "1TQdvtj/dBxThZngWVJKYe2InmtJiUZ+IFrZ50rlau7SZRFDAgMBAAGjYzBhMA4GA1UdDwEB\n" + "/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTvkUz1pcMw6C8I6tNxIqSSaHh0\n" + "2TAfBgNVHSMEGDAWgBTvkUz1pcMw6C8I6tNxIqSSaHh02TANBgkqhkiG9w0BAQsFAAOCAgEA\n" + "fj1U2iJdGlg+O1QnurrMyOMaauo++RLrVl89UM7g6kgmJs95Vn6RHJk/0KGRHCwPT5iVWVO9\n" + "0CLYiF2cN/z7ZMF4jIuaYAnq1fohX9B0ZedQxb8uuQsLrbWwF6YSjNRieOpWauwK0kDDPAUw\n" + "Pk2Ut59KA9N9J0u2/kTO+hkzGm2kQtHdzMjI1xZSg081lLMSVX3l4kLr5JyTCcBMWwerx20R\n" + "oFAXlCOotQqSD7J6wWAsOMwaplv/8gzjqh8c3LigkyfeY+N/IZ865Z764BNqdeuWXGKRlI5n\n" + "U7aJ+BIJy29SWwNyhlCVCNSNh4YVH5Uk2KRvms6knZtt0rJ2BobGVgjF6wnaNsIbW0G+YSrj\n" + "cOa4pvi2WsS9Iff/ql+hbHY5ZtbqTFXhADObE5hjyW/QASAJN1LnDE8+zbz1X5YnpyACleAu\n" + "6AdBBR8Vbtaw5BngDwKTACdyxYvRVB9dSsNAl35VpnzBMwQUAR1JIGkLGZOdblgi90AMRgwj\n" + "Y/M50n92Uaf0yKHxDHYiI0ZSKS3io0EHVmmY0gUJvGnHWmHNj4FgFU2A3ZDifcRQ8ow7bkrH\n" + "xuaAKzyBvBGAFhAn1/DNP3nMcyrDflOR1m749fPH0FFNjkulW+YZFzvWgQncItzujrnEj1Ph\n" + "Z7szuIgVRs/taTX/dQ1G885x4cVrhkIGuUE=\n" + "-----END CERTIFICATE-----\n", + + /* OISTE WISeKey Global Root GB CA */ + "-----BEGIN CERTIFICAT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Vqc1U2dAgrSS5tmS0YHF2Wtn2yIANwiieDhZNRnvDF5YTy7ykHNXGoAyDw4jlivAgMB\n" + "AAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBQuFqlK\n" + "GLXLzPVvUPMjX/hd56zwyDANBgkqhkiG9w0BAQsFAAOCAQEAtXP4A9xZWx126aMqe5Aosk3A\n" + "M0+qmrHUuOQn/6mWmc5G4G18TKI4pAZw8PRBEew/R40/cof5O/2kbytTAOD/OblqBw7rHRz2\n" + "onKQy4I9EYKL0rufKq8h5mOGnXkZ7/e7DDWQw4rtTw/1zBLZpD67oPwglV9PJi8RI4NOdQcP\n" + "v5vRtB3pEAT+ymCPoky4rc/hkA/NrgrHXXu3UNLUYfrVFdvXn4dRVOul4+vJhaAlIDf7js4M\n" + "NIThPIGyd05DpYhfhmehPea0XGG2Ptv+tyjFogeutcrKjSoS75ftwjCkySp6+/NNIxuZMzSg\n" + "LvWpCz/UXeHPhJ/iGcJfitYgHuNztw==\n" + "-----END CERTIFICATE-----\n", + + /* Certum Trusted Network CA 2 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIF0jCCA7qgAwIBAgIQIdbQSk8lD8kyN/yqXhKN6TANBgkqhkiG9w0BAQ0FADCBgDELMAkG\n" + "A1UEBhMCUEwxIjAgBgNVBAoTGVVuaXpldG8gVGVjaG5vbG9naWVzIFMuQS4xJzAlBgNVBAsT\n" + "HkNlcnR1bSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEkMCIGA1UEAxMbQ2VydHVtIFRydXN0\n" + "ZWQgTmV0d29yayBDQSAyMCIYDzIwMTExMDA2MDgzOTU2WhgPMjA0NjEwMDYwODM5NTZaMIGA\n" + "MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBUZWNobm9sb2dpZXMgUy5BLjEnMCUG\n" + "A1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MSQw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+mLIMb4Ck4uWBzrM9DPhmDJ\n" + "2vuAL55MYIR4PSFk1vtBHxgP58l1cb29XN40hz5BsA72udY/CROWFC/emh1auVbONTqwX3BN\n" + "XuMp8SMoclm2q8KMZiYcdywmdjWLKKdpoPk79SPdhRB0yZADVpHnr7pH1BKXESLjokmUbOe3\n" + "lEu6LaTaM4tMpkT/WjzGHWTYtTHkpjx6qFcL2+1hGsvxznN3Y6SHb0xRONbkX8eftoEq5IVI\n" + "eVheO/jbAoJnwTnbw3RLPTYe+SmTiGhbqEQZIfCn6IENLOiTNrQ3ssqwGyZ6miUfmpqAnksq\n" + "P/ujmv5zMnHCnsZy4YpoJ/HkD7TETKVhk/iXEAcqMCWpuchxuO9ozC1+9eB+D4Kob7a6bIND\n" + "d82Kkhehnlt4Fj1F4jNy3eFmypnTycUm/Q1oBEauttmbjL4ZvrHG8hnjXALKLNhvSgfZyTXa\n" + "QHXyxKcZb55CEJh15pWLYLztxRLXis7VmFxWlgPF7ncGNf/P5O4/E2Hu29othfDNrp2yGAlF\n" + "w5Khchf8R7agCyzxxN5DaAhqXzvwdmP7zAYspsbiDrW5viSP\n" + "-----END CERTIFICATE-----\n", + + /* Hellenic Academic and Research Institutions RootCA 2015 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIGCzCCA/OgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBpjELMAkGA1UEBhMCR1IxDzANBgNV\n" + "BAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIElu\n" + "c3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNVBAMTN0hlbGxlbmljIEFjYWRlbWlj\n" + "IGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgUm9vdENBIDIwMTUwHhcNMTUwNzA3MTAxMTIx\n" + "WhcNNDAwNjMwMTAxMTIxWjCBpjELMAkGA1UEBhMCR1IxDzANBgNVBAcTBkF0aGVuczFEMEIG\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qd83EkVAswDQYJKoZI\n" + "hvcNAQELBQADggIBAHW7bVRLqhBYRjTyYtcWNl0IXtVsyIe9tC5G8jH4fOpCtZMWVdyhDBKg\n" + "2mF+D1hYc2Ryx+hFjtyp8iY/xnmMsVMIM4GwVhO+5lFc2JsKT0ucVlMC6U/2DWDqTUJV6Hwb\n" + "ISHTGzrMd/K4kPFox/la/vot9L/J9UUbzjgQKjeKeaO04wlshYaT/4mWJ3iBj2fjRnRUjtkN\n" + "aeJK9E10A/+yd+2VZ5fkscWrv2oj6NSU4kQoYsRL4vDY4ilrGnB+JGGTe08DMiUNRSQrlrRG\n" + "ar9KC/eaj8GsGsVn82800vpzY4zvFrCopEYq+OsS7HK07/grfoxSwIuEVPkvPuNVqNxmsdnh\n" + "X9izjFk0WaSrT2y7HxjbdavYy5LNlDhhDgcGH0tGEPEVvo2FXDtKK4F5D7Rpn0lQl033DlZd\n" + "wJVqwjbDG2jJ9SrcR5q+ss7FJej6A7na+RZukYT1HCjI/CbM1xyQVqdfbzoEvM14iQuODy+j\n" + "qk+iGxI9FghAD/FGTNeqewjBCvVtJ94Cj8rDtSvK6evIIVM4pcw72Hc3MKJP2W/R8kCtQXoX\n" + "xdZKNYm3QdV8hn9VTYNKpXMgwDqvkPGaJI7ZjnHKe7iG2rKPmT4dEw0SEe7Uq/DpFXYC5ODf\n" + "qiAeW2GFZECpkJcNrVPSWh2HagCXZWK0vm9qp/UsQu0yrbYhnr68\n" + "-----END CERTIFICATE-----\n", + + /* Hellenic Academic and Research Institutions ECC RootCA 2015 */ + "-----BEGIN CERTIFICATE-----\n" + "MIICwzCCAkqgAwIBAgIBADAKBggqhkjOPQQDAjCBqjELMAkGA1UEBhMCR1IxDzANBgNVBAcT\n" + "BkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3Rp\n" + "dHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxRDBCBgNVBAMTO0hlbGxlbmljIE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/9ARP67Jpi6Yb+tmLSbkyU+8B1RXxlDPiyN8+sD8+N\n" + "b/kZ94/sHvJwnvDKuO+3/3Y3dlv2bojzr2IyIpMNOmqOFGYMLVN0V2Ue1bLdI4E7pWYjJ2cJ\n" + "j+F3qkPNZVEI7VFY/uY5+ctHhKQV8Xa7pO6kO8Rf77IzlhEYt8llvhjho6Tc+hj507wTmzl6\n" + "NLrTQfv6MooqtyuGC2mDOL7Nii4LcK2NJpLuHvUBKwrZ1pebbuCoGRw6IYsMHkCtA+fdZn71\n" + "uSANA+iW+YJF1DngoABd15jmfZ5nc8OaKveri6E6FO80vFIOiZiaBECEHX5FaZNXzuvO+FB8\n" + "TxxuBEOb+dY7Ixjp6o7RTUaN8Tvkasq6+yO3m/qZASlaWFot4/nUbQ4mrcFuNLwy+AwF+mWj\n" + "2zs3gyLp1txyM/1d8iC9djwj2ij3+RvrWWTV3F9yfiD8zYm1kGdNYno/Tq0dwzn+evQoFt9B\n" + "9kiABdcPUXmsEKvU7ANm5mqwujGSQkBqvjrTcuFqN1W8rB2Vt2lh8kORdOag0wokRqEIr9ba\n" + "RRmW1FMdW4R58MD3R++Lj8UGrp1MYp3/RgT408m2ECVAdf4WqslKYIYvuu8wd+RU4riEmViA\n" + "qhOLUTpPSPaLtrM=\n" + "-----END CERTIFICATE-----\n", + + /* Amazon Root CA 1 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsFADA5MQsw\n" + "CQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSAx\n" + "MB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNV\n" + "BAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEB\n" + "BQADggEPADCCAQoCggEBALJ4gHHKeNXjca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOg\n" + "Q3pOsqTQNroBvo3bSMgHFzZM9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9\n" + "tBb6dNqcmzU5L/qwIFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAw\n" + "hmahRWa6VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L\n" + "93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQmjgSubJrI\n" + "qg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYE\n" + "FIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUAA4IBAQCY8jdaQZChGsV2USgg\n" + "NiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDIU5PMCCjjmCXPI6T53iHTfIUJrU6adTrC\n" + "C2qJeHZERxhlbI1Bjjt/msv0tadQ1wUsN+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V\n" + "8viTO96LXFvKWlJbYK8U90vvo/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJc\n" + "JmApzyMZFo6IQ6XU5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeX\n" + "eGADbkpyrqXRfboQnoZsG4q5WTP468SQvvG5\n" + "-----END CERTIFICATE-----\n", + + /* Amazon Root CA 2 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFQTCCAymgAwIBAgITBmyf0pY1hp8KD+WGePhbJruKNzANBgkqhkiG9w0BAQwFADA5MQsw\n" + "CQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBD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m9Zh6O+oAA7CXDpO8Wqj2\n" + "LIxyh6mx/H9z/WNxeKWHWc8w4Q0QshNabYL1auaAn6AFC2jkR2vHat+2/XcycuUY+gn0oJMs\n" + "XdKMdYV2ZZAMA3m3MSNjrXiDCYZohMr/+c8mmpJ5581LxedhpxfL86kSk5Nrp+gvU5LEYFiw\n" + "zAJRGFuFjWJZY7attN6a+yb3ACfAXVU3dJnJUH/jWS5E4ywl7uxMMne0nxrpS10gxdr9HIcW\n" + "xkPo1LsmmkVwXqkLN1PiRnsn/eBG8om3zEK2yygmbtmlyTrIQRNg91CMFa6ybRoVGld45pIq\n" + "2WWQgj9sAq+uEjonljYE1x2igGOpm/HlurR8FLBOybEfdF849lHqm/osohHUqS0nGkWxr7JO\n" + "cQ3AWEbWaQbLU8uz/mtBzUF+fUwPfHJ5elnNXkoOrJupmHN5fLT0zLm4BwyydFy4x2+IoZCn\n" + "9Kr5v2c69BoVYh63n749sSmvZ6ES8lgQGVMDMBu4Gon2nL2XA46jCfMdiyHxtN/kHNGfZQIG\n" + "6lzWE7OE76KlXIx3KadowGuuQNKotOrN8I1LOJwZmhsoVLiJkO/KdYE+HvJkJMcYr07/R54H\n" + "9jVlpNMKVv/1F2Rs76giJUmTtt8AF9pYfl3uxRuw0dFfIRDH+fO6AgonB8Xx1sfT4PsJYGw=\n" + "-----END CERTIFICATE-----\n", + + /* Amazon Root CA 3 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIBtjCCAVugAwIBAgITBmyf1XSXNmY/Owua2eiedgPySjAKBggqhkjOPQQDAjA5MQswCQYD\n" + "VQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSAzMB4X\n" + "DTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoT\n" + "BkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgMzBZMBMGByqGSM49AgEGCCqGSM49\n" + "AwEHA0IABCmXp8ZBf8ANm+gBG1bG8lKlui2yEujSLtf6ycXYqm0fc4E7O5hrOXwzpcVOho6A\n" + "F2hiRVd9RFgdszflZwjrZt6jQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGG\n" + "MB0GA1UdDgQWBBSrttvXBp43rDCGB5Fwx5zEGbF4wDAKBggqhkjOPQQDAgNJADBGAiEA4IWS\n" + "oxe3jfkrBqWTrBqYaGFy+uGh0PsceGCmQ5nFuMQCIQCcAu/xlJyzlvnrxir4tiz+OpAUFteM\n" + "YyRIHN8wfdVoOw==\n" + "-----END CERTIFICATE-----\n", + + /* Amazon Root CA 4 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIB8jCCAXigAwIBAgITBmyf18G7EEwpQ+Vxe3ssyBrBDjAKBggqhkjOPQQDAzA5MQswCQYD\n" + "VQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSA0MB4X\n" + "DTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoT\n" + "BkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgNDB2MBAGByqGSM49AgEGBSuBBAAi\n" + "A2IABNKrijdPo1MN/sGKe0uoe0ZLY7Bi9i0b2whxIdIA6GO9mif78DluXeo9pcmBqqNbIJhF\n" + "XRbb/egQbeOc4OO9X4Ri83BkM6DLJC9wuoihKqB1+IGuYgbEgds5bimwHvouXKNCMEAwDwYD\n" + "VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFNPsxzplbszh2naaVvuc\n" + "84ZtV+WBMAoGCCqGSM49BAMDA2gAMGUCMDqLIfG9fhGt0O9Yli/W651+kI0rz2ZVwyzjKKlw\n" + "CkcO8DdZEv8tmZQoTipPNU0zWgIxAOp1AE47xDqUEpHJWEadIRNyp4iciuRMStuW1KyLa2tJ\n" + "ElMzrdfkviT8tQp21KW8EA==\n" + "-----END CERTIFICATE-----\n", + + /* LuxTrust Global Root 2 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFwzCCA6ugAwIBAgIUCn6m30tEntpqJIWe5rgV0xZ/u7EwDQYJKoZIhvcNAQELBQAwRjEL\n" + "MAkGA1UEBhMCTFUxFjAUBgNVBAoMDUx1eFRydXN0IFMuQS4xHzAdBgNVBAMMFkx1eFRydXN0\n" + "IEdsb2JhbCBSb290IDIwHhcNMTUwMzA1MTMyMTU3WhcNMzUwMzA1MTMyMTU3WjBGMQswCQYD\n" + "VQQGEwJMVTEWMBQGA1UECgwNTHV4VHJ1c3QgUy5BLjEfMB0GA1UEAwwWTHV4VHJ1c3QgR2xv\n" + "YmFsIFJvb3QgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANeFl78RmOnwYoNM\n" + "PIf5U2o3C/IPPIfOb9wmKb3FibrJgz337spbxm1Jc7TJRqMbNBM/wYlFV/TZsfs2ZUv7COJI\n" + "cRHIbjuend+JZTemhfY7RBi2xjcwYkSSl2l9QjAk5A0MiWtj3sXh306pFGxT4GHO9hcvHTy9\n" + "5iJMHZP1EMShduxq3sVs35a0VkBCwGKSMKEtFZSg0iAGCW5qbeXrt77U8PEVfIvmTroTzEsn\n" + "Xpk8F12PgX8zPU/TPxvsXD/wPEx1bvKm1Z3aLQdjAsZy6ZS8TEmVT4hSyNvoaYL4zDRbIvCG\n" + "p4m9SAptZoFtyMhk+wHh9OHe2Z7d21vUKpkmFRseTJIpgp7VkoGSQXAZ96Tlk0u8d2cx3Rz9\n" + "MXANF5kM+Qw5GSoXtTBxVdUPrljhPS80m8+f9niFwpN6cj5mj5wWEWCPnolvZ77gR1o7DJpn\n" + "i89Gxq44o/KnvObWhWszJHAiS8sIm7vI+AIpHb4gDEa/a4ebsypmQjVGbKq6rfmYe+lQVRQx\n" + "v7HaLe2ArWgk+2mr2HETMO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aJMobtNeWOWyu8Q6qp31IiyBMz2TWuJdGsE7RKlY6oJO9r4Ak4Ap+58rVyuiFVdw2\n" + "KuGUaJPHZnJED4AhMmwlxyOAgwrr\n" + "-----END CERTIFICATE-----\n", + + /* TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIEYzCCA0ugAwIBAgIBATANBgkqhkiG9w0BAQsFADCB0jELMAkGA1UEBhMCVFIxGDAWBgNV\n" + "BAcTD0dlYnplIC0gS29jYWVsaTFCMEAGA1UEChM5VHVya2l5ZSBCaWxpbXNlbCB2ZSBUZWtu\n" + "b2xvamlrIEFyYXN0aXJtYSBLdXJ1bXUgLSBUVUJJVEFLMS0wKwYDVQQLEyRLYW11IFNlcnRp\n" + "ZmlrYXN5b24gTWVya2V6aSAtIEthbXUgU00xNjA0BgNVBAMTLVRVQklUQUsgS2FtdSBTTSBT\n" + "U0wgS29rIFNlcnRpZmlrYXNpIC0gU3VydW0gMTAeFw0xMzExMjUwODI1NTVaFw00MzEwMjUw\n" + "ODI1NTVaMIHSMQswCQYDVQQGEwJUUjEYMBYGA1UEBxMPR2ViemUgLSBLb2NhZWxpMUIwQAYD\n" + "VQQKEzlUdXJraXllIEJpbGltc2VsIHZlIFRla25vbG9qaWsgQXJhc3Rpcm1hIEt1cnVtdSAt\n" + "IFRVQklUQUsxLTArBgNVBAsTJEthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppIC0gS2FtdSBT\n" + "TTE2MDQGA1UEAxMtVFVCSVRBSyBLYW11IFNNIFNTTCBLb2sgU2VydGlmaWthc2kgLSBTdXJ1\n" + "bSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr3UwM6q7a9OZLBI3hNmNe5eA\n" + "027n/5tQlT6QlVZC1xl8JoSNkvoBHToP4mQ4t4y86Ij5iySrLqP1N+RAjhgleYN1Hzv/bKjF\n" + "xlb4tO2KRKOrbEz8HdDc72i9z+SqzvBV96I01INrN3wcwv61A+xXzry0tcXtAA9TNypN9E8M\n" + "g/uGz8v+jE69h/mniyFXnHrfA2eJLJ2XYacQuFWQfw4tJzh03+f92k4S400VIgLI4OD8D62K\n" + "18lUUMw7D8oWgITQUVbDjlZ/iSIzL+aFCr2lqBs23tPcLG07xxO9WSMs5uWk99gL7eqQQESo\n" + "lbuT1dCANLZGeA4fAJNG4e7p+exPFwIDAQABo0IwQDAdBgNVHQ4EFgQUZT/HiobGPN08VFw1\n" + "+DrtUgxHV8gwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL\n" + "BQADggEBACo/4fEyjq7hmFxLXs9rHmoJ0iKpEsdeV31zVmSAhHqT5Am5EM2fKifhAHe+SMg1\n" + "qIGf5LgsyX8OsNJLN13qudULXjS99HMpw+0mFZx+CFOKWI3QSyjfwbPfIPP54+M638yclNhO\n" + "T8NrF7f3cuitZjO1JVOr4PhMqZ398g26rrnZqsZr+ZO7rqu4lzwDGrpDxpa5RXI4s6ehlj2R\n" + "e37AIVNMh+3yC1SVUZPVIqUNivGTDj5UDrDYyU7c8jEyVupk+eq1nRZmQnLzf9OxMUP8pI4X\n" + "8W0jq5Rm+K37DwhuJi1/FwcJsoz7UMCflo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM=\n" + "-----END CERTIFICATE-----\n", + + /* GDCA TrustAUTH R5 ROOT */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFiDCCA3CgAwIBAgIIfQmX/vBH6nowDQYJKoZIhvcNAQELBQAwYjELMAkGA1UEBhMCQ04x\n" + "MjAwBgNVBAoMKUdVQU5HIERPTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZIENPLixMVEQuMR8w\n" + "HQYDVQQDDBZHRENBIFRydXN0QVVUSCBSNSBST09UMB4XDTE0MTEyNjA1MTMxNVoXDTQwMTIz\n" + "MTE1NTk1OVowYjELMAkGA1UEBhMCQ04xMjAwBgNVBAoMKUdVQ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dtJnJO29fDMylyrHBYZmDRd9FBUb1Ov9H5r2\n" + "XpdptxolpAqzkT9fNqyL7FeoPueBihhXOYV0GkLH6VsTX4/5COmSdI31R9KrO9b7eGZONn35\n" + "6ZLpBN79SWP8bfsUcZNnL0dKt7n/HipzcEYwv1ryL3ml4Y0M2fmyYzeMN2WFcGpcWwlyua1j\n" + "PLHd+PwyvzeG5LuOmCd+uh8W4XAR8gPfJWIyJyYYMoSf/wA6E7qaTfRPuBRwIrHKK5DOKcFw\n" + "9C+df/KQHtZa37dG/OaG+svgIHZ6uqbL9XzeYqWxi+7egmaKTjowHz+Ay60nugxe19CxVsp3\n" + "cbK1daFQqUBDF8Io2c9Si1vIY9RCPqAzekYu9wogRlR+ak8x8YF+QnQ4ZXMn7sZ8uI7XpTrX\n" + "mKGcjBBV09tL7ECQ8s1uV9JiDnxXk7Gnbc2dg7sq5+W2O3FYrf3RRbxake5TFW/TRQl1brqQ\n" + "XR4EzzffHqhmsYzmIGrv/EhOdJhCrylvLmrH+33RZjEizIYAfmaDDEL0vTSSwxrqT8p+ck0L\n" + "cIymSLumoRT2+1hEmRSuqguTaaApJUqlyyvdimYHFngVV3Eb7PVHhPOeMTd61X8kreS8/f3M\n" + "boPoDKi3QWwH3b08hpcv0g==\n" + "-----END CERTIFICATE-----\n", + + /* TrustCor RootCert CA-1 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIEMDCCAxigAwIBAgIJANqb7HHzA7AZMA0GCSqGSIb3DQEBCwUAMIGkMQswCQYDVQQGEwJQ\n" + "QTEPMA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEgQ2l0eTEkMCIGA1UECgwbVHJ1\n" + "c3RDb3IgU3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5UcnVzdENvciBDZXJ0aWZpY2F0\n" + "ZSBBdXRob3JpdHkxHzAdBgNVBAMMFlRydXN0Q29yIFJvb3RDZXJ0IENBLTEwHhcNMTYwMjA0\n" + "MTIzMj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ARtZ+odnbb\n" + "3w9U73NjKYKtR8aja+3+XzP4Q1HpGjORMRegdMTUpwHmspI+ap3tDvl0mEDTPwOABoJA6LHi\n" + "p1GnHYMma6ve+heRK9jGrB6xnhkB1Zem6g23xFUfJ3zSCNV2HykVh0A53ThFEXXQmqc04L/N\n" + "yFIduUd+Dbi7xgz2c1cWWn5DkR9VOsZtRASqnKmcp0yJF4OuowReUoCLHhIlERnXDH19MURB\n" + "6tuvsBzvgdAsxZohmz3tQjtQJvLsznFhBmIhVE5/wZ0+fyCMgMsq2JdiyIMzkX2woloPV+g7\n" + "zPIlstR8L+xNxqE6FXrntl019fZISjZFZtS6mFjBAgMBAAGjYzBhMB0GA1UdDgQWBBREnkj1\n" + "zG1I1KBLf/5ZJC+Dl5mahjAfBgNVHSMEGDAWgBREnkj1zG1I1KBLf/5ZJC+Dl5mahjAPBgNV\n" + "HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsFAAOCAQEABT41XBVw\n" + "m8nHc2FvcivUwo/yQ10CzsSUuZQRg2dd4mdsdXa/uwyqNsatR5Nj3B5+1t4u/ukZMjgDfxT2\n" + "AHMsWbEhBuH7rBiVDKP/mZb3Kyeb1STMHd3BOuCYRLDE5D53sXOpZCz2HAF8P11FhcCF5yWP\n" + "ldwX8zyfGm6wyuMdKulMY/okYWLW2n62HGz1Ah3UKt1VkOsqEUc8Ll50soIipX1TH0XsJ5F9\n" + "5yIW6MBoNtjG8U+ARDL54dHRHareqKucBK+tIA5kmE2la8BIWJZpTdwHjFGTot+fDz2LYLSC\n" + "jaoITmJF4PkL0uDgPFveXHEnJcLmA4GLEFPjx1WitJ/X5g==\n" + "-----END CERTIFICATE-----\n", + + /* SSL.com Root Certification Authority RSA */ + "-----BEGIN CERTIFICATE-----\n" + "MIIF3TCCA8WgAwIBAgIIeyyb0xaAMpkwDQYJKoZIhvcNAQELBQAwfDELMAkGA1UEBhMCVVMx\n" + "DjAMBgNVBAgMBVRle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\n" + "YxnP/Okm+Mpxm3+T/jRnhE6Z6/yzeAkzcLpmpnbtG3PrGqUNxCITIJRWCk4sbE6x/c+cCbqi\n" + "M+2HAgMBAAGjYzBhMB0GA1UdDgQWBBTdBAkHovV6fVJTEpKV7jiAJQ2mWTAPBgNVHRMBAf8E\n" + "BTADAQH/MB8GA1UdIwQYMBaAFN0ECQei9Xp9UlMSkpXuOIAlDaZZMA4GA1UdDwEB/wQEAwIB\n" + "hjANBgkqhkiG9w0BAQsFAAOCAgEAIBgRlCn7Jp0cHh5wYfGVcpNxJK1ok1iOMq8bs3AD/CUr\n" + "dIWQPXhq9LmLpZc7tRiRux6n+UBbkflVma8eEdBcHadm47GUBwwyOabqG7B52B2ccETjit3E\n" + "+ZUfijhDPwGFpUenPUayvOUiaPd7nNgsPgohyC0zrL/FgZkxdMF1ccW+sfAjRfSda/wZY52j\n" + "vATGGAslu1OJD7OAUN5F7kR/q5R4ZJjT9ijdh9hwZXT7DrkT66cPYakylszeu+1jTBi7qUD3\n" + "oFRuIIhxdRjqerQ0cuAjJ3dctpDqhiVAq+8zD8ufgr6iIPv2tS0a5sKFsXQP+8hlAqRSAUfd\n" + "SSLBv9jra6x+3uxjMxW3IwiPxg+NQVrdjsW5j+VFP3jbutIbQLH+cU0/4IGiul607BXgk90I\n" + "H37hVZkLId6Tngr75qNJvTYw/ud3sqB1l7UtgYgXZSD32pAAn8lSzDLKNXz1PQ/YK9f1JmzJ\n" + "BjSWFupwWRoyeXkLtoh/D1JIPb9s2KJELtFOt3JY04kTlf5Eq/jXixtunLwsoFvVagCvXzfh\n" + "1foQC5ichucmj87w7G6KVwuA406ywKBjYZC6VWg3dGq2ktufoYYitmUnDuy2n0Jg5GfCtdpB\n" + "C8TTi2EbvPofkSvXRAdeuims2cXp71NIWuuA8ShYIc2wBlX7Jz9TkHCpBB5XJ7k=\n" + "-----END CERTIFICATE-----\n", + + /* SSL.com Root Certification Authority ECC */ + "-----BEGIN CERTIFICATE-----\n" + "MIICjTCCAhSgAwIBAgIIdebfy8FoW6gwCgYIKoZIzj0EAwIwfDELMAkGA1UEBhMCVVMxDjAM\n" + "BgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9TU0wgQ29ycG9yYXRp\n" + "b24xMTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBFQ0Mw\n" + "HhcNMTYwMjEyMTgxNDAzWhcNNDEwMjEyMTgxNDAzWjB8MQswCQYDVQQGEwJVUzEOMAwGA1UE\n" + "CAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjEx\n" + "MC8GA1UEAwwoU1NMLmNvbSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAG\n" + "ByqGSM49AgEGBSuBBAAiA2IABEVuqVDEpiM2nl8ojRfLliJkP9x6jh3MCLOicSS6jkm5BBtH\n" + "llirLZXI7Z4INcgn64mMU1jrYor+8FsPazFSY0E7ic3s7LaNGdM0B9y7xgZ/wkWV7Mt/qCPg\n" + "CemB+vNH06NjMGEwHQYDVR0OBBYEFILRhXMw5zUE044CkvvlpNHEIejNMA8GA1UdEwEB/wQF\n" + "MAMBAf8wHwYDVR0jBBgwFoAUgtGFczDnNQTTjgKS++Wk0cQh6M0wDgYDVR0PAQH/BAQDAgGG\n" + "MAoGCCqGSM49BAMCA2cAMGQCMG/n61kRpGDPYbCWe+0F+S8Tkdzt5fxQaxFGRrMcIQBiu77D\n" + "5+jNB5n5DQtdcj7EqgIwH7y6C+IwJPt8bYBVCpk+gA0z5Wajs6O7pdWLjwkspl1+4vAHCGht\n" + "0nxpbl/f5Wpl\n" + "-----END CERTIFICATE-----\n", + + /* SSL.com EV Root Certification Authority RSA R2 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIF6zCCA9OgAwIBAgIIVrYpzTS8ePYwDQYJKoZIhvcNAQELB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+ /* SSL.com EV Root Certification Authority ECC */ + "-----BEGIN CERTIFICATE-----\n" + "MIIClDCCAhqgAwIBAgIILCmcWxbtBZUwCgYIKoZIzj0EAwIwfzELMAkGA1UEBhMCVVMxDjAM\n" + "BgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9TU0wgQ29ycG9yYXRp\n" + "b24xNDAyBgNVBAMMK1NTTC5jb20gRVYgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBF\n" + "Q0MwHhcNMTYwMjEyMTgxNTIzWhcNNDEwMjEyMTgxNTIzWjB/MQswCQYDVQQGEwJVUzEOMAwG\n" + "A1UECAwFVGV4YXMxEDAOBgNVBAcMB0hvdXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlv\n" + "bjE0MDIGA1UEAwwrU1NMLmNvbSBFViBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVD\n" + "QzB2MBAGByqGSM49AgEGBSuBBAAiA2IABKoSR5CYG/vvw0AHgyBO8TCCogbR8pKGYfL2IWjK\n" + "AMTH6kMAVIbc/R/fALhBYlzccBYy3h+Z1MzFB8gIH2EWB1E9fVwHU+M1OIzfzZ/ZLg1Kthku\n" + "WnBaBu2+8KGwytAJKaNjMGEwHQYDVR0OBBYEFFvKXuXe0oGqzagtZFG22XKbl+ZPMA8GA1Ud\n" + "EwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUW8pe5d7SgarNqC1kUbbZcpuX5k8wDgYDVR0PAQH/\n" + "BAQDAgGGMAoGCCqGSM49BAMCA2gAMGUCMQCK5kCJN+vp1RPZytRrJPOwPYdGWBrssd9v+1a6\n" + "cGvHOMzosYxPD/fxZ3YOg9AeUY8CMD32IygmTMZgh5Mmm7I1HrrW9zzRHM76JTymGoEVW/MS\n" + "D2zuZYrJh6j5B+BimoxcSg==\n" + "-----END CERTIFICATE-----\n", + + /* GlobalSign Root CA - R6 */ + "-----BEGIN CERTIFIC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" + "cIN5kZeR1BonvzceMgfYFGM8KEyvAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB\n" + "Af8EBTADAQH/MB0GA1UdDgQWBBSubAWjkxPioufi1xzWx/B/yGdToDAfBgNVHSMEGDAWgBSu\n" + "bAWjkxPioufi1xzWx/B/yGdToDANBgkqhkiG9w0BAQwFAAOCAgEAgyXt6NH9lVLNnsAEoJFp\n" + "5lzQhN7craJP6Ed41mWYqVuoPId8AorRbrcWc+ZfwFSY1XS+wc3iEZGtIxg93eFyRJa0lV7A\n" + "e46ZeBZDE1ZXs6KzO7V33EByrKPrmzU+sQghoefEQzd5Mr6155wsTLxDKZmOMNOsIeDjHfrY\n" + "BzN2VAAiKrlNIC5waNrlU/yDXNOd8v9EDERm8tLjvUYAGm0CuiVdjaExUd1URhxN25mW7xoc\n" + "BFymFe944Hn+Xds+qkxV/ZoVqW/hpvvfcDDpw+5CRu3CkwWJ+n1jez/QcYF8AOiYrg54NMMl\n" + "+68KnyBr3TsTjxKM4kEaSHpzoHdpx7Zcf4LIHv5YGygrqGytXm3ABdJ7t+uA/iU3/gKbaKxC\n" + "XcPu9czc8FB10jZpnOZ7BN9uBmm23goJSFmH63sUYHpkqmlD75HHTOwY3WzvUy2MmeFe8nI+\n" + "z1TIvWfspA9MRf/TuTAjB0yPEL+GltmZWrSZVxykzLsViVO6LAUP5MSeGbEYNNVMnbrt9x+v\n" + "JJUEeKgDu+6B5dpffItKoZB0JaezPkvILFa9x8jvOOJckvB595yEunQtYQEgfn7R8k8HWV+L\n" + "LUNS60YMlOH1Zkd5d9VUWx+tJDfLRVpOoERIyNiwmcUVhAn21klJwGW45hpxbqCo8YLoRT5s\n" + "1gLXCmeDBVrJpBA=\n" + "-----END CERTIFICATE-----\n", + + /* OISTE WISeKey Global Root GC CA */ + "-----BEGIN CERTIFICATE-----\n" + "MIICaTCCAe+gAwIBAgIQISpWDK7aDKtARb8roi066jAKBggqhkjOPQQDAzBtMQswCQYDV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Asznyvgyv3SjgofQXSlfKqE1OXyHuY3UjKcC9FhHb8owbZEKTV1d5iyfNm9\n" + "dKyKaOOpMQkpAWBz40d8U6iQSifvS9efk+eCNs6aaAyC58/UEBZvXw6ZXPYfcX3v73svfuo2\n" + "1pdwCxXu11xWajOl40k4DLh9+42FpLFZXvRq4d2h9mREruZRgyFmxhE+885H7pwoHyXa/6xm\n" + "ld01D1zvICxi/ZG6qcz8WpyTgYMpl0p8WnK0OdC3d8t5/Wk6kjftbjhlRn7pYL15iJdfOBL0\n" + "7q9bgsiG1eGZbYwE8na6SfZu6W0eX6DvJ4J2QPim01hcDyxC2kLGe4g0x8HYRZvBPsVhHdlj\n" + "UEn2NIVq4BjFbkerQUIpm/ZgDdIx02OYI5NaAIFItO/Nis3Jz5nu2Z6qNuFoS3FJFDYoOj0d\n" + "zpqPJeaAcWErtXvM+SUWgeExX6GjfhaknBZqlxi9dnKlC54dNuYvoS++cJEPqOba+MSSQGwl\n" + "fnuzCdyyF62ARPBopY+Udf90WuioAnwMCeKpSwughQtiue+hMZL77/ZRBIls6Kl0obsXs7X9\n" + "SQ98POyDGCBDTtWTurQ0sR8WNh8M5mQ5Fkzc4P4dyKliPUDqysU0ArSuiYgzNdwsE3PYJ/HQ\n" + "cu51OyLemGhmW/HGY0dVHLqlCFF1pkgl\n" + "-----END CERTIFICATE-----\n", + + /* GTS Root R2 */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFWjCCA0KgAwIBAgIQbkepxlqz5yDFMJo/aFLybzANBgkqhkiG9w0BAQwFADBHMQswCQYD\n" + "VQQGEwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxML\n" + "R1RTIFJvb3QgUjIwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQG\n" + "EwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1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Oyxfi//qXGdGIRFBEFVbivqJn+7kAHjSxm65FSWRQmx\n" + "1WyRRK2EE46ajA2ADDL24CejQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/\n" + "MB0GA1UdDgQWBBTB8Sa6oC2uhYHP0/EqEr24Cmf9vDAKBggqhkjOPQQDAwNpADBmAjEAgFuk\n" + "fCPAlaUs3L6JbyO5o91lAFJekazInXJ0glMLfalAvWhgxeG4VDvBNhcl2MG9AjEAnjWSdIUl\n" + "UfUk7GRSJFClH9voy8l27OyCbvWFGFPouOOaKaqW04MjyaR7YbPMAuhd\n" + "-----END CERTIFICATE-----\n", + + /* GTS Root R4 */ + "-----BEGIN CERTIFICATE-----\n" + "MIICCjCCAZGgAwIBAgIQbkepyIuUtui7OyrYorLBmTAKBggqhkjOPQQDAzBHMQswCQYDVQQG\n" + "EwJVUzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RT\n" + "IFJvb3QgUjQwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJV\n" + "UzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJv\n" + "b3QgUjQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAATzdHOnaItgrkO4NcWBMHtLSZ37wWHO5t5G\n" + "vWvVYRg1rkDdc/eJkTBa6zzuhXyiQHY7qca4R9gq55KRanPpsXI5nymfopjTX15YhmUPoYRl\n" + "BtHci8nHc8iMai/lxKvRHYqjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/\n" + "MB0GA1UdDgQWBBSATNbrdP9JNqPV2Py1PsVq8JQdjDAKBggqhkjOPQQDAwNnADBkAjBqUFJ0\n" + "CMRw3J5QdCHojXohw0+WbhXRIjVhLfoIN+4Zba3bssx9BzT1YBkstTTZbyACMANxsbqjYAuG\n" + "7ZoIapVon+Kz4ZNkfF6Tpt95LY2F45TPI11xzPKwTdb+mciUqXWi4w==\n" + "-----END CERTIFICATE-----\n", + + /* UCA Global G2 Root */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFRjCCAy6gAwIBAgIQXd+x2lqj7V2+WmUgZQOQ7zANBgkqhkiG9w0BAQsFADA9MQswCQYD\n" + "VQQGEwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxGzAZBgNVBAMMElVDQSBHbG9iYWwgRzIgUm9v\n" + "dDAeFw0xNjAzMTEwMDAwMDBaFw00MDEyMzEwMDAwMDBaMD0xCzAJBgNVBAYTAkNOMREwDwYD\n" + "VQQKDAhVbmlUcnVzdDEbMBkGA1UEAwwSVUNBIEdsb2JhbCBHMiBSb290MIICIjANBgkqhkiG\n" + "9w0BAQEFAAOCAg8AMIICCgKCAgEAxeYrb3zvJgUno4Ek2m/LAfmZmqkywiKHYUGRO8vDaBsG\n" + "xUypK8FnFyIdK+35KYmToni9kmugow2ifsqTs6bRjDXVdfkX9s9FxeV67HeToI8jrg4aA3++\n" + "1NDtLnurRiNb/yzmVHqUwCoV8MmNsHo7JOHXaOIxPAYzRrZUEaalLyJUKlgNAQLx+hVRZ2zA\n" + "+te2G3/RVogvGjqNO7uCEeBHANBSh6v7hn4PJGtAnTRnvI3HLYZveT6OqTwXS3+wmeOwcWDc\n" + "C/Vkw85DvG1xudLeJ1uK6NjGruFZfc8oLTW4lVYa8bJYS7cSN8h8s+1LgOGN+jIjtm+3SJUI\n" + "sUROhYw6AlQgL9+/V087OpAh18EmNVQg7Mc/R+zvWr9LesGtOxdQXGLYD0tK3Cv6brxzks3s\n" + "x1DoQZbXqX5t2Okdj4q1uViSukqSKwxW/YDrCPBeKW4bHAyvj5OJrdu9o54hyokZ7N+1wxrr\n" + "Fv54NkzWbtA+FxyQF2smuvt6L78RHBgOLXMDj6DlNaBa4kx1HXHhOThTeEDMg5PXCp6dW4+K\n" + "5OXgSORIskfNTip1KnvyIvbJvgmRlld6iIis7nCs+dwp4wwcOxJORNanTrAmyPPZGpeRaOrv\n" + "jUYG0lZFWJo8DA+DuAUlwznPO6Q0ibd5Ei9Hxeepl2n8pndntd978XplFeRhVmUCAwEAAaNC\n" + "MEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFIHEjMz15DD/\n" + "pQwIX4wVZyF0Ad/fMA0GCSqGSIb3DQEBCwUAA4ICAQATZSL1jiutROTL/7lo5sOASD0Ee/oj\n" + "L3rtNtqyzm325p7lX1iPyzcyochltq44PTUbPrw7tgTQvPlJ9Zv3hcU2tsu8+Mg51eRfB70V\n" + "VJd0ysrtT7q6ZHafgbiERUlMjW+i67HM0cOU2kTC5uLqGOiiHycFutfl1qnN3e92mI0ADs0b\n" + "+gO3joBYDic/UvuUospeZcnWhNq5NXHzJsBPd+aBJ9J3O5oUb3n09tDh05S60FdRvScFDcH9\n" + "yBIw7m+NESsIndTUv4BFFJqIRNow6rSn4+7vW4LVPtateJLbXDzz2K36uGt/xDYotgIVilQs\n" + "nLAXc47QN6MUPJiVAAwpBVueSUmxX8fjy88nZY41F7dXyDDZQVu5FLbowg+UMaeUmMxq67Xh\n" + "J/UQqAHojhJi6IjMtX9Gl8CbEGY4GjZGXyJoPd/JxhMnq1MGrKI8hgZlb7F+sSlEmqO6SWko\n" + "aY/X5V+tBIZkbxqgDMUIYs6Ao9Dz7GjevjPHF1t/gMRMTLGmhIrDO7gJzRSBuhjjVFc2/tsv\n" + "fEehOjPI+Vg7RE+xygKJBJYoaMVLuCaJu9YzL1DV/pqJuhgyklTGW+Cd+V7lDSKb9triyCGy\n" + "YiGqhkCyLmTTX8jjfhFnRR8F/uOi77Oos/N9j/gMHyIfLXC0uAE0djAA5SN4p1bXUB+K+wb1\n" + "whnw0A==\n" + "-----END CERTIFICATE-----\n", + + /* UCA Extended Validation Root */ + "-----BEGIN CERTIFICATE-----\n" + "MIIFWjCCA0KgAwI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fdRUVjzyAfd5LQDfwIDAQABo0IwQDAdBgNVHQ4EFgQU2XQ65DA9DfcS3H5aBZ8eNJr34RQw\n" + "DwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggIBADaN\n" + "l8xCFWQpN5smLNb7rhVpLGsaGvdftvkHTFnq88nIua7Mui563MD1sC3AO6+fcAURap8lTwEp\n" + "cOPlDOHqWnzcSbvBHiqB9RZLcpHIojG5qtr8nR/zXUACE/xOHAbKsxSQVBcZEhrxH9cMaVr2\n" + "cXj0lH2RC47skFSOvG+hTKv8dGT9cZr4QQehzZHkPJrgmzI5c6sq1WnIeJEmMX3ixzDx/BR4\n" + "dxIOE/TdFpS/S2d7cFOFyrC78zhNLJA5wA3CXWvp4uXViI3WLL+rG761KIcSF3Ru/H38j9CH\n" + "JrAb+7lsq+KePRXBOy5nAliRn+/4Qh8st2j1da3Ptfb/EX3C8CSlrdP6oDyp+l3cpaDvRKS+\n" + "1ujl5BOWF3sGPjLtx7dCvHaj2GU4Kzg1USEODm8uNBNA4StnDG1KQTAYI1oyVZnJF+A83vbs\n" + "ea0rWBmirSwiGpWOvpaQXUJXxPkUAzUrHC1RVwinOt4/5Mi0A3PCwSaAuwtCH60NryZy2sy+\n" + "s6ODWA2CxR9GUeOcGMyNm43sSet1UNWMKFnKdDTajAshqx7qG+XH/RU+wBeq+yNuJkbL+vmx\n" + "cmtpzyKEC2IPrNkZAJSidjzULZrtBJ4tBmIQN1IchXIbJ+XMxjHsN+xjWZsLHXbMfjKaiJUI\n" + "NlK73nZfdklJrX+9ZSCyycErdhh2n1ax\n" + "-----END CERTIFICATE-----\n", + + /* Certigna Root CA */ + "-----BEGIN CERTIFICATE-----\n" + "MIIGWzCCBEOgAwIBAgIRAMrpG4nxVQMNo+ZBbcTjpuEwDQYJKoZIhvcNAQELBQAwWjELMAkG\n" + "A1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczEcMBoGA1UECww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xA61GU5wSesVywlVP+i\n" + "2k+KYTlerj1KjL0=\n" + "-----END CERTIFICATE-----\n", #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS diff --git a/src/node_serdes.cc b/src/node_serdes.cc index 58ce70b2e08b5e..65170f4710cf64 100644 --- a/src/node_serdes.cc +++ b/src/node_serdes.cc @@ -1,7 +1,7 @@ -#include "node_internals.h" +#include "base_object-inl.h" #include "node_buffer.h" #include "node_errors.h" -#include "base_object-inl.h" +#include "node_internals.h" namespace node { @@ -27,11 +27,9 @@ using v8::ValueSerializer; namespace { -class SerializerContext : public BaseObject, - public ValueSerializer::Delegate { +class SerializerContext : public BaseObject, public ValueSerializer::Delegate { public: - SerializerContext(Environment* env, - Local wrap); + SerializerContext(Environment* env, Local wrap); ~SerializerContext() {} @@ -94,24 +92,20 @@ class DeserializerContext : public BaseObject, }; SerializerContext::SerializerContext(Environment* env, Local wrap) - : BaseObject(env, wrap), - serializer_(env->isolate(), this) { + : BaseObject(env, wrap), serializer_(env->isolate(), this) { MakeWeak(); } void SerializerContext::ThrowDataCloneError(Local message) { - Local args[1] = { message }; + Local args[1] = {message}; Local get_data_clone_error = - object()->Get(env()->context(), - env()->get_data_clone_error_string()) - .ToLocalChecked(); + object() + ->Get(env()->context(), env()->get_data_clone_error_string()) + .ToLocalChecked(); CHECK(get_data_clone_error->IsFunction()); - MaybeLocal error = - get_data_clone_error.As()->Call(env()->context(), - object(), - arraysize(args), - args); + MaybeLocal error = get_data_clone_error.As()->Call( + env()->context(), object(), arraysize(args), args); if (error.IsEmpty()) return; @@ -120,22 +114,19 @@ void SerializerContext::ThrowDataCloneError(Local message) { Maybe SerializerContext::GetSharedArrayBufferId( Isolate* isolate, Local shared_array_buffer) { - Local args[1] = { shared_array_buffer }; + Local args[1] = {shared_array_buffer}; Local get_shared_array_buffer_id = - object()->Get(env()->context(), - env()->get_shared_array_buffer_id_string()) - .ToLocalChecked(); + object() + ->Get(env()->context(), env()->get_shared_array_buffer_id_string()) + .ToLocalChecked(); if (!get_shared_array_buffer_id->IsFunction()) { return ValueSerializer::Delegate::GetSharedArrayBufferId( isolate, shared_array_buffer); } - MaybeLocal id = - get_shared_array_buffer_id.As()->Call(env()->context(), - object(), - arraysize(args), - args); + MaybeLocal id = get_shared_array_buffer_id.As()->Call( + env()->context(), object(), arraysize(args), args); if (id.IsEmpty()) return Nothing(); @@ -145,23 +136,21 @@ Maybe SerializerContext::GetSharedArrayBufferId( Maybe SerializerContext::WriteHostObject(Isolate* isolate, Local input) { MaybeLocal ret; - Local args[1] = { input }; + Local args[1] = {input}; Local write_host_object = - object()->Get(env()->context(), - env()->write_host_object_string()).ToLocalChecked(); + object() + ->Get(env()->context(), env()->write_host_object_string()) + .ToLocalChecked(); if (!write_host_object->IsFunction()) { return ValueSerializer::Delegate::WriteHostObject(isolate, input); } - ret = write_host_object.As()->Call(env()->context(), - object(), - arraysize(args), - args); + ret = write_host_object.As()->Call( + env()->context(), object(), arraysize(args), args); - if (ret.IsEmpty()) - return Nothing(); + if (ret.IsEmpty()) return Nothing(); return Just(true); } @@ -181,8 +170,7 @@ void SerializerContext::WriteHeader(const FunctionCallbackInfo& args) { void SerializerContext::WriteValue(const FunctionCallbackInfo& args) { SerializerContext* ctx; ASSIGN_OR_RETURN_UNWRAP(&ctx, args.Holder()); - Maybe ret = - ctx->serializer_.WriteValue(ctx->env()->context(), args[0]); + Maybe ret = ctx->serializer_.WriteValue(ctx->env()->context(), args[0]); if (ret.IsJust()) args.GetReturnValue().Set(ret.FromJust()); } @@ -201,9 +189,8 @@ void SerializerContext::ReleaseBuffer(const FunctionCallbackInfo& args) { ASSIGN_OR_RETURN_UNWRAP(&ctx, args.Holder()); std::pair ret = ctx->serializer_.Release(); - auto buf = Buffer::New(ctx->env(), - reinterpret_cast(ret.first), - ret.second); + auto buf = + Buffer::New(ctx->env(), reinterpret_cast(ret.first), ret.second); if (!buf.IsEmpty()) { args.GetReturnValue().Set(buf.ToLocalChecked()); @@ -243,8 +230,7 @@ void SerializerContext::WriteUint64(const FunctionCallbackInfo& args) { Maybe arg0 = args[0]->Uint32Value(ctx->env()->context()); Maybe arg1 = args[1]->Uint32Value(ctx->env()->context()); - if (arg0.IsNothing() || arg1.IsNothing()) - return; + if (arg0.IsNothing() || arg1.IsNothing()) return; uint64_t hi = arg0.FromJust(); uint64_t lo = arg1.FromJust(); @@ -277,10 +263,10 @@ void SerializerContext::WriteRawBytes(const FunctionCallbackInfo& args) { DeserializerContext::DeserializerContext(Environment* env, Local wrap, Local buffer) - : BaseObject(env, wrap), - data_(reinterpret_cast(Buffer::Data(buffer))), - length_(Buffer::Length(buffer)), - deserializer_(env->isolate(), data_, length_, this) { + : BaseObject(env, wrap), + data_(reinterpret_cast(Buffer::Data(buffer))), + length_(Buffer::Length(buffer)), + deserializer_(env->isolate(), data_, length_, this) { object()->Set(env->context(), env->buffer_string(), buffer).FromJust(); deserializer_.SetExpectInlineWasm(true); @@ -289,22 +275,19 @@ DeserializerContext::DeserializerContext(Environment* env, MaybeLocal DeserializerContext::ReadHostObject(Isolate* isolate) { Local read_host_object = - object()->Get(env()->context(), - env()->read_host_object_string()).ToLocalChecked(); + object() + ->Get(env()->context(), env()->read_host_object_string()) + .ToLocalChecked(); if (!read_host_object->IsFunction()) { return ValueDeserializer::Delegate::ReadHostObject(isolate); } Isolate::AllowJavascriptExecutionScope allow_js(isolate); - MaybeLocal ret = - read_host_object.As()->Call(env()->context(), - object(), - 0, - nullptr); + MaybeLocal ret = read_host_object.As()->Call( + env()->context(), object(), 0, nullptr); - if (ret.IsEmpty()) - return MaybeLocal(); + if (ret.IsEmpty()) return MaybeLocal(); Local return_value = ret.ToLocalChecked(); if (!return_value->IsObject()) { @@ -399,10 +382,8 @@ void DeserializerContext::ReadUint64(const FunctionCallbackInfo& args) { Isolate* isolate = ctx->env()->isolate(); - Local ret[] = { - Integer::NewFromUnsigned(isolate, hi), - Integer::NewFromUnsigned(isolate, lo) - }; + Local ret[] = {Integer::NewFromUnsigned(isolate, hi), + Integer::NewFromUnsigned(isolate, lo)}; return args.GetReturnValue().Set(Array::New(isolate, ret, arraysize(ret))); } @@ -452,9 +433,8 @@ void Initialize(Local target, env->SetProtoMethod(ser, "writeHeader", SerializerContext::WriteHeader); env->SetProtoMethod(ser, "writeValue", SerializerContext::WriteValue); env->SetProtoMethod(ser, "releaseBuffer", SerializerContext::ReleaseBuffer); - env->SetProtoMethod(ser, - "transferArrayBuffer", - SerializerContext::TransferArrayBuffer); + env->SetProtoMethod( + ser, "transferArrayBuffer", SerializerContext::TransferArrayBuffer); env->SetProtoMethod(ser, "writeUint32", SerializerContext::WriteUint32); env->SetProtoMethod(ser, "writeUint64", SerializerContext::WriteUint64); env->SetProtoMethod(ser, "writeDouble", SerializerContext::WriteDouble); @@ -466,9 +446,11 @@ void Initialize(Local target, Local serializerString = FIXED_ONE_BYTE_STRING(env->isolate(), "Serializer"); ser->SetClassName(serializerString); - target->Set(env->context(), - serializerString, - ser->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + serializerString, + ser->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); Local des = env->NewFunctionTemplate(DeserializerContext::New); @@ -477,12 +459,10 @@ void Initialize(Local target, env->SetProtoMethod(des, "readHeader", DeserializerContext::ReadHeader); env->SetProtoMethod(des, "readValue", DeserializerContext::ReadValue); - env->SetProtoMethod(des, - "getWireFormatVersion", - DeserializerContext::GetWireFormatVersion); - env->SetProtoMethod(des, - "transferArrayBuffer", - DeserializerContext::TransferArrayBuffer); + env->SetProtoMethod( + des, "getWireFormatVersion", DeserializerContext::GetWireFormatVersion); + env->SetProtoMethod( + des, "transferArrayBuffer", DeserializerContext::TransferArrayBuffer); env->SetProtoMethod(des, "readUint32", DeserializerContext::ReadUint32); env->SetProtoMethod(des, "readUint64", DeserializerContext::ReadUint64); env->SetProtoMethod(des, "readDouble", DeserializerContext::ReadDouble); @@ -491,9 +471,11 @@ void Initialize(Local target, Local deserializerString = FIXED_ONE_BYTE_STRING(env->isolate(), "Deserializer"); des->SetClassName(deserializerString); - target->Set(env->context(), - deserializerString, - des->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + deserializerString, + des->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); } } // anonymous namespace diff --git a/src/node_stat_watcher.cc b/src/node_stat_watcher.cc index 9564a0a2b32ad7..1ca03e69b6fff7 100644 --- a/src/node_stat_watcher.cc +++ b/src/node_stat_watcher.cc @@ -25,8 +25,8 @@ #include "node_file.h" #include "util.h" -#include #include +#include namespace node { @@ -41,7 +41,6 @@ using v8::String; using v8::Uint32; using v8::Value; - void StatWatcher::Initialize(Environment* env, Local target) { HandleScope scope(env->isolate()); @@ -54,14 +53,14 @@ void StatWatcher::Initialize(Environment* env, Local target) { env->SetProtoMethod(t, "start", StatWatcher::Start); - target->Set(env->context(), statWatcherString, - t->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + statWatcherString, + t->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); } - -StatWatcher::StatWatcher(Environment* env, - Local wrap, - bool use_bigint) +StatWatcher::StatWatcher(Environment* env, Local wrap, bool use_bigint) : HandleWrap(env, wrap, reinterpret_cast(&watcher_), @@ -70,7 +69,6 @@ StatWatcher::StatWatcher(Environment* env, CHECK_EQ(0, uv_fs_poll_init(env->event_loop(), &watcher_)); } - void StatWatcher::Callback(uv_fs_poll_t* handle, int status, const uv_stat_t* prev, @@ -83,11 +81,10 @@ void StatWatcher::Callback(uv_fs_poll_t* handle, Local arr = fs::FillGlobalStatsArray(env, wrap->use_bigint_, curr); USE(fs::FillGlobalStatsArray(env, wrap->use_bigint_, prev, true)); - Local argv[2] = { Integer::New(env->isolate(), status), arr }; + Local argv[2] = {Integer::New(env->isolate(), status), arr}; wrap->MakeCallback(env->onchange_string(), arraysize(argv), argv); } - void StatWatcher::New(const FunctionCallbackInfo& args) { CHECK(args.IsConstructCall()); Environment* env = Environment::GetCurrent(args); diff --git a/src/node_stat_watcher.h b/src/node_stat_watcher.h index 3d819b45787e98..5e07861d2e420b 100644 --- a/src/node_stat_watcher.h +++ b/src/node_stat_watcher.h @@ -24,9 +24,9 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "node.h" -#include "handle_wrap.h" #include "env.h" +#include "handle_wrap.h" +#include "node.h" #include "uv.h" #include "v8.h" @@ -37,9 +37,7 @@ class StatWatcher : public HandleWrap { static void Initialize(Environment* env, v8::Local target); protected: - StatWatcher(Environment* env, - v8::Local wrap, - bool use_bigint); + StatWatcher(Environment* env, v8::Local wrap, bool use_bigint); static void New(const v8::FunctionCallbackInfo& args); static void Start(const v8::FunctionCallbackInfo& args); diff --git a/src/node_task_queue.cc b/src/node_task_queue.cc index b7bafe6db69c36..35c39bf107e4b6 100644 --- a/src/node_task_queue.cc +++ b/src/node_task_queue.cc @@ -60,16 +60,20 @@ void PromiseRejectCallback(PromiseRejectMessage message) { value = message.GetValue(); unhandledRejections++; TRACE_COUNTER2(TRACING_CATEGORY_NODE2(promises, rejections), - "rejections", - "unhandled", unhandledRejections, - "handledAfter", rejectionsHandledAfter); + "rejections", + "unhandled", + unhandledRejections, + "handledAfter", + rejectionsHandledAfter); } else if (event == kPromiseHandlerAddedAfterReject) { value = Undefined(isolate); rejectionsHandledAfter++; TRACE_COUNTER2(TRACING_CATEGORY_NODE2(promises, rejections), - "rejections", - "unhandled", unhandledRejections, - "handledAfter", rejectionsHandledAfter); + "rejections", + "unhandled", + unhandledRejections, + "handledAfter", + rejectionsHandledAfter); } else if (event == kPromiseResolveAfterResolved) { value = message.GetValue(); } else if (event == kPromiseRejectAfterResolved) { @@ -82,13 +86,12 @@ void PromiseRejectCallback(PromiseRejectMessage message) { value = Undefined(isolate); } - Local args[] = { type, promise, value }; + Local args[] = {type, promise, value}; USE(callback->Call( env->context(), Undefined(isolate), arraysize(args), args)); } -static void SetPromiseRejectCallback( - const FunctionCallbackInfo& args) { +static void SetPromiseRejectCallback(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); CHECK(args[0]->IsFunction()); @@ -104,9 +107,11 @@ static void Initialize(Local target, env->SetMethod(target, "setTickCallback", SetTickCallback); env->SetMethod(target, "runMicrotasks", RunMicrotasks); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(isolate, "tickInfo"), - env->tick_info()->fields().GetJSArray()).FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(isolate, "tickInfo"), + env->tick_info()->fields().GetJSArray()) + .FromJust(); Local events = Object::New(isolate); NODE_DEFINE_CONSTANT(events, kPromiseRejectWithNoHandler); @@ -114,12 +119,12 @@ static void Initialize(Local target, NODE_DEFINE_CONSTANT(events, kPromiseResolveAfterResolved); NODE_DEFINE_CONSTANT(events, kPromiseRejectAfterResolved); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(isolate, "promiseRejectEvents"), - events).FromJust(); - env->SetMethod(target, - "setPromiseRejectCallback", - SetPromiseRejectCallback); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(isolate, "promiseRejectEvents"), + events) + .FromJust(); + env->SetMethod(target, "setPromiseRejectCallback", SetPromiseRejectCallback); } } // namespace task_queue diff --git a/src/node_trace_events.cc b/src/node_trace_events.cc index 9538e75d2c54ed..534006b34e3858 100644 --- a/src/node_trace_events.cc +++ b/src/node_trace_events.cc @@ -23,9 +23,9 @@ using v8::Value; class NodeCategorySet : public BaseObject { public: static void Initialize(Local target, - Local unused, - Local context, - void* priv); + Local unused, + Local context, + void* priv); static void New(const FunctionCallbackInfo& args); static void Enable(const FunctionCallbackInfo& args); @@ -43,8 +43,8 @@ class NodeCategorySet : public BaseObject { private: NodeCategorySet(Environment* env, Local wrap, - std::set&& categories) : - BaseObject(env, wrap), categories_(std::move(categories)) { + std::set&& categories) + : BaseObject(env, wrap), categories_(std::move(categories)) { MakeWeak(); } @@ -95,11 +95,11 @@ void GetEnabledCategories(const FunctionCallbackInfo& args) { std::string categories = GetTracingAgentWriter()->agent()->GetEnabledCategories(); if (!categories.empty()) { - args.GetReturnValue().Set( - String::NewFromUtf8(env->isolate(), - categories.c_str(), - NewStringType::kNormal, - categories.size()).ToLocalChecked()); + args.GetReturnValue().Set(String::NewFromUtf8(env->isolate(), + categories.c_str(), + NewStringType::kNormal, + categories.size()) + .ToLocalChecked()); } } @@ -111,15 +111,15 @@ static void SetTraceCategoryStateUpdateHandler( } void NodeCategorySet::Initialize(Local target, - Local unused, - Local context, - void* priv) { + Local unused, + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); env->SetMethod(target, "getEnabledCategories", GetEnabledCategories); - env->SetMethod( - target, "setTraceCategoryStateUpdateHandler", - SetTraceCategoryStateUpdateHandler); + env->SetMethod(target, + "setTraceCategoryStateUpdateHandler", + SetTraceCategoryStateUpdateHandler); Local category_set = env->NewFunctionTemplate(NodeCategorySet::New); @@ -127,10 +127,11 @@ void NodeCategorySet::Initialize(Local target, env->SetProtoMethod(category_set, "enable", NodeCategorySet::Enable); env->SetProtoMethod(category_set, "disable", NodeCategorySet::Disable); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "CategorySet"), - category_set->GetFunction(env->context()).ToLocalChecked()) - .FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "CategorySet"), + category_set->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); Local isTraceCategoryEnabled = FIXED_ONE_BYTE_STRING(env->isolate(), "isTraceCategoryEnabled"); @@ -139,15 +140,19 @@ void NodeCategorySet::Initialize(Local target, // Grab the trace and isTraceCategoryEnabled intrinsics from the binding // object and expose those to our binding layer. Local binding = context->GetExtrasBindingObject(); - target->Set(context, isTraceCategoryEnabled, - binding->Get(context, isTraceCategoryEnabled).ToLocalChecked()) - .FromJust(); - target->Set(context, trace, - binding->Get(context, trace).ToLocalChecked()).FromJust(); - - target->Set(context, - FIXED_ONE_BYTE_STRING(env->isolate(), "traceCategoryState"), - env->trace_category_state().GetJSArray()).FromJust(); + target + ->Set(context, + isTraceCategoryEnabled, + binding->Get(context, isTraceCategoryEnabled).ToLocalChecked()) + .FromJust(); + target->Set(context, trace, binding->Get(context, trace).ToLocalChecked()) + .FromJust(); + + target + ->Set(context, + FIXED_ONE_BYTE_STRING(env->isolate(), "traceCategoryState"), + env->trace_category_state().GetJSArray()) + .FromJust(); } } // namespace node diff --git a/src/node_types.cc b/src/node_types.cc index a53bcba555448f..906c312efd1ded 100644 --- a/src/node_types.cc +++ b/src/node_types.cc @@ -10,55 +10,52 @@ using v8::Value; namespace node { namespace { -#define VALUE_METHOD_MAP(V) \ - V(External) \ - V(Date) \ - V(ArgumentsObject) \ - V(BigIntObject) \ - V(BooleanObject) \ - V(NumberObject) \ - V(StringObject) \ - V(SymbolObject) \ - V(NativeError) \ - V(RegExp) \ - V(AsyncFunction) \ - V(GeneratorFunction) \ - V(GeneratorObject) \ - V(Promise) \ - V(Map) \ - V(Set) \ - V(MapIterator) \ - V(SetIterator) \ - V(WeakMap) \ - V(WeakSet) \ - V(ArrayBuffer) \ - V(DataView) \ - V(SharedArrayBuffer) \ - V(Proxy) \ - V(WebAssemblyCompiledModule) \ - V(ModuleNamespaceObject) \ +#define VALUE_METHOD_MAP(V) \ + V(External) \ + V(Date) \ + V(ArgumentsObject) \ + V(BigIntObject) \ + V(BooleanObject) \ + V(NumberObject) \ + V(StringObject) \ + V(SymbolObject) \ + V(NativeError) \ + V(RegExp) \ + V(AsyncFunction) \ + V(GeneratorFunction) \ + V(GeneratorObject) \ + V(Promise) \ + V(Map) \ + V(Set) \ + V(MapIterator) \ + V(SetIterator) \ + V(WeakMap) \ + V(WeakSet) \ + V(ArrayBuffer) \ + V(DataView) \ + V(SharedArrayBuffer) \ + V(Proxy) \ + V(WebAssemblyCompiledModule) \ + V(ModuleNamespaceObject) - -#define V(type) \ - static void Is##type(const FunctionCallbackInfo& args) { \ - args.GetReturnValue().Set(args[0]->Is##type()); \ +#define V(type) \ + static void Is##type(const FunctionCallbackInfo& args) { \ + args.GetReturnValue().Set(args[0]->Is##type()); \ } - VALUE_METHOD_MAP(V) +VALUE_METHOD_MAP(V) #undef V static void IsAnyArrayBuffer(const FunctionCallbackInfo& args) { - args.GetReturnValue().Set( - args[0]->IsArrayBuffer() || args[0]->IsSharedArrayBuffer()); + args.GetReturnValue().Set(args[0]->IsArrayBuffer() || + args[0]->IsSharedArrayBuffer()); } static void IsBoxedPrimitive(const FunctionCallbackInfo& args) { args.GetReturnValue().Set( - args[0]->IsNumberObject() || - args[0]->IsStringObject() || - args[0]->IsBooleanObject() || - args[0]->IsBigIntObject() || - args[0]->IsSymbolObject()); + args[0]->IsNumberObject() || args[0]->IsStringObject() || + args[0]->IsBooleanObject() || args[0]->IsBigIntObject() || + args[0]->IsSymbolObject()); } void InitializeTypes(Local target, @@ -67,9 +64,7 @@ void InitializeTypes(Local target, void* priv) { Environment* env = Environment::GetCurrent(context); -#define V(type) env->SetMethodNoSideEffect(target, \ - "is" #type, \ - Is##type); +#define V(type) env->SetMethodNoSideEffect(target, "is" #type, Is##type); VALUE_METHOD_MAP(V) #undef V diff --git a/src/node_url.cc b/src/node_url.cc index d7402c4d043430..265e58cdef0ddb 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -4,10 +4,10 @@ #include "node_i18n.h" #include "util.h" -#include -#include #include #include +#include +#include namespace node { @@ -31,10 +31,9 @@ using v8::Undefined; using v8::Value; inline Local Utf8String(Isolate* isolate, const std::string& str) { - return String::NewFromUtf8(isolate, - str.data(), - NewStringType::kNormal, - str.length()).ToLocalChecked(); + return String::NewFromUtf8( + isolate, str.data(), NewStringType::kNormal, str.length()) + .ToLocalChecked(); } namespace url { @@ -110,13 +109,13 @@ class URLHost { inline void SetOpaque(std::string&& string) { Reset(); type_ = HostType::H_OPAQUE; - new(&value_.domain_or_opaque) std::string(std::move(string)); + new (&value_.domain_or_opaque) std::string(std::move(string)); } inline void SetDomain(std::string&& string) { Reset(); type_ = HostType::H_DOMAIN; - new(&value_.domain_or_opaque) std::string(std::move(string)); + new (&value_.domain_or_opaque) std::string(std::move(string)); } }; @@ -124,21 +123,21 @@ URLHost::~URLHost() { Reset(); } -#define ARGS(XX) \ - XX(ARG_FLAGS) \ - XX(ARG_PROTOCOL) \ - XX(ARG_USERNAME) \ - XX(ARG_PASSWORD) \ - XX(ARG_HOST) \ - XX(ARG_PORT) \ - XX(ARG_PATH) \ - XX(ARG_QUERY) \ - XX(ARG_FRAGMENT) \ +#define ARGS(XX) \ + XX(ARG_FLAGS) \ + XX(ARG_PROTOCOL) \ + XX(ARG_USERNAME) \ + XX(ARG_PASSWORD) \ + XX(ARG_HOST) \ + XX(ARG_PORT) \ + XX(ARG_PATH) \ + XX(ARG_QUERY) \ + XX(ARG_FRAGMENT) \ XX(ARG_COUNT) // This one has to be last. -#define ERR_ARGS(XX) \ - XX(ERR_ARG_FLAGS) \ - XX(ERR_ARG_INPUT) \ +#define ERR_ARGS(XX) \ + XX(ERR_ARG_FLAGS) \ + XX(ERR_ARG_INPUT) enum url_cb_args { #define XX(name) name, @@ -152,26 +151,26 @@ enum url_error_cb_args { #undef XX }; -#define CHAR_TEST(bits, name, expr) \ - template \ - inline bool name(const T ch) { \ - static_assert(sizeof(ch) >= (bits) / 8, \ - "Character must be wider than " #bits " bits"); \ - return (expr); \ +#define CHAR_TEST(bits, name, expr) \ + template \ + inline bool name(const T ch) { \ + static_assert(sizeof(ch) >= (bits) / 8, \ + "Character must be wider than " #bits " bits"); \ + return (expr); \ } -#define TWO_CHAR_STRING_TEST(bits, name, expr) \ - template \ - inline bool name(const T ch1, const T ch2) { \ - static_assert(sizeof(ch1) >= (bits) / 8, \ - "Character must be wider than " #bits " bits"); \ - return (expr); \ - } \ - template \ - inline bool name(const std::basic_string& str) { \ - static_assert(sizeof(str[0]) >= (bits) / 8, \ - "Character must be wider than " #bits " bits"); \ - return str.length() >= 2 && name(str[0], str[1]); \ +#define TWO_CHAR_STRING_TEST(bits, name, expr) \ + template \ + inline bool name(const T ch1, const T ch2) { \ + static_assert(sizeof(ch1) >= (bits) / 8, \ + "Character must be wider than " #bits " bits"); \ + return (expr); \ + } \ + template \ + inline bool name(const std::basic_string& str) { \ + static_assert(sizeof(str[0]) >= (bits) / 8, \ + "Character must be wider than " #bits " bits"); \ + return str.length() >= 2 && name(str[0], str[1]); \ } // https://infra.spec.whatwg.org/#ascii-tab-or-newline @@ -184,13 +183,15 @@ CHAR_TEST(8, IsC0ControlOrSpace, (ch >= '\0' && ch <= ' ')) CHAR_TEST(8, IsASCIIDigit, (ch >= '0' && ch <= '9')) // https://infra.spec.whatwg.org/#ascii-hex-digit -CHAR_TEST(8, IsASCIIHexDigit, (IsASCIIDigit(ch) || - (ch >= 'A' && ch <= 'F') || - (ch >= 'a' && ch <= 'f'))) +CHAR_TEST(8, + IsASCIIHexDigit, + (IsASCIIDigit(ch) || (ch >= 'A' && ch <= 'F') || + (ch >= 'a' && ch <= 'f'))) // https://infra.spec.whatwg.org/#ascii-alpha -CHAR_TEST(8, IsASCIIAlpha, ((ch >= 'A' && ch <= 'Z') || - (ch >= 'a' && ch <= 'z'))) +CHAR_TEST(8, + IsASCIIAlpha, + ((ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z'))) // https://infra.spec.whatwg.org/#ascii-alphanumeric CHAR_TEST(8, IsASCIIAlphanumeric, (IsASCIIDigit(ch) || IsASCIIAlpha(ch))) @@ -202,18 +203,20 @@ inline T ASCIILowercase(T ch) { } // https://url.spec.whatwg.org/#forbidden-host-code-point -CHAR_TEST(8, IsForbiddenHostCodePoint, - ch == '\0' || ch == '\t' || ch == '\n' || ch == '\r' || - ch == ' ' || ch == '#' || ch == '%' || ch == '/' || - ch == ':' || ch == '?' || ch == '@' || ch == '[' || - ch == '\\' || ch == ']') +CHAR_TEST(8, + IsForbiddenHostCodePoint, + ch == '\0' || ch == '\t' || ch == '\n' || ch == '\r' || ch == ' ' || + ch == '#' || ch == '%' || ch == '/' || ch == ':' || ch == '?' || + ch == '@' || ch == '[' || ch == '\\' || ch == ']') // https://url.spec.whatwg.org/#windows-drive-letter -TWO_CHAR_STRING_TEST(8, IsWindowsDriveLetter, +TWO_CHAR_STRING_TEST(8, + IsWindowsDriveLetter, (IsASCIIAlpha(ch1) && (ch2 == ':' || ch2 == '|'))) // https://url.spec.whatwg.org/#normalized-windows-drive-letter -TWO_CHAR_STRING_TEST(8, IsNormalizedWindowsDriveLetter, +TWO_CHAR_STRING_TEST(8, + IsNormalizedWindowsDriveLetter, (IsASCIIAlpha(ch1) && ch2 == ':')) // If a UTF-16 character is a low/trailing surrogate. @@ -229,443 +232,427 @@ CHAR_TEST(16, IsUnicodeSurrogateTrail, (ch & 0x400) != 0) #undef TWO_CHAR_STRING_TEST const char* hex[256] = { - "%00", "%01", "%02", "%03", "%04", "%05", "%06", "%07", - "%08", "%09", "%0A", "%0B", "%0C", "%0D", "%0E", "%0F", - "%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17", - "%18", "%19", "%1A", "%1B", "%1C", "%1D", "%1E", "%1F", - "%20", "%21", "%22", "%23", "%24", "%25", "%26", "%27", - "%28", "%29", "%2A", "%2B", "%2C", "%2D", "%2E", "%2F", - "%30", "%31", "%32", "%33", "%34", "%35", "%36", "%37", - "%38", "%39", "%3A", "%3B", "%3C", "%3D", "%3E", "%3F", - "%40", "%41", "%42", "%43", "%44", "%45", "%46", "%47", - "%48", "%49", "%4A", "%4B", "%4C", "%4D", "%4E", "%4F", - "%50", "%51", "%52", "%53", "%54", "%55", "%56", "%57", - "%58", "%59", "%5A", "%5B", "%5C", "%5D", "%5E", "%5F", - "%60", "%61", "%62", "%63", "%64", "%65", "%66", "%67", - "%68", "%69", "%6A", "%6B", "%6C", "%6D", "%6E", "%6F", - "%70", "%71", "%72", "%73", "%74", "%75", "%76", "%77", - "%78", "%79", "%7A", "%7B", "%7C", "%7D", "%7E", "%7F", - "%80", "%81", "%82", "%83", "%84", "%85", "%86", "%87", - "%88", "%89", "%8A", "%8B", "%8C", "%8D", "%8E", "%8F", - "%90", "%91", "%92", "%93", "%94", "%95", "%96", "%97", - "%98", "%99", "%9A", "%9B", "%9C", "%9D", "%9E", "%9F", - "%A0", "%A1", "%A2", "%A3", "%A4", "%A5", "%A6", "%A7", - "%A8", "%A9", "%AA", "%AB", "%AC", "%AD", "%AE", "%AF", - "%B0", "%B1", "%B2", "%B3", "%B4", "%B5", "%B6", "%B7", - "%B8", "%B9", "%BA", "%BB", "%BC", "%BD", "%BE", "%BF", - "%C0", "%C1", "%C2", "%C3", "%C4", "%C5", "%C6", "%C7", - "%C8", "%C9", "%CA", "%CB", "%CC", "%CD", "%CE", "%CF", - "%D0", "%D1", "%D2", "%D3", "%D4", "%D5", "%D6", "%D7", - "%D8", "%D9", "%DA", "%DB", "%DC", "%DD", "%DE", "%DF", - "%E0", "%E1", "%E2", "%E3", "%E4", "%E5", "%E6", "%E7", - "%E8", "%E9", "%EA", "%EB", "%EC", "%ED", "%EE", "%EF", - "%F0", "%F1", "%F2", "%F3", "%F4", "%F5", "%F6", "%F7", - "%F8", "%F9", "%FA", "%FB", "%FC", "%FD", "%FE", "%FF" -}; + "%00", "%01", "%02", "%03", "%04", "%05", "%06", "%07", "%08", "%09", "%0A", + "%0B", "%0C", "%0D", "%0E", "%0F", "%10", "%11", "%12", "%13", "%14", "%15", + "%16", "%17", "%18", "%19", "%1A", "%1B", "%1C", "%1D", "%1E", "%1F", "%20", + "%21", "%22", "%23", "%24", "%25", "%26", "%27", "%28", "%29", "%2A", "%2B", + "%2C", "%2D", "%2E", "%2F", "%30", "%31", "%32", "%33", "%34", "%35", "%36", + "%37", "%38", "%39", "%3A", "%3B", "%3C", "%3D", "%3E", "%3F", "%40", "%41", + "%42", "%43", "%44", "%45", "%46", "%47", "%48", "%49", "%4A", "%4B", "%4C", + "%4D", "%4E", "%4F", "%50", "%51", "%52", "%53", "%54", "%55", "%56", "%57", + "%58", "%59", "%5A", "%5B", "%5C", "%5D", "%5E", "%5F", "%60", "%61", "%62", + "%63", "%64", "%65", "%66", "%67", "%68", "%69", "%6A", "%6B", "%6C", "%6D", + "%6E", "%6F", "%70", "%71", "%72", "%73", "%74", "%75", "%76", "%77", "%78", + "%79", "%7A", "%7B", "%7C", "%7D", "%7E", "%7F", "%80", "%81", "%82", "%83", + "%84", "%85", "%86", "%87", "%88", "%89", "%8A", "%8B", "%8C", "%8D", "%8E", + "%8F", "%90", "%91", "%92", "%93", "%94", "%95", "%96", "%97", "%98", "%99", + "%9A", "%9B", "%9C", "%9D", "%9E", "%9F", "%A0", "%A1", "%A2", "%A3", "%A4", + "%A5", "%A6", "%A7", "%A8", "%A9", "%AA", "%AB", "%AC", "%AD", "%AE", "%AF", + "%B0", "%B1", "%B2", "%B3", "%B4", "%B5", "%B6", "%B7", "%B8", "%B9", "%BA", + "%BB", "%BC", "%BD", "%BE", "%BF", "%C0", "%C1", "%C2", "%C3", "%C4", "%C5", + "%C6", "%C7", "%C8", "%C9", "%CA", "%CB", "%CC", "%CD", "%CE", "%CF", "%D0", + "%D1", "%D2", "%D3", "%D4", "%D5", "%D6", "%D7", "%D8", "%D9", "%DA", "%DB", + "%DC", "%DD", "%DE", "%DF", "%E0", "%E1", "%E2", "%E3", "%E4", "%E5", "%E6", + "%E7", "%E8", "%E9", "%EA", "%EB", "%EC", "%ED", "%EE", "%EF", "%F0", "%F1", + "%F2", "%F3", "%F4", "%F5", "%F6", "%F7", "%F8", "%F9", "%FA", "%FB", "%FC", + "%FD", "%FE", "%FF"}; const uint8_t C0_CONTROL_ENCODE_SET[32] = { - // 00 01 02 03 04 05 06 07 + // 00 01 02 03 04 05 06 07 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 08 09 0A 0B 0C 0D 0E 0F + // 08 09 0A 0B 0C 0D 0E 0F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 10 11 12 13 14 15 16 17 + // 10 11 12 13 14 15 16 17 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 18 19 1A 1B 1C 1D 1E 1F + // 18 19 1A 1B 1C 1D 1E 1F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 20 21 22 23 24 25 26 27 + // 20 21 22 23 24 25 26 27 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 28 29 2A 2B 2C 2D 2E 2F + // 28 29 2A 2B 2C 2D 2E 2F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 30 31 32 33 34 35 36 37 + // 30 31 32 33 34 35 36 37 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 38 39 3A 3B 3C 3D 3E 3F + // 38 39 3A 3B 3C 3D 3E 3F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 40 41 42 43 44 45 46 47 + // 40 41 42 43 44 45 46 47 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 48 49 4A 4B 4C 4D 4E 4F + // 48 49 4A 4B 4C 4D 4E 4F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 50 51 52 53 54 55 56 57 + // 50 51 52 53 54 55 56 57 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 58 59 5A 5B 5C 5D 5E 5F + // 58 59 5A 5B 5C 5D 5E 5F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 60 61 62 63 64 65 66 67 + // 60 61 62 63 64 65 66 67 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 68 69 6A 6B 6C 6D 6E 6F + // 68 69 6A 6B 6C 6D 6E 6F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 70 71 72 73 74 75 76 77 + // 70 71 72 73 74 75 76 77 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 78 79 7A 7B 7C 7D 7E 7F + // 78 79 7A 7B 7C 7D 7E 7F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x80, - // 80 81 82 83 84 85 86 87 + // 80 81 82 83 84 85 86 87 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 88 89 8A 8B 8C 8D 8E 8F + // 88 89 8A 8B 8C 8D 8E 8F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 90 91 92 93 94 95 96 97 + // 90 91 92 93 94 95 96 97 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 98 99 9A 9B 9C 9D 9E 9F + // 98 99 9A 9B 9C 9D 9E 9F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // A0 A1 A2 A3 A4 A5 A6 A7 + // A0 A1 A2 A3 A4 A5 A6 A7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // A8 A9 AA AB AC AD AE AF + // A8 A9 AA AB AC AD AE AF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // B0 B1 B2 B3 B4 B5 B6 B7 + // B0 B1 B2 B3 B4 B5 B6 B7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // B8 B9 BA BB BC BD BE BF + // B8 B9 BA BB BC BD BE BF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // C0 C1 C2 C3 C4 C5 C6 C7 + // C0 C1 C2 C3 C4 C5 C6 C7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // C8 C9 CA CB CC CD CE CF + // C8 C9 CA CB CC CD CE CF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // D0 D1 D2 D3 D4 D5 D6 D7 + // D0 D1 D2 D3 D4 D5 D6 D7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // D8 D9 DA DB DC DD DE DF + // D8 D9 DA DB DC DD DE DF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // E0 E1 E2 E3 E4 E5 E6 E7 + // E0 E1 E2 E3 E4 E5 E6 E7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // E8 E9 EA EB EC ED EE EF + // E8 E9 EA EB EC ED EE EF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // F0 F1 F2 F3 F4 F5 F6 F7 + // F0 F1 F2 F3 F4 F5 F6 F7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // F8 F9 FA FB FC FD FE FF - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80 -}; + // F8 F9 FA FB FC FD FE FF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80}; const uint8_t FRAGMENT_ENCODE_SET[32] = { - // 00 01 02 03 04 05 06 07 + // 00 01 02 03 04 05 06 07 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 08 09 0A 0B 0C 0D 0E 0F + // 08 09 0A 0B 0C 0D 0E 0F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 10 11 12 13 14 15 16 17 + // 10 11 12 13 14 15 16 17 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 18 19 1A 1B 1C 1D 1E 1F + // 18 19 1A 1B 1C 1D 1E 1F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 20 21 22 23 24 25 26 27 + // 20 21 22 23 24 25 26 27 0x01 | 0x00 | 0x04 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 28 29 2A 2B 2C 2D 2E 2F + // 28 29 2A 2B 2C 2D 2E 2F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 30 31 32 33 34 35 36 37 + // 30 31 32 33 34 35 36 37 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 38 39 3A 3B 3C 3D 3E 3F + // 38 39 3A 3B 3C 3D 3E 3F 0x00 | 0x00 | 0x00 | 0x00 | 0x10 | 0x00 | 0x40 | 0x00, - // 40 41 42 43 44 45 46 47 + // 40 41 42 43 44 45 46 47 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 48 49 4A 4B 4C 4D 4E 4F + // 48 49 4A 4B 4C 4D 4E 4F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 50 51 52 53 54 55 56 57 + // 50 51 52 53 54 55 56 57 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 58 59 5A 5B 5C 5D 5E 5F + // 58 59 5A 5B 5C 5D 5E 5F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 60 61 62 63 64 65 66 67 + // 60 61 62 63 64 65 66 67 0x01 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 68 69 6A 6B 6C 6D 6E 6F + // 68 69 6A 6B 6C 6D 6E 6F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 70 71 72 73 74 75 76 77 + // 70 71 72 73 74 75 76 77 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 78 79 7A 7B 7C 7D 7E 7F + // 78 79 7A 7B 7C 7D 7E 7F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x80, - // 80 81 82 83 84 85 86 87 + // 80 81 82 83 84 85 86 87 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 88 89 8A 8B 8C 8D 8E 8F + // 88 89 8A 8B 8C 8D 8E 8F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 90 91 92 93 94 95 96 97 + // 90 91 92 93 94 95 96 97 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 98 99 9A 9B 9C 9D 9E 9F + // 98 99 9A 9B 9C 9D 9E 9F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // A0 A1 A2 A3 A4 A5 A6 A7 + // A0 A1 A2 A3 A4 A5 A6 A7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // A8 A9 AA AB AC AD AE AF + // A8 A9 AA AB AC AD AE AF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // B0 B1 B2 B3 B4 B5 B6 B7 + // B0 B1 B2 B3 B4 B5 B6 B7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // B8 B9 BA BB BC BD BE BF + // B8 B9 BA BB BC BD BE BF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // C0 C1 C2 C3 C4 C5 C6 C7 + // C0 C1 C2 C3 C4 C5 C6 C7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // C8 C9 CA CB CC CD CE CF + // C8 C9 CA CB CC CD CE CF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // D0 D1 D2 D3 D4 D5 D6 D7 + // D0 D1 D2 D3 D4 D5 D6 D7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // D8 D9 DA DB DC DD DE DF + // D8 D9 DA DB DC DD DE DF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // E0 E1 E2 E3 E4 E5 E6 E7 + // E0 E1 E2 E3 E4 E5 E6 E7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // E8 E9 EA EB EC ED EE EF + // E8 E9 EA EB EC ED EE EF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // F0 F1 F2 F3 F4 F5 F6 F7 + // F0 F1 F2 F3 F4 F5 F6 F7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // F8 F9 FA FB FC FD FE FF - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80 -}; - + // F8 F9 FA FB FC FD FE FF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80}; const uint8_t PATH_ENCODE_SET[32] = { - // 00 01 02 03 04 05 06 07 + // 00 01 02 03 04 05 06 07 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 08 09 0A 0B 0C 0D 0E 0F + // 08 09 0A 0B 0C 0D 0E 0F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 10 11 12 13 14 15 16 17 + // 10 11 12 13 14 15 16 17 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 18 19 1A 1B 1C 1D 1E 1F + // 18 19 1A 1B 1C 1D 1E 1F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 20 21 22 23 24 25 26 27 + // 20 21 22 23 24 25 26 27 0x01 | 0x00 | 0x04 | 0x08 | 0x00 | 0x00 | 0x00 | 0x00, - // 28 29 2A 2B 2C 2D 2E 2F + // 28 29 2A 2B 2C 2D 2E 2F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 30 31 32 33 34 35 36 37 + // 30 31 32 33 34 35 36 37 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 38 39 3A 3B 3C 3D 3E 3F + // 38 39 3A 3B 3C 3D 3E 3F 0x00 | 0x00 | 0x00 | 0x00 | 0x10 | 0x00 | 0x40 | 0x80, - // 40 41 42 43 44 45 46 47 + // 40 41 42 43 44 45 46 47 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 48 49 4A 4B 4C 4D 4E 4F + // 48 49 4A 4B 4C 4D 4E 4F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 50 51 52 53 54 55 56 57 + // 50 51 52 53 54 55 56 57 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 58 59 5A 5B 5C 5D 5E 5F + // 58 59 5A 5B 5C 5D 5E 5F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 60 61 62 63 64 65 66 67 + // 60 61 62 63 64 65 66 67 0x01 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 68 69 6A 6B 6C 6D 6E 6F + // 68 69 6A 6B 6C 6D 6E 6F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 70 71 72 73 74 75 76 77 + // 70 71 72 73 74 75 76 77 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 78 79 7A 7B 7C 7D 7E 7F + // 78 79 7A 7B 7C 7D 7E 7F 0x00 | 0x00 | 0x00 | 0x08 | 0x00 | 0x20 | 0x00 | 0x80, - // 80 81 82 83 84 85 86 87 + // 80 81 82 83 84 85 86 87 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 88 89 8A 8B 8C 8D 8E 8F + // 88 89 8A 8B 8C 8D 8E 8F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 90 91 92 93 94 95 96 97 + // 90 91 92 93 94 95 96 97 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 98 99 9A 9B 9C 9D 9E 9F + // 98 99 9A 9B 9C 9D 9E 9F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // A0 A1 A2 A3 A4 A5 A6 A7 + // A0 A1 A2 A3 A4 A5 A6 A7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // A8 A9 AA AB AC AD AE AF + // A8 A9 AA AB AC AD AE AF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // B0 B1 B2 B3 B4 B5 B6 B7 + // B0 B1 B2 B3 B4 B5 B6 B7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // B8 B9 BA BB BC BD BE BF + // B8 B9 BA BB BC BD BE BF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // C0 C1 C2 C3 C4 C5 C6 C7 + // C0 C1 C2 C3 C4 C5 C6 C7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // C8 C9 CA CB CC CD CE CF + // C8 C9 CA CB CC CD CE CF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // D0 D1 D2 D3 D4 D5 D6 D7 + // D0 D1 D2 D3 D4 D5 D6 D7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // D8 D9 DA DB DC DD DE DF + // D8 D9 DA DB DC DD DE DF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // E0 E1 E2 E3 E4 E5 E6 E7 + // E0 E1 E2 E3 E4 E5 E6 E7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // E8 E9 EA EB EC ED EE EF + // E8 E9 EA EB EC ED EE EF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // F0 F1 F2 F3 F4 F5 F6 F7 + // F0 F1 F2 F3 F4 F5 F6 F7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // F8 F9 FA FB FC FD FE FF - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80 -}; + // F8 F9 FA FB FC FD FE FF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80}; const uint8_t USERINFO_ENCODE_SET[32] = { - // 00 01 02 03 04 05 06 07 + // 00 01 02 03 04 05 06 07 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 08 09 0A 0B 0C 0D 0E 0F + // 08 09 0A 0B 0C 0D 0E 0F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 10 11 12 13 14 15 16 17 + // 10 11 12 13 14 15 16 17 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 18 19 1A 1B 1C 1D 1E 1F + // 18 19 1A 1B 1C 1D 1E 1F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 20 21 22 23 24 25 26 27 + // 20 21 22 23 24 25 26 27 0x01 | 0x00 | 0x04 | 0x08 | 0x00 | 0x00 | 0x00 | 0x00, - // 28 29 2A 2B 2C 2D 2E 2F + // 28 29 2A 2B 2C 2D 2E 2F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x80, - // 30 31 32 33 34 35 36 37 + // 30 31 32 33 34 35 36 37 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 38 39 3A 3B 3C 3D 3E 3F + // 38 39 3A 3B 3C 3D 3E 3F 0x00 | 0x00 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 40 41 42 43 44 45 46 47 + // 40 41 42 43 44 45 46 47 0x01 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 48 49 4A 4B 4C 4D 4E 4F + // 48 49 4A 4B 4C 4D 4E 4F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 50 51 52 53 54 55 56 57 + // 50 51 52 53 54 55 56 57 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 58 59 5A 5B 5C 5D 5E 5F + // 58 59 5A 5B 5C 5D 5E 5F 0x00 | 0x00 | 0x00 | 0x08 | 0x10 | 0x20 | 0x40 | 0x00, - // 60 61 62 63 64 65 66 67 + // 60 61 62 63 64 65 66 67 0x01 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 68 69 6A 6B 6C 6D 6E 6F + // 68 69 6A 6B 6C 6D 6E 6F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 70 71 72 73 74 75 76 77 + // 70 71 72 73 74 75 76 77 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 78 79 7A 7B 7C 7D 7E 7F + // 78 79 7A 7B 7C 7D 7E 7F 0x00 | 0x00 | 0x00 | 0x08 | 0x10 | 0x20 | 0x00 | 0x80, - // 80 81 82 83 84 85 86 87 + // 80 81 82 83 84 85 86 87 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 88 89 8A 8B 8C 8D 8E 8F + // 88 89 8A 8B 8C 8D 8E 8F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 90 91 92 93 94 95 96 97 + // 90 91 92 93 94 95 96 97 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 98 99 9A 9B 9C 9D 9E 9F + // 98 99 9A 9B 9C 9D 9E 9F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // A0 A1 A2 A3 A4 A5 A6 A7 + // A0 A1 A2 A3 A4 A5 A6 A7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // A8 A9 AA AB AC AD AE AF + // A8 A9 AA AB AC AD AE AF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // B0 B1 B2 B3 B4 B5 B6 B7 + // B0 B1 B2 B3 B4 B5 B6 B7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // B8 B9 BA BB BC BD BE BF + // B8 B9 BA BB BC BD BE BF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // C0 C1 C2 C3 C4 C5 C6 C7 + // C0 C1 C2 C3 C4 C5 C6 C7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // C8 C9 CA CB CC CD CE CF + // C8 C9 CA CB CC CD CE CF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // D0 D1 D2 D3 D4 D5 D6 D7 + // D0 D1 D2 D3 D4 D5 D6 D7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // D8 D9 DA DB DC DD DE DF + // D8 D9 DA DB DC DD DE DF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // E0 E1 E2 E3 E4 E5 E6 E7 + // E0 E1 E2 E3 E4 E5 E6 E7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // E8 E9 EA EB EC ED EE EF + // E8 E9 EA EB EC ED EE EF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // F0 F1 F2 F3 F4 F5 F6 F7 + // F0 F1 F2 F3 F4 F5 F6 F7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // F8 F9 FA FB FC FD FE FF - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80 -}; + // F8 F9 FA FB FC FD FE FF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80}; const uint8_t QUERY_ENCODE_SET_NONSPECIAL[32] = { - // 00 01 02 03 04 05 06 07 + // 00 01 02 03 04 05 06 07 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 08 09 0A 0B 0C 0D 0E 0F + // 08 09 0A 0B 0C 0D 0E 0F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 10 11 12 13 14 15 16 17 + // 10 11 12 13 14 15 16 17 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 18 19 1A 1B 1C 1D 1E 1F + // 18 19 1A 1B 1C 1D 1E 1F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 20 21 22 23 24 25 26 27 + // 20 21 22 23 24 25 26 27 0x01 | 0x00 | 0x04 | 0x08 | 0x00 | 0x00 | 0x00 | 0x00, - // 28 29 2A 2B 2C 2D 2E 2F + // 28 29 2A 2B 2C 2D 2E 2F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 30 31 32 33 34 35 36 37 + // 30 31 32 33 34 35 36 37 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 38 39 3A 3B 3C 3D 3E 3F + // 38 39 3A 3B 3C 3D 3E 3F 0x00 | 0x00 | 0x00 | 0x00 | 0x10 | 0x00 | 0x40 | 0x00, - // 40 41 42 43 44 45 46 47 + // 40 41 42 43 44 45 46 47 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 48 49 4A 4B 4C 4D 4E 4F + // 48 49 4A 4B 4C 4D 4E 4F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 50 51 52 53 54 55 56 57 + // 50 51 52 53 54 55 56 57 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 58 59 5A 5B 5C 5D 5E 5F + // 58 59 5A 5B 5C 5D 5E 5F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 60 61 62 63 64 65 66 67 + // 60 61 62 63 64 65 66 67 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 68 69 6A 6B 6C 6D 6E 6F + // 68 69 6A 6B 6C 6D 6E 6F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 70 71 72 73 74 75 76 77 + // 70 71 72 73 74 75 76 77 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 78 79 7A 7B 7C 7D 7E 7F + // 78 79 7A 7B 7C 7D 7E 7F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x80, - // 80 81 82 83 84 85 86 87 + // 80 81 82 83 84 85 86 87 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 88 89 8A 8B 8C 8D 8E 8F + // 88 89 8A 8B 8C 8D 8E 8F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 90 91 92 93 94 95 96 97 + // 90 91 92 93 94 95 96 97 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 98 99 9A 9B 9C 9D 9E 9F + // 98 99 9A 9B 9C 9D 9E 9F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // A0 A1 A2 A3 A4 A5 A6 A7 + // A0 A1 A2 A3 A4 A5 A6 A7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // A8 A9 AA AB AC AD AE AF + // A8 A9 AA AB AC AD AE AF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // B0 B1 B2 B3 B4 B5 B6 B7 + // B0 B1 B2 B3 B4 B5 B6 B7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // B8 B9 BA BB BC BD BE BF + // B8 B9 BA BB BC BD BE BF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // C0 C1 C2 C3 C4 C5 C6 C7 + // C0 C1 C2 C3 C4 C5 C6 C7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // C8 C9 CA CB CC CD CE CF + // C8 C9 CA CB CC CD CE CF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // D0 D1 D2 D3 D4 D5 D6 D7 + // D0 D1 D2 D3 D4 D5 D6 D7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // D8 D9 DA DB DC DD DE DF + // D8 D9 DA DB DC DD DE DF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // E0 E1 E2 E3 E4 E5 E6 E7 + // E0 E1 E2 E3 E4 E5 E6 E7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // E8 E9 EA EB EC ED EE EF + // E8 E9 EA EB EC ED EE EF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // F0 F1 F2 F3 F4 F5 F6 F7 + // F0 F1 F2 F3 F4 F5 F6 F7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // F8 F9 FA FB FC FD FE FF - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80 -}; + // F8 F9 FA FB FC FD FE FF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80}; // Same as QUERY_ENCODE_SET_NONSPECIAL, but with 0x27 (') encoded. const uint8_t QUERY_ENCODE_SET_SPECIAL[32] = { - // 00 01 02 03 04 05 06 07 + // 00 01 02 03 04 05 06 07 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 08 09 0A 0B 0C 0D 0E 0F + // 08 09 0A 0B 0C 0D 0E 0F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 10 11 12 13 14 15 16 17 + // 10 11 12 13 14 15 16 17 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 18 19 1A 1B 1C 1D 1E 1F + // 18 19 1A 1B 1C 1D 1E 1F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 20 21 22 23 24 25 26 27 + // 20 21 22 23 24 25 26 27 0x01 | 0x00 | 0x04 | 0x08 | 0x00 | 0x00 | 0x00 | 0x80, - // 28 29 2A 2B 2C 2D 2E 2F + // 28 29 2A 2B 2C 2D 2E 2F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 30 31 32 33 34 35 36 37 + // 30 31 32 33 34 35 36 37 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 38 39 3A 3B 3C 3D 3E 3F + // 38 39 3A 3B 3C 3D 3E 3F 0x00 | 0x00 | 0x00 | 0x00 | 0x10 | 0x00 | 0x40 | 0x00, - // 40 41 42 43 44 45 46 47 + // 40 41 42 43 44 45 46 47 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 48 49 4A 4B 4C 4D 4E 4F + // 48 49 4A 4B 4C 4D 4E 4F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 50 51 52 53 54 55 56 57 + // 50 51 52 53 54 55 56 57 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 58 59 5A 5B 5C 5D 5E 5F + // 58 59 5A 5B 5C 5D 5E 5F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 60 61 62 63 64 65 66 67 + // 60 61 62 63 64 65 66 67 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 68 69 6A 6B 6C 6D 6E 6F + // 68 69 6A 6B 6C 6D 6E 6F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 70 71 72 73 74 75 76 77 + // 70 71 72 73 74 75 76 77 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00, - // 78 79 7A 7B 7C 7D 7E 7F + // 78 79 7A 7B 7C 7D 7E 7F 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x80, - // 80 81 82 83 84 85 86 87 + // 80 81 82 83 84 85 86 87 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 88 89 8A 8B 8C 8D 8E 8F + // 88 89 8A 8B 8C 8D 8E 8F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 90 91 92 93 94 95 96 97 + // 90 91 92 93 94 95 96 97 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // 98 99 9A 9B 9C 9D 9E 9F + // 98 99 9A 9B 9C 9D 9E 9F 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // A0 A1 A2 A3 A4 A5 A6 A7 + // A0 A1 A2 A3 A4 A5 A6 A7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // A8 A9 AA AB AC AD AE AF + // A8 A9 AA AB AC AD AE AF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // B0 B1 B2 B3 B4 B5 B6 B7 + // B0 B1 B2 B3 B4 B5 B6 B7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // B8 B9 BA BB BC BD BE BF + // B8 B9 BA BB BC BD BE BF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // C0 C1 C2 C3 C4 C5 C6 C7 + // C0 C1 C2 C3 C4 C5 C6 C7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // C8 C9 CA CB CC CD CE CF + // C8 C9 CA CB CC CD CE CF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // D0 D1 D2 D3 D4 D5 D6 D7 + // D0 D1 D2 D3 D4 D5 D6 D7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // D8 D9 DA DB DC DD DE DF + // D8 D9 DA DB DC DD DE DF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // E0 E1 E2 E3 E4 E5 E6 E7 + // E0 E1 E2 E3 E4 E5 E6 E7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // E8 E9 EA EB EC ED EE EF + // E8 E9 EA EB EC ED EE EF 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // F0 F1 F2 F3 F4 F5 F6 F7 + // F0 F1 F2 F3 F4 F5 F6 F7 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80, - // F8 F9 FA FB FC FD FE FF - 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80 -}; + // F8 F9 FA FB FC FD FE FF + 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x40 | 0x80}; inline bool BitAt(const uint8_t a[], const uint8_t i) { return !!(a[i >> 3] & (1 << (i & 7))); @@ -684,19 +671,15 @@ inline void AppendOrEscape(std::string* str, template inline unsigned hex2bin(const T ch) { - if (ch >= '0' && ch <= '9') - return ch - '0'; - if (ch >= 'A' && ch <= 'F') - return 10 + (ch - 'A'); - if (ch >= 'a' && ch <= 'f') - return 10 + (ch - 'a'); + if (ch >= '0' && ch <= '9') return ch - '0'; + if (ch >= 'A' && ch <= 'F') return 10 + (ch - 'A'); + if (ch >= 'a' && ch <= 'f') return 10 + (ch - 'a'); return static_cast(-1); } inline std::string PercentDecode(const char* input, size_t len) { std::string dest; - if (len == 0) - return dest; + if (len == 0) return dest; dest.reserve(len); const char* pointer = input; const char* end = input + len; @@ -706,8 +689,7 @@ inline std::string PercentDecode(const char* input, size_t len) { const size_t remaining = end - pointer - 1; if (ch != '%' || remaining < 2 || (ch == '%' && - (!IsASCIIHexDigit(pointer[1]) || - !IsASCIIHexDigit(pointer[2])))) { + (!IsASCIIHexDigit(pointer[1]) || !IsASCIIHexDigit(pointer[2])))) { dest += ch; pointer++; continue; @@ -722,17 +704,18 @@ inline std::string PercentDecode(const char* input, size_t len) { return dest; } -#define SPECIALS(XX) \ - XX("ftp:", 21) \ - XX("file:", -1) \ - XX("gopher:", 70) \ - XX("http:", 80) \ - XX("https:", 443) \ - XX("ws:", 80) \ +#define SPECIALS(XX) \ + XX("ftp:", 21) \ + XX("file:", -1) \ + XX("gopher:", 70) \ + XX("http:", 80) \ + XX("https:", 443) \ + XX("ws:", 80) \ XX("wss:", 443) inline bool IsSpecial(const std::string& scheme) { -#define XX(name, _) if (scheme == name) return true; +#define XX(name, _) \ + if (scheme == name) return true; SPECIALS(XX); #undef XX return false; @@ -741,17 +724,14 @@ inline bool IsSpecial(const std::string& scheme) { // https://url.spec.whatwg.org/#start-with-a-windows-drive-letter inline bool StartsWithWindowsDriveLetter(const char* p, const char* end) { const size_t length = end - p; - return length >= 2 && - IsWindowsDriveLetter(p[0], p[1]) && - (length == 2 || - p[2] == '/' || - p[2] == '\\' || - p[2] == '?' || - p[2] == '#'); + return length >= 2 && IsWindowsDriveLetter(p[0], p[1]) && + (length == 2 || p[2] == '/' || p[2] == '\\' || p[2] == '?' || + p[2] == '#'); } inline int NormalizePort(const std::string& scheme, int p) { -#define XX(name, port) if (scheme == name && p == port) return -1; +#define XX(name, port) \ + if (scheme == name && p == port) return -1; SPECIALS(XX); #undef XX return p; @@ -760,16 +740,14 @@ inline int NormalizePort(const std::string& scheme, int p) { #if defined(NODE_HAVE_I18N_SUPPORT) inline bool ToUnicode(const std::string& input, std::string* output) { MaybeStackBuffer buf; - if (i18n::ToUnicode(&buf, input.c_str(), input.length()) < 0) - return false; + if (i18n::ToUnicode(&buf, input.c_str(), input.length()) < 0) return false; output->assign(*buf, buf.length()); return true; } inline bool ToASCII(const std::string& input, std::string* output) { MaybeStackBuffer buf; - if (i18n::ToASCII(&buf, input.c_str(), input.length()) < 0) - return false; + if (i18n::ToASCII(&buf, input.c_str(), input.length()) < 0) return false; output->assign(*buf, buf.length()); return true; } @@ -789,8 +767,7 @@ inline bool ToASCII(const std::string& input, std::string* output) { void URLHost::ParseIPv6Host(const char* input, size_t length) { CHECK_EQ(type_, HostType::H_FAILED); unsigned size = arraysize(value_.ipv6); - for (unsigned n = 0; n < size; n++) - value_.ipv6[n] = 0; + for (unsigned n = 0; n < size; n++) value_.ipv6[n] = 0; uint16_t* piece_pointer = &value_.ipv6[0]; uint16_t* const buffer_end = piece_pointer + size; uint16_t* compress_pointer = nullptr; @@ -799,19 +776,16 @@ void URLHost::ParseIPv6Host(const char* input, size_t length) { unsigned value, len, numbers_seen; char ch = pointer < end ? pointer[0] : kEOL; if (ch == ':') { - if (length < 2 || pointer[1] != ':') - return; + if (length < 2 || pointer[1] != ':') return; pointer += 2; ch = pointer < end ? pointer[0] : kEOL; piece_pointer++; compress_pointer = piece_pointer; } while (ch != kEOL) { - if (piece_pointer >= buffer_end) - return; + if (piece_pointer >= buffer_end) return; if (ch == ':') { - if (compress_pointer != nullptr) - return; + if (compress_pointer != nullptr) return; pointer++; ch = pointer < end ? pointer[0] : kEOL; piece_pointer++; @@ -828,12 +802,10 @@ void URLHost::ParseIPv6Host(const char* input, size_t length) { } switch (ch) { case '.': - if (len == 0) - return; + if (len == 0) return; pointer -= len; ch = pointer < end ? pointer[0] : kEOL; - if (piece_pointer > buffer_end - 2) - return; + if (piece_pointer > buffer_end - 2) return; numbers_seen = 0; while (ch != kEOL) { value = 0xffffffff; @@ -845,8 +817,7 @@ void URLHost::ParseIPv6Host(const char* input, size_t length) { return; } } - if (!IsASCIIDigit(ch)) - return; + if (!IsASCIIDigit(ch)) return; while (IsASCIIDigit(ch)) { unsigned number = ch - '0'; if (value == 0xffffffff) { @@ -856,24 +827,20 @@ void URLHost::ParseIPv6Host(const char* input, size_t length) { } else { value = value * 10 + number; } - if (value > 255) - return; + if (value > 255) return; pointer++; ch = pointer < end ? pointer[0] : kEOL; } *piece_pointer = *piece_pointer * 0x100 + value; numbers_seen++; - if (numbers_seen == 2 || numbers_seen == 4) - piece_pointer++; + if (numbers_seen == 2 || numbers_seen == 4) piece_pointer++; } - if (numbers_seen != 4) - return; + if (numbers_seen != 4) return; continue; case ':': pointer++; ch = pointer < end ? pointer[0] : kEOL; - if (ch == kEOL) - return; + if (ch == kEOL) return; break; case kEOL: break; @@ -892,11 +859,10 @@ void URLHost::ParseIPv6Host(const char* input, size_t length) { uint16_t* swap_piece = compress_pointer + swaps - 1; *piece_pointer = *swap_piece; *swap_piece = temp; - piece_pointer--; - swaps--; + piece_pointer--; + swaps--; } - } else if (compress_pointer == nullptr && - piece_pointer != buffer_end) { + } else if (compress_pointer == nullptr && piece_pointer != buffer_end) { return; } type_ = HostType::H_IPV6; @@ -920,16 +886,13 @@ inline int64_t ParseNumber(const char* start, const char* end) { const char ch = p[0]; switch (R) { case 8: - if (ch < '0' || ch > '7') - return -1; + if (ch < '0' || ch > '7') return -1; break; case 10: - if (!IsASCIIDigit(ch)) - return -1; + if (!IsASCIIDigit(ch)) return -1; break; case 16: - if (!IsASCIIHexDigit(ch)) - return -1; + if (!IsASCIIHexDigit(ch)) return -1; break; } p++; @@ -947,28 +910,23 @@ void URLHost::ParseIPv4Host(const char* input, size_t length, bool* is_ipv4) { uint32_t val = 0; uint64_t numbers[4]; int tooBigNumbers = 0; - if (length == 0) - return; + if (length == 0) return; while (pointer <= end) { const char ch = pointer < end ? pointer[0] : kEOL; const int remaining = end - pointer - 1; if (ch == '.' || ch == kEOL) { - if (++parts > static_cast(arraysize(numbers))) - return; - if (pointer == mark) - return; + if (++parts > static_cast(arraysize(numbers))) return; + if (pointer == mark) return; int64_t n = ParseNumber(mark, pointer); - if (n < 0) - return; + if (n < 0) return; if (n > 255) { tooBigNumbers++; } numbers[parts - 1] = n; mark = pointer + 1; - if (ch == '.' && remaining == 0) - break; + if (ch == '.' && remaining == 0) break; } pointer++; } @@ -978,8 +936,7 @@ void URLHost::ParseIPv4Host(const char* input, size_t length, bool* is_ipv4) { // If any but the last item in numbers is greater than 255, return failure. // If the last item in numbers is greater than or equal to // 256^(5 - the number of items in numbers), return failure. - if (tooBigNumbers > 1 || - (tooBigNumbers == 1 && numbers[parts - 1] <= 255) || + if (tooBigNumbers > 1 || (tooBigNumbers == 1 && numbers[parts - 1] <= 255) || numbers[parts - 1] >= pow(256, static_cast(5 - parts))) { return; } @@ -1017,24 +974,20 @@ void URLHost::ParseHost(const char* input, CHECK_EQ(type_, HostType::H_FAILED); const char* pointer = input; - if (length == 0) - return; + if (length == 0) return; if (pointer[0] == '[') { - if (pointer[length - 1] != ']') - return; + if (pointer[length - 1] != ']') return; return ParseIPv6Host(++pointer, length - 2); } - if (!is_special) - return ParseOpaqueHost(input, length); + if (!is_special) return ParseOpaqueHost(input, length); // First, we have to percent decode std::string decoded = PercentDecode(input, length); // Then we have to punycode toASCII - if (!ToASCII(decoded, &decoded)) - return; + if (!ToASCII(decoded, &decoded)) return; // If any of the following characters are still present, we have to fail for (size_t n = 0; n < decoded.size(); n++) { @@ -1047,12 +1000,10 @@ void URLHost::ParseHost(const char* input, // Check to see if it's an IPv4 IP address bool is_ipv4; ParseIPv4Host(decoded.c_str(), decoded.length(), &is_ipv4); - if (is_ipv4) - return; + if (is_ipv4) return; // If the unicode flag is set, run the result through punycode ToUnicode - if (unicode && !ToUnicode(decoded, &decoded)) - return; + if (unicode && !ToUnicode(decoded, &decoded)) return; // It's not an IPv4 or IPv6 address, it must be a domain SetDomain(std::move(decoded)); @@ -1071,8 +1022,7 @@ inline T* FindLongestZeroSequence(T* values, size_t len) { while (start < end) { if (*start == 0) { - if (current == nullptr) - current = start; + if (current == nullptr) current = start; counter++; } else { if (counter > longest) { @@ -1084,8 +1034,7 @@ inline T* FindLongestZeroSequence(T* values, size_t len) { } start++; } - if (counter > longest) - result = current; + if (counter > longest) result = current; return result; } @@ -1118,8 +1067,7 @@ std::string URLHost::ToString() const { char buf[4]; snprintf(buf, sizeof(buf), "%d", value % 256); dest.insert(0, buf); - if (n < 3) - dest.insert(0, 1, '.'); + if (n < 3) dest.insert(0, 1, '.'); value /= 256; } break; @@ -1128,8 +1076,7 @@ std::string URLHost::ToString() const { dest.reserve(41); dest += '['; const uint16_t* start = &value_.ipv6[0]; - const uint16_t* compress_pointer = - FindLongestZeroSequence(start, 8); + const uint16_t* compress_pointer = FindLongestZeroSequence(start, 8); bool ignore0 = false; for (int n = 0; n <= 7; n++) { const uint16_t* piece = &value_.ipv6[n]; @@ -1145,8 +1092,7 @@ std::string URLHost::ToString() const { char buf[5]; snprintf(buf, sizeof(buf), "%x", *piece); dest += buf; - if (n < 7) - dest += ':'; + if (n < 7) dest += ':'; } dest += ']'; break; @@ -1167,8 +1113,7 @@ bool ParseHost(const std::string& input, } URLHost host; host.ParseHost(input.c_str(), input.length(), is_special, unicode); - if (host.ParsingFailed()) - return false; + if (host.ParsingFailed()) return false; *output = host.ToStringMove(); return true; } @@ -1177,8 +1122,7 @@ inline std::vector FromJSStringArray(Environment* env, Local array) { std::vector vec; const int32_t len = array->Length(); - if (len == 0) - return vec; // nothing to copy + if (len == 0) return vec; // nothing to copy vec.reserve(len); for (int32_t n = 0; n < len; n++) { Local val = array->Get(env->context(), n).ToLocalChecked(); @@ -1195,8 +1139,7 @@ inline url_data HarvestBase(Environment* env, Local base_obj) { Local context = env->context(); Local flags = base_obj->Get(env->context(), env->flags_string()).ToLocalChecked(); - if (flags->IsInt32()) - base.flags = flags->Int32Value(context).FromJust(); + if (flags->IsInt32()) base.flags = flags->Int32Value(context).FromJust(); Local scheme = base_obj->Get(env->context(), env->scheme_string()).ToLocalChecked(); @@ -1232,11 +1175,10 @@ inline url_data HarvestBase(Environment* env, Local base_obj) { Local port = base_obj->Get(env->context(), env->port_string()).ToLocalChecked(); - if (port->IsInt32()) - base.port = port.As()->Value(); + if (port->IsInt32()) base.port = port.As()->Value(); - Local - path = base_obj->Get(env->context(), env->path_string()).ToLocalChecked(); + Local path = + base_obj->Get(env->context(), env->path_string()).ToLocalChecked(); if (path->IsArray()) { base.flags |= URL_FLAGS_HAS_PATH; base.path = FromJSStringArray(env, path.As()); @@ -1250,11 +1192,8 @@ inline url_data HarvestContext(Environment* env, Local context_obj) { context_obj->Get(env->context(), env->flags_string()).ToLocalChecked(); if (flags->IsInt32()) { static const int32_t copy_flags_mask = - URL_FLAGS_SPECIAL | - URL_FLAGS_CANNOT_BE_BASE | - URL_FLAGS_HAS_USERNAME | - URL_FLAGS_HAS_PASSWORD | - URL_FLAGS_HAS_HOST; + URL_FLAGS_SPECIAL | URL_FLAGS_CANNOT_BE_BASE | URL_FLAGS_HAS_USERNAME | + URL_FLAGS_HAS_PASSWORD | URL_FLAGS_HAS_HOST; context.flags |= flags.As()->Value() & copy_flags_mask; } Local scheme = @@ -1265,27 +1204,25 @@ inline url_data HarvestContext(Environment* env, Local context_obj) { } Local port = context_obj->Get(env->context(), env->port_string()).ToLocalChecked(); - if (port->IsInt32()) - context.port = port.As()->Value(); + if (port->IsInt32()) context.port = port.As()->Value(); if (context.flags & URL_FLAGS_HAS_USERNAME) { Local username = - context_obj->Get(env->context(), - env->username_string()).ToLocalChecked(); + context_obj->Get(env->context(), env->username_string()) + .ToLocalChecked(); CHECK(username->IsString()); Utf8Value value(env->isolate(), username); context.username.assign(*value, value.length()); } if (context.flags & URL_FLAGS_HAS_PASSWORD) { Local password = - context_obj->Get(env->context(), - env->password_string()).ToLocalChecked(); + context_obj->Get(env->context(), env->password_string()) + .ToLocalChecked(); CHECK(password->IsString()); Utf8Value value(env->isolate(), password); context.password.assign(*value, value.length()); } Local host = - context_obj->Get(env->context(), - env->host_string()).ToLocalChecked(); + context_obj->Get(env->context(), env->host_string()).ToLocalChecked(); if (host->IsString()) { Utf8Value value(env->isolate(), host); context.host.assign(*value, value.length()); @@ -1299,9 +1236,7 @@ inline bool IsSingleDotSegment(const std::string& str) { case 1: return str == "."; case 3: - return str[0] == '%' && - str[1] == '2' && - ASCIILowercase(str[2]) == 'e'; + return str[0] == '%' && str[1] == '2' && ASCIILowercase(str[2]) == 'e'; default: return false; } @@ -1315,23 +1250,14 @@ inline bool IsDoubleDotSegment(const std::string& str) { case 2: return str == ".."; case 4: - if (str[0] != '.' && str[0] != '%') - return false; - return ((str[0] == '.' && - str[1] == '%' && - str[2] == '2' && + if (str[0] != '.' && str[0] != '%') return false; + return ((str[0] == '.' && str[1] == '%' && str[2] == '2' && ASCIILowercase(str[3]) == 'e') || - (str[0] == '%' && - str[1] == '2' && - ASCIILowercase(str[2]) == 'e' && - str[3] == '.')); + (str[0] == '%' && str[1] == '2' && + ASCIILowercase(str[2]) == 'e' && str[3] == '.')); case 6: - return (str[0] == '%' && - str[1] == '2' && - ASCIILowercase(str[2]) == 'e' && - str[3] == '%' && - str[4] == '2' && - ASCIILowercase(str[5]) == 'e'); + return (str[0] == '%' && str[1] == '2' && ASCIILowercase(str[2]) == 'e' && + str[3] == '%' && str[4] == '2' && ASCIILowercase(str[5]) == 'e'); default: return false; } @@ -1340,7 +1266,8 @@ inline bool IsDoubleDotSegment(const std::string& str) { inline void ShortenUrlPath(struct url_data* url) { if (url->path.empty()) return; if (url->path.size() == 1 && url->scheme == "file:" && - IsNormalizedWindowsDriveLetter(url->path[0])) return; + IsNormalizedWindowsDriveLetter(url->path[0])) + return; url->path.pop_back(); } @@ -1378,16 +1305,14 @@ void URL::Parse(const char* input, // contents, but in the general case we avoid the overhead. std::string whitespace_stripped; for (const char* ptr = p; ptr < end; ptr++) { - if (!IsASCIITabOrNewline(*ptr)) - continue; + if (!IsASCIITabOrNewline(*ptr)) continue; // Hit tab or newline. Allocate storage, copy what we have until now, // and then iterate and filter all similar characters out. whitespace_stripped.reserve(len - 1); whitespace_stripped.assign(p, ptr - p); // 'ptr + 1' skips the current char, which we know to be tab or newline. for (ptr = ptr + 1; ptr < end; ptr++) { - if (!IsASCIITabOrNewline(*ptr)) - whitespace_stripped += *ptr; + if (!IsASCIITabOrNewline(*ptr)) whitespace_stripped += *ptr; } // Update variables like they should have looked like if the string @@ -1399,16 +1324,16 @@ void URL::Parse(const char* input, break; } - bool atflag = false; // Set when @ has been seen. - bool square_bracket_flag = false; // Set inside of [...] + bool atflag = false; // Set when @ has been seen. + bool square_bracket_flag = false; // Set inside of [...] bool password_token_seen_flag = false; // Set after a : after an username. std::string buffer; // Set the initial parse state. const bool has_state_override = state_override != kUnknownState; - enum url_parse_state state = has_state_override ? state_override : - kSchemeStart; + enum url_parse_state state = + has_state_override ? state_override : kSchemeStart; if (state < kSchemeStart || state > kFragment) { url->flags |= URL_FLAGS_INVALID_PARSE_STATE; @@ -1470,13 +1395,10 @@ void URL::Parse(const char* input, special = false; } buffer.clear(); - if (has_state_override) - return; + if (has_state_override) return; if (url->scheme == "file:") { state = kFile; - } else if (special && - has_base && - url->scheme == base->scheme) { + } else if (special && has_base && url->scheme == base->scheme) { state = kSpecialRelativeOrAuthority; } else if (special) { state = kSpecialAuthoritySlashes; @@ -1527,8 +1449,7 @@ void URL::Parse(const char* input, } url->flags |= URL_FLAGS_CANNOT_BE_BASE; state = kFragment; - } else if (has_base && - base->scheme != "file:") { + } else if (has_base && base->scheme != "file:") { state = kRelative; continue; } else { @@ -1727,10 +1648,7 @@ void URL::Parse(const char* input, } } buffer.clear(); - } else if (ch == kEOL || - ch == '/' || - ch == '?' || - ch == '#' || + } else if (ch == kEOL || ch == '/' || ch == '?' || ch == '#' || special_back_slash) { if (atflag && buffer.size() == 0) { url->flags |= URL_FLAGS_FAILED; @@ -1763,18 +1681,14 @@ void URL::Parse(const char* input, if (state_override == kHostname) { return; } - } else if (ch == kEOL || - ch == '/' || - ch == '?' || - ch == '#' || + } else if (ch == kEOL || ch == '/' || ch == '?' || ch == '#' || special_back_slash) { p--; if (special && buffer.size() == 0) { url->flags |= URL_FLAGS_FAILED; return; } - if (has_state_override && - buffer.size() == 0 && + if (has_state_override && buffer.size() == 0 && ((url->username.size() > 0 || url->password.size() > 0) || url->port != -1)) { url->flags |= URL_FLAGS_TERMINATED; @@ -1791,22 +1705,16 @@ void URL::Parse(const char* input, return; } } else { - if (ch == '[') - square_bracket_flag = true; - if (ch == ']') - square_bracket_flag = false; + if (ch == '[') square_bracket_flag = true; + if (ch == ']') square_bracket_flag = false; buffer += ch; } break; case kPort: if (IsASCIIDigit(ch)) { buffer += ch; - } else if (has_state_override || - ch == kEOL || - ch == '/' || - ch == '?' || - ch == '#' || - special_back_slash) { + } else if (has_state_override || ch == kEOL || ch == '/' || ch == '?' || + ch == '#' || special_back_slash) { if (buffer.size() > 0) { unsigned port = 0; // the condition port <= 0xffff prevents integer overflow @@ -1825,8 +1733,7 @@ void URL::Parse(const char* input, } // the port is valid url->port = NormalizePort(url->scheme, static_cast(port)); - if (url->port == -1) - url->flags |= URL_FLAGS_IS_DEFAULT_SCHEME_PORT; + if (url->port == -1) url->flags |= URL_FLAGS_IS_DEFAULT_SCHEME_PORT; buffer.clear(); } else if (has_state_override) { // TODO(TimothyGu): Similar case as above. @@ -1917,8 +1824,7 @@ void URL::Parse(const char* input, if (ch == '/' || ch == '\\') { state = kFileHost; } else { - if (has_base && - base->scheme == "file:" && + if (has_base && base->scheme == "file:" && !StartsWithWindowsDriveLetter(p, end)) { if (IsNormalizedWindowsDriveLetter(base->path[0])) { url->flags |= URL_FLAGS_HAS_PATH; @@ -1938,20 +1844,14 @@ void URL::Parse(const char* input, } break; case kFileHost: - if (ch == kEOL || - ch == '/' || - ch == '\\' || - ch == '?' || - ch == '#') { - if (!has_state_override && - buffer.size() == 2 && + if (ch == kEOL || ch == '/' || ch == '\\' || ch == '?' || ch == '#') { + if (!has_state_override && buffer.size() == 2 && IsWindowsDriveLetter(buffer)) { state = kPath; } else if (buffer.size() == 0) { url->flags |= URL_FLAGS_HAS_HOST; url->host.clear(); - if (has_state_override) - return; + if (has_state_override) return; state = kPathStart; } else { std::string host; @@ -1959,12 +1859,10 @@ void URL::Parse(const char* input, url->flags |= URL_FLAGS_FAILED; return; } - if (host == "localhost") - host.clear(); + if (host == "localhost") host.clear(); url->flags |= URL_FLAGS_HAS_HOST; url->host = host; - if (has_state_override) - return; + if (has_state_override) return; buffer.clear(); state = kPathStart; } @@ -1995,9 +1893,7 @@ void URL::Parse(const char* input, } break; case kPath: - if (ch == kEOL || - ch == '/' || - special_back_slash || + if (ch == kEOL || ch == '/' || special_back_slash || (!has_state_override && (ch == '?' || ch == '#'))) { if (IsDoubleDotSegment(buffer)) { ShortenUrlPath(url); @@ -2005,17 +1901,14 @@ void URL::Parse(const char* input, url->flags |= URL_FLAGS_HAS_PATH; url->path.emplace_back(""); } - } else if (IsSingleDotSegment(buffer) && - ch != '/' && !special_back_slash) { + } else if (IsSingleDotSegment(buffer) && ch != '/' && + !special_back_slash) { url->flags |= URL_FLAGS_HAS_PATH; url->path.emplace_back(""); } else if (!IsSingleDotSegment(buffer)) { - if (url->scheme == "file:" && - url->path.empty() && - buffer.size() == 2 && - IsWindowsDriveLetter(buffer)) { - if ((url->flags & URL_FLAGS_HAS_HOST) && - !url->host.empty()) { + if (url->scheme == "file:" && url->path.empty() && + buffer.size() == 2 && IsWindowsDriveLetter(buffer)) { + if ((url->flags & URL_FLAGS_HAS_HOST) && !url->host.empty()) { url->host.clear(); url->flags |= URL_FLAGS_HAS_HOST; } @@ -2026,9 +1919,7 @@ void URL::Parse(const char* input, } buffer.clear(); if (url->scheme == "file:" && - (ch == kEOL || - ch == '?' || - ch == '#')) { + (ch == kEOL || ch == '?' || ch == '#')) { while (url->path.size() > 1 && url->path[0].length() == 0) { url->path.erase(url->path.begin()); } @@ -2052,8 +1943,7 @@ void URL::Parse(const char* input, state = kFragment; break; default: - if (url->path.size() == 0) - url->path.push_back(""); + if (url->path.size() == 0) url->path.push_back(""); if (url->path.size() > 0 && ch != kEOL) AppendOrEscape(&url->path[0], ch, C0_CONTROL_ENCODE_SET); } @@ -2063,11 +1953,12 @@ void URL::Parse(const char* input, url->flags |= URL_FLAGS_HAS_QUERY; url->query = std::move(buffer); buffer.clear(); - if (ch == '#') - state = kFragment; + if (ch == '#') state = kFragment; } else { - AppendOrEscape(&buffer, ch, special ? QUERY_ENCODE_SET_SPECIAL : - QUERY_ENCODE_SET_NONSPECIAL); + AppendOrEscape( + &buffer, + ch, + special ? QUERY_ENCODE_SET_SPECIAL : QUERY_ENCODE_SET_NONSPECIAL); } break; case kFragment: @@ -2107,8 +1998,7 @@ static inline void SetArgs(Environment* env, argv[ARG_QUERY] = Utf8String(isolate, url.query); if (url.flags & URL_FLAGS_HAS_FRAGMENT) argv[ARG_FRAGMENT] = Utf8String(isolate, url.fragment); - if (url.port > -1) - argv[ARG_PORT] = Integer::New(isolate, url.port); + if (url.port > -1) argv[ARG_PORT] = Integer::New(isolate, url.port); if (url.flags & URL_FLAGS_HAS_PATH) argv[ARG_PATH] = ToV8Value(env->context(), url.path).ToLocalChecked(); } @@ -2132,15 +2022,12 @@ static void Parse(Environment* env, url_data base; url_data url; - if (has_context) - url = HarvestContext(env, context_obj.As()); - if (has_base) - base = HarvestBase(env, base_obj.As()); + if (has_context) url = HarvestContext(env, context_obj.As()); + if (has_base) base = HarvestBase(env, base_obj.As()); URL::Parse(input, len, state_override, &url, has_context, &base, has_base); if ((url.flags & URL_FLAGS_INVALID_PARSE_STATE) || - ((state_override != kUnknownState) && - (url.flags & URL_FLAGS_TERMINATED))) + ((state_override != kUnknownState) && (url.flags & URL_FLAGS_TERMINATED))) return; // Define the return value placeholders @@ -2148,26 +2035,26 @@ static void Parse(Environment* env, const Local null = Null(isolate); if (!(url.flags & URL_FLAGS_FAILED)) { Local argv[] = { - undef, - undef, - undef, - undef, - null, // host defaults to null - null, // port defaults to null - undef, - null, // query defaults to null - null, // fragment defaults to null + undef, + undef, + undef, + undef, + null, // host defaults to null + null, // port defaults to null + undef, + null, // query defaults to null + null, // fragment defaults to null }; SetArgs(env, argv, url); cb->Call(context, recv, arraysize(argv), argv).FromMaybe(Local()); } else if (error_cb->IsFunction()) { - Local argv[2] = { undef, undef }; + Local argv[2] = {undef, undef}; argv[ERR_ARG_FLAGS] = Integer::NewFromUnsigned(isolate, url.flags); argv[ERR_ARG_INPUT] = - String::NewFromUtf8(env->isolate(), - input, - NewStringType::kNormal).ToLocalChecked(); - error_cb.As()->Call(context, recv, arraysize(argv), argv) + String::NewFromUtf8(env->isolate(), input, NewStringType::kNormal) + .ToLocalChecked(); + error_cb.As() + ->Call(context, recv, arraysize(argv), argv) .FromMaybe(Local()); } } @@ -2175,14 +2062,12 @@ static void Parse(Environment* env, static void Parse(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); CHECK_GE(args.Length(), 5); - CHECK(args[0]->IsString()); // input + CHECK(args[0]->IsString()); // input CHECK(args[2]->IsUndefined() || // base context - args[2]->IsNull() || - args[2]->IsObject()); + args[2]->IsNull() || args[2]->IsObject()); CHECK(args[3]->IsUndefined() || // context - args[3]->IsNull() || - args[3]->IsObject()); - CHECK(args[4]->IsFunction()); // complete callback + args[3]->IsNull() || args[3]->IsObject()); + CHECK(args[4]->IsFunction()); // complete callback CHECK(args[5]->IsUndefined() || args[5]->IsFunction()); // error callback Utf8Value input(env->isolate(), args[0]); @@ -2192,8 +2077,10 @@ static void Parse(const FunctionCallbackInfo& args) { args[1]->Uint32Value(env->context()).FromJust()); } - Parse(env, args.This(), - *input, input.length(), + Parse(env, + args.This(), + *input, + input.length(), state_override, args[2], args[3], @@ -2213,10 +2100,10 @@ static void EncodeAuthSet(const FunctionCallbackInfo& args) { const char ch = (*value)[n]; AppendOrEscape(&output, ch, USERINFO_ENCODE_SET); } - args.GetReturnValue().Set( - String::NewFromUtf8(env->isolate(), - output.c_str(), - NewStringType::kNormal).ToLocalChecked()); + args.GetReturnValue().Set(String::NewFromUtf8(env->isolate(), + output.c_str(), + NewStringType::kNormal) + .ToLocalChecked()); } static void ToUSVString(const FunctionCallbackInfo& args) { @@ -2248,10 +2135,8 @@ static void ToUSVString(const FunctionCallbackInfo& args) { } args.GetReturnValue().Set( - String::NewFromTwoByte(env->isolate(), - *value, - NewStringType::kNormal, - n).ToLocalChecked()); + String::NewFromTwoByte(env->isolate(), *value, NewStringType::kNormal, n) + .ToLocalChecked()); } static void DomainToASCII(const FunctionCallbackInfo& args) { @@ -2269,9 +2154,8 @@ static void DomainToASCII(const FunctionCallbackInfo& args) { } std::string out = host.ToStringMove(); args.GetReturnValue().Set( - String::NewFromUtf8(env->isolate(), - out.c_str(), - NewStringType::kNormal).ToLocalChecked()); + String::NewFromUtf8(env->isolate(), out.c_str(), NewStringType::kNormal) + .ToLocalChecked()); } static void DomainToUnicode(const FunctionCallbackInfo& args) { @@ -2289,9 +2173,8 @@ static void DomainToUnicode(const FunctionCallbackInfo& args) { } std::string out = host.ToStringMove(); args.GetReturnValue().Set( - String::NewFromUtf8(env->isolate(), - out.c_str(), - NewStringType::kNormal).ToLocalChecked()); + String::NewFromUtf8(env->isolate(), out.c_str(), NewStringType::kNormal) + .ToLocalChecked()); } std::string URL::ToFilePath() const { @@ -2301,16 +2184,11 @@ std::string URL::ToFilePath() const { #ifdef _WIN32 const char* slash = "\\"; - auto is_slash = [] (char ch) { - return ch == '/' || ch == '\\'; - }; + auto is_slash = [](char ch) { return ch == '/' || ch == '\\'; }; #else const char* slash = "/"; - auto is_slash = [] (char ch) { - return ch == '/'; - }; - if ((context_.flags & URL_FLAGS_HAS_HOST) && - context_.host.length() > 0) { + auto is_slash = [](char ch) { return ch == '/'; }; + if ((context_.flags & URL_FLAGS_HAS_HOST) && context_.host.length() > 0) { return ""; } #endif @@ -2333,8 +2211,7 @@ std::string URL::ToFilePath() const { // need to worry about percent encoding because the URL parser will have // already taken care of that for us. Note that this only causes IDNs with an // appropriate `xn--` prefix to be decoded. - if ((context_.flags & URL_FLAGS_HAS_HOST) && - context_.host.length() > 0) { + if ((context_.flags & URL_FLAGS_HAS_HOST) && context_.host.length() > 0) { std::string unicode_host; if (!ToUnicode(context_.host, &unicode_host)) { return ""; @@ -2345,8 +2222,7 @@ std::string URL::ToFilePath() const { if (decoded_path.length() < 3) { return ""; } - if (decoded_path[2] != ':' || - !IsASCIIAlpha(decoded_path[1])) { + if (decoded_path[2] != ':' || !IsASCIIAlpha(decoded_path[1])) { return ""; } // Strip out the leading '\'. @@ -2361,11 +2237,15 @@ URL URL::FromFilePath(const std::string& file_path) { std::string escaped_file_path; for (size_t i = 0; i < file_path.length(); ++i) { escaped_file_path += file_path[i]; - if (file_path[i] == '%') - escaped_file_path += "25"; + if (file_path[i] == '%') escaped_file_path += "25"; } - URL::Parse(escaped_file_path.c_str(), escaped_file_path.length(), kPathStart, - &url.context_, true, nullptr, false); + URL::Parse(escaped_file_path.c_str(), + escaped_file_path.length(), + kPathStart, + &url.context_, + true, + nullptr, + false); return url; } @@ -2380,19 +2260,18 @@ MaybeLocal URL::ToObject(Environment* env) const { const Local undef = Undefined(isolate); const Local null = Null(isolate); - if (context_.flags & URL_FLAGS_FAILED) - return Local(); + if (context_.flags & URL_FLAGS_FAILED) return Local(); Local argv[] = { - undef, - undef, - undef, - undef, - null, // host defaults to null - null, // port defaults to null - undef, - null, // query defaults to null - null, // fragment defaults to null + undef, + undef, + undef, + undef, + null, // host defaults to null + null, // port defaults to null + undef, + null, // query defaults to null + null, // fragment defaults to null }; SetArgs(env, argv, context_); @@ -2404,8 +2283,8 @@ MaybeLocal URL::ToObject(Environment* env) const { // set the constructor function used below. SetURLConstructor is // called automatically when the internal/url.js module is loaded // during the internal/bootstrap/node.js processing. - ret = env->url_constructor_function() - ->Call(env->context(), undef, arraysize(argv), argv); + ret = env->url_constructor_function()->Call( + env->context(), undef, arraysize(argv), argv); } return ret; diff --git a/src/node_url.h b/src/node_url.h index 47b859b879bca4..f3e1b27e6a8c8d 100644 --- a/src/node_url.h +++ b/src/node_url.h @@ -3,51 +3,51 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "node.h" #include "env-inl.h" +#include "node.h" #include namespace node { namespace url { -#define PARSESTATES(XX) \ - XX(kSchemeStart) \ - XX(kScheme) \ - XX(kNoScheme) \ - XX(kSpecialRelativeOrAuthority) \ - XX(kPathOrAuthority) \ - XX(kRelative) \ - XX(kRelativeSlash) \ - XX(kSpecialAuthoritySlashes) \ - XX(kSpecialAuthorityIgnoreSlashes) \ - XX(kAuthority) \ - XX(kHost) \ - XX(kHostname) \ - XX(kPort) \ - XX(kFile) \ - XX(kFileSlash) \ - XX(kFileHost) \ - XX(kPathStart) \ - XX(kPath) \ - XX(kCannotBeBase) \ - XX(kQuery) \ +#define PARSESTATES(XX) \ + XX(kSchemeStart) \ + XX(kScheme) \ + XX(kNoScheme) \ + XX(kSpecialRelativeOrAuthority) \ + XX(kPathOrAuthority) \ + XX(kRelative) \ + XX(kRelativeSlash) \ + XX(kSpecialAuthoritySlashes) \ + XX(kSpecialAuthorityIgnoreSlashes) \ + XX(kAuthority) \ + XX(kHost) \ + XX(kHostname) \ + XX(kPort) \ + XX(kFile) \ + XX(kFileSlash) \ + XX(kFileHost) \ + XX(kPathStart) \ + XX(kPath) \ + XX(kCannotBeBase) \ + XX(kQuery) \ XX(kFragment) -#define FLAGS(XX) \ - XX(URL_FLAGS_NONE, 0) \ - XX(URL_FLAGS_FAILED, 0x01) \ - XX(URL_FLAGS_CANNOT_BE_BASE, 0x02) \ - XX(URL_FLAGS_INVALID_PARSE_STATE, 0x04) \ - XX(URL_FLAGS_TERMINATED, 0x08) \ - XX(URL_FLAGS_SPECIAL, 0x10) \ - XX(URL_FLAGS_HAS_USERNAME, 0x20) \ - XX(URL_FLAGS_HAS_PASSWORD, 0x40) \ - XX(URL_FLAGS_HAS_HOST, 0x80) \ - XX(URL_FLAGS_HAS_PATH, 0x100) \ - XX(URL_FLAGS_HAS_QUERY, 0x200) \ - XX(URL_FLAGS_HAS_FRAGMENT, 0x400) \ - XX(URL_FLAGS_IS_DEFAULT_SCHEME_PORT, 0x800) \ +#define FLAGS(XX) \ + XX(URL_FLAGS_NONE, 0) \ + XX(URL_FLAGS_FAILED, 0x01) \ + XX(URL_FLAGS_CANNOT_BE_BASE, 0x02) \ + XX(URL_FLAGS_INVALID_PARSE_STATE, 0x04) \ + XX(URL_FLAGS_TERMINATED, 0x08) \ + XX(URL_FLAGS_SPECIAL, 0x10) \ + XX(URL_FLAGS_HAS_USERNAME, 0x20) \ + XX(URL_FLAGS_HAS_PASSWORD, 0x40) \ + XX(URL_FLAGS_HAS_HOST, 0x80) \ + XX(URL_FLAGS_HAS_PATH, 0x100) \ + XX(URL_FLAGS_HAS_QUERY, 0x200) \ + XX(URL_FLAGS_HAS_FRAGMENT, 0x400) \ + XX(URL_FLAGS_IS_DEFAULT_SCHEME_PORT, 0x800) enum url_parse_state { kUnknownState = -1, @@ -90,68 +90,51 @@ class URL { URL(const char* input, const size_t len, const URL* base) { if (base != nullptr) - Parse(input, len, kUnknownState, - &context_, false, - &(base->context_), true); + Parse( + input, len, kUnknownState, &context_, false, &(base->context_), true); else Parse(input, len, kUnknownState, &context_, false, nullptr, false); } - URL(const char* input, const size_t len, - const char* base, const size_t baselen) { + URL(const char* input, + const size_t len, + const char* base, + const size_t baselen) { if (base != nullptr && baselen > 0) { URL _base(base, baselen); - Parse(input, len, kUnknownState, - &context_, false, - &(_base.context_), true); + Parse( + input, len, kUnknownState, &context_, false, &(_base.context_), true); } else { Parse(input, len, kUnknownState, &context_, false, nullptr, false); } } - explicit URL(std::string input) : - URL(input.c_str(), input.length()) {} + explicit URL(std::string input) : URL(input.c_str(), input.length()) {} - URL(std::string input, const URL* base) : - URL(input.c_str(), input.length(), base) {} + URL(std::string input, const URL* base) + : URL(input.c_str(), input.length(), base) {} - URL(std::string input, const URL& base) : - URL(input.c_str(), input.length(), &base) {} + URL(std::string input, const URL& base) + : URL(input.c_str(), input.length(), &base) {} - URL(std::string input, std::string base) : - URL(input.c_str(), input.length(), base.c_str(), base.length()) {} + URL(std::string input, std::string base) + : URL(input.c_str(), input.length(), base.c_str(), base.length()) {} - int32_t flags() { - return context_.flags; - } + int32_t flags() { return context_.flags; } - int port() { - return context_.port; - } + int port() { return context_.port; } - const std::string& protocol() const { - return context_.scheme; - } + const std::string& protocol() const { return context_.scheme; } - const std::string& username() const { - return context_.username; - } + const std::string& username() const { return context_.username; } - const std::string& password() const { - return context_.password; - } + const std::string& password() const { return context_.password; } - const std::string& host() const { - return context_.host; - } + const std::string& host() const { return context_.host; } - const std::string& query() const { - return context_.query; - } + const std::string& query() const { return context_.query; } - const std::string& fragment() const { - return context_.fragment; - } + const std::string& fragment() const { return context_.fragment; } std::string path() const { std::string ret; diff --git a/src/node_util.cc b/src/node_util.cc index 2a7d90cfe2b661..15447f9e01ceca 100644 --- a/src/node_util.cc +++ b/src/node_util.cc @@ -30,8 +30,7 @@ using v8::String; using v8::Uint32; using v8::Value; -static void GetOwnNonIndexProperties( - const FunctionCallbackInfo& args) { +static void GetOwnNonIndexProperties(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); Local context = env->context(); @@ -43,13 +42,14 @@ static void GetOwnNonIndexProperties( Local properties; PropertyFilter filter = - static_cast(args[1].As()->Value()); - - if (!object->GetPropertyNames( - context, KeyCollectionMode::kOwnOnly, - filter, - IndexFilter::kSkipIndices) - .ToLocal(&properties)) { + static_cast(args[1].As()->Value()); + + if (!object + ->GetPropertyNames(context, + KeyCollectionMode::kOwnOnly, + filter, + IndexFilter::kSkipIndices) + .ToLocal(&properties)) { return; } args.GetReturnValue().Set(properties); @@ -57,15 +57,14 @@ static void GetOwnNonIndexProperties( static void GetPromiseDetails(const FunctionCallbackInfo& args) { // Return undefined if it's not a Promise. - if (!args[0]->IsPromise()) - return; + if (!args[0]->IsPromise()) return; auto isolate = args.GetIsolate(); Local promise = args[0].As(); int state = promise->State(); - Local values[2] = { Integer::New(isolate, state) }; + Local values[2] = {Integer::New(isolate, state)}; size_t number_of_values = 1; if (state != Promise::PromiseState::kPending) values[number_of_values++] = promise->Result(); @@ -75,23 +74,17 @@ static void GetPromiseDetails(const FunctionCallbackInfo& args) { static void GetProxyDetails(const FunctionCallbackInfo& args) { // Return undefined if it's not a proxy. - if (!args[0]->IsProxy()) - return; + if (!args[0]->IsProxy()) return; Local proxy = args[0].As(); - Local ret[] = { - proxy->GetTarget(), - proxy->GetHandler() - }; + Local ret[] = {proxy->GetTarget(), proxy->GetHandler()}; - args.GetReturnValue().Set( - Array::New(args.GetIsolate(), ret, arraysize(ret))); + args.GetReturnValue().Set(Array::New(args.GetIsolate(), ret, arraysize(ret))); } static void PreviewEntries(const FunctionCallbackInfo& args) { - if (!args[0]->IsObject()) - return; + if (!args[0]->IsObject()) return; Environment* env = Environment::GetCurrent(args); bool is_key_value; @@ -99,13 +92,9 @@ static void PreviewEntries(const FunctionCallbackInfo& args) { if (!args[0].As()->PreviewEntries(&is_key_value).ToLocal(&entries)) return; // Fast path for WeakMap, WeakSet and Set iterators. - if (args.Length() == 1) - return args.GetReturnValue().Set(entries); + if (args.Length() == 1) return args.GetReturnValue().Set(entries); - Local ret[] = { - entries, - Boolean::New(env->isolate(), is_key_value) - }; + Local ret[] = {entries, Boolean::New(env->isolate(), is_key_value)}; return args.GetReturnValue().Set( Array::New(env->isolate(), ret, arraysize(ret))); } @@ -118,9 +107,8 @@ static void SafeToString(const FunctionCallbackInfo& args) { inline Local IndexToPrivateSymbol(Environment* env, uint32_t index) { #define V(name, _) &Environment::name, - static Local (Environment::*const methods[])() const = { - PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(V) - }; + static Local (Environment::*const methods[])() + const = {PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(V)}; #undef V CHECK_LT(index, arraysize(methods)); return (env->*methods[index])(); @@ -154,19 +142,16 @@ static void SetHiddenValue(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(maybe_value.FromJust()); } - void StartSigintWatchdog(const FunctionCallbackInfo& args) { int ret = SigintWatchdogHelper::GetInstance()->Start(); args.GetReturnValue().Set(ret == 0); } - void StopSigintWatchdog(const FunctionCallbackInfo& args) { bool had_pending_signals = SigintWatchdogHelper::GetInstance()->Stop(); args.GetReturnValue().Set(had_pending_signals); } - void WatchdogHasPendingSigint(const FunctionCallbackInfo& args) { bool ret = SigintWatchdogHelper::GetInstance()->HasPendingSignal(); args.GetReturnValue().Set(ret); @@ -187,21 +172,24 @@ void Initialize(Local target, void* priv) { Environment* env = Environment::GetCurrent(context); -#define V(name, _) \ - target->Set(context, \ - FIXED_ONE_BYTE_STRING(env->isolate(), #name), \ - Integer::NewFromUnsigned(env->isolate(), index++)).FromJust(); +#define V(name, _) \ + target \ + ->Set(context, \ + FIXED_ONE_BYTE_STRING(env->isolate(), #name), \ + Integer::NewFromUnsigned(env->isolate(), index++)) \ + .FromJust(); { uint32_t index = 0; PER_ISOLATE_PRIVATE_SYMBOL_PROPERTIES(V) } #undef V -#define V(name) \ - target->Set(context, \ - FIXED_ONE_BYTE_STRING(env->isolate(), #name), \ - Integer::New(env->isolate(), Promise::PromiseState::name)) \ - .FromJust() +#define V(name) \ + target \ + ->Set(context, \ + FIXED_ONE_BYTE_STRING(env->isolate(), #name), \ + Integer::New(env->isolate(), Promise::PromiseState::name)) \ + .FromJust() V(kPending); V(kFulfilled); V(kRejected); @@ -213,13 +201,13 @@ void Initialize(Local target, env->SetMethodNoSideEffect(target, "getProxyDetails", GetProxyDetails); env->SetMethodNoSideEffect(target, "safeToString", SafeToString); env->SetMethodNoSideEffect(target, "previewEntries", PreviewEntries); - env->SetMethodNoSideEffect(target, "getOwnNonIndexProperties", - GetOwnNonIndexProperties); + env->SetMethodNoSideEffect( + target, "getOwnNonIndexProperties", GetOwnNonIndexProperties); env->SetMethod(target, "startSigintWatchdog", StartSigintWatchdog); env->SetMethod(target, "stopSigintWatchdog", StopSigintWatchdog); - env->SetMethodNoSideEffect(target, "watchdogHasPendingSigint", - WatchdogHasPendingSigint); + env->SetMethodNoSideEffect( + target, "watchdogHasPendingSigint", WatchdogHasPendingSigint); env->SetMethod(target, "enqueueMicrotask", EnqueueMicrotask); env->SetMethod(target, "triggerFatalException", FatalException); @@ -230,9 +218,11 @@ void Initialize(Local target, NODE_DEFINE_CONSTANT(constants, ONLY_CONFIGURABLE); NODE_DEFINE_CONSTANT(constants, SKIP_STRINGS); NODE_DEFINE_CONSTANT(constants, SKIP_SYMBOLS); - target->Set(context, - FIXED_ONE_BYTE_STRING(env->isolate(), "propertyFilter"), - constants).FromJust(); + target + ->Set(context, + FIXED_ONE_BYTE_STRING(env->isolate(), "propertyFilter"), + constants) + .FromJust(); Local should_abort_on_uncaught_toggle = FIXED_ONE_BYTE_STRING(env->isolate(), "shouldAbortOnUncaughtToggle"); diff --git a/src/node_v8.cc b/src/node_v8.cc index 8ed0e416702e0b..7388fffe74fc8b 100644 --- a/src/node_v8.cc +++ b/src/node_v8.cc @@ -19,8 +19,8 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -#include "node.h" #include "env-inl.h" +#include "node.h" #include "util-inl.h" #include "v8.h" @@ -43,15 +43,15 @@ using v8::Uint32; using v8::V8; using v8::Value; -#define HEAP_STATISTICS_PROPERTIES(V) \ - V(0, total_heap_size, kTotalHeapSizeIndex) \ - V(1, total_heap_size_executable, kTotalHeapSizeExecutableIndex) \ - V(2, total_physical_size, kTotalPhysicalSizeIndex) \ - V(3, total_available_size, kTotalAvailableSize) \ - V(4, used_heap_size, kUsedHeapSizeIndex) \ - V(5, heap_size_limit, kHeapSizeLimitIndex) \ - V(6, malloced_memory, kMallocedMemoryIndex) \ - V(7, peak_malloced_memory, kPeakMallocedMemoryIndex) \ +#define HEAP_STATISTICS_PROPERTIES(V) \ + V(0, total_heap_size, kTotalHeapSizeIndex) \ + V(1, total_heap_size_executable, kTotalHeapSizeExecutableIndex) \ + V(2, total_physical_size, kTotalPhysicalSizeIndex) \ + V(3, total_available_size, kTotalAvailableSize) \ + V(4, used_heap_size, kUsedHeapSizeIndex) \ + V(5, heap_size_limit, kHeapSizeLimitIndex) \ + V(6, malloced_memory, kMallocedMemoryIndex) \ + V(7, peak_malloced_memory, kPeakMallocedMemoryIndex) \ V(8, does_zap_garbage, kDoesZapGarbageIndex) #define V(a, b, c) +1 @@ -59,10 +59,10 @@ static const size_t kHeapStatisticsPropertiesCount = HEAP_STATISTICS_PROPERTIES(V); #undef V -#define HEAP_SPACE_STATISTICS_PROPERTIES(V) \ - V(0, space_size, kSpaceSizeIndex) \ - V(1, space_used_size, kSpaceUsedSizeIndex) \ - V(2, space_available_size, kSpaceAvailableSizeIndex) \ +#define HEAP_SPACE_STATISTICS_PROPERTIES(V) \ + V(0, space_size, kSpaceSizeIndex) \ + V(1, space_used_size, kSpaceUsedSizeIndex) \ + V(2, space_available_size, kSpaceAvailableSizeIndex) \ V(3, physical_space_size, kPhysicalSpaceSizeIndex) #define V(a, b, c) +1 @@ -70,16 +70,13 @@ static const size_t kHeapSpaceStatisticsPropertiesCount = HEAP_SPACE_STATISTICS_PROPERTIES(V); #undef V - void CachedDataVersionTag(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); - Local result = - Integer::NewFromUnsigned(env->isolate(), - ScriptCompiler::CachedDataVersionTag()); + Local result = Integer::NewFromUnsigned( + env->isolate(), ScriptCompiler::CachedDataVersionTag()); args.GetReturnValue().Set(result); } - void UpdateHeapStatisticsArrayBuffer(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); HeapStatistics s; @@ -90,7 +87,6 @@ void UpdateHeapStatisticsArrayBuffer(const FunctionCallbackInfo& args) { #undef V } - void UpdateHeapSpaceStatisticsBuffer(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); HeapSpaceStatistics s; @@ -101,29 +97,27 @@ void UpdateHeapSpaceStatisticsBuffer(const FunctionCallbackInfo& args) { for (size_t i = 0; i < number_of_heap_spaces; i++) { isolate->GetHeapSpaceStatistics(&s, i); size_t const property_offset = i * kHeapSpaceStatisticsPropertiesCount; -#define V(index, name, _) buffer[property_offset + index] = \ - static_cast(s.name()); - HEAP_SPACE_STATISTICS_PROPERTIES(V) +#define V(index, name, _) \ + buffer[property_offset + index] = static_cast(s.name()); + HEAP_SPACE_STATISTICS_PROPERTIES(V) #undef V } } - void SetFlagsFromString(const FunctionCallbackInfo& args) { CHECK(args[0]->IsString()); String::Utf8Value flags(args.GetIsolate(), args[0]); V8::SetFlagsFromString(*flags, flags.length()); } - void Initialize(Local target, Local unused, Local context, void* priv) { Environment* env = Environment::GetCurrent(context); - env->SetMethodNoSideEffect(target, "cachedDataVersionTag", - CachedDataVersionTag); + env->SetMethodNoSideEffect( + target, "cachedDataVersionTag", CachedDataVersionTag); env->SetMethod(target, "updateHeapStatisticsArrayBuffer", @@ -134,71 +128,79 @@ void Initialize(Local target, const size_t heap_statistics_buffer_byte_length = sizeof(*env->heap_statistics_buffer()) * kHeapStatisticsPropertiesCount; - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), - "heapStatisticsArrayBuffer"), - ArrayBuffer::New(env->isolate(), - env->heap_statistics_buffer(), - heap_statistics_buffer_byte_length)).FromJust(); - -#define V(i, _, name) \ - target->Set(env->context(), \ - FIXED_ONE_BYTE_STRING(env->isolate(), #name), \ - Uint32::NewFromUnsigned(env->isolate(), i)).FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "heapStatisticsArrayBuffer"), + ArrayBuffer::New(env->isolate(), + env->heap_statistics_buffer(), + heap_statistics_buffer_byte_length)) + .FromJust(); + +#define V(i, _, name) \ + target \ + ->Set(env->context(), \ + FIXED_ONE_BYTE_STRING(env->isolate(), #name), \ + Uint32::NewFromUnsigned(env->isolate(), i)) \ + .FromJust(); HEAP_STATISTICS_PROPERTIES(V) #undef V - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), - "kHeapSpaceStatisticsPropertiesCount"), - Uint32::NewFromUnsigned(env->isolate(), - kHeapSpaceStatisticsPropertiesCount)) - .FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), + "kHeapSpaceStatisticsPropertiesCount"), + Uint32::NewFromUnsigned(env->isolate(), + kHeapSpaceStatisticsPropertiesCount)) + .FromJust(); size_t number_of_heap_spaces = env->isolate()->NumberOfHeapSpaces(); // Heap space names are extracted once and exposed to JavaScript to // avoid excessive creation of heap space name Strings. HeapSpaceStatistics s; - const Local heap_spaces = Array::New(env->isolate(), - number_of_heap_spaces); + const Local heap_spaces = + Array::New(env->isolate(), number_of_heap_spaces); for (size_t i = 0; i < number_of_heap_spaces; i++) { env->isolate()->GetHeapSpaceStatistics(&s, i); - Local heap_space_name = String::NewFromUtf8(env->isolate(), - s.space_name(), - NewStringType::kNormal) - .ToLocalChecked(); + Local heap_space_name = + String::NewFromUtf8( + env->isolate(), s.space_name(), NewStringType::kNormal) + .ToLocalChecked(); heap_spaces->Set(env->context(), i, heap_space_name).FromJust(); } - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "kHeapSpaces"), - heap_spaces).FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "kHeapSpaces"), + heap_spaces) + .FromJust(); env->SetMethod(target, "updateHeapSpaceStatisticsArrayBuffer", UpdateHeapSpaceStatisticsBuffer); env->set_heap_space_statistics_buffer( - new double[kHeapSpaceStatisticsPropertiesCount * number_of_heap_spaces]); + new double[kHeapSpaceStatisticsPropertiesCount * number_of_heap_spaces]); const size_t heap_space_statistics_buffer_byte_length = sizeof(*env->heap_space_statistics_buffer()) * - kHeapSpaceStatisticsPropertiesCount * - number_of_heap_spaces; - - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), - "heapSpaceStatisticsArrayBuffer"), - ArrayBuffer::New(env->isolate(), - env->heap_space_statistics_buffer(), - heap_space_statistics_buffer_byte_length)) - .FromJust(); - -#define V(i, _, name) \ - target->Set(env->context(), \ - FIXED_ONE_BYTE_STRING(env->isolate(), #name), \ - Uint32::NewFromUnsigned(env->isolate(), i)).FromJust(); + kHeapSpaceStatisticsPropertiesCount * number_of_heap_spaces; + + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), + "heapSpaceStatisticsArrayBuffer"), + ArrayBuffer::New(env->isolate(), + env->heap_space_statistics_buffer(), + heap_space_statistics_buffer_byte_length)) + .FromJust(); + +#define V(i, _, name) \ + target \ + ->Set(env->context(), \ + FIXED_ONE_BYTE_STRING(env->isolate(), #name), \ + Uint32::NewFromUnsigned(env->isolate(), i)) \ + .FromJust(); HEAP_SPACE_STATISTICS_PROPERTIES(V) #undef V diff --git a/src/node_version.h b/src/node_version.h index f64aa2aad77334..f8fbc1d1ef3a87 100644 --- a/src/node_version.h +++ b/src/node_version.h @@ -41,35 +41,34 @@ #endif #ifndef NODE_TAG -# if NODE_VERSION_IS_RELEASE -# define NODE_TAG "" -# else -# define NODE_TAG "-pre" -# endif +#if NODE_VERSION_IS_RELEASE +#define NODE_TAG "" +#else +#define NODE_TAG "-pre" +#endif #else // NODE_TAG is passed without quotes when rc.exe is run from msbuild -# define NODE_EXE_VERSION NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \ - NODE_STRINGIFY(NODE_MINOR_VERSION) "." \ - NODE_STRINGIFY(NODE_PATCH_VERSION) \ - NODE_STRINGIFY(NODE_TAG) +#define NODE_EXE_VERSION \ + NODE_STRINGIFY(NODE_MAJOR_VERSION) \ + "." NODE_STRINGIFY(NODE_MINOR_VERSION) "." NODE_STRINGIFY( \ + NODE_PATCH_VERSION) NODE_STRINGIFY(NODE_TAG) #endif -# define NODE_VERSION_STRING NODE_STRINGIFY(NODE_MAJOR_VERSION) "." \ - NODE_STRINGIFY(NODE_MINOR_VERSION) "." \ - NODE_STRINGIFY(NODE_PATCH_VERSION) \ - NODE_TAG +#define NODE_VERSION_STRING \ + NODE_STRINGIFY(NODE_MAJOR_VERSION) \ + "." NODE_STRINGIFY(NODE_MINOR_VERSION) "." NODE_STRINGIFY( \ + NODE_PATCH_VERSION) NODE_TAG #ifndef NODE_EXE_VERSION -# define NODE_EXE_VERSION NODE_VERSION_STRING +#define NODE_EXE_VERSION NODE_VERSION_STRING #endif #define NODE_VERSION "v" NODE_VERSION_STRING - -#define NODE_VERSION_AT_LEAST(major, minor, patch) \ - (( (major) < NODE_MAJOR_VERSION) \ - || ((major) == NODE_MAJOR_VERSION && (minor) < NODE_MINOR_VERSION) \ - || ((major) == NODE_MAJOR_VERSION && \ - (minor) == NODE_MINOR_VERSION && (patch) <= NODE_PATCH_VERSION)) +#define NODE_VERSION_AT_LEAST(major, minor, patch) \ + (((major) < NODE_MAJOR_VERSION) || \ + ((major) == NODE_MAJOR_VERSION && (minor) < NODE_MINOR_VERSION) || \ + ((major) == NODE_MAJOR_VERSION && (minor) == NODE_MINOR_VERSION && \ + (patch) <= NODE_PATCH_VERSION)) /** * Node.js will refuse to load modules that weren't compiled against its own @@ -118,6 +117,6 @@ #define NODE_MODULE_VERSION 68 // the NAPI_VERSION provided by this version of the runtime -#define NAPI_VERSION 4 +#define NAPI_VERSION 4 #endif // SRC_NODE_VERSION_H_ diff --git a/src/node_watchdog.cc b/src/node_watchdog.cc index 9ef7bafeded44f..ce52fa948ad732 100644 --- a/src/node_watchdog.cc +++ b/src/node_watchdog.cc @@ -29,14 +29,12 @@ namespace node { Watchdog::Watchdog(v8::Isolate* isolate, uint64_t ms, bool* timed_out) : isolate_(isolate), timed_out_(timed_out) { - int rc; loop_ = new uv_loop_t; CHECK(loop_); rc = uv_loop_init(loop_); if (rc != 0) { - FatalError("node::Watchdog::Watchdog()", - "Failed to initialize uv loop."); + FatalError("node::Watchdog::Watchdog()", "Failed to initialize uv loop."); } rc = uv_async_init(loop_, &async_, &Watchdog::Async); @@ -52,7 +50,6 @@ Watchdog::Watchdog(v8::Isolate* isolate, uint64_t ms, bool* timed_out) CHECK_EQ(0, rc); } - Watchdog::~Watchdog() { uv_async_send(&async_); uv_thread_join(&thread_); @@ -67,7 +64,6 @@ Watchdog::~Watchdog() { loop_ = nullptr; } - void Watchdog::Run(void* arg) { Watchdog* wd = static_cast(arg); @@ -80,13 +76,11 @@ void Watchdog::Run(void* arg) { uv_close(reinterpret_cast(&wd->timer_), nullptr); } - void Watchdog::Async(uv_async_t* async) { Watchdog* w = ContainerOf(&Watchdog::async_, async); uv_stop(w->loop_); } - void Watchdog::Timer(uv_timer_t* timer) { Watchdog* w = ContainerOf(&Watchdog::timer_, timer); *w->timed_out_ = true; @@ -94,9 +88,7 @@ void Watchdog::Timer(uv_timer_t* timer) { uv_stop(w->loop_); } - -SigintWatchdog::SigintWatchdog( - v8::Isolate* isolate, bool* received_signal) +SigintWatchdog::SigintWatchdog(v8::Isolate* isolate, bool* received_signal) : isolate_(isolate), received_signal_(received_signal) { // Register this watchdog with the global SIGINT/Ctrl+C listener. SigintWatchdogHelper::GetInstance()->Register(this); @@ -104,13 +96,11 @@ SigintWatchdog::SigintWatchdog( SigintWatchdogHelper::GetInstance()->Start(); } - SigintWatchdog::~SigintWatchdog() { SigintWatchdogHelper::GetInstance()->Unregister(this); SigintWatchdogHelper::GetInstance()->Stop(); } - void SigintWatchdog::HandleSigint() { *received_signal_ = true; isolate_->TerminateExecution(); @@ -129,7 +119,6 @@ void* SigintWatchdogHelper::RunSigintWatchdog(void* arg) { return nullptr; } - void SigintWatchdogHelper::HandleSignal(int signum) { uv_sem_post(&instance.sem_); } @@ -151,7 +140,6 @@ BOOL WINAPI SigintWatchdogHelper::WinCtrlCHandlerRoutine(DWORD dwCtrlType) { } #endif - bool SigintWatchdogHelper::InformWatchdogsAboutSignal() { Mutex::ScopedLock list_lock(instance.list_mutex_); @@ -166,13 +154,11 @@ bool SigintWatchdogHelper::InformWatchdogsAboutSignal() { instance.has_pending_signal_ = true; } - for (auto it : instance.watchdogs_) - it->HandleSigint(); + for (auto it : instance.watchdogs_) it->HandleSigint(); return is_stopping; } - int SigintWatchdogHelper::Start() { Mutex::ScopedLock lock(mutex_); @@ -209,7 +195,6 @@ int SigintWatchdogHelper::Start() { return 0; } - bool SigintWatchdogHelper::Stop() { bool had_pending_signal; Mutex::ScopedLock lock(mutex_); @@ -256,21 +241,18 @@ bool SigintWatchdogHelper::Stop() { return had_pending_signal; } - bool SigintWatchdogHelper::HasPendingSignal() { Mutex::ScopedLock lock(list_mutex_); return has_pending_signal_; } - void SigintWatchdogHelper::Register(SigintWatchdog* wd) { Mutex::ScopedLock lock(list_mutex_); watchdogs_.push_back(wd); } - void SigintWatchdogHelper::Unregister(SigintWatchdog* wd) { Mutex::ScopedLock lock(list_mutex_); @@ -280,10 +262,8 @@ void SigintWatchdogHelper::Unregister(SigintWatchdog* wd) { watchdogs_.erase(it); } - SigintWatchdogHelper::SigintWatchdogHelper() - : start_stop_count_(0), - has_pending_signal_(false) { + : start_stop_count_(0), has_pending_signal_(false) { #ifdef __POSIX__ has_running_thread_ = false; stopping_ = false; @@ -293,7 +273,6 @@ SigintWatchdogHelper::SigintWatchdogHelper() #endif } - SigintWatchdogHelper::~SigintWatchdogHelper() { start_stop_count_ = 0; Stop(); diff --git a/src/node_watchdog.h b/src/node_watchdog.h index 2cc7eab837cb88..831d3661346834 100644 --- a/src/node_watchdog.h +++ b/src/node_watchdog.h @@ -24,10 +24,10 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "v8.h" -#include "uv.h" -#include "node_mutex.h" #include +#include "node_mutex.h" +#include "uv.h" +#include "v8.h" #ifdef __POSIX__ #include diff --git a/src/node_win32_etw_provider-inl.h b/src/node_win32_etw_provider-inl.h index a7846f413a204c..bb2f911b12ce1e 100644 --- a/src/node_win32_etw_provider-inl.h +++ b/src/node_win32_etw_provider-inl.h @@ -24,8 +24,8 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "node_win32_etw_provider.h" #include "node_etw_provider.h" +#include "node_win32_etw_provider.h" namespace node { @@ -34,143 +34,149 @@ extern REGHANDLE node_provider; extern EventWriteFunc event_write; extern int events_enabled; -#define ETW_WRITE_STRING_DATA(data_descriptor, data) \ - EventDataDescCreate(data_descriptor, \ - data, \ - (strlen(data) + 1) * sizeof(*data)); +#define ETW_WRITE_STRING_DATA(data_descriptor, data) \ + EventDataDescCreate( \ + data_descriptor, data, (strlen(data) + 1) * sizeof(*data)); -#define ETW_WRITE_INT32_DATA(data_descriptor, data) \ +#define ETW_WRITE_INT32_DATA(data_descriptor, data) \ EventDataDescCreate(data_descriptor, data, sizeof(int32_t)); -#define ETW_WRITE_INT64_DATA(data_descriptor, data) \ +#define ETW_WRITE_INT64_DATA(data_descriptor, data) \ EventDataDescCreate(data_descriptor, data, sizeof(int64_t)); -#define ETW_WRITE_ADDRESS_DATA(data_descriptor, data) \ +#define ETW_WRITE_ADDRESS_DATA(data_descriptor, data) \ EventDataDescCreate(data_descriptor, data, sizeof(intptr_t)); -#define ETW_WRITE_INT16_DATA(data_descriptor, data) \ +#define ETW_WRITE_INT16_DATA(data_descriptor, data) \ EventDataDescCreate(data_descriptor, data, sizeof(int16_t)); -#define ETW_WRITE_WSTRING_DATA_LENGTH(data_descriptor, data, data_len_bytes) \ - EventDataDescCreate(data_descriptor, \ - data, \ - data_len_bytes); +#define ETW_WRITE_WSTRING_DATA_LENGTH(data_descriptor, data, data_len_bytes) \ + EventDataDescCreate(data_descriptor, data, data_len_bytes); -#define ETW_WRITE_NET_CONNECTION(descriptors, conn) \ - ETW_WRITE_INT32_DATA(descriptors, &conn->fd); \ - ETW_WRITE_INT32_DATA(descriptors + 1, &conn->port); \ - ETW_WRITE_STRING_DATA(descriptors + 2, conn->remote); \ +#define ETW_WRITE_NET_CONNECTION(descriptors, conn) \ + ETW_WRITE_INT32_DATA(descriptors, &conn->fd); \ + ETW_WRITE_INT32_DATA(descriptors + 1, &conn->port); \ + ETW_WRITE_STRING_DATA(descriptors + 2, conn->remote); \ ETW_WRITE_INT32_DATA(descriptors + 3, &conn->buffered); -#define ETW_WRITE_HTTP_SERVER_REQUEST(descriptors, req) \ - ETW_WRITE_STRING_DATA(descriptors, req->url); \ - ETW_WRITE_STRING_DATA(descriptors + 1, req->method); \ +#define ETW_WRITE_HTTP_SERVER_REQUEST(descriptors, req) \ + ETW_WRITE_STRING_DATA(descriptors, req->url); \ + ETW_WRITE_STRING_DATA(descriptors + 1, req->method); \ ETW_WRITE_STRING_DATA(descriptors + 2, req->forwardedFor); -#define ETW_WRITE_HTTP_CLIENT_REQUEST(descriptors, req) \ - ETW_WRITE_STRING_DATA(descriptors, req->url); \ +#define ETW_WRITE_HTTP_CLIENT_REQUEST(descriptors, req) \ + ETW_WRITE_STRING_DATA(descriptors, req->url); \ ETW_WRITE_STRING_DATA(descriptors + 1, req->method); -#define ETW_WRITE_GC(descriptors, type, flags) \ - ETW_WRITE_INT32_DATA(descriptors, &type); \ +#define ETW_WRITE_GC(descriptors, type, flags) \ + ETW_WRITE_INT32_DATA(descriptors, &type); \ ETW_WRITE_INT32_DATA(descriptors + 1, &flags); -#define ETW_WRITE_V8ADDRESSCHANGE(descriptors, addr1, addr2) \ - ETW_WRITE_ADDRESS_DATA(descriptors, &addr1); \ - ETW_WRITE_ADDRESS_DATA(descriptors + 1, &addr2); - -#define ETW_WRITE_JSMETHOD_LOADUNLOAD(descriptors, \ - context, \ - startAddr, \ - size, \ - id, \ - flags, \ - rangeId, \ - sourceId, \ - line, \ - col, \ - name, \ - name_len_bytes) \ - ETW_WRITE_ADDRESS_DATA(descriptors, &context); \ - ETW_WRITE_ADDRESS_DATA(descriptors + 1, &startAddr); \ - ETW_WRITE_INT64_DATA(descriptors + 2, &size); \ - ETW_WRITE_INT32_DATA(descriptors + 3, &id); \ - ETW_WRITE_INT16_DATA(descriptors + 4, &flags); \ - ETW_WRITE_INT16_DATA(descriptors + 5, &rangeId); \ - ETW_WRITE_INT64_DATA(descriptors + 6, &sourceId); \ - ETW_WRITE_INT32_DATA(descriptors + 7, &line); \ - ETW_WRITE_INT32_DATA(descriptors + 8, &col); \ - ETW_WRITE_WSTRING_DATA_LENGTH(descriptors + 9, name, name_len_bytes); - - -#define ETW_WRITE_EVENT(eventDescriptor, dataDescriptors) \ - DWORD status = event_write(node_provider, \ - &eventDescriptor, \ - sizeof(dataDescriptors) / \ - sizeof(*dataDescriptors), \ - dataDescriptors); \ +#define ETW_WRITE_V8ADDRESSCHANGE(descriptors, addr1, addr2) \ + ETW_WRITE_ADDRESS_DATA(descriptors, &addr1); \ + ETW_WRITE_ADDRESS_DATA(descriptors + 1, &addr2); + +#define ETW_WRITE_JSMETHOD_LOADUNLOAD(descriptors, \ + context, \ + startAddr, \ + size, \ + id, \ + flags, \ + rangeId, \ + sourceId, \ + line, \ + col, \ + name, \ + name_len_bytes) \ + ETW_WRITE_ADDRESS_DATA(descriptors, &context); \ + ETW_WRITE_ADDRESS_DATA(descriptors + 1, &startAddr); \ + ETW_WRITE_INT64_DATA(descriptors + 2, &size); \ + ETW_WRITE_INT32_DATA(descriptors + 3, &id); \ + ETW_WRITE_INT16_DATA(descriptors + 4, &flags); \ + ETW_WRITE_INT16_DATA(descriptors + 5, &rangeId); \ + ETW_WRITE_INT64_DATA(descriptors + 6, &sourceId); \ + ETW_WRITE_INT32_DATA(descriptors + 7, &line); \ + ETW_WRITE_INT32_DATA(descriptors + 8, &col); \ + ETW_WRITE_WSTRING_DATA_LENGTH(descriptors + 9, name, name_len_bytes); + +#define ETW_WRITE_EVENT(eventDescriptor, dataDescriptors) \ + DWORD status = \ + event_write(node_provider, \ + &eventDescriptor, \ + sizeof(dataDescriptors) / sizeof(*dataDescriptors), \ + dataDescriptors); \ CHECK_EQ(status, ERROR_SUCCESS); -#define ETW_WRITE_EMPTY_EVENT(eventDescriptor) \ - DWORD status = event_write(node_provider, \ - &eventDescriptor, \ - 0, \ - NULL); // NOLINT (readability/null_usage) \ +#define ETW_WRITE_EMPTY_EVENT(eventDescriptor) \ + DWORD status = \ + event_write(node_provider, \ + &eventDescriptor, \ + 0, \ + NULL); // NOLINT (readability/null_usage) \ CHECK_EQ(status, ERROR_SUCCESS); - void NODE_HTTP_SERVER_REQUEST(node_dtrace_http_server_request_t* req, - node_dtrace_connection_t* conn, const char* remote, int port, - const char* method, const char* url, int fd) { + node_dtrace_connection_t* conn, + const char* remote, + int port, + const char* method, + const char* url, + int fd) { EVENT_DATA_DESCRIPTOR descriptors[7]; ETW_WRITE_HTTP_SERVER_REQUEST(descriptors, req); ETW_WRITE_NET_CONNECTION(descriptors + 3, conn); ETW_WRITE_EVENT(NODE_HTTP_SERVER_REQUEST_EVENT, descriptors); } - void NODE_HTTP_SERVER_RESPONSE(node_dtrace_connection_t* conn, - const char* remote, int port, int fd) { + const char* remote, + int port, + int fd) { EVENT_DATA_DESCRIPTOR descriptors[4]; ETW_WRITE_NET_CONNECTION(descriptors, conn); ETW_WRITE_EVENT(NODE_HTTP_SERVER_RESPONSE_EVENT, descriptors); } - void NODE_HTTP_CLIENT_REQUEST(node_dtrace_http_client_request_t* req, - node_dtrace_connection_t* conn, const char* remote, int port, - const char* method, const char* url, int fd) { + node_dtrace_connection_t* conn, + const char* remote, + int port, + const char* method, + const char* url, + int fd) { EVENT_DATA_DESCRIPTOR descriptors[6]; ETW_WRITE_HTTP_CLIENT_REQUEST(descriptors, req); ETW_WRITE_NET_CONNECTION(descriptors + 2, conn); ETW_WRITE_EVENT(NODE_HTTP_CLIENT_REQUEST_EVENT, descriptors); } - void NODE_HTTP_CLIENT_RESPONSE(node_dtrace_connection_t* conn, - const char* remote, int port, int fd) { + const char* remote, + int port, + int fd) { EVENT_DATA_DESCRIPTOR descriptors[4]; ETW_WRITE_NET_CONNECTION(descriptors, conn); ETW_WRITE_EVENT(NODE_HTTP_CLIENT_RESPONSE_EVENT, descriptors); } - void NODE_NET_SERVER_CONNECTION(node_dtrace_connection_t* conn, - const char* remote, int port, int fd) { + const char* remote, + int port, + int fd) { EVENT_DATA_DESCRIPTOR descriptors[4]; ETW_WRITE_NET_CONNECTION(descriptors, conn); ETW_WRITE_EVENT(NODE_NET_SERVER_CONNECTION_EVENT, descriptors); } - void NODE_NET_STREAM_END(node_dtrace_connection_t* conn, - const char* remote, int port, int fd) { + const char* remote, + int port, + int fd) { EVENT_DATA_DESCRIPTOR descriptors[4]; ETW_WRITE_NET_CONNECTION(descriptors, conn); ETW_WRITE_EVENT(NODE_NET_STREAM_END_EVENT, descriptors); } - void NODE_GC_START(v8::GCType type, v8::GCCallbackFlags flags, v8::Isolate* isolate) { @@ -181,7 +187,6 @@ void NODE_GC_START(v8::GCType type, } } - void NODE_GC_DONE(v8::GCType type, v8::GCCallbackFlags flags, v8::Isolate* isolate) { @@ -192,7 +197,6 @@ void NODE_GC_DONE(v8::GCType type, } } - void NODE_V8SYMBOL_REMOVE(const void* addr1, const void* addr2) { if (events_enabled > 0) { EVENT_DATA_DESCRIPTOR descriptors[2]; @@ -201,7 +205,6 @@ void NODE_V8SYMBOL_REMOVE(const void* addr1, const void* addr2) { } } - void NODE_V8SYMBOL_MOVE(const void* addr1, const void* addr2) { if (events_enabled > 0) { EVENT_DATA_DESCRIPTOR descriptors[2]; @@ -210,15 +213,14 @@ void NODE_V8SYMBOL_MOVE(const void* addr1, const void* addr2) { } } - void NODE_V8SYMBOL_RESET() { if (events_enabled > 0) { ETW_WRITE_EMPTY_EVENT(NODE_V8SYMBOL_RESET_EVENT); } } -#define SETSYMBUF(s) \ - wcscpy(symbuf, s); \ +#define SETSYMBUF(s) \ + wcscpy(symbuf, s); \ symbol_len = arraysize(s) - 1; void NODE_V8SYMBOL_ADD(LPCSTR symbol, @@ -230,12 +232,8 @@ void NODE_V8SYMBOL_ADD(LPCSTR symbol, if (symbol == nullptr) { SETSYMBUF(L"nullptr"); } else { - symbol_len = MultiByteToWideChar(CP_ACP, - 0, - symbol, - symbol_len, - symbuf, - 128); + symbol_len = + MultiByteToWideChar(CP_ACP, 0, symbol, symbol_len, symbuf, 128); if (symbol_len == 0) { SETSYMBUF(L"Invalid"); } else { @@ -271,14 +269,27 @@ void NODE_V8SYMBOL_ADD(LPCSTR symbol, } #undef SETSYMBUF - -bool NODE_HTTP_SERVER_REQUEST_ENABLED() { return events_enabled > 0; } -bool NODE_HTTP_SERVER_RESPONSE_ENABLED() { return events_enabled > 0; } -bool NODE_HTTP_CLIENT_REQUEST_ENABLED() { return events_enabled > 0; } -bool NODE_HTTP_CLIENT_RESPONSE_ENABLED() { return events_enabled > 0; } -bool NODE_NET_SERVER_CONNECTION_ENABLED() { return events_enabled > 0; } -bool NODE_NET_STREAM_END_ENABLED() { return events_enabled > 0; } -bool NODE_V8SYMBOL_ENABLED() { return events_enabled > 0; } +bool NODE_HTTP_SERVER_REQUEST_ENABLED() { + return events_enabled > 0; +} +bool NODE_HTTP_SERVER_RESPONSE_ENABLED() { + return events_enabled > 0; +} +bool NODE_HTTP_CLIENT_REQUEST_ENABLED() { + return events_enabled > 0; +} +bool NODE_HTTP_CLIENT_RESPONSE_ENABLED() { + return events_enabled > 0; +} +bool NODE_NET_SERVER_CONNECTION_ENABLED() { + return events_enabled > 0; +} +bool NODE_NET_STREAM_END_ENABLED() { + return events_enabled > 0; +} +bool NODE_V8SYMBOL_ENABLED() { + return events_enabled > 0; +} } // namespace node diff --git a/src/node_win32_etw_provider.cc b/src/node_win32_etw_provider.cc index 8a854767d6aed8..da1ef9bdc423c8 100644 --- a/src/node_win32_etw_provider.cc +++ b/src/node_win32_etw_provider.cc @@ -45,12 +45,13 @@ struct v8tags { // Many of these are internal to v8. // The trace_codes array specifies which types are written. struct v8tags trace_codes[] = { -#define MAKE_V8TAG(s) { s, sizeof(s) - 1 } - MAKE_V8TAG("LazyCompile:"), - MAKE_V8TAG("Script:"), - MAKE_V8TAG("Function:"), - MAKE_V8TAG("RegExp:"), - MAKE_V8TAG("Eval:") +#define MAKE_V8TAG(s) \ + { s, sizeof(s) - 1 } + MAKE_V8TAG("LazyCompile:"), + MAKE_V8TAG("Script:"), + MAKE_V8TAG("Function:"), + MAKE_V8TAG("RegExp:"), + MAKE_V8TAG("Eval:") #undef MAKE_V8TAG }; @@ -72,7 +73,6 @@ struct v8tags trace_codes[] = { #define V8_MARKER1 '*' #define V8_MARKER2 '~' - // If prefix is not in filtered list return -1, // else return length of prefix and marker. int FilterCodeEvents(const char* name, size_t len) { @@ -80,8 +80,7 @@ int FilterCodeEvents(const char* name, size_t len) { size_t prelen = trace_codes[i].prelen; if (prelen < len) { if (strncmp(name, trace_codes[i].prefix, prelen) == 0) { - if (name[prelen] == V8_MARKER1 || name[prelen] == V8_MARKER2) - prelen++; + if (name[prelen] == V8_MARKER1 || name[prelen] == V8_MARKER2) prelen++; return prelen; } } @@ -89,35 +88,33 @@ int FilterCodeEvents(const char* name, size_t len) { return -1; } - // callback from V8 module passes symbol and address info for stack walk void CodeAddressNotification(const JitCodeEvent* jevent) { int pre_offset = 0; if (NODE_V8SYMBOL_ENABLED()) { switch (jevent->type) { - case JitCodeEvent::CODE_ADDED: - pre_offset = FilterCodeEvents(jevent->name.str, jevent->name.len); - if (pre_offset >= 0) { - // skip over prefix and marker - NODE_V8SYMBOL_ADD(jevent->name.str + pre_offset, - jevent->name.len - pre_offset, - jevent->code_start, - jevent->code_len); - } - break; - case JitCodeEvent::CODE_REMOVED: - NODE_V8SYMBOL_REMOVE(jevent->code_start, 0); - break; - case JitCodeEvent::CODE_MOVED: - NODE_V8SYMBOL_MOVE(jevent->code_start, jevent->new_code_start); - break; - default: - break; + case JitCodeEvent::CODE_ADDED: + pre_offset = FilterCodeEvents(jevent->name.str, jevent->name.len); + if (pre_offset >= 0) { + // skip over prefix and marker + NODE_V8SYMBOL_ADD(jevent->name.str + pre_offset, + jevent->name.len - pre_offset, + jevent->code_start, + jevent->code_len); + } + break; + case JitCodeEvent::CODE_REMOVED: + NODE_V8SYMBOL_REMOVE(jevent->code_start, 0); + break; + case JitCodeEvent::CODE_MOVED: + NODE_V8SYMBOL_MOVE(jevent->code_start, jevent->new_code_start); + break; + default: + break; } } } - // Call v8 to enable or disable code event callbacks. // Must be on default thread to do this. // Note: It is possible to call v8 from ETW thread, but then @@ -127,28 +124,24 @@ void etw_events_change_async(uv_async_t* handle) { if (events_enabled > 0) { NODE_V8SYMBOL_RESET(); v8::Isolate::GetCurrent()->SetJitCodeEventHandler( - v8::kJitCodeEventEnumExisting, - CodeAddressNotification); + v8::kJitCodeEventEnumExisting, CodeAddressNotification); } else { - v8::Isolate::GetCurrent()->SetJitCodeEventHandler( - v8::kJitCodeEventDefault, - nullptr); + v8::Isolate::GetCurrent()->SetJitCodeEventHandler(v8::kJitCodeEventDefault, + nullptr); } } - // This callback is called by ETW when consumers of our provider // are enabled or disabled. // The callback is dispatched on ETW thread. // Before calling into V8 to enable code events, switch to default thread. -void NTAPI etw_events_enable_callback( - LPCGUID SourceId, - ULONG IsEnabled, - UCHAR Level, - ULONGLONG MatchAnyKeyword, - ULONGLONG MatchAllKeywords, - PEVENT_FILTER_DESCRIPTOR FilterData, - PVOID CallbackContext) { +void NTAPI etw_events_enable_callback(LPCGUID SourceId, + ULONG IsEnabled, + UCHAR Level, + ULONGLONG MatchAnyKeyword, + ULONGLONG MatchAllKeywords, + PEVENT_FILTER_DESCRIPTOR FilterData, + PVOID CallbackContext) { if (IsEnabled) { events_enabled++; if (events_enabled == 1) { @@ -162,22 +155,21 @@ void NTAPI etw_events_enable_callback( } } - void init_etw() { events_enabled = 0; advapi = LoadLibraryW(L"advapi32.dll"); if (advapi) { - event_register = (EventRegisterFunc) - GetProcAddress(advapi, "EventRegister"); - event_unregister = (EventUnregisterFunc) - GetProcAddress(advapi, "EventUnregister"); + event_register = (EventRegisterFunc)GetProcAddress(advapi, "EventRegister"); + event_unregister = + (EventUnregisterFunc)GetProcAddress(advapi, "EventUnregister"); event_write = (EventWriteFunc)GetProcAddress(advapi, "EventWrite"); // create async object used to invoke main thread from callback - CHECK_EQ(0, uv_async_init(uv_default_loop(), - &dispatch_etw_events_change_async, - etw_events_change_async)); + CHECK_EQ(0, + uv_async_init(uv_default_loop(), + &dispatch_etw_events_change_async, + etw_events_change_async)); uv_unref(reinterpret_cast(&dispatch_etw_events_change_async)); if (event_register) { @@ -190,7 +182,6 @@ void init_etw() { } } - void shutdown_etw() { if (advapi && event_unregister && node_provider) { event_unregister(node_provider); @@ -198,9 +189,8 @@ void shutdown_etw() { } events_enabled = 0; - v8::Isolate::GetCurrent()->SetJitCodeEventHandler( - v8::kJitCodeEventDefault, - nullptr); + v8::Isolate::GetCurrent()->SetJitCodeEventHandler(v8::kJitCodeEventDefault, + nullptr); if (advapi) { FreeLibrary(advapi); diff --git a/src/node_win32_etw_provider.h b/src/node_win32_etw_provider.h index 0f84a86f0ac3fc..203863372adb73 100644 --- a/src/node_win32_etw_provider.h +++ b/src/node_win32_etw_provider.h @@ -24,52 +24,62 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "node_dtrace.h" #include +#include "node_dtrace.h" namespace node { #if defined(_MSC_VER) -# define INLINE __forceinline +#define INLINE __forceinline #else -# define INLINE inline +#define INLINE inline #endif -typedef ULONG (NTAPI* EventRegisterFunc)( - LPCGUID ProviderId, - PENABLECALLBACK EnableCallback, - PVOID CallbackContext, - PREGHANDLE RegHandle -); +typedef ULONG(NTAPI* EventRegisterFunc)(LPCGUID ProviderId, + PENABLECALLBACK EnableCallback, + PVOID CallbackContext, + PREGHANDLE RegHandle); -typedef ULONG (NTAPI* EventUnregisterFunc)( - REGHANDLE RegHandle -); +typedef ULONG(NTAPI* EventUnregisterFunc)(REGHANDLE RegHandle); -typedef ULONG (NTAPI* EventWriteFunc)( - REGHANDLE RegHandle, - PCEVENT_DESCRIPTOR EventDescriptor, - ULONG UserDataCount, - PEVENT_DATA_DESCRIPTOR UserData -); +typedef ULONG(NTAPI* EventWriteFunc)(REGHANDLE RegHandle, + PCEVENT_DESCRIPTOR EventDescriptor, + ULONG UserDataCount, + PEVENT_DATA_DESCRIPTOR UserData); void init_etw(); void shutdown_etw(); INLINE void NODE_HTTP_SERVER_REQUEST(node_dtrace_http_server_request_t* req, - node_dtrace_connection_t* conn, const char* remote, int port, - const char* method, const char* url, int fd); + node_dtrace_connection_t* conn, + const char* remote, + int port, + const char* method, + const char* url, + int fd); INLINE void NODE_HTTP_SERVER_RESPONSE(node_dtrace_connection_t* conn, - const char* remote, int port, int fd); + const char* remote, + int port, + int fd); INLINE void NODE_HTTP_CLIENT_REQUEST(node_dtrace_http_client_request_t* req, - node_dtrace_connection_t* conn, const char* remote, int port, - const char* method, const char* url, int fd); + node_dtrace_connection_t* conn, + const char* remote, + int port, + const char* method, + const char* url, + int fd); INLINE void NODE_HTTP_CLIENT_RESPONSE(node_dtrace_connection_t* conn, - const char* remote, int port, int fd); + const char* remote, + int port, + int fd); INLINE void NODE_NET_SERVER_CONNECTION(node_dtrace_connection_t* conn, - const char* remote, int port, int fd); + const char* remote, + int port, + int fd); INLINE void NODE_NET_STREAM_END(node_dtrace_connection_t* conn, - const char* remote, int port, int fd); + const char* remote, + int port, + int fd); INLINE void NODE_GC_START(v8::GCType type, v8::GCCallbackFlags flags, v8::Isolate* isolate); diff --git a/src/node_worker.cc b/src/node_worker.cc index 2d960f6e4defef..b2309e466b8f64 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -1,12 +1,12 @@ #include "node_worker.h" +#include "async_wrap-inl.h" +#include "async_wrap.h" #include "debug_utils.h" -#include "node_errors.h" #include "node_buffer.h" +#include "node_errors.h" #include "node_perf.h" -#include "util.h" #include "util-inl.h" -#include "async_wrap.h" -#include "async_wrap-inl.h" +#include "util.h" #include #include @@ -46,8 +46,8 @@ void AddWorkerInspector(Environment* parent, Environment* child, int id, const std::string& url) { - parent->inspector_agent()->AddWorkerInspector(id, url, - child->inspector_agent()); + parent->inspector_agent()->AddWorkerInspector( + id, url, child->inspector_agent()); } void WaitForWorkerInspectorToStop(Environment* child) { @@ -84,9 +84,9 @@ Worker::Worker(Environment* env, child_port_data_.reset(new MessagePortData(nullptr)); MessagePort::Entangle(parent_port_, child_port_data_.get()); - object()->Set(env->context(), - env->message_port_string(), - parent_port_->object()).FromJust(); + object() + ->Set(env->context(), env->message_port_string(), parent_port_->object()) + .FromJust(); array_buffer_allocator_.reset(CreateArrayBufferAllocator()); @@ -122,7 +122,7 @@ Worker::Worker(Environment* env, env_->Start(env->profiler_idle_notifier_started()); env_->ProcessCliArgs(std::vector{}, - std::vector{}); + std::vector{}); // Done while on the parent thread AddWorkerInspector(env, env_.get(), thread_id_, url_); } @@ -150,8 +150,7 @@ void Worker::Run() { std::string name = "WorkerThread "; name += std::to_string(thread_id_); TRACE_EVENT_METADATA1( - "__metadata", "thread_name", "name", - TRACE_STR_COPY(name.c_str())); + "__metadata", "thread_name", "name", TRACE_STR_COPY(name.c_str())); MultiIsolatePlatform* platform = isolate_data_->platform(); CHECK_NE(platform, nullptr); @@ -170,9 +169,8 @@ void Worker::Run() { HandleScope handle_scope(isolate_); Mutex::ScopedLock lock(mutex_); // Set up the message channel for receiving messages in the child. - child_port_ = MessagePort::New(env_.get(), - env_->context(), - std::move(child_port_data_)); + child_port_ = MessagePort::New( + env_.get(), env_->context(), std::move(child_port_data_)); // MessagePort::New() may return nullptr if execution is terminated // within it. if (child_port_ != nullptr) @@ -210,8 +208,7 @@ void Worker::Run() { platform->DrainTasks(isolate_); more = uv_loop_alive(&loop_); - if (more && !is_stopped()) - continue; + if (more && !is_stopped()) continue; EmitBeforeExit(env_.get()); @@ -227,19 +224,19 @@ void Worker::Run() { { int exit_code; bool stopped = is_stopped(); - if (!stopped) - exit_code = EmitExit(env_.get()); + if (!stopped) exit_code = EmitExit(env_.get()); Mutex::ScopedLock lock(mutex_); - if (exit_code_ == 0 && !stopped) - exit_code_ = exit_code; + if (exit_code_ == 0 && !stopped) exit_code_ = exit_code; - Debug(this, "Exiting thread for worker %llu with exit code %d", - thread_id_, exit_code_); + Debug(this, + "Exiting thread for worker %llu with exit code %d", + thread_id_, + exit_code_); } env_->set_can_call_into_js(false); - Isolate::DisallowJavascriptExecutionScope disallow_js(isolate_, - Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE); + Isolate::DisallowJavascriptExecutionScope disallow_js( + isolate_, Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE); // Grab the parent-to-child channel and render is unusable. MessagePort* child_port; @@ -255,8 +252,7 @@ void Worker::Run() { env_->stop_sub_worker_contexts(); env_->RunCleanup(); RunAtExit(env_.get()); - if (inspector_started) - WaitForWorkerInspectorToStop(env_.get()); + if (inspector_started) WaitForWorkerInspectorToStop(env_.get()); { Mutex::ScopedLock stopped_lock(stopped_mutex_); @@ -294,8 +290,7 @@ void Worker::DisposeIsolate() { env_.reset(); } - if (isolate_ == nullptr) - return; + if (isolate_ == nullptr) return; Debug(this, "Worker %llu dispose isolate", thread_id_); CHECK(isolate_data_); @@ -310,20 +305,17 @@ void Worker::DisposeIsolate() { } void Worker::JoinThread() { - if (thread_joined_) - return; + if (thread_joined_) return; CHECK_EQ(uv_thread_join(&tid_), 0); thread_joined_ = true; env()->remove_sub_worker_context(this); if (thread_exit_async_) { - env()->CloseHandle(thread_exit_async_.release(), [](uv_async_t* async) { - delete async; - }); + env()->CloseHandle(thread_exit_async_.release(), + [](uv_async_t* async) { delete async; }); - if (scheduled_on_thread_stopped_) - OnThreadStopped(); + if (scheduled_on_thread_stopped_) OnThreadStopped(); } } @@ -350,9 +342,11 @@ void Worker::OnThreadStopped() { Context::Scope context_scope(env()->context()); // Reset the parent port as we're closing it now anyway. - object()->Set(env()->context(), - env()->message_port_string(), - Undefined(env()->isolate())).FromJust(); + object() + ->Set(env()->context(), + env()->message_port_string(), + Undefined(env()->isolate())) + .FromJust(); Local code = Integer::New(env()->isolate(), exit_code_); MakeCallback(env()->onexit_string(), 1, &code); @@ -444,8 +438,7 @@ void Worker::New(const FunctionCallbackInfo& args) { invalid_args.erase(invalid_args.begin()); if (errors.size() > 0 || invalid_args.size() > 0) { v8::Local value = - ToV8Value(env->context(), - errors.size() > 0 ? errors : invalid_args) + ToV8Value(env->context(), errors.size() > 0 ? errors : invalid_args) .ToLocalChecked(); Local key = FIXED_ONE_BYTE_STRING(env->isolate(), "invalidExecArgv"); @@ -468,15 +461,18 @@ void Worker::StartThread(const FunctionCallbackInfo& args) { w->thread_exit_async_.reset(new uv_async_t); w->thread_exit_async_->data = w; - CHECK_EQ(uv_async_init(w->env()->event_loop(), - w->thread_exit_async_.get(), - [](uv_async_t* handle) { - static_cast(handle->data)->OnThreadStopped(); - }), 0); - - CHECK_EQ(uv_thread_create(&w->tid_, [](void* arg) { - static_cast(arg)->Run(); - }, static_cast(w)), 0); + CHECK_EQ( + uv_async_init(w->env()->event_loop(), + w->thread_exit_async_.get(), + [](uv_async_t* handle) { + static_cast(handle->data)->OnThreadStopped(); + }), + 0); + + CHECK_EQ(uv_thread_create(&w->tid_, + [](void* arg) { static_cast(arg)->Run(); }, + static_cast(w)), + 0); } void Worker::StopThread(const FunctionCallbackInfo& args) { @@ -512,8 +508,7 @@ void Worker::Exit(int code) { CHECK_NE(env_, nullptr); stopped_ = true; exit_code_ = code; - if (child_port_ != nullptr) - child_port_->StopEventLoop(); + if (child_port_ != nullptr) child_port_->StopEventLoop(); isolate_->TerminateExecution(); } } @@ -551,9 +546,11 @@ void InitWorker(Local target, Local workerString = FIXED_ONE_BYTE_STRING(env->isolate(), "Worker"); w->SetClassName(workerString); - target->Set(env->context(), - workerString, - w->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + workerString, + w->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); } env->SetMethod(target, "getEnvMessagePort", GetEnvMessagePort); diff --git a/src/node_worker.h b/src/node_worker.h index dd054ac38d5f76..af0a8e271afab5 100644 --- a/src/node_worker.h +++ b/src/node_worker.h @@ -3,8 +3,8 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "node_messaging.h" #include +#include "node_messaging.h" namespace node { namespace worker { @@ -93,5 +93,4 @@ class Worker : public AsyncWrap { #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS - #endif // SRC_NODE_WORKER_H_ diff --git a/src/node_zlib.cc b/src/node_zlib.cc index 639d7f87c5abe4..51cc2612d4442a 100644 --- a/src/node_zlib.cc +++ b/src/node_zlib.cc @@ -28,8 +28,8 @@ #include "v8.h" -#include "brotli/encode.h" #include "brotli/decode.h" +#include "brotli/encode.h" #include "zlib.h" #include @@ -71,19 +71,20 @@ namespace { #define Z_MAX_LEVEL 9 #define Z_DEFAULT_LEVEL Z_DEFAULT_COMPRESSION -#define ZLIB_ERROR_CODES(V) \ - V(Z_OK) \ - V(Z_STREAM_END) \ - V(Z_NEED_DICT) \ - V(Z_ERRNO) \ - V(Z_STREAM_ERROR) \ - V(Z_DATA_ERROR) \ - V(Z_MEM_ERROR) \ - V(Z_BUF_ERROR) \ - V(Z_VERSION_ERROR) \ +#define ZLIB_ERROR_CODES(V) \ + V(Z_OK) \ + V(Z_STREAM_END) \ + V(Z_NEED_DICT) \ + V(Z_ERRNO) \ + V(Z_STREAM_ERROR) \ + V(Z_DATA_ERROR) \ + V(Z_MEM_ERROR) \ + V(Z_BUF_ERROR) \ + V(Z_VERSION_ERROR) inline const char* ZlibStrerror(int err) { -#define V(code) if (err == code) return #code; +#define V(code) \ + if (err == code) return #code; ZLIB_ERROR_CODES(V) #undef V return "Z_UNKNOWN_ERROR"; @@ -107,7 +108,7 @@ enum node_zlib_mode { struct CompressionError { CompressionError(const char* message, const char* code, int err) - : message(message), code(code), err(err) {} + : message(message), code(code), err(err) {} CompressionError() = default; const char* message = nullptr; @@ -132,7 +133,10 @@ class ZlibContext : public MemoryRetainer { CompressionError ResetStream(); // Zlib-specific: - CompressionError Init(int level, int window_bits, int mem_level, int strategy, + CompressionError Init(int level, + int window_bits, + int mem_level, + int strategy, std::vector&& dictionary); void SetAllocationFunctions(alloc_func alloc, free_func free, void* opaque); CompressionError SetParams(int level, int strategy); @@ -265,14 +269,12 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { ctx_.Close(); } - static void Close(const FunctionCallbackInfo& args) { CompressionStream* ctx; ASSIGN_OR_RETURN_UNWRAP(&ctx, args.Holder()); ctx->Close(); } - // write(flush, in, in_off, in_len, out, out_off, out_len) template static void Write(const FunctionCallbackInfo& args) { @@ -287,11 +289,8 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { CHECK_EQ(false, args[0]->IsUndefined() && "must provide flush value"); if (!args[0]->Uint32Value(context).To(&flush)) return; - if (flush != Z_NO_FLUSH && - flush != Z_PARTIAL_FLUSH && - flush != Z_SYNC_FLUSH && - flush != Z_FULL_FLUSH && - flush != Z_FINISH && + if (flush != Z_NO_FLUSH && flush != Z_PARTIAL_FLUSH && + flush != Z_SYNC_FLUSH && flush != Z_FULL_FLUSH && flush != Z_FINISH && flush != Z_BLOCK) { CHECK(0 && "Invalid flush value"); } @@ -325,9 +324,8 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { } template - void Write(uint32_t flush, - char* in, uint32_t in_len, - char* out, uint32_t out_len) { + void Write( + uint32_t flush, char* in, uint32_t in_len, char* out, uint32_t out_len) { AllocScope alloc_scope(this); CHECK(init_done_ && "write before init"); @@ -365,10 +363,7 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { // This function may be called multiple times on the uv_work pool // for a single write() call, until all of the input bytes have // been consumed. - void DoThreadPoolWork() override { - ctx_.DoThreadPoolWork(); - } - + void DoThreadPoolWork() override { ctx_.DoThreadPoolWork(); } bool CheckError() { const CompressionError err = ctx_.GetErrorInfo(); @@ -377,7 +372,6 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { return false; } - // v8 land! void AfterThreadPoolWork(int status) override { AllocScope alloc_scope(this); @@ -395,18 +389,16 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { HandleScope handle_scope(env()->isolate()); Context::Scope context_scope(env()->context()); - if (!CheckError()) - return; + if (!CheckError()) return; UpdateWriteResult(); // call the write() cb - Local cb = PersistentToLocal::Default(env()->isolate(), - write_js_callback_); + Local cb = + PersistentToLocal::Default(env()->isolate(), write_js_callback_); MakeCallback(cb, 0, nullptr); - if (pending_close_) - Close(); + if (pending_close_) Close(); } // TODO(addaleax): Switch to modern error system (node_errors.h). @@ -415,27 +407,23 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { CHECK_EQ(env()->context(), env()->isolate()->GetCurrentContext()); HandleScope scope(env()->isolate()); - Local args[3] = { - OneByteString(env()->isolate(), err.message), - Integer::New(env()->isolate(), err.err), - OneByteString(env()->isolate(), err.code) - }; + Local args[3] = {OneByteString(env()->isolate(), err.message), + Integer::New(env()->isolate(), err.err), + OneByteString(env()->isolate(), err.code)}; MakeCallback(env()->onerror_string(), arraysize(args), args); // no hope of rescue. write_in_progress_ = false; - if (pending_close_) - Close(); + if (pending_close_) Close(); } - static void Reset(const FunctionCallbackInfo &args) { + static void Reset(const FunctionCallbackInfo& args) { CompressionStream* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); AllocScope alloc_scope(wrap); const CompressionError err = wrap->context()->ResetStream(); - if (err.IsError()) - wrap->EmitError(err); + if (err.IsError()) wrap->EmitError(err); } void MemoryInfo(MemoryTracker* tracker) const override { @@ -460,9 +448,8 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { // to V8; rather, we first store it as "unreported" memory in a separate // field and later report it back from the main thread. static void* AllocForZlib(void* data, uInt items, uInt size) { - size_t real_size = - MultiplyWithOverflowCheck(static_cast(items), - static_cast(size)); + size_t real_size = MultiplyWithOverflowCheck(static_cast(items), + static_cast(size)); return AllocForBrotli(data, real_size); } @@ -472,8 +459,7 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { char* memory = UncheckedMalloc(size); if (UNLIKELY(memory == nullptr)) return nullptr; *reinterpret_cast(memory) = size; - ctx->unreported_allocations_.fetch_add(size, - std::memory_order_relaxed); + ctx->unreported_allocations_.fetch_add(size, std::memory_order_relaxed); return memory + sizeof(size_t); } @@ -534,7 +520,7 @@ class CompressionStream : public AsyncWrap, public ThreadPoolWork { class ZlibStream : public CompressionStream { public: ZlibStream(Environment* env, Local wrap, node_zlib_mode mode) - : CompressionStream(env, wrap) { + : CompressionStream(env, wrap) { context()->SetMode(mode); } @@ -552,15 +538,15 @@ class ZlibStream : public CompressionStream { // Refs: https://github.com/nodejs/node/issues/14161 if (args.Length() == 5) { fprintf(stderr, - "WARNING: You are likely using a version of node-tar or npm that " - "is incompatible with this version of Node.js.\nPlease use " - "either the version of npm that is bundled with Node.js, or " - "a version of npm (> 5.5.1 or < 5.4.0) or node-tar (> 4.0.1) " - "that is compatible with Node.js 9 and above.\n"); + "WARNING: You are likely using a version of node-tar or npm that " + "is incompatible with this version of Node.js.\nPlease use " + "either the version of npm that is bundled with Node.js, or " + "a version of npm (> 5.5.1 or < 5.4.0) or node-tar (> 4.0.1) " + "that is compatible with Node.js 9 and above.\n"); } - CHECK(args.Length() == 7 && - "init(windowBits, level, memLevel, strategy, writeResult, writeCallback," - " dictionary)"); + CHECK(args.Length() == 7 && "init(windowBits, level, memLevel, strategy, " + "writeResult, writeCallback," + " dictionary)"); ZlibStream* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); @@ -594,9 +580,8 @@ class ZlibStream : public CompressionStream { if (Buffer::HasInstance(args[6])) { unsigned char* data = reinterpret_cast(Buffer::Data(args[6])); - dictionary = std::vector( - data, - data + Buffer::Length(args[6])); + dictionary = + std::vector(data, data + Buffer::Length(args[6])); } wrap->InitStream(write_result, write_js_callback); @@ -604,11 +589,9 @@ class ZlibStream : public CompressionStream { AllocScope alloc_scope(wrap); wrap->context()->SetAllocationFunctions( AllocForZlib, FreeForZlib, static_cast(wrap)); - const CompressionError err = - wrap->context()->Init(level, window_bits, mem_level, strategy, - std::move(dictionary)); - if (err.IsError()) - wrap->EmitError(err); + const CompressionError err = wrap->context()->Init( + level, window_bits, mem_level, strategy, std::move(dictionary)); + if (err.IsError()) wrap->EmitError(err); return args.GetReturnValue().Set(!err.IsError()); } @@ -625,8 +608,7 @@ class ZlibStream : public CompressionStream { AllocScope alloc_scope(wrap); const CompressionError err = wrap->context()->SetParams(level, strategy); - if (err.IsError()) - wrap->EmitError(err); + if (err.IsError()) wrap->EmitError(err); } SET_MEMORY_INFO_NAME(ZlibStream) @@ -639,7 +621,7 @@ class BrotliCompressionStream : public CompressionStream { BrotliCompressionStream(Environment* env, Local wrap, node_zlib_mode mode) - : CompressionStream(env, wrap) { + : CompressionStream(env, wrap) { context()->SetMode(mode); } @@ -669,11 +651,10 @@ class BrotliCompressionStream : public CompressionStream { wrap->InitStream(write_result, write_js_callback); AllocScope alloc_scope(wrap); - CompressionError err = - wrap->context()->Init( - CompressionStream::AllocForBrotli, - CompressionStream::FreeForZlib, - static_cast*>(wrap)); + CompressionError err = wrap->context()->Init( + CompressionStream::AllocForBrotli, + CompressionStream::FreeForZlib, + static_cast*>(wrap)); if (err.IsError()) { wrap->EmitError(err); args.GetReturnValue().Set(false); @@ -685,8 +666,7 @@ class BrotliCompressionStream : public CompressionStream { size_t len = args[0].As()->Length(); for (int i = 0; static_cast(i) < len; i++) { - if (data[i] == static_cast(-1)) - continue; + if (data[i] == static_cast(-1)) continue; err = wrap->context()->SetParams(i, data[i]); if (err.IsError()) { wrap->EmitError(err); @@ -729,7 +709,6 @@ void ZlibContext::Close() { dictionary_.clear(); } - void ZlibContext::DoThreadPoolWork() { const Bytef* next_expected_header_byte = nullptr; @@ -794,13 +773,10 @@ void ZlibContext::DoThreadPoolWork() { // If data was encoded with dictionary (INFLATERAW will have it set in // SetDictionary, don't repeat that here) - if (mode_ != INFLATERAW && - err_ == Z_NEED_DICT && - !dictionary_.empty()) { + if (mode_ != INFLATERAW && err_ == Z_NEED_DICT && !dictionary_.empty()) { // Load it - err_ = inflateSetDictionary(&strm_, - dictionary_.data(), - dictionary_.size()); + err_ = inflateSetDictionary( + &strm_, dictionary_.data(), dictionary_.size()); if (err_ == Z_OK) { // And try to decode again err_ = inflate(&strm_, flush_); @@ -812,9 +788,7 @@ void ZlibContext::DoThreadPoolWork() { } } - while (strm_.avail_in > 0 && - mode_ == GUNZIP && - err_ == Z_STREAM_END && + while (strm_.avail_in > 0 && mode_ == GUNZIP && err_ == Z_STREAM_END && strm_.next_in[0] != 0x00) { // Bytes remain in input buffer. Perhaps this is another compressed // member in the same archive, or just trailing garbage. @@ -830,61 +804,56 @@ void ZlibContext::DoThreadPoolWork() { } } - -void ZlibContext::SetBuffers(char* in, uint32_t in_len, - char* out, uint32_t out_len) { +void ZlibContext::SetBuffers(char* in, + uint32_t in_len, + char* out, + uint32_t out_len) { strm_.avail_in = in_len; strm_.next_in = reinterpret_cast(in); strm_.avail_out = out_len; strm_.next_out = reinterpret_cast(out); } - void ZlibContext::SetFlush(int flush) { flush_ = flush; } - void ZlibContext::GetAfterWriteOffsets(uint32_t* avail_in, uint32_t* avail_out) const { *avail_in = strm_.avail_in; *avail_out = strm_.avail_out; } - CompressionError ZlibContext::ErrorForMessage(const char* message) const { - if (strm_.msg != nullptr) - message = strm_.msg; + if (strm_.msg != nullptr) message = strm_.msg; - return CompressionError { message, ZlibStrerror(err_), err_ }; + return CompressionError{message, ZlibStrerror(err_), err_}; } - CompressionError ZlibContext::GetErrorInfo() const { // Acceptable error states depend on the type of zlib stream. switch (err_) { - case Z_OK: - case Z_BUF_ERROR: - if (strm_.avail_out != 0 && flush_ == Z_FINISH) { - return ErrorForMessage("unexpected end of file"); - } - case Z_STREAM_END: - // normal statuses, not fatal - break; - case Z_NEED_DICT: - if (dictionary_.empty()) - return ErrorForMessage("Missing dictionary"); - else - return ErrorForMessage("Bad dictionary"); - default: - // something else. - return ErrorForMessage("Zlib error"); + case Z_OK: + case Z_BUF_ERROR: + if (strm_.avail_out != 0 && flush_ == Z_FINISH) { + return ErrorForMessage("unexpected end of file"); + } + case Z_STREAM_END: + // normal statuses, not fatal + break; + case Z_NEED_DICT: + if (dictionary_.empty()) + return ErrorForMessage("Missing dictionary"); + else + return ErrorForMessage("Bad dictionary"); + default: + // something else. + return ErrorForMessage("Zlib error"); } - return CompressionError {}; + return CompressionError{}; } - CompressionError ZlibContext::ResetStream() { err_ = Z_OK; @@ -903,13 +872,11 @@ CompressionError ZlibContext::ResetStream() { break; } - if (err_ != Z_OK) - return ErrorForMessage("Failed to reset stream"); + if (err_ != Z_OK) return ErrorForMessage("Failed to reset stream"); return SetDictionary(); } - void ZlibContext::SetAllocationFunctions(alloc_func alloc, free_func free, void* opaque) { @@ -918,21 +885,20 @@ void ZlibContext::SetAllocationFunctions(alloc_func alloc, strm_.opaque = opaque; } - -CompressionError ZlibContext::Init( - int level, int window_bits, int mem_level, int strategy, - std::vector&& dictionary) { +CompressionError ZlibContext::Init(int level, + int window_bits, + int mem_level, + int strategy, + std::vector&& dictionary) { if (!((window_bits == 0) && - (mode_ == INFLATE || - mode_ == GUNZIP || - mode_ == UNZIP))) { + (mode_ == INFLATE || mode_ == GUNZIP || mode_ == UNZIP))) { CHECK( (window_bits >= Z_MIN_WINDOWBITS && window_bits <= Z_MAX_WINDOWBITS) && "invalid windowBits"); } CHECK((level >= Z_MIN_LEVEL && level <= Z_MAX_LEVEL) && - "invalid compression level"); + "invalid compression level"); CHECK((mem_level >= Z_MIN_MEMLEVEL && mem_level <= Z_MAX_MEMLEVEL) && "invalid memlevel"); @@ -967,12 +933,8 @@ CompressionError ZlibContext::Init( case DEFLATE: case GZIP: case DEFLATERAW: - err_ = deflateInit2(&strm_, - level_, - Z_DEFLATED, - window_bits_, - mem_level_, - strategy_); + err_ = deflateInit2( + &strm_, level_, Z_DEFLATED, window_bits_, mem_level_, strategy_); break; case INFLATE: case GUNZIP: @@ -995,26 +957,22 @@ CompressionError ZlibContext::Init( return SetDictionary(); } - CompressionError ZlibContext::SetDictionary() { - if (dictionary_.empty()) - return CompressionError {}; + if (dictionary_.empty()) return CompressionError{}; err_ = Z_OK; switch (mode_) { case DEFLATE: case DEFLATERAW: - err_ = deflateSetDictionary(&strm_, - dictionary_.data(), - dictionary_.size()); + err_ = + deflateSetDictionary(&strm_, dictionary_.data(), dictionary_.size()); break; case INFLATERAW: // The other inflate cases will have the dictionary set when inflate() // returns Z_NEED_DICT in Process() - err_ = inflateSetDictionary(&strm_, - dictionary_.data(), - dictionary_.size()); + err_ = + inflateSetDictionary(&strm_, dictionary_.data(), dictionary_.size()); break; default: break; @@ -1024,10 +982,9 @@ CompressionError ZlibContext::SetDictionary() { return ErrorForMessage("Failed to set dictionary"); } - return CompressionError {}; + return CompressionError{}; } - CompressionError ZlibContext::SetParams(int level, int strategy) { err_ = Z_OK; @@ -1044,31 +1001,29 @@ CompressionError ZlibContext::SetParams(int level, int strategy) { return ErrorForMessage("Failed to set parameters"); } - return CompressionError {}; + return CompressionError{}; } - -void BrotliContext::SetBuffers(char* in, uint32_t in_len, - char* out, uint32_t out_len) { +void BrotliContext::SetBuffers(char* in, + uint32_t in_len, + char* out, + uint32_t out_len) { next_in_ = reinterpret_cast(in); next_out_ = reinterpret_cast(out); avail_in_ = in_len; avail_out_ = out_len; } - void BrotliContext::SetFlush(int flush) { flush_ = static_cast(flush); } - void BrotliContext::GetAfterWriteOffsets(uint32_t* avail_in, uint32_t* avail_out) const { *avail_in = avail_in_; *avail_out = avail_out_; } - void BrotliEncoderContext::DoThreadPoolWork() { CHECK_EQ(mode_, BROTLI_ENCODE); CHECK(state_); @@ -1083,7 +1038,6 @@ void BrotliEncoderContext::DoThreadPoolWork() { next_in_ += next_in - next_in_; } - void BrotliEncoderContext::Close() { state_.reset(); mode_ = NONE; @@ -1101,7 +1055,7 @@ CompressionError BrotliEncoderContext::Init(brotli_alloc_func alloc, "ERR_ZLIB_INITIALIZATION_FAILED", -1); } else { - return CompressionError {}; + return CompressionError{}; } } @@ -1110,28 +1064,24 @@ CompressionError BrotliEncoderContext::ResetStream() { } CompressionError BrotliEncoderContext::SetParams(int key, uint32_t value) { - if (!BrotliEncoderSetParameter(state_.get(), - static_cast(key), - value)) { - return CompressionError("Setting parameter failed", - "ERR_BROTLI_PARAM_SET_FAILED", - -1); + if (!BrotliEncoderSetParameter( + state_.get(), static_cast(key), value)) { + return CompressionError( + "Setting parameter failed", "ERR_BROTLI_PARAM_SET_FAILED", -1); } else { - return CompressionError {}; + return CompressionError{}; } } CompressionError BrotliEncoderContext::GetErrorInfo() const { if (!last_result_) { - return CompressionError("Compression failed", - "ERR_BROTLI_COMPRESSION_FAILED", - -1); + return CompressionError( + "Compression failed", "ERR_BROTLI_COMPRESSION_FAILED", -1); } else { - return CompressionError {}; + return CompressionError{}; } } - void BrotliDecoderContext::Close() { state_.reset(); mode_ = NONE; @@ -1141,12 +1091,8 @@ void BrotliDecoderContext::DoThreadPoolWork() { CHECK_EQ(mode_, BROTLI_DECODE); CHECK(state_); const uint8_t* next_in = next_in_; - last_result_ = BrotliDecoderDecompressStream(state_.get(), - &avail_in_, - &next_in, - &avail_out_, - &next_out_, - nullptr); + last_result_ = BrotliDecoderDecompressStream( + state_.get(), &avail_in_, &next_in, &avail_out_, &next_out_, nullptr); next_in_ += next_in - next_in_; if (last_result_ == BROTLI_DECODER_RESULT_ERROR) { error_ = BrotliDecoderGetErrorCode(state_.get()); @@ -1166,7 +1112,7 @@ CompressionError BrotliDecoderContext::Init(brotli_alloc_func alloc, "ERR_ZLIB_INITIALIZATION_FAILED", -1); } else { - return CompressionError {}; + return CompressionError{}; } } @@ -1175,14 +1121,12 @@ CompressionError BrotliDecoderContext::ResetStream() { } CompressionError BrotliDecoderContext::SetParams(int key, uint32_t value) { - if (!BrotliDecoderSetParameter(state_.get(), - static_cast(key), - value)) { - return CompressionError("Setting parameter failed", - "ERR_BROTLI_PARAM_SET_FAILED", - -1); + if (!BrotliDecoderSetParameter( + state_.get(), static_cast(key), value)) { + return CompressionError( + "Setting parameter failed", "ERR_BROTLI_PARAM_SET_FAILED", -1); } else { - return CompressionError {}; + return CompressionError{}; } } @@ -1194,15 +1138,13 @@ CompressionError BrotliDecoderContext::GetErrorInfo() const { } else if (flush_ == BROTLI_OPERATION_FINISH && last_result_ == BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT) { // Match zlib's behaviour, as brotli doesn't have its own code for this. - return CompressionError("unexpected end of file", - "Z_BUF_ERROR", - Z_BUF_ERROR); + return CompressionError( + "unexpected end of file", "Z_BUF_ERROR", Z_BUF_ERROR); } else { - return CompressionError {}; + return CompressionError{}; } } - template struct MakeClass { static void Make(Environment* env, Local target, const char* name) { @@ -1221,9 +1163,11 @@ struct MakeClass { Local zlibString = OneByteString(env->isolate(), name); z->SetClassName(zlibString); - target->Set(env->context(), - zlibString, - z->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + zlibString, + z->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); } }; @@ -1237,9 +1181,11 @@ void Initialize(Local target, MakeClass::Make(env, target, "BrotliEncoder"); MakeClass::Make(env, target, "BrotliDecoder"); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "ZLIB_VERSION"), - FIXED_ONE_BYTE_STRING(env->isolate(), ZLIB_VERSION)).FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "ZLIB_VERSION"), + FIXED_ONE_BYTE_STRING(env->isolate(), ZLIB_VERSION)) + .FromJust(); } } // anonymous namespace @@ -1329,7 +1275,7 @@ void DefineZlibConstants(Local target) { NODE_DEFINE_CONSTANT(target, BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT); NODE_DEFINE_CONSTANT(target, BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT); NODE_DEFINE_CONSTANT(target, - BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION); + BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION); NODE_DEFINE_CONSTANT(target, BROTLI_DECODER_PARAM_LARGE_WINDOW); NODE_DEFINE_CONSTANT(target, BROTLI_DECODER_NO_ERROR); NODE_DEFINE_CONSTANT(target, BROTLI_DECODER_SUCCESS); @@ -1338,9 +1284,9 @@ void DefineZlibConstants(Local target) { NODE_DEFINE_CONSTANT(target, BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE); NODE_DEFINE_CONSTANT(target, BROTLI_DECODER_ERROR_FORMAT_RESERVED); NODE_DEFINE_CONSTANT(target, - BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE); + BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE); NODE_DEFINE_CONSTANT(target, - BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET); + BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET); NODE_DEFINE_CONSTANT(target, BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME); NODE_DEFINE_CONSTANT(target, BROTLI_DECODER_ERROR_FORMAT_CL_SPACE); NODE_DEFINE_CONSTANT(target, BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE); diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc index 06bb3dd73d1b3c..a550e459db1e86 100644 --- a/src/pipe_wrap.cc +++ b/src/pipe_wrap.cc @@ -22,12 +22,12 @@ #include "pipe_wrap.h" #include "async_wrap.h" +#include "connect_wrap.h" #include "connection_wrap.h" #include "env-inl.h" #include "handle_wrap.h" #include "node.h" #include "node_buffer.h" -#include "connect_wrap.h" #include "stream_base-inl.h" #include "stream_wrap.h" #include "util-inl.h" @@ -64,7 +64,6 @@ MaybeLocal PipeWrap::Instantiate(Environment* env, constructor->NewInstance(env->context(), 1, &type_value)); } - void PipeWrap::Initialize(Local target, Local unused, Local context, @@ -89,9 +88,11 @@ void PipeWrap::Initialize(Local target, env->SetProtoMethod(t, "fchmod", Fchmod); - target->Set(env->context(), - pipeString, - t->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + pipeString, + t->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); env->set_pipe_constructor_template(t); // Create FunctionTemplate for PipeConnectWrap. @@ -100,9 +101,11 @@ void PipeWrap::Initialize(Local target, Local wrapString = FIXED_ONE_BYTE_STRING(env->isolate(), "PipeConnectWrap"); cwt->SetClassName(wrapString); - target->Set(env->context(), - wrapString, - cwt->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + wrapString, + cwt->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); // Define constants Local constants = Object::New(env->isolate()); @@ -111,12 +114,9 @@ void PipeWrap::Initialize(Local target, NODE_DEFINE_CONSTANT(constants, IPC); NODE_DEFINE_CONSTANT(constants, UV_READABLE); NODE_DEFINE_CONSTANT(constants, UV_WRITABLE); - target->Set(context, - env->constants_string(), - constants).FromJust(); + target->Set(context, env->constants_string(), constants).FromJust(); } - void PipeWrap::New(const FunctionCallbackInfo& args) { // This constructor should not be exposed to public javascript. // Therefore we assert that we are not trying to call this as a @@ -150,7 +150,6 @@ void PipeWrap::New(const FunctionCallbackInfo& args) { new PipeWrap(env, args.This(), provider, ipc); } - PipeWrap::PipeWrap(Environment* env, Local object, ProviderType provider, @@ -161,7 +160,6 @@ PipeWrap::PipeWrap(Environment* env, // Suggestion: uv_pipe_init() returns void. } - void PipeWrap::Bind(const FunctionCallbackInfo& args) { PipeWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); @@ -170,7 +168,6 @@ void PipeWrap::Bind(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(err); } - #ifdef _WIN32 void PipeWrap::SetPendingInstances(const FunctionCallbackInfo& args) { PipeWrap* wrap; @@ -181,31 +178,26 @@ void PipeWrap::SetPendingInstances(const FunctionCallbackInfo& args) { } #endif - void PipeWrap::Fchmod(const v8::FunctionCallbackInfo& args) { PipeWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); CHECK(args[0]->IsInt32()); int mode = args[0].As()->Value(); - int err = uv_pipe_chmod(reinterpret_cast(&wrap->handle_), - mode); + int err = uv_pipe_chmod(reinterpret_cast(&wrap->handle_), mode); args.GetReturnValue().Set(err); } - void PipeWrap::Listen(const FunctionCallbackInfo& args) { PipeWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); Environment* env = wrap->env(); int backlog; if (!args[0]->Int32Value(env->context()).To(&backlog)) return; - int err = uv_listen(reinterpret_cast(&wrap->handle_), - backlog, - OnConnection); + int err = uv_listen( + reinterpret_cast(&wrap->handle_), backlog, OnConnection); args.GetReturnValue().Set(err); } - void PipeWrap::Open(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -222,7 +214,6 @@ void PipeWrap::Open(const FunctionCallbackInfo& args) { env->isolate()->ThrowException(UVException(err, "uv_pipe_open")); } - void PipeWrap::Connect(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -237,15 +228,11 @@ void PipeWrap::Connect(const FunctionCallbackInfo& args) { ConnectWrap* req_wrap = new ConnectWrap(env, req_wrap_obj, AsyncWrap::PROVIDER_PIPECONNECTWRAP); - req_wrap->Dispatch(uv_pipe_connect, - &wrap->handle_, - *name, - AfterConnect); + req_wrap->Dispatch(uv_pipe_connect, &wrap->handle_, *name, AfterConnect); args.GetReturnValue().Set(0); // uv_pipe_connect() doesn't return errors. } - } // namespace node NODE_MODULE_CONTEXT_AWARE_INTERNAL(pipe_wrap, node::PipeWrap::Initialize) diff --git a/src/pipe_wrap.h b/src/pipe_wrap.h index 473179a4f6fba0..c211df9b82cc86 100644 --- a/src/pipe_wrap.h +++ b/src/pipe_wrap.h @@ -32,11 +32,7 @@ namespace node { class PipeWrap : public ConnectionWrap { public: - enum SocketType { - SOCKET, - SERVER, - IPC - }; + enum SocketType { SOCKET, SERVER, IPC }; static v8::MaybeLocal Instantiate(Environment* env, AsyncWrap* parent, @@ -69,7 +65,6 @@ class PipeWrap : public ConnectionWrap { static void Fchmod(const v8::FunctionCallbackInfo& args); }; - } // namespace node #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS diff --git a/src/process_wrap.cc b/src/process_wrap.cc index 37afaf8ff961c9..a5dbf90faaa5a7 100644 --- a/src/process_wrap.cc +++ b/src/process_wrap.cc @@ -24,8 +24,8 @@ #include "stream_wrap.h" #include "util-inl.h" -#include #include +#include namespace node { @@ -62,9 +62,11 @@ class ProcessWrap : public HandleWrap { env->SetProtoMethod(constructor, "spawn", Spawn); env->SetProtoMethod(constructor, "kill", Kill); - target->Set(env->context(), - processString, - constructor->GetFunction(context).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + processString, + constructor->GetFunction(context).ToLocalChecked()) + .FromJust(); } SET_NO_MEMORY_INFO() @@ -215,7 +217,7 @@ class ProcessWrap : public HandleWrap { if (!env_v.IsEmpty() && env_v->IsArray()) { Local env_opt = Local::Cast(env_v); int envc = env_opt->Length(); - CHECK_GT(envc + 1, 0); // Check for overflow. + CHECK_GT(envc + 1, 0); // Check for overflow. options.env = new char*[envc + 1]; // Heap allocated to detect errors. for (int i = 0; i < envc; i++) { node::Utf8Value pair(env->isolate(), @@ -259,19 +261,21 @@ class ProcessWrap : public HandleWrap { if (err == 0) { CHECK_EQ(wrap->process_.data, wrap); - wrap->object()->Set(context, env->pid_string(), - Integer::New(env->isolate(), - wrap->process_.pid)).FromJust(); + wrap->object() + ->Set(context, + env->pid_string(), + Integer::New(env->isolate(), wrap->process_.pid)) + .FromJust(); } if (options.args) { for (int i = 0; options.args[i]; i++) free(options.args[i]); - delete [] options.args; + delete[] options.args; } if (options.env) { for (int i = 0; options.env[i]; i++) free(options.env[i]); - delete [] options.env; + delete[] options.env; } delete[] options.stdio; @@ -300,9 +304,8 @@ class ProcessWrap : public HandleWrap { Context::Scope context_scope(env->context()); Local argv[] = { - Number::New(env->isolate(), static_cast(exit_status)), - OneByteString(env->isolate(), signo_string(term_signal)) - }; + Number::New(env->isolate(), static_cast(exit_status)), + OneByteString(env->isolate(), signo_string(term_signal))}; wrap->MakeCallback(env->onexit_string(), arraysize(argv), argv); } @@ -310,7 +313,6 @@ class ProcessWrap : public HandleWrap { uv_process_t process_; }; - } // anonymous namespace } // namespace node diff --git a/src/req_wrap-inl.h b/src/req_wrap-inl.h index 4f9da1c4f35d9e..c5e9e1359b6c45 100644 --- a/src/req_wrap-inl.h +++ b/src/req_wrap-inl.h @@ -3,9 +3,9 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "req_wrap.h" #include "async_wrap-inl.h" #include "env-inl.h" +#include "req_wrap.h" #include "util-inl.h" #include "uv.h" @@ -16,7 +16,6 @@ ReqWrap::ReqWrap(Environment* env, v8::Local object, AsyncWrap::ProviderType provider) : AsyncWrap(env, object, provider) { - // FIXME(bnoordhuis) The fact that a reinterpret_cast is needed is // arguably a good indicator that there should be more than one queue. env->req_wrap_queue()->PushBack(reinterpret_cast*>(this)); @@ -66,8 +65,8 @@ struct CallLibuvFunction; // Detect `int uv_foo(uv_loop_t* loop, uv_req_t* request, ...);`. template -struct CallLibuvFunction { - using T = int(*)(uv_loop_t*, ReqT*, Args...); +struct CallLibuvFunction { + using T = int (*)(uv_loop_t*, ReqT*, Args...); template static int Call(T fn, uv_loop_t* loop, ReqT* req, PassedArgs... args) { return fn(loop, req, args...); @@ -76,8 +75,8 @@ struct CallLibuvFunction { // Detect `int uv_foo(uv_req_t* request, ...);`. template -struct CallLibuvFunction { - using T = int(*)(ReqT*, Args...); +struct CallLibuvFunction { + using T = int (*)(ReqT*, Args...); template static int Call(T fn, uv_loop_t* loop, ReqT* req, PassedArgs... args) { return fn(req, args...); @@ -86,8 +85,8 @@ struct CallLibuvFunction { // Detect `void uv_foo(uv_req_t* request, ...);`. template -struct CallLibuvFunction { - using T = void(*)(ReqT*, Args...); +struct CallLibuvFunction { + using T = void (*)(ReqT*, Args...); template static int Call(T fn, uv_loop_t* loop, ReqT* req, PassedArgs... args) { fn(req, args...); @@ -112,8 +111,8 @@ struct MakeLibuvRequestCallback { // Match the `void callback(uv_req_t*, ...);` signature that all libuv // callbacks use. template -struct MakeLibuvRequestCallback { - using F = void(*)(ReqT* req, Args... args); +struct MakeLibuvRequestCallback { + using F = void (*)(ReqT* req, Args... args); static void Wrapper(ReqT* req, Args... args) { ReqWrap* req_wrap = ContainerOf(&ReqWrap::req_, req); @@ -154,8 +153,7 @@ int ReqWrap::Dispatch(LibuvFunction fn, Args... args) { env()->event_loop(), req(), MakeLibuvRequestCallback::For(this, args)...); - if (err >= 0) - env()->IncreaseWaitingRequestCounter(); + if (err >= 0) env()->IncreaseWaitingRequestCounter(); return err; } diff --git a/src/sharedarraybuffer_metadata.cc b/src/sharedarraybuffer_metadata.cc index 671ad6d6820440..05e604ef33ac6f 100644 --- a/src/sharedarraybuffer_metadata.cc +++ b/src/sharedarraybuffer_metadata.cc @@ -1,6 +1,6 @@ #include "sharedarraybuffer_metadata.h" -#include "base_object.h" #include "base_object-inl.h" +#include "base_object.h" #include "node_errors.h" using v8::Context; @@ -22,16 +22,15 @@ namespace { // Yield a JS constructor for SABLifetimePartner objects in the form of a // standard API object, that has a single field for containing the raw // SABLifetimePartner* pointer. -Local GetSABLifetimePartnerConstructor( - Environment* env, Local context) { +Local GetSABLifetimePartnerConstructor(Environment* env, + Local context) { Local templ; templ = env->sab_lifetimepartner_constructor_template(); - if (!templ.IsEmpty()) - return templ->GetFunction(context).ToLocalChecked(); + if (!templ.IsEmpty()) return templ->GetFunction(context).ToLocalChecked(); templ = BaseObject::MakeLazilyInitializedJSTemplate(env); - templ->SetClassName(FIXED_ONE_BYTE_STRING(env->isolate(), - "SABLifetimePartner")); + templ->SetClassName( + FIXED_ONE_BYTE_STRING(env->isolate(), "SABLifetimePartner")); env->set_sab_lifetimepartner_constructor_template(templ); return GetSABLifetimePartnerConstructor(env, context); @@ -42,8 +41,7 @@ class SABLifetimePartner : public BaseObject { SABLifetimePartner(Environment* env, Local obj, SharedArrayBufferMetadataReference r) - : BaseObject(env, obj), - reference(r) { + : BaseObject(env, obj), reference(r) { MakeWeak(); } @@ -58,20 +56,17 @@ class SABLifetimePartner : public BaseObject { SharedArrayBufferMetadataReference SharedArrayBufferMetadata::ForSharedArrayBuffer( - Environment* env, - Local context, - Local source) { + Environment* env, Local context, Local source) { Local lifetime_partner; - if (!source->GetPrivate(context, - env->sab_lifetimepartner_symbol()) - .ToLocal(&lifetime_partner)) { + if (!source->GetPrivate(context, env->sab_lifetimepartner_symbol()) + .ToLocal(&lifetime_partner)) { return nullptr; } if (lifetime_partner->IsObject() && - env->sab_lifetimepartner_constructor_template() - ->HasInstance(lifetime_partner)) { + env->sab_lifetimepartner_constructor_template()->HasInstance( + lifetime_partner)) { CHECK(source->IsExternal()); SABLifetimePartner* partner = Unwrap(lifetime_partner.As()); @@ -96,36 +91,29 @@ SharedArrayBufferMetadata::ForSharedArrayBuffer( } Maybe SharedArrayBufferMetadata::AssignToSharedArrayBuffer( - Environment* env, Local context, - Local target) { + Environment* env, Local context, Local target) { CHECK(target->IsExternal()); Local ctor = GetSABLifetimePartnerConstructor(env, context); Local obj; - if (!ctor->NewInstance(context).ToLocal(&obj)) - return Nothing(); + if (!ctor->NewInstance(context).ToLocal(&obj)) return Nothing(); new SABLifetimePartner(env, obj, shared_from_this()); - return target->SetPrivate(context, - env->sab_lifetimepartner_symbol(), - obj); + return target->SetPrivate(context, env->sab_lifetimepartner_symbol(), obj); } SharedArrayBufferMetadata::SharedArrayBufferMetadata( const SharedArrayBuffer::Contents& contents) - : contents_(contents) { } + : contents_(contents) {} SharedArrayBufferMetadata::~SharedArrayBufferMetadata() { - contents_.Deleter()(contents_.Data(), - contents_.ByteLength(), - contents_.DeleterData()); + contents_.Deleter()( + contents_.Data(), contents_.ByteLength(), contents_.DeleterData()); } MaybeLocal SharedArrayBufferMetadata::GetSharedArrayBuffer( Environment* env, Local context) { - Local obj = - SharedArrayBuffer::New(env->isolate(), - contents_.Data(), - contents_.ByteLength()); + Local obj = SharedArrayBuffer::New( + env->isolate(), contents_.Data(), contents_.ByteLength()); if (AssignToSharedArrayBuffer(env, context, obj).IsNothing()) return MaybeLocal(); diff --git a/src/sharedarraybuffer_metadata.h b/src/sharedarraybuffer_metadata.h index 8c753a89c11a88..818556b34e9a28 100644 --- a/src/sharedarraybuffer_metadata.h +++ b/src/sharedarraybuffer_metadata.h @@ -3,8 +3,8 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "node.h" #include +#include "node.h" namespace node { namespace worker { @@ -39,10 +39,10 @@ class SharedArrayBufferMetadata Environment* env, v8::Local context); SharedArrayBufferMetadata(SharedArrayBufferMetadata&& other) = delete; - SharedArrayBufferMetadata& operator=( - SharedArrayBufferMetadata&& other) = delete; - SharedArrayBufferMetadata& operator=( - const SharedArrayBufferMetadata&) = delete; + SharedArrayBufferMetadata& operator=(SharedArrayBufferMetadata&& other) = + delete; + SharedArrayBufferMetadata& operator=(const SharedArrayBufferMetadata&) = + delete; SharedArrayBufferMetadata(const SharedArrayBufferMetadata&) = delete; private: @@ -62,5 +62,4 @@ class SharedArrayBufferMetadata #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS - #endif // SRC_SHAREDARRAYBUFFER_METADATA_H_ diff --git a/src/signal_wrap.cc b/src/signal_wrap.cc index ca08342ec63bb1..9e756abdf4a9be 100644 --- a/src/signal_wrap.cc +++ b/src/signal_wrap.cc @@ -57,9 +57,11 @@ class SignalWrap : public HandleWrap { env->SetProtoMethod(constructor, "start", Start); env->SetProtoMethod(constructor, "stop", Stop); - target->Set(env->context(), signalString, - constructor->GetFunction(env->context()).ToLocalChecked()) - .FromJust(); + target + ->Set(env->context(), + signalString, + constructor->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); } SET_NO_MEMORY_INFO() @@ -125,9 +127,7 @@ class SignalWrap : public HandleWrap { uv_signal_t handle_; }; - } // anonymous namespace } // namespace node - NODE_MODULE_CONTEXT_AWARE_INTERNAL(signal_wrap, node::SignalWrap::Initialize) diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc index 749e628fbdfe9a..00026ca3ef0ae8 100644 --- a/src/spawn_sync.cc +++ b/src/spawn_sync.cc @@ -27,7 +27,6 @@ #include - namespace node { using v8::Array; @@ -49,10 +48,7 @@ using v8::Object; using v8::String; using v8::Value; - -SyncProcessOutputBuffer::SyncProcessOutputBuffer() { -} - +SyncProcessOutputBuffer::SyncProcessOutputBuffer() {} void SyncProcessOutputBuffer::OnAlloc(size_t suggested_size, uv_buf_t* buf) const { @@ -62,40 +58,33 @@ void SyncProcessOutputBuffer::OnAlloc(size_t suggested_size, *buf = uv_buf_init(data_ + used(), available()); } - void SyncProcessOutputBuffer::OnRead(const uv_buf_t* buf, size_t nread) { // If we hand out the same chunk twice, this should catch it. CHECK_EQ(buf->base, data_ + used()); used_ += static_cast(nread); } - size_t SyncProcessOutputBuffer::Copy(char* dest) const { memcpy(dest, data_, used()); return used(); } - unsigned int SyncProcessOutputBuffer::available() const { return sizeof data_ - used(); } - unsigned int SyncProcessOutputBuffer::used() const { return used_; } - SyncProcessOutputBuffer* SyncProcessOutputBuffer::next() const { return next_; } - void SyncProcessOutputBuffer::set_next(SyncProcessOutputBuffer* next) { next_ = next; } - SyncProcessStdioPipe::SyncProcessStdioPipe(SyncProcessRunner* process_handler, bool readable, bool writable, @@ -116,7 +105,6 @@ SyncProcessStdioPipe::SyncProcessStdioPipe(SyncProcessRunner* process_handler, CHECK(readable || writable); } - SyncProcessStdioPipe::~SyncProcessStdioPipe() { CHECK(lifecycle_ == kUninitialized || lifecycle_ == kClosed); @@ -129,13 +117,11 @@ SyncProcessStdioPipe::~SyncProcessStdioPipe() { } } - int SyncProcessStdioPipe::Initialize(uv_loop_t* loop) { CHECK_EQ(lifecycle_, kUninitialized); int r = uv_pipe_init(loop, uv_pipe(), 0); - if (r < 0) - return r; + if (r < 0) return r; uv_pipe()->data = this; @@ -143,7 +129,6 @@ int SyncProcessStdioPipe::Initialize(uv_loop_t* loop) { return 0; } - int SyncProcessStdioPipe::Start() { CHECK_EQ(lifecycle_, kInitialized); @@ -155,30 +140,23 @@ int SyncProcessStdioPipe::Start() { if (input_buffer_.len > 0) { CHECK_NOT_NULL(input_buffer_.base); - int r = uv_write(&write_req_, - uv_stream(), - &input_buffer_, - 1, - WriteCallback); - if (r < 0) - return r; + int r = + uv_write(&write_req_, uv_stream(), &input_buffer_, 1, WriteCallback); + if (r < 0) return r; } int r = uv_shutdown(&shutdown_req_, uv_stream(), ShutdownCallback); - if (r < 0) - return r; + if (r < 0) return r; } if (writable()) { int r = uv_read_start(uv_stream(), AllocCallback, ReadCallback); - if (r < 0) - return r; + if (r < 0) return r; } return 0; } - void SyncProcessStdioPipe::Close() { CHECK(lifecycle_ == kInitialized || lifecycle_ == kStarted); @@ -187,7 +165,6 @@ void SyncProcessStdioPipe::Close() { lifecycle_ = kClosing; } - Local SyncProcessStdioPipe::GetOutputAsBuffer(Environment* env) const { size_t length = OutputLength(); Local js_buffer = Buffer::New(env, length).ToLocalChecked(); @@ -195,46 +172,37 @@ Local SyncProcessStdioPipe::GetOutputAsBuffer(Environment* env) const { return js_buffer; } - bool SyncProcessStdioPipe::readable() const { return readable_; } - bool SyncProcessStdioPipe::writable() const { return writable_; } - uv_stdio_flags SyncProcessStdioPipe::uv_flags() const { unsigned int flags; flags = UV_CREATE_PIPE; - if (readable()) - flags |= UV_READABLE_PIPE; - if (writable()) - flags |= UV_WRITABLE_PIPE; + if (readable()) flags |= UV_READABLE_PIPE; + if (writable()) flags |= UV_WRITABLE_PIPE; return static_cast(flags); } - uv_pipe_t* SyncProcessStdioPipe::uv_pipe() const { CHECK_LT(lifecycle_, kClosing); return &uv_pipe_; } - uv_stream_t* SyncProcessStdioPipe::uv_stream() const { return reinterpret_cast(uv_pipe()); } - uv_handle_t* SyncProcessStdioPipe::uv_handle() const { return reinterpret_cast(uv_pipe()); } - size_t SyncProcessStdioPipe::OutputLength() const { SyncProcessOutputBuffer* buf; size_t size = 0; @@ -245,7 +213,6 @@ size_t SyncProcessStdioPipe::OutputLength() const { return size; } - void SyncProcessStdioPipe::CopyOutput(char* dest) const { SyncProcessOutputBuffer* buf; size_t offset = 0; @@ -254,7 +221,6 @@ void SyncProcessStdioPipe::CopyOutput(char* dest) const { offset += buf->Copy(dest + offset); } - void SyncProcessStdioPipe::OnAlloc(size_t suggested_size, uv_buf_t* buf) { // This function assumes that libuv will never allocate two buffers for the // same stream at the same time. There's an assert in @@ -276,7 +242,6 @@ void SyncProcessStdioPipe::OnAlloc(size_t suggested_size, uv_buf_t* buf) { last_output_buffer_->OnAlloc(suggested_size, buf); } - void SyncProcessStdioPipe::OnRead(const uv_buf_t* buf, ssize_t nread) { if (nread == UV_EOF) { // Libuv implicitly stops reading on EOF. @@ -292,30 +257,23 @@ void SyncProcessStdioPipe::OnRead(const uv_buf_t* buf, ssize_t nread) { } } - void SyncProcessStdioPipe::OnWriteDone(int result) { - if (result < 0) - SetError(result); + if (result < 0) SetError(result); } - void SyncProcessStdioPipe::OnShutdownDone(int result) { - if (result < 0) - SetError(result); + if (result < 0) SetError(result); } - void SyncProcessStdioPipe::OnClose() { lifecycle_ = kClosed; } - void SyncProcessStdioPipe::SetError(int error) { CHECK_NE(error, 0); process_handler_->SetPipeError(error); } - void SyncProcessStdioPipe::AllocCallback(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) { @@ -324,23 +282,20 @@ void SyncProcessStdioPipe::AllocCallback(uv_handle_t* handle, self->OnAlloc(suggested_size, buf); } - void SyncProcessStdioPipe::ReadCallback(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { SyncProcessStdioPipe* self = - reinterpret_cast(stream->data); + reinterpret_cast(stream->data); self->OnRead(buf, nread); } - void SyncProcessStdioPipe::WriteCallback(uv_write_t* req, int result) { SyncProcessStdioPipe* self = reinterpret_cast(req->handle->data); self->OnWriteDone(result); } - void SyncProcessStdioPipe::ShutdownCallback(uv_shutdown_t* req, int result) { SyncProcessStdioPipe* self = reinterpret_cast(req->handle->data); @@ -349,20 +304,17 @@ void SyncProcessStdioPipe::ShutdownCallback(uv_shutdown_t* req, int result) { // when the other end has closed the connection fails with ENOTCONN. // Libuv is not the right place to handle that because it can't tell // if the error is genuine but we here can. - if (result == UV_ENOTCONN) - result = 0; + if (result == UV_ENOTCONN) result = 0; self->OnShutdownDone(result); } - void SyncProcessStdioPipe::CloseCallback(uv_handle_t* handle) { SyncProcessStdioPipe* self = reinterpret_cast(handle->data); self->OnClose(); } - void SyncProcessRunner::Initialize(Local target, Local unused, Local context, @@ -371,7 +323,6 @@ void SyncProcessRunner::Initialize(Local target, env->SetMethod(target, "spawn", Spawn); } - void SyncProcessRunner::Spawn(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); env->PrintSyncTrace(); @@ -381,7 +332,6 @@ void SyncProcessRunner::Spawn(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(result); } - SyncProcessRunner::SyncProcessRunner(Environment* env) : max_buffer_(0), timeout_(0), @@ -414,9 +364,7 @@ SyncProcessRunner::SyncProcessRunner(Environment* env) lifecycle_(kUninitialized), - env_(env) { -} - + env_(env) {} SyncProcessRunner::~SyncProcessRunner() { CHECK_EQ(lifecycle_, kHandlesClosed); @@ -429,7 +377,6 @@ SyncProcessRunner::~SyncProcessRunner() { delete[] uv_stdio_containers_; } - Environment* SyncProcessRunner::env() const { return env_; } @@ -520,7 +467,6 @@ Maybe SyncProcessRunner::TryInitializeAndRunLoop(Local options) { return Just(true); } - void SyncProcessRunner::CloseHandlesAndDeleteLoop() { CHECK_LT(lifecycle_, kHandlesClosed); @@ -541,8 +487,7 @@ void SyncProcessRunner::CloseHandlesAndDeleteLoop() { // Give closing watchers a chance to finish closing and get their close // callbacks called. int r = uv_run(uv_loop_, UV_RUN_DEFAULT); - if (r < 0) - ABORT(); + if (r < 0) ABORT(); CheckedUvLoopClose(uv_loop_); delete uv_loop_; @@ -557,7 +502,6 @@ void SyncProcessRunner::CloseHandlesAndDeleteLoop() { lifecycle_ = kHandlesClosed; } - void SyncProcessRunner::CloseStdioPipes() { CHECK_LT(lifecycle_, kHandlesClosed); @@ -566,15 +510,13 @@ void SyncProcessRunner::CloseStdioPipes() { CHECK_NOT_NULL(uv_loop_); for (const auto& pipe : stdio_pipes_) { - if (pipe) - pipe->Close(); + if (pipe) pipe->Close(); } stdio_pipes_initialized_ = false; } } - void SyncProcessRunner::CloseKillTimer() { CHECK_LT(lifecycle_, kHandlesClosed); @@ -590,11 +532,9 @@ void SyncProcessRunner::CloseKillTimer() { } } - void SyncProcessRunner::Kill() { // Only attempt to kill once. - if (killed_) - return; + if (killed_) return; killed_ = true; // We might get here even if the process we spawned has already exited. This @@ -623,7 +563,6 @@ void SyncProcessRunner::Kill() { CloseKillTimer(); } - void SyncProcessRunner::IncrementBufferSizeAndCheckOverflow(ssize_t length) { buffered_output_size_ += length; @@ -633,22 +572,18 @@ void SyncProcessRunner::IncrementBufferSizeAndCheckOverflow(ssize_t length) { } } - void SyncProcessRunner::OnExit(int64_t exit_status, int term_signal) { - if (exit_status < 0) - return SetError(static_cast(exit_status)); + if (exit_status < 0) return SetError(static_cast(exit_status)); exit_status_ = exit_status; term_signal_ = term_signal; } - void SyncProcessRunner::OnKillTimerTimeout() { SetError(UV_ETIMEDOUT); Kill(); } - int SyncProcessRunner::GetError() { if (error_ != 0) return error_; @@ -656,19 +591,14 @@ int SyncProcessRunner::GetError() { return pipe_error_; } - void SyncProcessRunner::SetError(int error) { - if (error_ == 0) - error_ = error; + if (error_ == 0) error_ = error; } - void SyncProcessRunner::SetPipeError(int pipe_error) { - if (pipe_error_ == 0) - pipe_error_ = pipe_error; + if (pipe_error_ == 0) pipe_error_ = pipe_error; } - Local SyncProcessRunner::BuildResultObject() { EscapableHandleScope scope(env()->isolate()); Local context = env()->context(); @@ -676,50 +606,60 @@ Local SyncProcessRunner::BuildResultObject() { Local js_result = Object::New(env()->isolate()); if (GetError() != 0) { - js_result->Set(context, env()->error_string(), - Integer::New(env()->isolate(), GetError())).FromJust(); + js_result + ->Set(context, + env()->error_string(), + Integer::New(env()->isolate(), GetError())) + .FromJust(); } if (exit_status_ >= 0) { if (term_signal_ > 0) { - js_result->Set(context, env()->status_string(), - Null(env()->isolate())).FromJust(); + js_result->Set(context, env()->status_string(), Null(env()->isolate())) + .FromJust(); } else { - js_result->Set(context, env()->status_string(), - Number::New(env()->isolate(), - static_cast(exit_status_))).FromJust(); + js_result + ->Set( + context, + env()->status_string(), + Number::New(env()->isolate(), static_cast(exit_status_))) + .FromJust(); } } else { // If exit_status_ < 0 the process was never started because of some error. - js_result->Set(context, env()->status_string(), - Null(env()->isolate())).FromJust(); + js_result->Set(context, env()->status_string(), Null(env()->isolate())) + .FromJust(); } if (term_signal_ > 0) - js_result->Set(context, env()->signal_string(), - String::NewFromUtf8(env()->isolate(), - signo_string(term_signal_), - v8::NewStringType::kNormal) - .ToLocalChecked()) + js_result + ->Set(context, + env()->signal_string(), + String::NewFromUtf8(env()->isolate(), + signo_string(term_signal_), + v8::NewStringType::kNormal) + .ToLocalChecked()) .FromJust(); else - js_result->Set(context, env()->signal_string(), - Null(env()->isolate())).FromJust(); + js_result->Set(context, env()->signal_string(), Null(env()->isolate())) + .FromJust(); if (exit_status_ >= 0) - js_result->Set(context, env()->output_string(), - BuildOutputArray()).FromJust(); + js_result->Set(context, env()->output_string(), BuildOutputArray()) + .FromJust(); else - js_result->Set(context, env()->output_string(), - Null(env()->isolate())).FromJust(); + js_result->Set(context, env()->output_string(), Null(env()->isolate())) + .FromJust(); - js_result->Set(context, env()->pid_string(), - Number::New(env()->isolate(), uv_process_.pid)).FromJust(); + js_result + ->Set(context, + env()->pid_string(), + Number::New(env()->isolate(), uv_process_.pid)) + .FromJust(); return scope.Escape(js_result); } - Local SyncProcessRunner::BuildOutputArray() { CHECK_GE(lifecycle_, kInitialized); CHECK(!stdio_pipes_.empty()); @@ -843,13 +783,11 @@ Maybe SyncProcessRunner::ParseOptions(Local js_value) { return Just(0); } - int SyncProcessRunner::ParseStdioOptions(Local js_value) { HandleScope scope(env()->isolate()); Local js_stdio_options; - if (!js_value->IsArray()) - return UV_EINVAL; + if (!js_value->IsArray()) return UV_EINVAL; Local context = env()->context(); js_stdio_options = js_value.As(); @@ -865,12 +803,10 @@ int SyncProcessRunner::ParseStdioOptions(Local js_value) { Local js_stdio_option = js_stdio_options->Get(context, i).ToLocalChecked(); - if (!js_stdio_option->IsObject()) - return UV_EINVAL; + if (!js_stdio_option->IsObject()) return UV_EINVAL; int r = ParseStdioOption(i, js_stdio_option.As()); - if (r < 0) - return r; + if (r < 0) return r; } uv_process_options_.stdio = uv_stdio_containers_; @@ -879,7 +815,6 @@ int SyncProcessRunner::ParseStdioOptions(Local js_value) { return 0; } - int SyncProcessRunner::ParseStdioOption(int child_fd, Local js_stdio_option) { Local context = env()->context(); @@ -895,10 +830,11 @@ int SyncProcessRunner::ParseStdioOption(int child_fd, Local ws = env()->writable_string(); bool readable = js_stdio_option->Get(context, rs) - .ToLocalChecked()->BooleanValue(isolate); - bool writable = - js_stdio_option->Get(context, ws) - .ToLocalChecked()->BooleanValue(isolate); + .ToLocalChecked() + ->BooleanValue(isolate); + bool writable = js_stdio_option->Get(context, ws) + .ToLocalChecked() + ->BooleanValue(isolate); uv_buf_t buf = uv_buf_init(nullptr, 0); @@ -921,7 +857,9 @@ int SyncProcessRunner::ParseStdioOption(int child_fd, } else if (js_type->StrictEquals(env()->inherit_string()) || js_type->StrictEquals(env()->fd_string())) { int inherit_fd = js_stdio_option->Get(context, env()->fd_string()) - .ToLocalChecked()->Int32Value(context).FromJust(); + .ToLocalChecked() + ->Int32Value(context) + .FromJust(); return AddStdioInheritFD(child_fd, inherit_fd); } else { @@ -930,7 +868,6 @@ int SyncProcessRunner::ParseStdioOption(int child_fd, } } - int SyncProcessRunner::AddStdioIgnore(uint32_t child_fd) { CHECK_LT(child_fd, stdio_count_); CHECK(!stdio_pipes_[child_fd]); @@ -940,7 +877,6 @@ int SyncProcessRunner::AddStdioIgnore(uint32_t child_fd) { return 0; } - int SyncProcessRunner::AddStdioPipe(uint32_t child_fd, bool readable, bool writable, @@ -965,7 +901,6 @@ int SyncProcessRunner::AddStdioPipe(uint32_t child_fd, return 0; } - int SyncProcessRunner::AddStdioInheritFD(uint32_t child_fd, int inherit_fd) { CHECK_LT(child_fd, stdio_count_); CHECK(!stdio_pipes_[child_fd]); @@ -976,7 +911,6 @@ int SyncProcessRunner::AddStdioInheritFD(uint32_t child_fd, int inherit_fd) { return 0; } - bool SyncProcessRunner::IsSet(Local value) { return !value->IsUndefined() && !value->IsNull(); } @@ -1062,11 +996,8 @@ Maybe SyncProcessRunner::CopyJsStringArray(Local js_value, for (uint32_t i = 0; i < length; i++) { list[i] = buffer + data_offset; auto value = js_array->Get(context, i).ToLocalChecked(); - data_offset += StringBytes::Write(isolate, - buffer + data_offset, - -1, - value, - UTF8); + data_offset += + StringBytes::Write(isolate, buffer + data_offset, -1, value, UTF8); buffer[data_offset++] = '\0'; data_offset = RoundUp(data_offset, sizeof(void*)); } @@ -1077,7 +1008,6 @@ Maybe SyncProcessRunner::CopyJsStringArray(Local js_value, return Just(0); } - void SyncProcessRunner::ExitCallback(uv_process_t* handle, int64_t exit_status, int term_signal) { @@ -1086,13 +1016,11 @@ void SyncProcessRunner::ExitCallback(uv_process_t* handle, self->OnExit(exit_status, term_signal); } - void SyncProcessRunner::KillTimerCallback(uv_timer_t* handle) { SyncProcessRunner* self = reinterpret_cast(handle->data); self->OnKillTimerTimeout(); } - void SyncProcessRunner::KillTimerCloseCallback(uv_handle_t* handle) { // No-op. } @@ -1100,4 +1028,4 @@ void SyncProcessRunner::KillTimerCloseCallback(uv_handle_t* handle) { } // namespace node NODE_MODULE_CONTEXT_AWARE_INTERNAL(spawn_sync, - node::SyncProcessRunner::Initialize) + node::SyncProcessRunner::Initialize) diff --git a/src/spawn_sync.h b/src/spawn_sync.h index 0ed6b9dff3a663..6231c158eabe2c 100644 --- a/src/spawn_sync.h +++ b/src/spawn_sync.h @@ -30,13 +30,10 @@ namespace node { - - class SyncProcessOutputBuffer; class SyncProcessStdioPipe; class SyncProcessRunner; - class SyncProcessOutputBuffer { static const unsigned int kBufferSize = 65536; @@ -62,7 +59,6 @@ class SyncProcessOutputBuffer { SyncProcessOutputBuffer* next_ = nullptr; }; - class SyncProcessStdioPipe { enum Lifecycle { kUninitialized = 0, @@ -131,13 +127,8 @@ class SyncProcessStdioPipe { Lifecycle lifecycle_; }; - class SyncProcessRunner { - enum Lifecycle { - kUninitialized = 0, - kInitialized, - kHandlesClosed - }; + enum Lifecycle { kUninitialized = 0, kInitialized, kHandlesClosed }; public: static void Initialize(v8::Local target, diff --git a/src/stream_base-inl.h b/src/stream_base-inl.h index 7e2bbaa1730f2e..99674f31ad57ac 100644 --- a/src/stream_base-inl.h +++ b/src/stream_base-inl.h @@ -5,13 +5,12 @@ #include "stream_base.h" -#include "node.h" #include "env-inl.h" +#include "node.h" #include "v8.h" namespace node { -using v8::Signature; using v8::External; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; @@ -20,6 +19,7 @@ using v8::Local; using v8::Object; using v8::PropertyAttribute; using v8::PropertyCallbackInfo; +using v8::Signature; using v8::String; using v8::Value; @@ -46,8 +46,7 @@ inline v8::Local StreamReq::object() { } inline StreamListener::~StreamListener() { - if (stream_ != nullptr) - stream_->RemoveStreamListener(this); + if (stream_ != nullptr) stream_->RemoveStreamListener(this); } inline void StreamListener::PassReadErrorToPreviousListener(ssize_t nread) { @@ -73,8 +72,7 @@ inline StreamResource::~StreamResource() { // in `OnStreamDestroy()` implementations easier, because they // may call generic cleanup functions which can just remove the // listener unconditionally. - if (listener == listener_) - RemoveStreamListener(listener_); + if (listener == listener_) RemoveStreamListener(listener_); } } @@ -97,7 +95,8 @@ inline void StreamResource::RemoveStreamListener(StreamListener* listener) { // Remove from the linked list. for (current = listener_, previous = nullptr; /* No loop condition because we want a crash if listener is not found */ - ; previous = current, current = current->previous_listener_) { + ; + previous = current, current = current->previous_listener_) { CHECK_NOT_NULL(current); if (current == listener) { if (previous != nullptr) @@ -123,8 +122,7 @@ inline void StreamResource::EmitRead(ssize_t nread, const uv_buf_t& buf) { #ifdef DEBUG v8::SealHandleScope handle_scope(v8::Isolate::GetCurrent()); #endif - if (nread > 0) - bytes_read_ += static_cast(nread); + if (nread > 0) bytes_read_ += static_cast(nread); listener_->OnStreamRead(nread, buf); } @@ -163,9 +161,9 @@ inline int StreamBase::Shutdown(v8::Local req_wrap_obj) { HandleScope handle_scope(env->isolate()); if (req_wrap_obj.IsEmpty()) { - req_wrap_obj = - env->shutdown_wrap_template() - ->NewInstance(env->context()).ToLocalChecked(); + req_wrap_obj = env->shutdown_wrap_template() + ->NewInstance(env->context()) + .ToLocalChecked(); StreamReq::ResetObject(req_wrap_obj); } @@ -179,41 +177,41 @@ inline int StreamBase::Shutdown(v8::Local req_wrap_obj) { const char* msg = Error(); if (msg != nullptr) { - req_wrap_obj->Set( - env->context(), - env->error_string(), OneByteString(env->isolate(), msg)).FromJust(); + req_wrap_obj + ->Set(env->context(), + env->error_string(), + OneByteString(env->isolate(), msg)) + .FromJust(); ClearError(); } return err; } -inline StreamWriteResult StreamBase::Write( - uv_buf_t* bufs, - size_t count, - uv_stream_t* send_handle, - v8::Local req_wrap_obj) { +inline StreamWriteResult StreamBase::Write(uv_buf_t* bufs, + size_t count, + uv_stream_t* send_handle, + v8::Local req_wrap_obj) { Environment* env = stream_env(); int err; size_t total_bytes = 0; - for (size_t i = 0; i < count; ++i) - total_bytes += bufs[i].len; + for (size_t i = 0; i < count; ++i) total_bytes += bufs[i].len; bytes_written_ += total_bytes; if (send_handle == nullptr) { err = DoTryWrite(&bufs, &count); if (err != 0 || count == 0) { - return StreamWriteResult { false, err, nullptr, total_bytes }; + return StreamWriteResult{false, err, nullptr, total_bytes}; } } HandleScope handle_scope(env->isolate()); if (req_wrap_obj.IsEmpty()) { - req_wrap_obj = - env->write_wrap_template() - ->NewInstance(env->context()).ToLocalChecked(); + req_wrap_obj = env->write_wrap_template() + ->NewInstance(env->context()) + .ToLocalChecked(); StreamReq::ResetObject(req_wrap_obj); } @@ -230,24 +228,24 @@ inline StreamWriteResult StreamBase::Write( const char* msg = Error(); if (msg != nullptr) { - req_wrap_obj->Set(env->context(), - env->error_string(), - OneByteString(env->isolate(), msg)).FromJust(); + req_wrap_obj + ->Set(env->context(), + env->error_string(), + OneByteString(env->isolate(), msg)) + .FromJust(); ClearError(); } - return StreamWriteResult { async, err, req_wrap, total_bytes }; + return StreamWriteResult{async, err, req_wrap, total_bytes}; } template SimpleShutdownWrap::SimpleShutdownWrap( - StreamBase* stream, - v8::Local req_wrap_obj) - : ShutdownWrap(stream, req_wrap_obj), - OtherBase(stream->stream_env(), - req_wrap_obj, - AsyncWrap::PROVIDER_SHUTDOWNWRAP) { -} + StreamBase* stream, v8::Local req_wrap_obj) + : ShutdownWrap(stream, req_wrap_obj), + OtherBase(stream->stream_env(), + req_wrap_obj, + AsyncWrap::PROVIDER_SHUTDOWNWRAP) {} inline ShutdownWrap* StreamBase::CreateShutdownWrap( v8::Local object) { @@ -255,17 +253,13 @@ inline ShutdownWrap* StreamBase::CreateShutdownWrap( } template -SimpleWriteWrap::SimpleWriteWrap( - StreamBase* stream, - v8::Local req_wrap_obj) - : WriteWrap(stream, req_wrap_obj), - OtherBase(stream->stream_env(), - req_wrap_obj, - AsyncWrap::PROVIDER_WRITEWRAP) { -} +SimpleWriteWrap::SimpleWriteWrap(StreamBase* stream, + v8::Local req_wrap_obj) + : WriteWrap(stream, req_wrap_obj), + OtherBase( + stream->stream_env(), req_wrap_obj, AsyncWrap::PROVIDER_WRITEWRAP) {} -inline WriteWrap* StreamBase::CreateWriteWrap( - v8::Local object) { +inline WriteWrap* StreamBase::CreateWriteWrap(v8::Local object) { return new SimpleWriteWrap(this, object); } @@ -273,9 +267,8 @@ template void StreamBase::AddMethods(Environment* env, Local t) { HandleScope scope(env->isolate()); - enum PropertyAttribute attributes = - static_cast( - v8::ReadOnly | v8::DontDelete | v8::DontEnum); + enum PropertyAttribute attributes = static_cast( + v8::ReadOnly | v8::DontDelete | v8::DontEnum); Local signature = Signature::New(env->isolate(), t); @@ -303,10 +296,8 @@ void StreamBase::AddMethods(Environment* env, Local t) { v8::ConstructorBehavior::kThrow, v8::SideEffectType::kHasNoSideEffect); - t->PrototypeTemplate()->SetAccessorProperty(env->fd_string(), - get_fd_templ, - Local(), - attributes); + t->PrototypeTemplate()->SetAccessorProperty( + env->fd_string(), get_fd_templ, Local(), attributes); t->PrototypeTemplate()->SetAccessorProperty(env->external_stream_string(), get_external_templ, @@ -327,35 +318,28 @@ void StreamBase::AddMethods(Environment* env, Local t) { env->SetProtoMethod(t, "readStop", JSMethod); env->SetProtoMethod(t, "shutdown", JSMethod); env->SetProtoMethod(t, "writev", JSMethod); - env->SetProtoMethod(t, - "writeBuffer", - JSMethod); - env->SetProtoMethod(t, - "writeAsciiString", - JSMethod >); - env->SetProtoMethod(t, - "writeUtf8String", - JSMethod >); - env->SetProtoMethod(t, - "writeUcs2String", - JSMethod >); + env->SetProtoMethod( + t, "writeBuffer", JSMethod); + env->SetProtoMethod( + t, "writeAsciiString", JSMethod >); + env->SetProtoMethod( + t, "writeUtf8String", JSMethod >); + env->SetProtoMethod( + t, "writeUcs2String", JSMethod >); env->SetProtoMethod(t, "writeLatin1String", JSMethod >); } - template void StreamBase::GetFD(const FunctionCallbackInfo& args) { // Mimic implementation of StreamBase::GetFD() and UDPWrap::GetFD(). Base* handle; - ASSIGN_OR_RETURN_UNWRAP(&handle, - args.This(), - args.GetReturnValue().Set(UV_EINVAL)); + ASSIGN_OR_RETURN_UNWRAP( + &handle, args.This(), args.GetReturnValue().Set(UV_EINVAL)); StreamBase* wrap = static_cast(handle); - if (!wrap->IsAlive()) - return args.GetReturnValue().Set(UV_EINVAL); + if (!wrap->IsAlive()) return args.GetReturnValue().Set(UV_EINVAL); args.GetReturnValue().Set(wrap->GetFD()); } @@ -363,9 +347,7 @@ void StreamBase::GetFD(const FunctionCallbackInfo& args) { template void StreamBase::GetBytesRead(const FunctionCallbackInfo& args) { Base* handle; - ASSIGN_OR_RETURN_UNWRAP(&handle, - args.This(), - args.GetReturnValue().Set(0)); + ASSIGN_OR_RETURN_UNWRAP(&handle, args.This(), args.GetReturnValue().Set(0)); StreamBase* wrap = static_cast(handle); // uint64_t -> double. 53bits is enough for all real cases. @@ -375,9 +357,7 @@ void StreamBase::GetBytesRead(const FunctionCallbackInfo& args) { template void StreamBase::GetBytesWritten(const FunctionCallbackInfo& args) { Base* handle; - ASSIGN_OR_RETURN_UNWRAP(&handle, - args.This(), - args.GetReturnValue().Set(0)); + ASSIGN_OR_RETURN_UNWRAP(&handle, args.This(), args.GetReturnValue().Set(0)); StreamBase* wrap = static_cast(handle); // uint64_t -> double. 53bits is enough for all real cases. @@ -394,7 +374,6 @@ void StreamBase::GetExternal(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(ext); } - template & args)> void StreamBase::JSMethod(const FunctionCallbackInfo& args) { @@ -402,14 +381,12 @@ void StreamBase::JSMethod(const FunctionCallbackInfo& args) { ASSIGN_OR_RETURN_UNWRAP(&handle, args.Holder()); StreamBase* wrap = static_cast(handle); - if (!wrap->IsAlive()) - return args.GetReturnValue().Set(UV_EINVAL); + if (!wrap->IsAlive()) return args.GetReturnValue().Set(UV_EINVAL); AsyncHooks::DefaultTriggerAsyncIdScope trigger_scope(handle); args.GetReturnValue().Set((wrap->*Method)(args)); } - inline void ShutdownWrap::OnDone(int status) { stream()->EmitAfterShutdown(this, status); Dispose(); @@ -438,10 +415,11 @@ inline void StreamReq::Done(int status, const char* error_str) { AsyncWrap* async_wrap = GetAsyncWrap(); Environment* env = async_wrap->env(); if (error_str != nullptr) { - async_wrap->object()->Set(env->context(), - env->error_string(), - OneByteString(env->isolate(), error_str)) - .FromJust(); + async_wrap->object() + ->Set(env->context(), + env->error_string(), + OneByteString(env->isolate(), error_str)) + .FromJust(); } OnDone(status); @@ -454,7 +432,6 @@ inline void StreamReq::ResetObject(v8::Local obj) { obj->SetAlignedPointerInInternalField(StreamReq::kStreamReqField, nullptr); } - } // namespace node #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS diff --git a/src/stream_base.cc b/src/stream_base.cc index a55cb60cfc5338..2312567c102935 100644 --- a/src/stream_base.cc +++ b/src/stream_base.cc @@ -1,11 +1,11 @@ #include "stream_base-inl.h" #include "stream_wrap.h" +#include "env-inl.h" +#include "js_stream.h" #include "node.h" #include "node_buffer.h" #include "node_errors.h" -#include "env-inl.h" -#include "js_stream.h" #include "string_bytes.h" #include "util-inl.h" #include "v8.h" @@ -34,17 +34,14 @@ template int StreamBase::WriteString( template int StreamBase::WriteString( const FunctionCallbackInfo& args); - int StreamBase::ReadStartJS(const FunctionCallbackInfo& args) { return ReadStart(); } - int StreamBase::ReadStopJS(const FunctionCallbackInfo& args) { return ReadStop(); } - int StreamBase::Shutdown(const FunctionCallbackInfo& args) { CHECK(args[0]->IsObject()); Local req_wrap_obj = args[0].As(); @@ -83,13 +80,13 @@ int StreamBase::Writev(const FunctionCallbackInfo& args) { for (size_t i = 0; i < count; i++) { Local chunk = chunks->Get(env->context(), i * 2).ToLocalChecked(); - if (Buffer::HasInstance(chunk)) - continue; - // Buffer chunk, no additional storage required + if (Buffer::HasInstance(chunk)) continue; + // Buffer chunk, no additional storage required // String chunk Local string = chunk->ToString(env->context()).ToLocalChecked(); - enum encoding encoding = ParseEncoding(env->isolate(), + enum encoding encoding = ParseEncoding( + env->isolate(), chunks->Get(env->context(), i * 2 + 1).ToLocalChecked()); size_t chunk_size; if (encoding == UTF8 && string->Length() > 65535 && @@ -101,8 +98,7 @@ int StreamBase::Writev(const FunctionCallbackInfo& args) { storage_size += chunk_size; } - if (storage_size > INT_MAX) - return UV_ENOBUFS; + if (storage_size > INT_MAX) return UV_ENOBUFS; } else { for (size_t i = 0; i < count; i++) { Local chunk = chunks->Get(env->context(), i).ToLocalChecked(); @@ -112,8 +108,7 @@ int StreamBase::Writev(const FunctionCallbackInfo& args) { } MallocedBuffer storage; - if (storage_size > 0) - storage = MallocedBuffer(storage_size); + if (storage_size > 0) storage = MallocedBuffer(storage_size); offset = 0; if (!all_buffers) { @@ -133,13 +128,11 @@ int StreamBase::Writev(const FunctionCallbackInfo& args) { size_t str_size = storage_size - offset; Local string = chunk->ToString(env->context()).ToLocalChecked(); - enum encoding encoding = ParseEncoding(env->isolate(), + enum encoding encoding = ParseEncoding( + env->isolate(), chunks->Get(env->context(), i * 2 + 1).ToLocalChecked()); - str_size = StringBytes::Write(env->isolate(), - str_storage, - str_size, - string, - encoding); + str_size = StringBytes::Write( + env->isolate(), str_storage, str_size, string, encoding); bufs[i].base = str_storage; bufs[i].len = str_size; offset += str_size; @@ -154,7 +147,6 @@ int StreamBase::Writev(const FunctionCallbackInfo& args) { return res.err; } - int StreamBase::WriteBuffer(const FunctionCallbackInfo& args) { CHECK(args[0]->IsObject()); @@ -177,7 +169,6 @@ int StreamBase::WriteBuffer(const FunctionCallbackInfo& args) { return res.err; } - template int StreamBase::WriteString(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -187,8 +178,7 @@ int StreamBase::WriteString(const FunctionCallbackInfo& args) { Local req_wrap_obj = args[0].As(); Local string = args[1].As(); Local send_handle_obj; - if (args[2]->IsObject()) - send_handle_obj = args[2].As(); + if (args[2]->IsObject()) send_handle_obj = args[2].As(); // Compute the size of the storage that the string will be flattened into. // For UTF8 strings that are very long, go ahead and take the hit for @@ -201,8 +191,7 @@ int StreamBase::WriteString(const FunctionCallbackInfo& args) { .To(&storage_size)) return 0; - if (storage_size > INT_MAX) - return UV_ENOBUFS; + if (storage_size > INT_MAX) return UV_ENOBUFS; // Try writing immediately if write size isn't too big char stack_storage[16384]; // 16kb @@ -213,11 +202,8 @@ int StreamBase::WriteString(const FunctionCallbackInfo& args) { bool try_write = storage_size <= sizeof(stack_storage) && (!IsIPCPipe() || send_handle_obj.IsEmpty()); if (try_write) { - data_size = StringBytes::Write(env->isolate(), - stack_storage, - storage_size, - string, - enc); + data_size = StringBytes::Write( + env->isolate(), stack_storage, storage_size, string, enc); buf = uv_buf_init(stack_storage, data_size); uv_buf_t* bufs = &buf; @@ -231,7 +217,7 @@ int StreamBase::WriteString(const FunctionCallbackInfo& args) { // Immediate failure or success if (err != 0 || count == 0) { - SetWriteResult(StreamWriteResult { false, err, nullptr, data_size }); + SetWriteResult(StreamWriteResult{false, err, nullptr, data_size}); return err; } @@ -249,11 +235,8 @@ int StreamBase::WriteString(const FunctionCallbackInfo& args) { } else { // Write it data = MallocedBuffer(storage_size); - data_size = StringBytes::Write(env->isolate(), - data.data, - storage_size, - string, - enc); + data_size = StringBytes::Write( + env->isolate(), data.data, storage_size, string, enc); } CHECK_LE(data_size, storage_size); @@ -268,9 +251,8 @@ int StreamBase::WriteString(const FunctionCallbackInfo& args) { send_handle = reinterpret_cast(wrap->GetHandle()); // Reference LibuvStreamWrap instance to prevent it from being garbage // collected before `AfterWrite` is called. - req_wrap_obj->Set(env->context(), - env->handle_string(), - send_handle_obj).FromJust(); + req_wrap_obj->Set(env->context(), env->handle_string(), send_handle_obj) + .FromJust(); } StreamWriteResult res = Write(&buf, 1, send_handle, req_wrap_obj); @@ -284,7 +266,6 @@ int StreamBase::WriteString(const FunctionCallbackInfo& args) { return res.err; } - void StreamBase::CallJSOnreadMethod(ssize_t nread, Local ab, size_t offset) { @@ -303,52 +284,43 @@ void StreamBase::CallJSOnreadMethod(ssize_t nread, env->stream_base_state()[kReadBytesOrError] = nread; env->stream_base_state()[kArrayBufferOffset] = offset; - Local argv[] = { - ab.IsEmpty() ? Undefined(env->isolate()).As() : ab.As() - }; + Local argv[] = {ab.IsEmpty() ? Undefined(env->isolate()).As() + : ab.As()}; AsyncWrap* wrap = GetAsyncWrap(); CHECK_NOT_NULL(wrap); wrap->MakeCallback(env->onread_string(), arraysize(argv), argv); } - bool StreamBase::IsIPCPipe() { return false; } - int StreamBase::GetFD() { return -1; } - Local StreamBase::GetObject() { return GetAsyncWrap()->object(); } - int StreamResource::DoTryWrite(uv_buf_t** bufs, size_t* count) { // No TryWrite by default return 0; } - const char* StreamResource::Error() const { return nullptr; } - void StreamResource::ClearError() { // No-op } - uv_buf_t StreamListener::OnStreamAlloc(size_t suggested_size) { return uv_buf_init(Malloc(suggested_size), suggested_size); } - void EmitToJSStreamListener::OnStreamRead(ssize_t nread, const uv_buf_t& buf) { CHECK_NOT_NULL(stream_); StreamBase* stream = static_cast(stream_); @@ -356,10 +328,9 @@ void EmitToJSStreamListener::OnStreamRead(ssize_t nread, const uv_buf_t& buf) { HandleScope handle_scope(env->isolate()); Context::Scope context_scope(env->context()); - if (nread <= 0) { + if (nread <= 0) { free(buf.base); - if (nread < 0) - stream->CallJSOnreadMethod(nread, Local()); + if (nread < 0) stream->CallJSOnreadMethod(nread, Local()); return; } @@ -374,7 +345,6 @@ void EmitToJSStreamListener::OnStreamRead(ssize_t nread, const uv_buf_t& buf) { stream->CallJSOnreadMethod(nread, obj); } - void ReportWritesToJSStreamListener::OnStreamAfterReqFinished( StreamReq* req_wrap, int status) { StreamBase* stream = static_cast(stream_); @@ -385,11 +355,9 @@ void ReportWritesToJSStreamListener::OnStreamAfterReqFinished( CHECK(!async_wrap->persistent().IsEmpty()); Local req_wrap_obj = async_wrap->object(); - Local argv[] = { - Integer::New(env->isolate(), status), - stream->GetObject(), - Undefined(env->isolate()) - }; + Local argv[] = {Integer::New(env->isolate(), status), + stream->GetObject(), + Undefined(env->isolate())}; const char* msg = stream->Error(); if (msg != nullptr) { @@ -401,8 +369,8 @@ void ReportWritesToJSStreamListener::OnStreamAfterReqFinished( async_wrap->MakeCallback(env->oncomplete_string(), arraysize(argv), argv); } -void ReportWritesToJSStreamListener::OnStreamAfterWrite( - WriteWrap* req_wrap, int status) { +void ReportWritesToJSStreamListener::OnStreamAfterWrite(WriteWrap* req_wrap, + int status) { OnStreamAfterReqFinished(req_wrap, status); } @@ -411,5 +379,4 @@ void ReportWritesToJSStreamListener::OnStreamAfterShutdown( OnStreamAfterReqFinished(req_wrap, status); } - } // namespace node diff --git a/src/stream_base.h b/src/stream_base.h index cde3343d624fa4..d99db4c1c98a91 100644 --- a/src/stream_base.h +++ b/src/stream_base.h @@ -3,8 +3,8 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#include "env.h" #include "async_wrap-inl.h" +#include "env.h" #include "node.h" #include "util.h" @@ -25,13 +25,12 @@ struct StreamWriteResult { size_t bytes; }; - class StreamReq { public: static constexpr int kStreamReqField = 1; - explicit StreamReq(StreamBase* stream, - v8::Local req_wrap_obj) : stream_(stream) { + explicit StreamReq(StreamBase* stream, v8::Local req_wrap_obj) + : stream_(stream) { AttachToObject(req_wrap_obj); } @@ -64,9 +63,8 @@ class StreamReq { class ShutdownWrap : public StreamReq { public: - ShutdownWrap(StreamBase* stream, - v8::Local req_wrap_obj) - : StreamReq(stream, req_wrap_obj) { } + ShutdownWrap(StreamBase* stream, v8::Local req_wrap_obj) + : StreamReq(stream, req_wrap_obj) {} // Call stream()->EmitAfterShutdown() and dispose of this request wrap. void OnDone(int status) override; @@ -78,13 +76,10 @@ class WriteWrap : public StreamReq { size_t StorageSize() const; void SetAllocatedStorage(char* data, size_t size); - WriteWrap(StreamBase* stream, - v8::Local req_wrap_obj) - : StreamReq(stream, req_wrap_obj) { } + WriteWrap(StreamBase* stream, v8::Local req_wrap_obj) + : StreamReq(stream, req_wrap_obj) {} - ~WriteWrap() { - free(storage_); - } + ~WriteWrap() { free(storage_); } // Call stream()->EmitAfterWrite() and dispose of this request wrap. void OnDone(int status) override; @@ -94,7 +89,6 @@ class WriteWrap : public StreamReq { size_t storage_size_ = 0; }; - // This is the generic interface for objects that control Node.js' C++ streams. // For example, the default `EmitToJSStreamListener` emits a stream's data // as Buffers in JS, or `TLSWrap` reads and decrypts data from a stream. @@ -123,8 +117,7 @@ class StreamListener { // with base nullptr in case of an error. // `nread` is the number of read bytes (which is at most the buffer length), // or, if negative, a libuv error code. - virtual void OnStreamRead(ssize_t nread, - const uv_buf_t& buf) = 0; + virtual void OnStreamRead(ssize_t nread, const uv_buf_t& buf) = 0; // This is called once a write has finished. `status` may be 0 or, // if negative, a libuv error code. @@ -164,7 +157,6 @@ class StreamListener { friend class StreamResource; }; - // An (incomplete) stream listener class that calls the `.oncomplete()` // method of the JS objects associated with the wrap objects. class ReportWritesToJSStreamListener : public StreamListener { @@ -176,7 +168,6 @@ class ReportWritesToJSStreamListener : public StreamListener { void OnStreamAfterReqFinished(StreamReq* req_wrap, int status); }; - // A default emitter that just pushes data chunks as Buffer instances to // JS land via the handle’s .ondata method. class EmitToJSStreamListener : public ReportWritesToJSStreamListener { @@ -184,7 +175,6 @@ class EmitToJSStreamListener : public ReportWritesToJSStreamListener { void OnStreamRead(ssize_t nread, const uv_buf_t& buf) override; }; - // A generic stream, comparable to JS land’s `Duplex` streams. // A stream is always controlled through one `StreamListener` instance. class StreamResource { @@ -256,7 +246,6 @@ class StreamResource { friend class StreamListener; }; - class StreamBase : public StreamResource { public: template @@ -331,7 +320,7 @@ class StreamBase : public StreamResource { template & args)> + const v8::FunctionCallbackInfo& args)> static void JSMethod(const v8::FunctionCallbackInfo& args); // Internal, used only in StreamBase methods + env.cc. @@ -354,7 +343,6 @@ class StreamBase : public StreamResource { friend class Environment; // For kNumStreamBaseStateFields. }; - // These are helpers for creating `ShutdownWrap`/`WriteWrap` instances. // `OtherBase` must have a constructor that matches the `AsyncWrap` // constructors’s (Environment*, Local, AsyncWrap::Provider) signature @@ -362,8 +350,7 @@ class StreamBase : public StreamResource { template class SimpleShutdownWrap : public ShutdownWrap, public OtherBase { public: - SimpleShutdownWrap(StreamBase* stream, - v8::Local req_wrap_obj); + SimpleShutdownWrap(StreamBase* stream, v8::Local req_wrap_obj); AsyncWrap* GetAsyncWrap() override { return this; } @@ -375,8 +362,7 @@ class SimpleShutdownWrap : public ShutdownWrap, public OtherBase { template class SimpleWriteWrap : public WriteWrap, public OtherBase { public: - SimpleWriteWrap(StreamBase* stream, - v8::Local req_wrap_obj); + SimpleWriteWrap(StreamBase* stream, v8::Local req_wrap_obj); AsyncWrap* GetAsyncWrap() override { return this; } diff --git a/src/stream_pipe.cc b/src/stream_pipe.cc index 19d732d6592aaa..b7e7ad6127a4bb 100644 --- a/src/stream_pipe.cc +++ b/src/stream_pipe.cc @@ -1,6 +1,6 @@ #include "stream_pipe.h" -#include "stream_base-inl.h" #include "node_buffer.h" +#include "stream_base-inl.h" using v8::Context; using v8::External; @@ -13,9 +13,7 @@ using v8::Value; namespace node { -StreamPipe::StreamPipe(StreamBase* source, - StreamBase* sink, - Local obj) +StreamPipe::StreamPipe(StreamBase* source, StreamBase* sink, Local obj) : AsyncWrap(source->stream_env(), obj, AsyncWrap::PROVIDER_STREAMPIPE) { MakeWeak(); @@ -33,11 +31,13 @@ StreamPipe::StreamPipe(StreamBase* source, // weak references). obj->Set(env()->context(), env()->source_string(), source->GetObject()) .FromJust(); - source->GetObject()->Set(env()->context(), env()->pipe_target_string(), obj) + source->GetObject() + ->Set(env()->context(), env()->pipe_target_string(), obj) .FromJust(); obj->Set(env()->context(), env()->sink_string(), sink->GetObject()) .FromJust(); - sink->GetObject()->Set(env()->context(), env()->pipe_source_string(), obj) + sink->GetObject() + ->Set(env()->context(), env()->pipe_source_string(), obj) .FromJust(); } @@ -54,14 +54,12 @@ StreamBase* StreamPipe::sink() { } void StreamPipe::Unpipe() { - if (is_closed_) - return; + if (is_closed_) return; // Note that we possibly cannot use virtual methods on `source` and `sink` // here, because this function can be called from their destructors via // `OnStreamDestroy()`. - if (!source_destroyed_) - source()->ReadStop(); + if (!source_destroyed_) source()->ReadStop(); is_closed_ = true; is_reading_ = false; @@ -71,43 +69,49 @@ void StreamPipe::Unpipe() { // Delay the JS-facing part with SetImmediate, because this might be from // inside the garbage collector, so we can’t run JS here. HandleScope handle_scope(env()->isolate()); - env()->SetImmediate([](Environment* env, void* data) { - StreamPipe* pipe = static_cast(data); - - HandleScope handle_scope(env->isolate()); - Context::Scope context_scope(env->context()); - Local object = pipe->object(); - - Local onunpipe; - if (!object->Get(env->context(), env->onunpipe_string()).ToLocal(&onunpipe)) - return; - if (onunpipe->IsFunction() && - pipe->MakeCallback(onunpipe.As(), 0, nullptr).IsEmpty()) { - return; - } - - // Set all the links established in the constructor to `null`. - Local null = Null(env->isolate()); - - Local source_v; - Local sink_v; - if (!object->Get(env->context(), env->source_string()).ToLocal(&source_v) || - !object->Get(env->context(), env->sink_string()).ToLocal(&sink_v) || - !source_v->IsObject() || !sink_v->IsObject()) { - return; - } - - if (object->Set(env->context(), env->source_string(), null).IsNothing() || - object->Set(env->context(), env->sink_string(), null).IsNothing() || - source_v.As() - ->Set(env->context(), env->pipe_target_string(), null) - .IsNothing() || - sink_v.As() - ->Set(env->context(), env->pipe_source_string(), null) - .IsNothing()) { - return; - } - }, static_cast(this), object()); + env()->SetImmediate( + [](Environment* env, void* data) { + StreamPipe* pipe = static_cast(data); + + HandleScope handle_scope(env->isolate()); + Context::Scope context_scope(env->context()); + Local object = pipe->object(); + + Local onunpipe; + if (!object->Get(env->context(), env->onunpipe_string()) + .ToLocal(&onunpipe)) + return; + if (onunpipe->IsFunction() && + pipe->MakeCallback(onunpipe.As(), 0, nullptr).IsEmpty()) { + return; + } + + // Set all the links established in the constructor to `null`. + Local null = Null(env->isolate()); + + Local source_v; + Local sink_v; + if (!object->Get(env->context(), env->source_string()) + .ToLocal(&source_v) || + !object->Get(env->context(), env->sink_string()).ToLocal(&sink_v) || + !source_v->IsObject() || !sink_v->IsObject()) { + return; + } + + if (object->Set(env->context(), env->source_string(), null) + .IsNothing() || + object->Set(env->context(), env->sink_string(), null).IsNothing() || + source_v.As() + ->Set(env->context(), env->pipe_target_string(), null) + .IsNothing() || + sink_v.As() + ->Set(env->context(), env->pipe_source_string(), null) + .IsNothing()) { + return; + } + }, + static_cast(this), + object()); } uv_buf_t StreamPipe::ReadableListener::OnStreamAlloc(size_t suggested_size) { @@ -151,8 +155,7 @@ void StreamPipe::ProcessData(size_t nread, const uv_buf_t& buf) { is_writing_ = true; is_reading_ = false; res.wrap->SetAllocatedStorage(buf.base, buf.len); - if (source() != nullptr) - source()->ReadStop(); + if (source() != nullptr) source()->ReadStop(); } } @@ -207,8 +210,7 @@ void StreamPipe::WritableListener::OnStreamDestroy() { void StreamPipe::WritableListener::OnStreamWantsWrite(size_t suggested_size) { StreamPipe* pipe = ContainerOf(&StreamPipe::writable_listener_, this); pipe->wanted_data_ = suggested_size; - if (pipe->is_reading_ || pipe->is_closed_) - return; + if (pipe->is_reading_ || pipe->is_closed_) return; AsyncScope async_scope(pipe); pipe->is_reading_ = true; pipe->source()->ReadStart(); @@ -267,7 +269,8 @@ void InitializeStreamPipe(Local target, pipe->SetClassName(stream_pipe_string); pipe->InstanceTemplate()->SetInternalFieldCount(1); target - ->Set(context, stream_pipe_string, + ->Set(context, + stream_pipe_string, pipe->GetFunction(context).ToLocalChecked()) .FromJust(); } @@ -276,5 +279,4 @@ void InitializeStreamPipe(Local target, } // namespace node -NODE_MODULE_CONTEXT_AWARE_INTERNAL(stream_pipe, - node::InitializeStreamPipe) +NODE_MODULE_CONTEXT_AWARE_INTERNAL(stream_pipe, node::InitializeStreamPipe) diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index e957cb172533c3..c7fd24a5c8a597 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -31,9 +31,8 @@ #include "udp_wrap.h" #include "util-inl.h" -#include // memcpy() #include // INT_MAX - +#include // memcpy() namespace node { @@ -50,7 +49,6 @@ using v8::ReadOnly; using v8::Signature; using v8::Value; - void LibuvStreamWrap::Initialize(Local target, Local unused, Local context, @@ -59,9 +57,9 @@ void LibuvStreamWrap::Initialize(Local target, auto is_construct_call_callback = [](const FunctionCallbackInfo& args) { - CHECK(args.IsConstructCall()); - StreamReq::ResetObject(args.This()); - }; + CHECK(args.IsConstructCall()); + StreamReq::ResetObject(args.This()); + }; Local sw = FunctionTemplate::New(env->isolate(), is_construct_call_callback); sw->InstanceTemplate()->SetInternalFieldCount(StreamReq::kStreamReqField + 1); @@ -69,9 +67,11 @@ void LibuvStreamWrap::Initialize(Local target, FIXED_ONE_BYTE_STRING(env->isolate(), "ShutdownWrap"); sw->SetClassName(wrapString); sw->Inherit(AsyncWrap::GetConstructorTemplate(env)); - target->Set(env->context(), - wrapString, - sw->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + wrapString, + sw->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); env->set_shutdown_wrap_template(sw->InstanceTemplate()); Local ww = @@ -81,32 +81,31 @@ void LibuvStreamWrap::Initialize(Local target, FIXED_ONE_BYTE_STRING(env->isolate(), "WriteWrap"); ww->SetClassName(writeWrapString); ww->Inherit(AsyncWrap::GetConstructorTemplate(env)); - target->Set(env->context(), - writeWrapString, - ww->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + writeWrapString, + ww->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); env->set_write_wrap_template(ww->InstanceTemplate()); NODE_DEFINE_CONSTANT(target, kReadBytesOrError); NODE_DEFINE_CONSTANT(target, kArrayBufferOffset); NODE_DEFINE_CONSTANT(target, kBytesWritten); NODE_DEFINE_CONSTANT(target, kLastWriteWasAsync); - target->Set(context, FIXED_ONE_BYTE_STRING(env->isolate(), "streamBaseState"), - env->stream_base_state().GetJSArray()).FromJust(); + target + ->Set(context, + FIXED_ONE_BYTE_STRING(env->isolate(), "streamBaseState"), + env->stream_base_state().GetJSArray()) + .FromJust(); } - LibuvStreamWrap::LibuvStreamWrap(Environment* env, Local object, uv_stream_t* stream, AsyncWrap::ProviderType provider) - : HandleWrap(env, - object, - reinterpret_cast(stream), - provider), + : HandleWrap(env, object, reinterpret_cast(stream), provider), StreamBase(env), - stream_(stream) { -} - + stream_(stream) {} Local LibuvStreamWrap::GetConstructorTemplate( Environment* env) { @@ -133,14 +132,12 @@ Local LibuvStreamWrap::GetConstructorTemplate( return tmpl; } - LibuvStreamWrap* LibuvStreamWrap::From(Environment* env, Local object) { Local sw = env->libuv_stream_wrap_ctor_template(); CHECK(!sw.IsEmpty() && sw->HasInstance(object)); return Unwrap(object); } - int LibuvStreamWrap::GetFD() { #ifdef _WIN32 return fd_; @@ -152,43 +149,38 @@ int LibuvStreamWrap::GetFD() { #endif } - bool LibuvStreamWrap::IsAlive() { return HandleWrap::IsAlive(this); } - bool LibuvStreamWrap::IsClosing() { return uv_is_closing(reinterpret_cast(stream())); } - AsyncWrap* LibuvStreamWrap::GetAsyncWrap() { return static_cast(this); } - bool LibuvStreamWrap::IsIPCPipe() { return is_named_pipe_ipc(); } - int LibuvStreamWrap::ReadStart() { - return uv_read_start(stream(), [](uv_handle_t* handle, - size_t suggested_size, - uv_buf_t* buf) { - static_cast(handle->data)->OnUvAlloc(suggested_size, buf); - }, [](uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { - static_cast(stream->data)->OnUvRead(nread, buf); - }); + return uv_read_start( + stream(), + [](uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) { + static_cast(handle->data) + ->OnUvAlloc(suggested_size, buf); + }, + [](uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf) { + static_cast(stream->data)->OnUvRead(nread, buf); + }); } - int LibuvStreamWrap::ReadStop() { return uv_read_stop(stream()); } - void LibuvStreamWrap::OnUvAlloc(size_t suggested_size, uv_buf_t* buf) { HandleScope scope(env()->isolate()); Context::Scope context_scope(env()->context()); @@ -200,7 +192,7 @@ template static MaybeLocal AcceptHandle(Environment* env, LibuvStreamWrap* parent) { static_assert(std::is_base_of::value || - std::is_base_of::value, + std::is_base_of::value, "Can only accept stream handles"); EscapableHandleScope scope(env->isolate()); @@ -214,13 +206,11 @@ static MaybeLocal AcceptHandle(Environment* env, uv_stream_t* stream = reinterpret_cast(wrap->GetHandle()); CHECK_NOT_NULL(stream); - if (uv_accept(parent->stream(), stream)) - ABORT(); + if (uv_accept(parent->stream(), stream)) ABORT(); return scope.Escape(wrap_obj); } - void LibuvStreamWrap::OnUvRead(ssize_t nread, const uv_buf_t* buf) { HandleScope scope(env()->isolate()); Context::Scope context_scope(env()->context()); @@ -260,7 +250,6 @@ void LibuvStreamWrap::OnUvRead(ssize_t nread, const uv_buf_t* buf) { EmitRead(nread, *buf); } - void LibuvStreamWrap::GetWriteQueueSize( const FunctionCallbackInfo& info) { LibuvStreamWrap* wrap; @@ -275,14 +264,12 @@ void LibuvStreamWrap::GetWriteQueueSize( info.GetReturnValue().Set(write_queue_size); } - void LibuvStreamWrap::SetBlocking(const FunctionCallbackInfo& args) { LibuvStreamWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); CHECK_GT(args.Length(), 0); - if (!wrap->IsAlive()) - return args.GetReturnValue().Set(UV_EINVAL); + if (!wrap->IsAlive()) return args.GetReturnValue().Set(UV_EINVAL); bool enable = args[0]->IsTrue(); args.GetReturnValue().Set(uv_stream_set_blocking(wrap->stream(), enable)); @@ -299,23 +286,20 @@ WriteWrap* LibuvStreamWrap::CreateWriteWrap(Local object) { return new LibuvWriteWrap(this, object); } - int LibuvStreamWrap::DoShutdown(ShutdownWrap* req_wrap_) { LibuvShutdownWrap* req_wrap = static_cast(req_wrap_); return req_wrap->Dispatch(uv_shutdown, stream(), AfterUvShutdown); } - void LibuvStreamWrap::AfterUvShutdown(uv_shutdown_t* req, int status) { - LibuvShutdownWrap* req_wrap = static_cast( - LibuvShutdownWrap::from_req(req)); + LibuvShutdownWrap* req_wrap = + static_cast(LibuvShutdownWrap::from_req(req)); CHECK_NOT_NULL(req_wrap); HandleScope scope(req_wrap->env()->isolate()); Context::Scope context_scope(req_wrap->env()->context()); req_wrap->Done(status); } - // NOTE: Call to this function could change both `buf`'s and `count`'s // values, shifting their base and decrementing their length. This is // required in order to skip the data that was successfully written via @@ -327,10 +311,8 @@ int LibuvStreamWrap::DoTryWrite(uv_buf_t** bufs, size_t* count) { size_t vcount = *count; err = uv_try_write(stream(), vbufs, vcount); - if (err == UV_ENOSYS || err == UV_EAGAIN) - return 0; - if (err < 0) - return err; + if (err == UV_ENOSYS || err == UV_EAGAIN) return 0; + if (err < 0) return err; // Slice off the buffers: skip all written buffers and slice the one that // was partially written. @@ -343,7 +325,7 @@ int LibuvStreamWrap::DoTryWrite(uv_buf_t** bufs, size_t* count) { written = 0; break; - // Discard + // Discard } else { written -= vbufs[0].len; } @@ -355,25 +337,18 @@ int LibuvStreamWrap::DoTryWrite(uv_buf_t** bufs, size_t* count) { return 0; } - int LibuvStreamWrap::DoWrite(WriteWrap* req_wrap, uv_buf_t* bufs, size_t count, uv_stream_t* send_handle) { LibuvWriteWrap* w = static_cast(req_wrap); - return w->Dispatch(uv_write2, - stream(), - bufs, - count, - send_handle, - AfterUvWrite); + return w->Dispatch( + uv_write2, stream(), bufs, count, send_handle, AfterUvWrite); } - - void LibuvStreamWrap::AfterUvWrite(uv_write_t* req, int status) { - LibuvWriteWrap* req_wrap = static_cast( - LibuvWriteWrap::from_req(req)); + LibuvWriteWrap* req_wrap = + static_cast(LibuvWriteWrap::from_req(req)); CHECK_NOT_NULL(req_wrap); HandleScope scope(req_wrap->env()->isolate()); Context::Scope context_scope(req_wrap->env()->context()); diff --git a/src/stream_wrap.h b/src/stream_wrap.h index 19366ff4fba2c4..4a801d157b7cf5 100644 --- a/src/stream_wrap.h +++ b/src/stream_wrap.h @@ -57,22 +57,16 @@ class LibuvStreamWrap : public HandleWrap, public StreamBase { size_t count, uv_stream_t* send_handle) override; - inline uv_stream_t* stream() const { - return stream_; - } + inline uv_stream_t* stream() const { return stream_; } - inline bool is_named_pipe() const { - return stream()->type == UV_NAMED_PIPE; - } + inline bool is_named_pipe() const { return stream()->type == UV_NAMED_PIPE; } inline bool is_named_pipe_ipc() const { return is_named_pipe() && reinterpret_cast(stream())->ipc != 0; } - inline bool is_tcp() const { - return stream()->type == UV_TCP; - } + inline bool is_tcp() const { return stream()->type == UV_TCP; } ShutdownWrap* CreateShutdownWrap(v8::Local object) override; WriteWrap* CreateWriteWrap(v8::Local object) override; @@ -97,7 +91,6 @@ class LibuvStreamWrap : public HandleWrap, public StreamBase { #endif } - private: static void GetWriteQueueSize( const v8::FunctionCallbackInfo& info); @@ -123,7 +116,6 @@ class LibuvStreamWrap : public HandleWrap, public StreamBase { #endif }; - } // namespace node #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS diff --git a/src/string_bytes.cc b/src/string_bytes.cc index 53bb95d80dab12..21e2ed1ab6c997 100644 --- a/src/string_bytes.cc +++ b/src/string_bytes.cc @@ -53,31 +53,24 @@ using v8::Value; namespace { template -class ExternString: public ResourceType { +class ExternString : public ResourceType { public: ~ExternString() override { free(const_cast(data_)); isolate()->AdjustAmountOfExternalAllocatedMemory(-byte_length()); } - const TypeName* data() const override { - return data_; - } + const TypeName* data() const override { return data_; } - size_t length() const override { - return length_; - } + size_t length() const override { return length_; } - int64_t byte_length() const { - return length() * sizeof(*data()); - } + int64_t byte_length() const { return length() * sizeof(*data()); } static MaybeLocal NewFromCopy(Isolate* isolate, const TypeName* data, size_t length, Local* error) { - if (length == 0) - return String::Empty(isolate); + if (length == 0) return String::Empty(isolate); if (length < EXTERN_APEX) return NewSimpleFromCopy(isolate, data, length, error); @@ -89,10 +82,8 @@ class ExternString: public ResourceType { } memcpy(new_data, data, length * sizeof(*new_data)); - return ExternString::New(isolate, - new_data, - length, - error); + return ExternString::New( + isolate, new_data, length, error); } // uses "data" for external resource, and will be free'd on gc @@ -100,8 +91,7 @@ class ExternString: public ResourceType { TypeName* data, size_t length, Local* error) { - if (length == 0) - return String::Empty(isolate); + if (length == 0) return String::Empty(isolate); if (length < EXTERN_APEX) { MaybeLocal str = NewSimpleFromCopy(isolate, data, length, error); @@ -109,9 +99,8 @@ class ExternString: public ResourceType { return str; } - ExternString* h_str = new ExternString(isolate, - data, - length); + ExternString* h_str = + new ExternString(isolate, data, length); MaybeLocal str = NewExternal(isolate, h_str); isolate->AdjustAmountOfExternalAllocatedMemory(h_str->byte_length()); @@ -128,9 +117,8 @@ class ExternString: public ResourceType { private: ExternString(Isolate* isolate, const TypeName* data, size_t length) - : isolate_(isolate), data_(data), length_(length) { } - static MaybeLocal NewExternal(Isolate* isolate, - ExternString* h_str); + : isolate_(isolate), data_(data), length_(length) {} + static MaybeLocal NewExternal(Isolate* isolate, ExternString* h_str); // This method does not actually create ExternString instances. static MaybeLocal NewSimpleFromCopy(Isolate* isolate, @@ -143,23 +131,20 @@ class ExternString: public ResourceType { size_t length_; }; - -typedef ExternString ExternOneByteString; -typedef ExternString ExternTwoByteString; - +typedef ExternString + ExternOneByteString; +typedef ExternString + ExternTwoByteString; template <> -MaybeLocal ExternOneByteString::NewExternal( - Isolate* isolate, ExternOneByteString* h_str) { +MaybeLocal ExternOneByteString::NewExternal(Isolate* isolate, + ExternOneByteString* h_str) { return String::NewExternalOneByte(isolate, h_str).FromMaybe(Local()); } - template <> -MaybeLocal ExternTwoByteString::NewExternal( - Isolate* isolate, ExternTwoByteString* h_str) { +MaybeLocal ExternTwoByteString::NewExternal(Isolate* isolate, + ExternTwoByteString* h_str) { return String::NewExternalTwoByte(isolate, h_str).FromMaybe(Local()); } @@ -180,17 +165,13 @@ MaybeLocal ExternOneByteString::NewSimpleFromCopy(Isolate* isolate, return str.ToLocalChecked(); } - template <> MaybeLocal ExternTwoByteString::NewSimpleFromCopy(Isolate* isolate, const uint16_t* data, size_t length, Local* error) { MaybeLocal str = - String::NewFromTwoByte(isolate, - data, - v8::NewStringType::kNormal, - length); + String::NewFromTwoByte(isolate, data, v8::NewStringType::kNormal, length); if (str.IsEmpty()) { *error = node::ERR_STRING_TOO_LONG(isolate); return MaybeLocal(); @@ -201,44 +182,37 @@ MaybeLocal ExternTwoByteString::NewSimpleFromCopy(Isolate* isolate, } // anonymous namespace // supports regular and URL-safe base64 -const int8_t unbase64_table[256] = - { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -2, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, 62, -1, 63, - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, - -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, 63, - -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - }; - - -static const int8_t unhex_table[256] = - { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, - -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 - }; +const int8_t unbase64_table[256] = { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -2, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 62, -1, 62, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, + 63, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1}; + +static const int8_t unhex_table[256] = { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, + 9, -1, -1, -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1}; static inline unsigned unhex(uint8_t x) { return unhex_table[x]; @@ -253,8 +227,7 @@ static size_t hex_decode(char* buf, for (i = 0; i < len && i * 2 + 1 < srcLen; ++i) { unsigned a = unhex(src[i * 2 + 0]); unsigned b = unhex(src[i * 2 + 1]); - if (!~a || !~b) - return i; + if (!~a || !~b) return i; buf[i] = (a << 4) | b; } @@ -304,7 +277,6 @@ size_t StringBytes::WriteUCS2(Isolate* isolate, return nchars * sizeof(*dst); } - size_t StringBytes::Write(Isolate* isolate, char* buf, size_t buflen, @@ -315,14 +287,12 @@ size_t StringBytes::Write(Isolate* isolate, size_t nbytes; int nchars; - if (chars_written == nullptr) - chars_written = &nchars; + if (chars_written == nullptr) chars_written = &nchars; CHECK(val->IsString() == true); Local str = val.As(); - int flags = String::HINT_MANY_WRITES_EXPECTED | - String::NO_NULL_TERMINATION | + int flags = String::HINT_MANY_WRITES_EXPECTED | String::NO_NULL_TERMINATION | String::REPLACE_INVALID_UTF8; switch (encoding) { @@ -354,8 +324,7 @@ size_t StringBytes::Write(Isolate* isolate, // the Buffer, so we need to reorder on BE platforms. See // https://nodejs.org/api/buffer.html regarding Node's "ucs2" // encoding specification - if (IsBigEndian()) - SwapBytes16(buf, nbytes); + if (IsBigEndian()) SwapBytes16(buf, nbytes); break; } @@ -390,16 +359,12 @@ size_t StringBytes::Write(Isolate* isolate, return nbytes; } - -bool StringBytes::IsValidString(Local string, - enum encoding enc) { - if (enc == HEX && string->Length() % 2 != 0) - return false; +bool StringBytes::IsValidString(Local string, enum encoding enc) { + if (enc == HEX && string->Length() % 2 != 0) return false; // TODO(bnoordhuis) Add BASE64 check? return true; } - // Quick and dirty size calculation // Will always be at least big enough, but may have some extra // UTF8 can be as much as 3x the size, Base64 can have 1-2 extra bytes @@ -489,18 +454,13 @@ Maybe StringBytes::Size(Isolate* isolate, UNREACHABLE(); } - - - static bool contains_non_ascii_slow(const char* buf, size_t len) { for (size_t i = 0; i < len; ++i) { - if (buf[i] & 0x80) - return true; + if (buf[i] & 0x80) return true; } return false; } - static bool contains_non_ascii(const char* src, size_t len) { if (len < 16) { return contains_non_ascii_slow(src, len); @@ -512,13 +472,11 @@ static bool contains_non_ascii(const char* src, size_t len) { if (unaligned > 0) { const unsigned n = bytes_per_word - unaligned; - if (contains_non_ascii_slow(src, n)) - return true; + if (contains_non_ascii_slow(src, n)) return true; src += n; len -= n; } - #if defined(_WIN64) || defined(_LP64) const uintptr_t mask = 0x8080808080808080ll; #else @@ -528,28 +486,24 @@ static bool contains_non_ascii(const char* src, size_t len) { const uintptr_t* srcw = reinterpret_cast(src); for (size_t i = 0, n = len / bytes_per_word; i < n; ++i) { - if (srcw[i] & mask) - return true; + if (srcw[i] & mask) return true; } const unsigned remainder = len & align_mask; if (remainder > 0) { const size_t offset = len - remainder; - if (contains_non_ascii_slow(src + offset, remainder)) - return true; + if (contains_non_ascii_slow(src + offset, remainder)) return true; } return false; } - static void force_ascii_slow(const char* src, char* dst, size_t len) { for (size_t i = 0; i < len; ++i) { dst[i] = src[i] & 0x7f; } } - static void force_ascii(const char* src, char* dst, size_t len) { if (len < 16) { force_ascii_slow(src, dst, len); @@ -594,11 +548,9 @@ static void force_ascii(const char* src, char* dst, size_t len) { } } - static size_t hex_encode(const char* src, size_t slen, char* dst, size_t dlen) { // We know how much we'll write, just make sure that there's space. - CHECK(dlen >= slen * 2 && - "not enough space provided for hex encode"); + CHECK(dlen >= slen * 2 && "not enough space provided for hex encode"); dlen = slen * 2; for (uint32_t i = 0, k = 0; k < dlen; i += 1, k += 2) { @@ -611,16 +563,14 @@ static size_t hex_encode(const char* src, size_t slen, char* dst, size_t dlen) { return dlen; } - -#define CHECK_BUFLEN_IN_RANGE(len) \ - do { \ - if ((len) > Buffer::kMaxLength) { \ - *error = node::ERR_BUFFER_TOO_LARGE(isolate); \ - return MaybeLocal(); \ - } \ +#define CHECK_BUFLEN_IN_RANGE(len) \ + do { \ + if ((len) > Buffer::kMaxLength) { \ + *error = node::ERR_BUFFER_TOO_LARGE(isolate); \ + return MaybeLocal(); \ + } \ } while (0) - MaybeLocal StringBytes::Encode(Isolate* isolate, const char* buf, size_t buflen, @@ -635,19 +585,18 @@ MaybeLocal StringBytes::Encode(Isolate* isolate, MaybeLocal val; switch (encoding) { - case BUFFER: - { - if (buflen > node::Buffer::kMaxLength) { - *error = node::ERR_BUFFER_TOO_LARGE(isolate); - return MaybeLocal(); - } - auto maybe_buf = Buffer::Copy(isolate, buf, buflen); - if (maybe_buf.IsEmpty()) { - *error = node::ERR_MEMORY_ALLOCATION_FAILED(isolate); - return MaybeLocal(); - } - return maybe_buf.ToLocalChecked(); + case BUFFER: { + if (buflen > node::Buffer::kMaxLength) { + *error = node::ERR_BUFFER_TOO_LARGE(isolate); + return MaybeLocal(); + } + auto maybe_buf = Buffer::Copy(isolate, buf, buflen); + if (maybe_buf.IsEmpty()) { + *error = node::ERR_MEMORY_ALLOCATION_FAILED(isolate); + return MaybeLocal(); } + return maybe_buf.ToLocalChecked(); + } case ASCII: if (contains_non_ascii(buf, buflen)) { @@ -663,10 +612,8 @@ MaybeLocal StringBytes::Encode(Isolate* isolate, } case UTF8: - val = String::NewFromUtf8(isolate, - buf, - v8::NewStringType::kNormal, - buflen); + val = + String::NewFromUtf8(isolate, buf, v8::NewStringType::kNormal, buflen); if (val.IsEmpty()) { *error = node::ERR_STRING_TOO_LONG(isolate); return MaybeLocal(); @@ -742,7 +689,6 @@ MaybeLocal StringBytes::Encode(Isolate* isolate, UNREACHABLE(); } - MaybeLocal StringBytes::Encode(Isolate* isolate, const uint16_t* buf, size_t buflen, diff --git a/src/string_bytes.h b/src/string_bytes.h index 62a67247375518..44ec2d586d164d 100644 --- a/src/string_bytes.h +++ b/src/string_bytes.h @@ -26,8 +26,8 @@ // Decodes a v8::Local or Buffer to a raw char* -#include "v8.h" #include "env.h" +#include "v8.h" namespace node { @@ -63,8 +63,7 @@ class StringBytes { // Does the string match the encoding? Quick but non-exhaustive. // Example: a HEX string must have a length that's a multiple of two. // FIXME(bnoordhuis) IsMaybeValidString()? Naming things is hard... - static bool IsValidString(v8::Local string, - enum encoding enc); + static bool IsValidString(v8::Local string, enum encoding enc); // Fast, but can be 2 bytes oversized for Base64, and // as much as triple UTF-8 strings <= 65536 chars in length diff --git a/src/string_decoder-inl.h b/src/string_decoder-inl.h index 8a04211906f759..90ae7ca160c015 100644 --- a/src/string_decoder-inl.h +++ b/src/string_decoder-inl.h @@ -30,9 +30,8 @@ char* StringDecoder::IncompleteCharacterBuffer() { return reinterpret_cast(state_ + kIncompleteCharactersStart); } - } // namespace node #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#endif // SRC_STRING_DECODER_INL_H_ +#endif // SRC_STRING_DECODER_INL_H_ diff --git a/src/string_decoder.cc b/src/string_decoder.cc index 9cf1bd671b3fc9..9cd337ed00aba9 100644 --- a/src/string_decoder.cc +++ b/src/string_decoder.cc @@ -26,17 +26,9 @@ MaybeLocal MakeString(Isolate* isolate, MaybeLocal ret; if (encoding == UTF8) { return String::NewFromUtf8( - isolate, - data, - v8::NewStringType::kNormal, - length); + isolate, data, v8::NewStringType::kNormal, length); } else { - ret = StringBytes::Encode( - isolate, - data, - length, - encoding, - &error); + ret = StringBytes::Encode(isolate, data, length, encoding, &error); } if (ret.IsEmpty()) { @@ -50,7 +42,6 @@ MaybeLocal MakeString(Isolate* isolate, } // anonymous namespace - MaybeLocal StringDecoder::DecodeData(Isolate* isolate, const char* data, size_t* nread_ptr) { @@ -65,8 +56,7 @@ MaybeLocal StringDecoder::DecodeData(Isolate* isolate, // main body. if (MissingBytes() > 0) { // There are never more bytes missing than the pre-calculated maximum. - CHECK_LE(MissingBytes() + BufferedBytes(), - kIncompleteCharactersEnd); + CHECK_LE(MissingBytes() + BufferedBytes(), kIncompleteCharactersEnd); if (Encoding() == UTF8) { // For UTF-8, we need special treatment to align with the V8 decoder: // If an incomplete character is found at a chunk boundary, we use @@ -87,11 +77,8 @@ MaybeLocal StringDecoder::DecodeData(Isolate* isolate, } } - size_t found_bytes = - std::min(nread, static_cast(MissingBytes())); - memcpy(IncompleteCharacterBuffer() + BufferedBytes(), - data, - found_bytes); + size_t found_bytes = std::min(nread, static_cast(MissingBytes())); + memcpy(IncompleteCharacterBuffer() + BufferedBytes(), data, found_bytes); // Adjust the two buffers. data += found_bytes; nread -= found_bytes; @@ -105,7 +92,8 @@ MaybeLocal StringDecoder::DecodeData(Isolate* isolate, if (!MakeString(isolate, IncompleteCharacterBuffer(), BufferedBytes(), - Encoding()).ToLocal(&prepend)) { + Encoding()) + .ToLocal(&prepend)) { return MaybeLocal(); } @@ -131,7 +119,7 @@ MaybeLocal StringDecoder::DecodeData(Isolate* isolate, // This is UTF-8 encoded data and we ended on a non-ASCII UTF-8 byte. // This means we'll need to figure out where the character to which // the byte belongs begins. - for (size_t i = nread - 1; ; --i) { + for (size_t i = nread - 1;; --i) { DCHECK_LT(i, nread); state_[kBufferedBytes]++; if ((data[i] & 0xC0) == 0x80) { @@ -231,14 +219,10 @@ MaybeLocal StringDecoder::FlushData(Isolate* isolate) { state_[kBufferedBytes]--; } - if (BufferedBytes() == 0) - return String::Empty(isolate); + if (BufferedBytes() == 0) return String::Empty(isolate); - MaybeLocal ret = - MakeString(isolate, - IncompleteCharacterBuffer(), - BufferedBytes(), - Encoding()); + MaybeLocal ret = MakeString( + isolate, IncompleteCharacterBuffer(), BufferedBytes(), Encoding()); state_[kMissingBytes] = 0; state_[kBufferedBytes] = 0; @@ -255,8 +239,7 @@ void DecodeData(const FunctionCallbackInfo& args) { size_t nread = Buffer::Length(args[1]); MaybeLocal ret = decoder->DecodeData(args.GetIsolate(), Buffer::Data(args[1]), &nread); - if (!ret.IsEmpty()) - args.GetReturnValue().Set(ret.ToLocalChecked()); + if (!ret.IsEmpty()) args.GetReturnValue().Set(ret.ToLocalChecked()); } void FlushData(const FunctionCallbackInfo& args) { @@ -264,8 +247,7 @@ void FlushData(const FunctionCallbackInfo& args) { reinterpret_cast(Buffer::Data(args[0])); CHECK_NOT_NULL(decoder); MaybeLocal ret = decoder->FlushData(args.GetIsolate()); - if (!ret.IsEmpty()) - args.GetReturnValue().Set(ret.ToLocalChecked()); + if (!ret.IsEmpty()) args.GetReturnValue().Set(ret.ToLocalChecked()); } void InitializeStringDecoder(Local target, @@ -275,10 +257,12 @@ void InitializeStringDecoder(Local target, Environment* env = Environment::GetCurrent(context); Isolate* isolate = env->isolate(); -#define SET_DECODER_CONSTANT(name) \ - target->Set(context, \ - FIXED_ONE_BYTE_STRING(isolate, #name), \ - Integer::New(isolate, StringDecoder::name)).FromJust() +#define SET_DECODER_CONSTANT(name) \ + target \ + ->Set(context, \ + FIXED_ONE_BYTE_STRING(isolate, #name), \ + Integer::New(isolate, StringDecoder::name)) \ + .FromJust() SET_DECODER_CONSTANT(kIncompleteCharactersStart); SET_DECODER_CONSTANT(kIncompleteCharactersEnd); @@ -288,10 +272,12 @@ void InitializeStringDecoder(Local target, SET_DECODER_CONSTANT(kNumFields); Local encodings = Array::New(isolate); -#define ADD_TO_ENCODINGS_ARRAY(cname, jsname) \ - encodings->Set(context, \ - static_cast(cname), \ - FIXED_ONE_BYTE_STRING(isolate, jsname)).FromJust() +#define ADD_TO_ENCODINGS_ARRAY(cname, jsname) \ + encodings \ + ->Set(context, \ + static_cast(cname), \ + FIXED_ONE_BYTE_STRING(isolate, jsname)) \ + .FromJust() ADD_TO_ENCODINGS_ARRAY(ASCII, "ascii"); ADD_TO_ENCODINGS_ARRAY(UTF8, "utf8"); ADD_TO_ENCODINGS_ARRAY(BASE64, "base64"); @@ -300,13 +286,14 @@ void InitializeStringDecoder(Local target, ADD_TO_ENCODINGS_ARRAY(BUFFER, "buffer"); ADD_TO_ENCODINGS_ARRAY(LATIN1, "latin1"); - target->Set(context, - FIXED_ONE_BYTE_STRING(isolate, "encodings"), - encodings).FromJust(); + target->Set(context, FIXED_ONE_BYTE_STRING(isolate, "encodings"), encodings) + .FromJust(); - target->Set(context, - FIXED_ONE_BYTE_STRING(isolate, "kSize"), - Integer::New(isolate, sizeof(StringDecoder))).FromJust(); + target + ->Set(context, + FIXED_ONE_BYTE_STRING(isolate, "kSize"), + Integer::New(isolate, sizeof(StringDecoder))) + .FromJust(); env->SetMethod(target, "decode", DecodeData); env->SetMethod(target, "flush", FlushData); diff --git a/src/string_decoder.h b/src/string_decoder.h index 9059eeaa9d2eb7..47881ed95890ce 100644 --- a/src/string_decoder.h +++ b/src/string_decoder.h @@ -47,4 +47,4 @@ class StringDecoder { #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS -#endif // SRC_STRING_DECODER_H_ +#endif // SRC_STRING_DECODER_H_ diff --git a/src/string_search.h b/src/string_search.h index 95c746ea89e01e..760e6cc2a106cf 100644 --- a/src/string_search.h +++ b/src/string_search.h @@ -46,7 +46,6 @@ class Vector { bool is_forward_; }; - //--------------------------------------------------------------------- // String Search object. //--------------------------------------------------------------------- @@ -90,8 +89,7 @@ class StringSearch : private StringSearchBase { public: typedef stringsearch::Vector Vector; - explicit StringSearch(Vector pattern) - : pattern_(pattern), start_(0) { + explicit StringSearch(Vector pattern) : pattern_(pattern), start_(0) { if (pattern.length() >= kBMMaxShift) { start_ = pattern.length() - kBMMaxShift; } @@ -122,9 +120,9 @@ class StringSearch : private StringSearchBase { return kUC16AlphabetSize; } - static_assert(sizeof(Char) == sizeof(uint8_t) || - sizeof(Char) == sizeof(uint16_t), - "sizeof(Char) == sizeof(uint16_t) || sizeof(uint8_t)"); + static_assert( + sizeof(Char) == sizeof(uint8_t) || sizeof(Char) == sizeof(uint16_t), + "sizeof(Char) == sizeof(uint16_t) || sizeof(uint8_t)"); } private: @@ -139,8 +137,7 @@ class StringSearch : private StringSearchBase { void PopulateBoyerMooreTable(); - static inline int CharOccurrence(int* bad_char_occurrence, - Char char_code) { + static inline int CharOccurrence(int* bad_char_occurrence, Char char_code) { if (sizeof(Char) == 1) { return bad_char_occurrence[static_cast(char_code)]; } @@ -157,27 +154,26 @@ class StringSearch : private StringSearchBase { size_t start_; }; - template inline T AlignDown(T value, U alignment) { return reinterpret_cast( (reinterpret_cast(value) & ~(alignment - 1))); } - inline uint8_t GetHighestValueByte(uint16_t character) { return std::max(static_cast(character & 0xFF), static_cast(character >> 8)); } - -inline uint8_t GetHighestValueByte(uint8_t character) { return character; } - +inline uint8_t GetHighestValueByte(uint8_t character) { + return character; +} // Searches for a byte value in a memory buffer, back to front. // Uses memrchr(3) on systems which support it, for speed. // Falls back to a vanilla for loop on non-GNU systems such as Windows. -inline const void* MemrchrFill(const void* haystack, uint8_t needle, +inline const void* MemrchrFill(const void* haystack, + uint8_t needle, size_t haystack_len) { #ifdef _GNU_SOURCE return memrchr(haystack, needle, haystack_len); @@ -192,12 +188,12 @@ inline const void* MemrchrFill(const void* haystack, uint8_t needle, #endif } - // Finds the first occurrence of *two-byte* character pattern[0] in the string // `subject`. Does not check that the whole pattern matches. template inline size_t FindFirstCharacter(Vector pattern, - Vector subject, size_t index) { + Vector subject, + size_t index) { const Char pattern_first_char = pattern[0]; const size_t max_n = (subject.length() - pattern.length() + 1); @@ -216,13 +212,11 @@ inline size_t FindFirstCharacter(Vector pattern, } else { CHECK_LE(pos, subject.length()); CHECK_LE(subject.length() - pos, SIZE_MAX / sizeof(Char)); - void_pos = MemrchrFill(subject.start() + pattern.length() - 1, - search_byte, - bytes_to_search); + void_pos = MemrchrFill( + subject.start() + pattern.length() - 1, search_byte, bytes_to_search); } const Char* char_pos = static_cast(void_pos); - if (char_pos == nullptr) - return subject.length(); + if (char_pos == nullptr) return subject.length(); // Then, for each match, verify that the full two bytes match pattern[0]. char_pos = AlignDown(char_pos, sizeof(Char)); @@ -238,7 +232,6 @@ inline size_t FindFirstCharacter(Vector pattern, return subject.length(); } - // Finds the first occurrence of the byte pattern[0] in string `subject`. // Does not verify that the whole pattern matches. template <> @@ -271,9 +264,7 @@ inline size_t FindFirstCharacter(Vector pattern, //--------------------------------------------------------------------- template -size_t StringSearch::SingleCharSearch( - Vector subject, - size_t index) { +size_t StringSearch::SingleCharSearch(Vector subject, size_t index) { CHECK_EQ(1, pattern_.length()); return FindFirstCharacter(pattern_, subject, index); } @@ -284,15 +275,12 @@ size_t StringSearch::SingleCharSearch( // Simple linear search for short patterns. Never bails out. template -size_t StringSearch::LinearSearch( - Vector subject, - size_t index) { +size_t StringSearch::LinearSearch(Vector subject, size_t index) { CHECK_GT(pattern_.length(), 1); const size_t n = subject.length() - pattern_.length(); for (size_t i = index; i <= n; i++) { i = FindFirstCharacter(pattern_, subject, i); - if (i == subject.length()) - return subject.length(); + if (i == subject.length()) return subject.length(); CHECK_LE(i, n); bool matches = true; @@ -314,9 +302,8 @@ size_t StringSearch::LinearSearch( //--------------------------------------------------------------------- template -size_t StringSearch::BoyerMooreSearch( - Vector subject, - size_t start_index) { +size_t StringSearch::BoyerMooreSearch(Vector subject, + size_t start_index) { const size_t subject_length = subject.length(); const size_t pattern_length = pattern_.length(); // Only preprocess at most kBMMaxShift last characters of pattern. @@ -347,9 +334,9 @@ size_t StringSearch::BoyerMooreSearch( if (j < start) { // we have matched more than our tables allow us to be smart about. // Fall back on BMH shift. - index += pattern_length - 1 - - CharOccurrence(bad_char_occurrence, - static_cast(last_char)); + index += + pattern_length - 1 - + CharOccurrence(bad_char_occurrence, static_cast(last_char)); } else { int gs_shift = good_suffix_shift[j + 1]; int bc_occ = CharOccurrence(bad_char_occurrence, c); @@ -434,9 +421,8 @@ void StringSearch::PopulateBoyerMooreTable() { //--------------------------------------------------------------------- template -size_t StringSearch::BoyerMooreHorspoolSearch( - Vector subject, - size_t start_index) { +size_t StringSearch::BoyerMooreHorspoolSearch(Vector subject, + size_t start_index) { const size_t subject_length = subject.length(); const size_t pattern_length = pattern_.length(); int* char_occurrences = bad_char_shift_table_; @@ -518,9 +504,7 @@ void StringSearch::PopulateBoyerMooreHorspoolTable() { // Simple linear search for short patterns, which bails out if the string // isn't found very early in the subject. Upgrades to BoyerMooreHorspool. template -size_t StringSearch::InitialSearch( - Vector subject, - size_t index) { +size_t StringSearch::InitialSearch(Vector subject, size_t index) { const size_t pattern_length = pattern_.length(); // Badness is a count of how much work we have done. When we have // done enough work we decide it's probably worth switching to a better @@ -533,8 +517,7 @@ size_t StringSearch::InitialSearch( badness++; if (badness <= 0) { i = FindFirstCharacter(pattern_, subject, i); - if (i == subject.length()) - return subject.length(); + if (i == subject.length()) return subject.length(); CHECK_LE(i, n); size_t j = 1; do { @@ -606,11 +589,15 @@ size_t SearchString(const Char* haystack, } template -size_t SearchString(const char* haystack, size_t haystack_length, +size_t SearchString(const char* haystack, + size_t haystack_length, const char (&needle)[N]) { - return SearchString( - reinterpret_cast(haystack), haystack_length, - reinterpret_cast(needle), N - 1, 0, true); + return SearchString(reinterpret_cast(haystack), + haystack_length, + reinterpret_cast(needle), + N - 1, + 0, + true); } } // namespace node diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index cb6e634006709d..76f73c2b23df53 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -21,19 +21,18 @@ #include "tcp_wrap.h" +#include "connect_wrap.h" #include "connection_wrap.h" #include "env-inl.h" #include "handle_wrap.h" #include "node_buffer.h" #include "node_internals.h" -#include "connect_wrap.h" #include "stream_base-inl.h" #include "stream_wrap.h" #include "util-inl.h" #include - namespace node { using v8::Boolean; @@ -69,7 +68,6 @@ MaybeLocal TCPWrap::Instantiate(Environment* env, constructor->NewInstance(env->context(), 1, &type_value)); } - void TCPWrap::Initialize(Local target, Local unused, Local context, @@ -96,10 +94,10 @@ void TCPWrap::Initialize(Local target, env->SetProtoMethod(t, "connect", Connect); env->SetProtoMethod(t, "bind6", Bind6); env->SetProtoMethod(t, "connect6", Connect6); - env->SetProtoMethod(t, "getsockname", - GetSockOrPeerName); - env->SetProtoMethod(t, "getpeername", - GetSockOrPeerName); + env->SetProtoMethod( + t, "getsockname", GetSockOrPeerName); + env->SetProtoMethod( + t, "getpeername", GetSockOrPeerName); env->SetProtoMethod(t, "setNoDelay", SetNoDelay); env->SetProtoMethod(t, "setKeepAlive", SetKeepAlive); @@ -107,9 +105,11 @@ void TCPWrap::Initialize(Local target, env->SetProtoMethod(t, "setSimultaneousAccepts", SetSimultaneousAccepts); #endif - target->Set(env->context(), - tcpString, - t->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + tcpString, + t->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); env->set_tcp_constructor_template(t); // Create FunctionTemplate for TCPConnectWrap. @@ -119,21 +119,20 @@ void TCPWrap::Initialize(Local target, Local wrapString = FIXED_ONE_BYTE_STRING(env->isolate(), "TCPConnectWrap"); cwt->SetClassName(wrapString); - target->Set(env->context(), - wrapString, - cwt->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + wrapString, + cwt->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); // Define constants Local constants = Object::New(env->isolate()); NODE_DEFINE_CONSTANT(constants, SOCKET); NODE_DEFINE_CONSTANT(constants, SERVER); NODE_DEFINE_CONSTANT(constants, UV_TCP_IPV6ONLY); - target->Set(context, - env->constants_string(), - constants).FromJust(); + target->Set(context, env->constants_string(), constants).FromJust(); } - void TCPWrap::New(const FunctionCallbackInfo& args) { // This constructor should not be exposed to public javascript. // Therefore we assert that we are not trying to call this as a @@ -160,7 +159,6 @@ void TCPWrap::New(const FunctionCallbackInfo& args) { new TCPWrap(env, args.This(), provider); } - TCPWrap::TCPWrap(Environment* env, Local object, ProviderType provider) : ConnectionWrap(env, object, provider) { int r = uv_tcp_init(env->event_loop(), &handle_); @@ -168,23 +166,19 @@ TCPWrap::TCPWrap(Environment* env, Local object, ProviderType provider) // Suggestion: uv_tcp_init() returns void. } - void TCPWrap::SetNoDelay(const FunctionCallbackInfo& args) { TCPWrap* wrap; - ASSIGN_OR_RETURN_UNWRAP(&wrap, - args.Holder(), - args.GetReturnValue().Set(UV_EBADF)); + ASSIGN_OR_RETURN_UNWRAP( + &wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); int enable = static_cast(args[0]->IsTrue()); int err = uv_tcp_nodelay(&wrap->handle_, enable); args.GetReturnValue().Set(err); } - void TCPWrap::SetKeepAlive(const FunctionCallbackInfo& args) { TCPWrap* wrap; - ASSIGN_OR_RETURN_UNWRAP(&wrap, - args.Holder(), - args.GetReturnValue().Set(UV_EBADF)); + ASSIGN_OR_RETURN_UNWRAP( + &wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); Environment* env = wrap->env(); int enable; if (!args[0]->Int32Value(env->context()).To(&enable)) return; @@ -193,33 +187,28 @@ void TCPWrap::SetKeepAlive(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(err); } - #ifdef _WIN32 void TCPWrap::SetSimultaneousAccepts(const FunctionCallbackInfo& args) { TCPWrap* wrap; - ASSIGN_OR_RETURN_UNWRAP(&wrap, - args.Holder(), - args.GetReturnValue().Set(UV_EBADF)); + ASSIGN_OR_RETURN_UNWRAP( + &wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); bool enable = args[0]->IsTrue(); int err = uv_tcp_simultaneous_accepts(&wrap->handle_, enable); args.GetReturnValue().Set(err); } #endif - void TCPWrap::Open(const FunctionCallbackInfo& args) { TCPWrap* wrap; - ASSIGN_OR_RETURN_UNWRAP(&wrap, - args.Holder(), - args.GetReturnValue().Set(UV_EBADF)); + ASSIGN_OR_RETURN_UNWRAP( + &wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); int64_t val; if (!args[0]->IntegerValue(args.GetIsolate()->GetCurrentContext()).To(&val)) return; int fd = static_cast(val); int err = uv_tcp_open(&wrap->handle_, fd); - if (err == 0) - wrap->set_fd(fd); + if (err == 0) wrap->set_fd(fd); args.GetReturnValue().Set(err); } @@ -230,16 +219,14 @@ void TCPWrap::Bind( int family, std::function uv_ip_addr) { TCPWrap* wrap; - ASSIGN_OR_RETURN_UNWRAP(&wrap, - args.Holder(), - args.GetReturnValue().Set(UV_EBADF)); + ASSIGN_OR_RETURN_UNWRAP( + &wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); Environment* env = wrap->env(); node::Utf8Value ip_address(env->isolate(), args[0]); int port; unsigned int flags = 0; if (!args[1]->Int32Value(env->context()).To(&port)) return; - if (family == AF_INET6 && - !args[2]->Uint32Value(env->context()).To(&flags)) { + if (family == AF_INET6 && !args[2]->Uint32Value(env->context()).To(&flags)) { return; } @@ -247,9 +234,8 @@ void TCPWrap::Bind( int err = uv_ip_addr(*ip_address, port, &addr); if (err == 0) { - err = uv_tcp_bind(&wrap->handle_, - reinterpret_cast(&addr), - flags); + err = uv_tcp_bind( + &wrap->handle_, reinterpret_cast(&addr), flags); } args.GetReturnValue().Set(err); } @@ -258,37 +244,30 @@ void TCPWrap::Bind(const FunctionCallbackInfo& args) { Bind(args, AF_INET, uv_ip4_addr); } - void TCPWrap::Bind6(const FunctionCallbackInfo& args) { Bind(args, AF_INET6, uv_ip6_addr); } - void TCPWrap::Listen(const FunctionCallbackInfo& args) { TCPWrap* wrap; - ASSIGN_OR_RETURN_UNWRAP(&wrap, - args.Holder(), - args.GetReturnValue().Set(UV_EBADF)); + ASSIGN_OR_RETURN_UNWRAP( + &wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); Environment* env = wrap->env(); int backlog; if (!args[0]->Int32Value(env->context()).To(&backlog)) return; - int err = uv_listen(reinterpret_cast(&wrap->handle_), - backlog, - OnConnection); + int err = uv_listen( + reinterpret_cast(&wrap->handle_), backlog, OnConnection); args.GetReturnValue().Set(err); } - void TCPWrap::Connect(const FunctionCallbackInfo& args) { CHECK(args[2]->IsUint32()); int port = args[2].As()->Value(); - Connect(args, - [port](const char* ip_address, sockaddr_in* addr) { - return uv_ip4_addr(ip_address, port, addr); + Connect(args, [port](const char* ip_address, sockaddr_in* addr) { + return uv_ip4_addr(ip_address, port, addr); }); } - void TCPWrap::Connect6(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); CHECK(args[2]->IsUint32()); @@ -296,19 +275,19 @@ void TCPWrap::Connect6(const FunctionCallbackInfo& args) { if (!args[2]->Int32Value(env->context()).To(&port)) return; Connect(args, [port](const char* ip_address, sockaddr_in6* addr) { - return uv_ip6_addr(ip_address, port, addr); - }); + return uv_ip6_addr(ip_address, port, addr); + }); } template -void TCPWrap::Connect(const FunctionCallbackInfo& args, +void TCPWrap::Connect( + const FunctionCallbackInfo& args, std::function uv_ip_addr) { Environment* env = Environment::GetCurrent(args); TCPWrap* wrap; - ASSIGN_OR_RETURN_UNWRAP(&wrap, - args.Holder(), - args.GetReturnValue().Set(UV_EBADF)); + ASSIGN_OR_RETURN_UNWRAP( + &wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); CHECK(args[0]->IsObject()); CHECK(args[1]->IsString()); @@ -327,14 +306,12 @@ void TCPWrap::Connect(const FunctionCallbackInfo& args, &wrap->handle_, reinterpret_cast(&addr), AfterConnect); - if (err) - delete req_wrap; + if (err) delete req_wrap; } args.GetReturnValue().Set(err); } - // also used by udp_wrap.cc Local AddressToJS(Environment* env, const sockaddr* addr, @@ -345,50 +322,51 @@ Local AddressToJS(Environment* env, const sockaddr_in6* a6; int port; - if (info.IsEmpty()) - info = Object::New(env->isolate()); + if (info.IsEmpty()) info = Object::New(env->isolate()); switch (addr->sa_family) { - case AF_INET6: - a6 = reinterpret_cast(addr); - uv_inet_ntop(AF_INET6, &a6->sin6_addr, ip, sizeof ip); - port = ntohs(a6->sin6_port); - info->Set(env->context(), - env->address_string(), - OneByteString(env->isolate(), ip)).FromJust(); - info->Set(env->context(), - env->family_string(), - env->ipv6_string()).FromJust(); - info->Set(env->context(), - env->port_string(), - Integer::New(env->isolate(), port)).FromJust(); - break; - - case AF_INET: - a4 = reinterpret_cast(addr); - uv_inet_ntop(AF_INET, &a4->sin_addr, ip, sizeof ip); - port = ntohs(a4->sin_port); - info->Set(env->context(), - env->address_string(), - OneByteString(env->isolate(), ip)).FromJust(); - info->Set(env->context(), - env->family_string(), - env->ipv4_string()).FromJust(); - info->Set(env->context(), - env->port_string(), - Integer::New(env->isolate(), port)).FromJust(); - break; - - default: - info->Set(env->context(), - env->address_string(), - String::Empty(env->isolate())).FromJust(); + case AF_INET6: + a6 = reinterpret_cast(addr); + uv_inet_ntop(AF_INET6, &a6->sin6_addr, ip, sizeof ip); + port = ntohs(a6->sin6_port); + info->Set(env->context(), + env->address_string(), + OneByteString(env->isolate(), ip)) + .FromJust(); + info->Set(env->context(), env->family_string(), env->ipv6_string()) + .FromJust(); + info->Set(env->context(), + env->port_string(), + Integer::New(env->isolate(), port)) + .FromJust(); + break; + + case AF_INET: + a4 = reinterpret_cast(addr); + uv_inet_ntop(AF_INET, &a4->sin_addr, ip, sizeof ip); + port = ntohs(a4->sin_port); + info->Set(env->context(), + env->address_string(), + OneByteString(env->isolate(), ip)) + .FromJust(); + info->Set(env->context(), env->family_string(), env->ipv4_string()) + .FromJust(); + info->Set(env->context(), + env->port_string(), + Integer::New(env->isolate(), port)) + .FromJust(); + break; + + default: + info->Set(env->context(), + env->address_string(), + String::Empty(env->isolate())) + .FromJust(); } return scope.Escape(info); } - } // namespace node NODE_MODULE_CONTEXT_AWARE_INTERNAL(tcp_wrap, node::TCPWrap::Initialize) diff --git a/src/tcp_wrap.h b/src/tcp_wrap.h index 0467a1c3f3bf20..1007857b9910f5 100644 --- a/src/tcp_wrap.h +++ b/src/tcp_wrap.h @@ -25,17 +25,14 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "async_wrap.h" -#include "env.h" #include "connection_wrap.h" +#include "env.h" namespace node { class TCPWrap : public ConnectionWrap { public: - enum SocketType { - SOCKET, - SERVER - }; + enum SocketType { SOCKET, SERVER }; static v8::MaybeLocal Instantiate(Environment* env, AsyncWrap* parent, @@ -65,7 +62,8 @@ class TCPWrap : public ConnectionWrap { int (*F)(const typename T::HandleType*, sockaddr*, int*)> friend void GetSockOrPeerName(const v8::FunctionCallbackInfo&); - TCPWrap(Environment* env, v8::Local object, + TCPWrap(Environment* env, + v8::Local object, ProviderType provider); static void New(const v8::FunctionCallbackInfo& args); @@ -77,7 +75,8 @@ class TCPWrap : public ConnectionWrap { static void Connect(const v8::FunctionCallbackInfo& args); static void Connect6(const v8::FunctionCallbackInfo& args); template - static void Connect(const v8::FunctionCallbackInfo& args, + static void Connect( + const v8::FunctionCallbackInfo& args, std::function uv_ip_addr); static void Open(const v8::FunctionCallbackInfo& args); template @@ -92,7 +91,6 @@ class TCPWrap : public ConnectionWrap { #endif }; - } // namespace node #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS diff --git a/src/timers.cc b/src/timers.cc index f80e9e6be4d20c..e0a75498c9847d 100644 --- a/src/timers.cc +++ b/src/timers.cc @@ -44,9 +44,9 @@ void ToggleImmediateRef(const FunctionCallbackInfo& args) { } void Initialize(Local target, - Local unused, - Local context, - void* priv) { + Local unused, + Local context, + void* priv) { Environment* env = Environment::GetCurrent(context); env->SetMethod(target, "getLibuvNow", GetLibuvNow); @@ -55,12 +55,13 @@ void Initialize(Local target, env->SetMethod(target, "toggleTimerRef", ToggleTimerRef); env->SetMethod(target, "toggleImmediateRef", ToggleImmediateRef); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(env->isolate(), "immediateInfo"), - env->immediate_info()->fields().GetJSArray()).FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(env->isolate(), "immediateInfo"), + env->immediate_info()->fields().GetJSArray()) + .FromJust(); } - } // anonymous namespace } // namespace node diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index 4871cd405d1ec0..8292d678f7358a 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -21,8 +21,8 @@ #include "tls_wrap.h" #include "async_wrap-inl.h" -#include "node_buffer.h" // Buffer -#include "node_crypto.h" // SecureContext +#include "node_buffer.h" // Buffer +#include "node_crypto.h" // SecureContext #include "node_crypto_bio.h" // NodeBIO // ClientHelloParser #include "node_crypto_clienthello-inl.h" @@ -54,7 +54,8 @@ TLSWrap::TLSWrap(Environment* env, SecureContext* sc) : AsyncWrap(env, env->tls_wrap_constructor_function() - ->NewInstance(env->context()).ToLocalChecked(), + ->NewInstance(env->context()) + .ToLocalChecked(), AsyncWrap::PROVIDER_TLSWRAP), SSLWrap(env, sc, kind), StreamBase(env), @@ -75,15 +76,12 @@ TLSWrap::TLSWrap(Environment* env, InitSSL(); } - TLSWrap::~TLSWrap() { sc_ = nullptr; } - bool TLSWrap::InvokeQueued(int status, const char* error_str) { - if (!write_callback_scheduled_) - return false; + if (!write_callback_scheduled_) return false; if (current_write_ != nullptr) { WriteWrap* w = current_write_; @@ -94,12 +92,10 @@ bool TLSWrap::InvokeQueued(int status, const char* error_str) { return true; } - void TLSWrap::NewSessionDoneCb() { Cycle(); } - void TLSWrap::InitSSL() { // Initialize SSL – OpenSSL takes ownership of these. enc_in_ = crypto::NodeBIO::New(env()).release(); @@ -143,7 +139,6 @@ void TLSWrap::InitSSL() { } } - void TLSWrap::Wrap(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -154,8 +149,8 @@ void TLSWrap::Wrap(const FunctionCallbackInfo& args) { Local stream_obj = args[0].As(); Local sc = args[1].As(); - Kind kind = args[2]->IsTrue() ? SSLWrap::kServer : - SSLWrap::kClient; + Kind kind = + args[2]->IsTrue() ? SSLWrap::kServer : SSLWrap::kClient; StreamBase* stream = static_cast(stream_obj->Value()); CHECK_NOT_NULL(stream); @@ -165,7 +160,6 @@ void TLSWrap::Wrap(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(res->object()); } - void TLSWrap::Receive(const FunctionCallbackInfo& args) { TLSWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); @@ -187,7 +181,6 @@ void TLSWrap::Receive(const FunctionCallbackInfo& args) { } } - void TLSWrap::Start(const FunctionCallbackInfo& args) { TLSWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); @@ -205,10 +198,8 @@ void TLSWrap::Start(const FunctionCallbackInfo& args) { wrap->EncOut(); } - void TLSWrap::SSLInfoCallback(const SSL* ssl_, int where, int ret) { - if (!(where & (SSL_CB_HANDSHAKE_START | SSL_CB_HANDSHAKE_DONE))) - return; + if (!(where & (SSL_CB_HANDSHAKE_START | SSL_CB_HANDSHAKE_DONE))) return; // SSL_renegotiate_pending() should take `const SSL*`, but it does not. SSL* ssl = const_cast(ssl_); @@ -222,8 +213,9 @@ void TLSWrap::SSLInfoCallback(const SSL* ssl_, int where, int ret) { Local callback; if (object->Get(env->context(), env->onhandshakestart_string()) - .ToLocal(&callback) && callback->IsFunction()) { - Local argv[] = { env->GetNow() }; + .ToLocal(&callback) && + callback->IsFunction()) { + Local argv[] = {env->GetNow()}; c->MakeCallback(callback.As(), arraysize(argv), argv); } } @@ -237,52 +229,45 @@ void TLSWrap::SSLInfoCallback(const SSL* ssl_, int where, int ret) { c->established_ = true; if (object->Get(env->context(), env->onhandshakedone_string()) - .ToLocal(&callback) && callback->IsFunction()) { + .ToLocal(&callback) && + callback->IsFunction()) { c->MakeCallback(callback.As(), 0, nullptr); } } } - void TLSWrap::EncOut() { // Ignore cycling data if ClientHello wasn't yet parsed - if (!hello_parser_.IsEnded()) - return; + if (!hello_parser_.IsEnded()) return; // Write in progress - if (write_size_ != 0) - return; + if (write_size_ != 0) return; // Wait for `newSession` callback to be invoked - if (is_awaiting_new_session()) - return; + if (is_awaiting_new_session()) return; // Split-off queue if (established_ && current_write_ != nullptr) write_callback_scheduled_ = true; - if (ssl_ == nullptr) - return; + if (ssl_ == nullptr) return; // No encrypted output ready to write to the underlying stream. if (BIO_pending(enc_out_) == 0) { - if (pending_cleartext_input_.empty()) - InvokeQueued(0); + if (pending_cleartext_input_.empty()) InvokeQueued(0); return; } char* data[kSimultaneousBufferCount]; size_t size[arraysize(data)]; size_t count = arraysize(data); - write_size_ = crypto::NodeBIO::FromBIO(enc_out_)->PeekMultiple(data, - size, - &count); + write_size_ = + crypto::NodeBIO::FromBIO(enc_out_)->PeekMultiple(data, size, &count); CHECK(write_size_ != 0 && count != 0); uv_buf_t buf[arraysize(data)]; uv_buf_t* bufs = buf; - for (size_t i = 0; i < count; i++) - buf[i] = uv_buf_init(data[i], size[i]); + for (size_t i = 0; i < count; i++) buf[i] = uv_buf_init(data[i], size[i]); StreamWriteResult res = underlying_stream()->Write(bufs, count); if (res.err != 0) { @@ -294,13 +279,15 @@ void TLSWrap::EncOut() { HandleScope handle_scope(env()->isolate()); // Simulate asynchronous finishing, TLS cannot handle this at the moment. - env()->SetImmediate([](Environment* env, void* data) { - static_cast(data)->OnStreamAfterWrite(nullptr, 0); - }, this, object()); + env()->SetImmediate( + [](Environment* env, void* data) { + static_cast(data)->OnStreamAfterWrite(nullptr, 0); + }, + this, + object()); } } - void TLSWrap::OnStreamAfterWrite(WriteWrap* req_wrap, int status) { if (current_empty_write_ != nullptr) { WriteWrap* finishing = current_empty_write_; @@ -309,14 +296,12 @@ void TLSWrap::OnStreamAfterWrite(WriteWrap* req_wrap, int status) { return; } - if (ssl_ == nullptr) - status = UV_ECANCELED; + if (ssl_ == nullptr) status = UV_ECANCELED; // Handle error if (status) { // Ignore errors after shutdown - if (shutdown_) - return; + if (shutdown_) return; // Notify about error InvokeQueued(status); @@ -334,13 +319,11 @@ void TLSWrap::OnStreamAfterWrite(WriteWrap* req_wrap, int status) { EncOut(); } - Local TLSWrap::GetSSLError(int status, int* err, std::string* msg) { EscapableHandleScope scope(env()->isolate()); // ssl_ is already destroyed in reading EOF by close notify alert. - if (ssl_ == nullptr) - return Local(); + if (ssl_ == nullptr) return Local(); *err = SSL_get_error(ssl_.get(), status); switch (*err) { @@ -354,60 +337,58 @@ Local TLSWrap::GetSSLError(int status, int* err, std::string* msg) { return scope.Escape(env()->zero_return_string()); case SSL_ERROR_SSL: - case SSL_ERROR_SYSCALL: - { - unsigned long ssl_err = ERR_peek_error(); // NOLINT(runtime/int) - BIO* bio = BIO_new(BIO_s_mem()); - ERR_print_errors(bio); - - BUF_MEM* mem; - BIO_get_mem_ptr(bio, &mem); - - Isolate* isolate = env()->isolate(); - Local context = isolate->GetCurrentContext(); - - Local message = - OneByteString(isolate, mem->data, mem->length); - Local exception = Exception::Error(message); - Local obj = exception->ToObject(context).ToLocalChecked(); - - const char* ls = ERR_lib_error_string(ssl_err); - const char* fs = ERR_func_error_string(ssl_err); - const char* rs = ERR_reason_error_string(ssl_err); - - if (ls != nullptr) - obj->Set(context, env()->library_string(), - OneByteString(isolate, ls)).FromJust(); - if (fs != nullptr) - obj->Set(context, env()->function_string(), - OneByteString(isolate, fs)).FromJust(); - if (rs != nullptr) { - obj->Set(context, env()->reason_string(), - OneByteString(isolate, rs)).FromJust(); - - // SSL has no API to recover the error name from the number, so we - // transform reason strings like "this error" to "ERR_SSL_THIS_ERROR", - // which ends up being close to the original error macro name. - std::string code(rs); - - for (auto& c : code) { - if (c == ' ') - c = '_'; - else - c = ::toupper(c); - } - obj->Set(context, env()->code_string(), - OneByteString(isolate, ("ERR_SSL_" + code).c_str())) - .FromJust(); + case SSL_ERROR_SYSCALL: { + unsigned long ssl_err = ERR_peek_error(); // NOLINT(runtime/int) + BIO* bio = BIO_new(BIO_s_mem()); + ERR_print_errors(bio); + + BUF_MEM* mem; + BIO_get_mem_ptr(bio, &mem); + + Isolate* isolate = env()->isolate(); + Local context = isolate->GetCurrentContext(); + + Local message = OneByteString(isolate, mem->data, mem->length); + Local exception = Exception::Error(message); + Local obj = exception->ToObject(context).ToLocalChecked(); + + const char* ls = ERR_lib_error_string(ssl_err); + const char* fs = ERR_func_error_string(ssl_err); + const char* rs = ERR_reason_error_string(ssl_err); + + if (ls != nullptr) + obj->Set(context, env()->library_string(), OneByteString(isolate, ls)) + .FromJust(); + if (fs != nullptr) + obj->Set(context, env()->function_string(), OneByteString(isolate, fs)) + .FromJust(); + if (rs != nullptr) { + obj->Set(context, env()->reason_string(), OneByteString(isolate, rs)) + .FromJust(); + + // SSL has no API to recover the error name from the number, so we + // transform reason strings like "this error" to "ERR_SSL_THIS_ERROR", + // which ends up being close to the original error macro name. + std::string code(rs); + + for (auto& c : code) { + if (c == ' ') + c = '_'; + else + c = ::toupper(c); } + obj->Set(context, + env()->code_string(), + OneByteString(isolate, ("ERR_SSL_" + code).c_str())) + .FromJust(); + } - if (msg != nullptr) - msg->assign(mem->data, mem->data + mem->length); + if (msg != nullptr) msg->assign(mem->data, mem->data + mem->length); - BIO_free_all(bio); + BIO_free_all(bio); - return scope.Escape(exception); - } + return scope.Escape(exception); + } default: UNREACHABLE(); @@ -415,18 +396,14 @@ Local TLSWrap::GetSSLError(int status, int* err, std::string* msg) { UNREACHABLE(); } - void TLSWrap::ClearOut() { // Ignore cycling data if ClientHello wasn't yet parsed - if (!hello_parser_.IsEnded()) - return; + if (!hello_parser_.IsEnded()) return; // No reads after EOF - if (eof_) - return; + if (eof_) return; - if (ssl_ == nullptr) - return; + if (ssl_ == nullptr) return; crypto::MarkPopErrorOnReturn mark_pop_error_on_return; @@ -435,24 +412,21 @@ void TLSWrap::ClearOut() { for (;;) { read = SSL_read(ssl_.get(), out, sizeof(out)); - if (read <= 0) - break; + if (read <= 0) break; char* current = out; while (read > 0) { int avail = read; uv_buf_t buf = EmitAlloc(avail); - if (static_cast(buf.len) < avail) - avail = buf.len; + if (static_cast(buf.len) < avail) avail = buf.len; memcpy(buf.base, current, avail); EmitRead(avail, buf); // Caveat emptor: OnRead() calls into JS land which can result in // the SSL context object being destroyed. We have to carefully // check that ssl_ != nullptr afterwards. - if (ssl_ == nullptr) - return; + if (ssl_ == nullptr) return; read -= avail; current += avail; @@ -474,28 +448,23 @@ void TLSWrap::ClearOut() { Local arg = GetSSLError(read, &err, nullptr); // Ignore ZERO_RETURN after EOF, it is basically not a error - if (err == SSL_ERROR_ZERO_RETURN && eof_) - return; + if (err == SSL_ERROR_ZERO_RETURN && eof_) return; if (!arg.IsEmpty()) { // When TLS Alert are stored in wbio, // it should be flushed to socket before destroyed. - if (BIO_pending(enc_out_) != 0) - EncOut(); + if (BIO_pending(enc_out_) != 0) EncOut(); MakeCallback(env()->onerror_string(), 1, &arg); } } } - void TLSWrap::ClearIn() { // Ignore cycling data if ClientHello wasn't yet parsed - if (!hello_parser_.IsEnded()) - return; + if (!hello_parser_.IsEnded()) return; - if (ssl_ == nullptr) - return; + if (ssl_ == nullptr) return; std::vector buffers; buffers.swap(pending_cleartext_input_); @@ -509,8 +478,7 @@ void TLSWrap::ClearIn() { char* data = buffers[i].base; written = SSL_write(ssl_.get(), data, avail); CHECK(written == -1 || written == static_cast(avail)); - if (written == -1) - break; + if (written == -1) break; } // All written @@ -536,67 +504,52 @@ void TLSWrap::ClearIn() { // Push back the not-yet-written pending buffers into their queue. // This can be skipped in the error case because no further writes // would succeed anyway. - pending_cleartext_input_.insert(pending_cleartext_input_.end(), - buffers.begin() + i, - buffers.end()); + pending_cleartext_input_.insert( + pending_cleartext_input_.end(), buffers.begin() + i, buffers.end()); } return; } - AsyncWrap* TLSWrap::GetAsyncWrap() { return static_cast(this); } - bool TLSWrap::IsIPCPipe() { return underlying_stream()->IsIPCPipe(); } - int TLSWrap::GetFD() { return underlying_stream()->GetFD(); } - bool TLSWrap::IsAlive() { - return ssl_ != nullptr && - stream_ != nullptr && - underlying_stream()->IsAlive(); + return ssl_ != nullptr && stream_ != nullptr && + underlying_stream()->IsAlive(); } - bool TLSWrap::IsClosing() { return underlying_stream()->IsClosing(); } - - int TLSWrap::ReadStart() { - if (stream_ != nullptr) - return stream_->ReadStart(); + if (stream_ != nullptr) return stream_->ReadStart(); return 0; } - int TLSWrap::ReadStop() { - if (stream_ != nullptr) - return stream_->ReadStop(); + if (stream_ != nullptr) return stream_->ReadStop(); return 0; } - const char* TLSWrap::Error() const { return error_.empty() ? nullptr : error_.c_str(); } - void TLSWrap::ClearError() { error_.clear(); } - // Called by StreamBase::Write() to request async write of clear text into SSL. int TLSWrap::DoWrite(WriteWrap* w, uv_buf_t* bufs, @@ -637,10 +590,13 @@ int TLSWrap::DoWrite(WriteWrap* w, StreamWriteResult res = underlying_stream()->Write(bufs, count, send_handle); if (!res.async) { - env()->SetImmediate([](Environment* env, void* data) { - TLSWrap* self = static_cast(data); - self->OnStreamAfterWrite(self->current_empty_write_, 0); - }, this, object()); + env()->SetImmediate( + [](Environment* env, void* data) { + TLSWrap* self = static_cast(data); + self->OnStreamAfterWrite(self->current_empty_write_, 0); + }, + this, + object()); } return 0; } @@ -662,8 +618,7 @@ int TLSWrap::DoWrite(WriteWrap* w, for (i = 0; i < count; i++) { written = SSL_write(ssl_.get(), bufs[i].base, bufs[i].len); CHECK(written == -1 || written == static_cast(bufs[i].len)); - if (written == -1) - break; + if (written == -1) break; } if (i != count) { @@ -677,9 +632,8 @@ int TLSWrap::DoWrite(WriteWrap* w, } // Otherwise, save unwritten data so it can be written later by ClearIn(). - pending_cleartext_input_.insert(pending_cleartext_input_.end(), - &bufs[i], - &bufs[count]); + pending_cleartext_input_.insert( + pending_cleartext_input_.end(), &bufs[i], &bufs[count]); } // Write any encrypted/handshake output that may be ready. @@ -688,7 +642,6 @@ int TLSWrap::DoWrite(WriteWrap* w, return 0; } - uv_buf_t TLSWrap::OnStreamAlloc(size_t suggested_size) { CHECK_NOT_NULL(ssl_); @@ -697,16 +650,14 @@ uv_buf_t TLSWrap::OnStreamAlloc(size_t suggested_size) { return uv_buf_init(base, size); } - void TLSWrap::OnStreamRead(ssize_t nread, const uv_buf_t& buf) { - if (nread < 0) { + if (nread < 0) { // Error should be emitted only after all data was read ClearOut(); // Ignore EOF if received close_notify if (nread == UV_EOF) { - if (eof_) - return; + if (eof_) return; eof_ = true; } @@ -739,24 +690,20 @@ void TLSWrap::OnStreamRead(ssize_t nread, const uv_buf_t& buf) { Cycle(); } - ShutdownWrap* TLSWrap::CreateShutdownWrap(Local req_wrap_object) { return underlying_stream()->CreateShutdownWrap(req_wrap_object); } - int TLSWrap::DoShutdown(ShutdownWrap* req_wrap) { crypto::MarkPopErrorOnReturn mark_pop_error_on_return; - if (ssl_ && SSL_shutdown(ssl_.get()) == 0) - SSL_shutdown(ssl_.get()); + if (ssl_ && SSL_shutdown(ssl_.get()) == 0) SSL_shutdown(ssl_.get()); shutdown_ = true; EncOut(); return stream_->DoShutdown(req_wrap); } - void TLSWrap::SetVerifyMode(const FunctionCallbackInfo& args) { TLSWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); @@ -775,8 +722,7 @@ void TLSWrap::SetVerifyMode(const FunctionCallbackInfo& args) { } else { bool reject_unauthorized = args[1]->IsTrue(); verify_mode = SSL_VERIFY_PEER; - if (reject_unauthorized) - verify_mode |= SSL_VERIFY_FAIL_IF_NO_PEER_CERT; + if (reject_unauthorized) verify_mode |= SSL_VERIFY_FAIL_IF_NO_PEER_CERT; } } else { // Servers always send a cert if the cipher is not anonymous (anon is @@ -789,25 +735,20 @@ void TLSWrap::SetVerifyMode(const FunctionCallbackInfo& args) { SSL_set_verify(wrap->ssl_.get(), verify_mode, crypto::VerifyCallback); } - -void TLSWrap::EnableSessionCallbacks( - const FunctionCallbackInfo& args) { +void TLSWrap::EnableSessionCallbacks(const FunctionCallbackInfo& args) { TLSWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); CHECK_NOT_NULL(wrap->ssl_); wrap->enable_session_callbacks(); // Clients don't use the HelloParser. - if (wrap->is_client()) - return; + if (wrap->is_client()) return; crypto::NodeBIO::FromBIO(wrap->enc_in_)->set_initial(kMaxHelloLength); - wrap->hello_parser_.Start(SSLWrap::OnClientHello, - OnClientHelloParseEnd, - wrap); + wrap->hello_parser_.Start( + SSLWrap::OnClientHello, OnClientHelloParseEnd, wrap); } - void TLSWrap::DestroySSL(const FunctionCallbackInfo& args) { TLSWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); @@ -823,24 +764,20 @@ void TLSWrap::DestroySSL(const FunctionCallbackInfo& args) { wrap->enc_in_ = nullptr; wrap->enc_out_ = nullptr; - if (wrap->stream_ != nullptr) - wrap->stream_->RemoveStreamListener(wrap); + if (wrap->stream_ != nullptr) wrap->stream_->RemoveStreamListener(wrap); } - void TLSWrap::EnableCertCb(const FunctionCallbackInfo& args) { TLSWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); wrap->WaitForCertCb(OnClientHelloParseEnd, wrap); } - void TLSWrap::OnClientHelloParseEnd(void* arg) { TLSWrap* c = static_cast(arg); c->Cycle(); } - void TLSWrap::GetServername(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -849,8 +786,8 @@ void TLSWrap::GetServername(const FunctionCallbackInfo& args) { CHECK_NOT_NULL(wrap->ssl_); - const char* servername = SSL_get_servername(wrap->ssl_.get(), - TLSEXT_NAMETYPE_host_name); + const char* servername = + SSL_get_servername(wrap->ssl_.get(), TLSEXT_NAMETYPE_host_name); if (servername != nullptr) { args.GetReturnValue().Set(OneByteString(env->isolate(), servername)); } else { @@ -858,7 +795,6 @@ void TLSWrap::GetServername(const FunctionCallbackInfo& args) { } } - void TLSWrap::SetServername(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -876,15 +812,13 @@ void TLSWrap::SetServername(const FunctionCallbackInfo& args) { SSL_set_tlsext_host_name(wrap->ssl_.get(), *servername); } - int TLSWrap::SelectSNIContextCallback(SSL* s, int* ad, void* arg) { TLSWrap* p = static_cast(SSL_get_app_data(s)); Environment* env = p->env(); const char* servername = SSL_get_servername(s, TLSEXT_NAMETYPE_host_name); - if (servername == nullptr) - return SSL_TLSEXT_ERR_OK; + if (servername == nullptr) return SSL_TLSEXT_ERR_OK; HandleScope handle_scope(env->isolate()); Context::Scope context_scope(env->context()); @@ -897,8 +831,7 @@ int TLSWrap::SelectSNIContextCallback(SSL* s, int* ad, void* arg) { return SSL_TLSEXT_ERR_NOACK; // Not an object, probably undefined or null - if (!ctx->IsObject()) - return SSL_TLSEXT_ERR_NOACK; + if (!ctx->IsObject()) return SSL_TLSEXT_ERR_NOACK; Local cons = env->secure_context_constructor_template(); if (!cons->HasInstance(ctx)) { @@ -916,7 +849,6 @@ int TLSWrap::SelectSNIContextCallback(SSL* s, int* ad, void* arg) { return SSL_TLSEXT_ERR_OK; } - void TLSWrap::GetWriteQueueSize(const FunctionCallbackInfo& info) { TLSWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, info.This()); @@ -930,7 +862,6 @@ void TLSWrap::GetWriteQueueSize(const FunctionCallbackInfo& info) { info.GetReturnValue().Set(write_queue_size); } - void TLSWrap::MemoryInfo(MemoryTracker* tracker) const { tracker->TrackField("error", error_); tracker->TrackField("pending_cleartext_input", pending_cleartext_input_); @@ -940,7 +871,6 @@ void TLSWrap::MemoryInfo(MemoryTracker* tracker) const { tracker->TrackField("enc_out", crypto::NodeBIO::FromBIO(enc_out_)); } - void TLSWrap::Initialize(Local target, Local unused, Local context, @@ -982,9 +912,11 @@ void TLSWrap::Initialize(Local target, env->set_tls_wrap_constructor_function( t->GetFunction(env->context()).ToLocalChecked()); - target->Set(env->context(), - tlsWrapString, - t->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + tlsWrapString, + t->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); } } // namespace node diff --git a/src/tls_wrap.h b/src/tls_wrap.h index d3cbb992bafb29..4ca60e072acc26 100644 --- a/src/tls_wrap.h +++ b/src/tls_wrap.h @@ -43,7 +43,7 @@ class WriteWrap; namespace crypto { class SecureContext; class NodeBIO; -} +} // namespace crypto class TLSWrap : public AsyncWrap, public crypto::SSLWrap, @@ -66,7 +66,6 @@ class TLSWrap : public AsyncWrap, v8::Local req_wrap_object) override; AsyncWrap* GetAsyncWrap() override; - // Implement StreamResource: int ReadStart() override; // Exposed to JS int ReadStop() override; // Exposed to JS @@ -80,7 +79,6 @@ class TLSWrap : public AsyncWrap, // Reset error_ string to empty. Not related to "clear text". void ClearError() override; - // Called by the done() callback of the 'newSession' event. void NewSessionDoneCb(); @@ -120,8 +118,8 @@ class TLSWrap : public AsyncWrap, // // EncIn() doesn't exist. Encrypted data is pushed from underlying stream into // enc_in_ via the stream listener's OnStreamAlloc()/OnStreamRead() interface. - void EncOut(); // Write encrypted data from enc_out_ to underlying stream. - void ClearIn(); // SSL_write() clear data "in" to SSL. + void EncOut(); // Write encrypted data from enc_out_ to underlying stream. + void ClearIn(); // SSL_write() clear data "in" to SSL. void ClearOut(); // SSL_read() clear text "out" from SSL. // Call Done() on outstanding WriteWrap request. @@ -132,8 +130,7 @@ class TLSWrap : public AsyncWrap, // underlying stream even if there is no clear text to read or write. inline void Cycle() { // Prevent recursion - if (++cycle_depth_ > 1) - return; + if (++cycle_depth_ > 1) return; for (; cycle_depth_ > 0; cycle_depth_--) { ClearIn(); diff --git a/src/tracing/agent.cc b/src/tracing/agent.cc index 3d19c6c75844fc..9772ffe61e4761 100644 --- a/src/tracing/agent.cc +++ b/src/tracing/agent.cc @@ -1,19 +1,20 @@ #include "tracing/agent.h" #include -#include "trace_event.h" -#include "tracing/node_trace_buffer.h" #include "debug_utils.h" #include "env-inl.h" +#include "trace_event.h" +#include "tracing/node_trace_buffer.h" namespace node { namespace tracing { class Agent::ScopedSuspendTracing { public: - ScopedSuspendTracing(TracingController* controller, Agent* agent, + ScopedSuspendTracing(TracingController* controller, + Agent* agent, bool do_suspend = true) - : controller_(controller), agent_(do_suspend ? agent : nullptr) { + : controller_(controller), agent_(do_suspend ? agent : nullptr) { if (do_suspend) { CHECK(agent_->started_); controller->StopTracing(); @@ -45,9 +46,9 @@ std::set flatten( } // namespace +using std::string; using v8::platform::tracing::TraceConfig; using v8::platform::tracing::TraceWriter; -using std::string; Agent::Agent() : tracing_controller_(new TracingController()) { tracing_controller_->Initialize(nullptr); @@ -56,9 +57,11 @@ Agent::Agent() : tracing_controller_(new TracingController()) { CHECK_EQ(uv_async_init(&tracing_loop_, &initialize_writer_async_, [](uv_async_t* async) { - Agent* agent = ContainerOf(&Agent::initialize_writer_async_, async); - agent->InitializeWritersOnThread(); - }), 0); + Agent* agent = ContainerOf( + &Agent::initialize_writer_async_, async); + agent->InitializeWritersOnThread(); + }), + 0); uv_unref(reinterpret_cast(&initialize_writer_async_)); } @@ -84,27 +87,28 @@ Agent::~Agent() { } void Agent::Start() { - if (started_) - return; + if (started_) return; - NodeTraceBuffer* trace_buffer_ = new NodeTraceBuffer( - NodeTraceBuffer::kBufferChunks, this, &tracing_loop_); + NodeTraceBuffer* trace_buffer_ = + new NodeTraceBuffer(NodeTraceBuffer::kBufferChunks, this, &tracing_loop_); tracing_controller_->Initialize(trace_buffer_); // This thread should be created *after* async handles are created // (within NodeTraceWriter and NodeTraceBuffer constructors). // Otherwise the thread could shut down prematurely. - CHECK_EQ(0, uv_thread_create(&thread_, [](void* arg) { - Agent* agent = static_cast(arg); - uv_run(&agent->tracing_loop_, UV_RUN_DEFAULT); - }, this)); + CHECK_EQ(0, + uv_thread_create(&thread_, + [](void* arg) { + Agent* agent = static_cast(arg); + uv_run(&agent->tracing_loop_, UV_RUN_DEFAULT); + }, + this)); started_ = true; } -AgentWriterHandle Agent::AddClient( - const std::set& categories, - std::unique_ptr writer, - enum UseDefaultCategoryMode mode) { +AgentWriterHandle Agent::AddClient(const std::set& categories, + std::unique_ptr writer, + enum UseDefaultCategoryMode mode) { Start(); const std::set* use_categories = &categories; @@ -121,7 +125,7 @@ AgentWriterHandle Agent::AddClient( int id = next_writer_id_++; AsyncTraceWriter* raw = writer.get(); writers_[id] = std::move(writer); - categories_[id] = { use_categories->begin(), use_categories->end() }; + categories_[id] = {use_categories->begin(), use_categories->end()}; { Mutex::ScopedLock lock(initialize_writer_mutex_); @@ -139,8 +143,7 @@ AgentWriterHandle Agent::DefaultHandle() { } void Agent::StopTracing() { - if (!started_) - return; + if (!started_) return; // Perform final Flush on TraceBuffer. We don't want the tracing controller // to flush the buffer again on destruction of the V8::Platform. tracing_controller_->StopTracing(); @@ -163,28 +166,25 @@ void Agent::Disconnect(int client) { } void Agent::Enable(int id, const std::set& categories) { - if (categories.empty()) - return; + if (categories.empty()) return; - ScopedSuspendTracing suspend(tracing_controller_.get(), this, - id != kDefaultHandleId); + ScopedSuspendTracing suspend( + tracing_controller_.get(), this, id != kDefaultHandleId); categories_[id].insert(categories.begin(), categories.end()); } void Agent::Disable(int id, const std::set& categories) { - ScopedSuspendTracing suspend(tracing_controller_.get(), this, - id != kDefaultHandleId); + ScopedSuspendTracing suspend( + tracing_controller_.get(), this, id != kDefaultHandleId); std::multiset& writer_categories = categories_[id]; for (const std::string& category : categories) { auto it = writer_categories.find(category); - if (it != writer_categories.end()) - writer_categories.erase(it); + if (it != writer_categories.end()) writer_categories.erase(it); } } TraceConfig* Agent::CreateTraceConfig() const { - if (categories_.empty()) - return nullptr; + if (categories_.empty()) return nullptr; TraceConfig* trace_config = new TraceConfig(); for (const auto& category : flatten(categories_)) { trace_config->AddIncludedCategory(category.c_str()); @@ -195,8 +195,7 @@ TraceConfig* Agent::CreateTraceConfig() const { std::string Agent::GetEnabledCategories() const { std::string categories; for (const std::string& category : flatten(categories_)) { - if (!categories.empty()) - categories += ','; + if (!categories.empty()) categories += ','; categories += category; } return categories; @@ -215,12 +214,10 @@ void Agent::AddMetadataEvent(std::unique_ptr event) { void Agent::Flush(bool blocking) { { Mutex::ScopedLock lock(metadata_events_mutex_); - for (const auto& event : metadata_events_) - AppendTraceEvent(event.get()); + for (const auto& event : metadata_events_) AppendTraceEvent(event.get()); } - for (const auto& id_writer : writers_) - id_writer.second->Flush(blocking); + for (const auto& id_writer : writers_) id_writer.second->Flush(blocking); } void TracingController::AddMetadataEvent( @@ -233,15 +230,20 @@ void TracingController::AddMetadataEvent( std::unique_ptr* convertable_values, unsigned int flags) { std::unique_ptr trace_event(new TraceObject); - trace_event->Initialize( - TRACE_EVENT_PHASE_METADATA, category_group_enabled, name, - node::tracing::kGlobalScope, // scope - node::tracing::kNoId, // id - node::tracing::kNoId, // bind_id - num_args, arg_names, arg_types, arg_values, convertable_values, - TRACE_EVENT_FLAG_NONE, - CurrentTimestampMicroseconds(), - CurrentCpuTimestampMicroseconds()); + trace_event->Initialize(TRACE_EVENT_PHASE_METADATA, + category_group_enabled, + name, + node::tracing::kGlobalScope, // scope + node::tracing::kNoId, // id + node::tracing::kNoId, // bind_id + num_args, + arg_names, + arg_types, + arg_values, + convertable_values, + TRACE_EVENT_FLAG_NONE, + CurrentTimestampMicroseconds(), + CurrentCpuTimestampMicroseconds()); node::tracing::TraceEventHelper::GetAgent()->AddMetadataEvent( std::move(trace_event)); } diff --git a/src/tracing/agent.h b/src/tracing/agent.h index 62073ba6b214ef..041115a745f0c7 100644 --- a/src/tracing/agent.h +++ b/src/tracing/agent.h @@ -2,10 +2,10 @@ #define SRC_TRACING_AGENT_H_ #include "libplatform/v8-tracing.h" +#include "node_mutex.h" +#include "util.h" #include "uv.h" #include "v8.h" -#include "util.h" -#include "node_mutex.h" #include #include @@ -32,9 +32,7 @@ class TracingController : public v8::platform::tracing::TracingController { public: TracingController() : v8::platform::tracing::TracingController() {} - int64_t CurrentTimestampMicroseconds() override { - return uv_hrtime() / 1000; - } + int64_t CurrentTimestampMicroseconds() override { return uv_hrtime() / 1000; } void AddMetadataEvent( const unsigned char* category_group_enabled, const char* name, @@ -149,8 +147,7 @@ class Agent { }; void AgentWriterHandle::reset() { - if (agent_ != nullptr) - agent_->Disconnect(id_); + if (agent_ != nullptr) agent_->Disconnect(id_); agent_ = nullptr; } diff --git a/src/tracing/node_trace_buffer.cc b/src/tracing/node_trace_buffer.cc index 796c9f529288e5..fa79c6121795df 100644 --- a/src/tracing/node_trace_buffer.cc +++ b/src/tracing/node_trace_buffer.cc @@ -4,10 +4,10 @@ namespace node { namespace tracing { -InternalTraceBuffer::InternalTraceBuffer(size_t max_chunks, uint32_t id, +InternalTraceBuffer::InternalTraceBuffer(size_t max_chunks, + uint32_t id, Agent* agent) - : flushing_(false), max_chunks_(max_chunks), - agent_(agent), id_(id) { + : flushing_(false), max_chunks_(max_chunks), agent_(agent), id_(id) { chunks_.resize(max_chunks); } @@ -76,15 +76,20 @@ void InternalTraceBuffer::Flush(bool blocking) { agent_->Flush(blocking); } -uint64_t InternalTraceBuffer::MakeHandle( - size_t chunk_index, uint32_t chunk_seq, size_t event_index) const { +uint64_t InternalTraceBuffer::MakeHandle(size_t chunk_index, + uint32_t chunk_seq, + size_t event_index) const { return ((static_cast(chunk_seq) * Capacity() + - chunk_index * TraceBufferChunk::kChunkSize + event_index) << 1) + id_; + chunk_index * TraceBufferChunk::kChunkSize + event_index) + << 1) + + id_; } -void InternalTraceBuffer::ExtractHandle( - uint64_t handle, uint32_t* buffer_id, size_t* chunk_index, - uint32_t* chunk_seq, size_t* event_index) const { +void InternalTraceBuffer::ExtractHandle(uint64_t handle, + uint32_t* buffer_id, + size_t* chunk_index, + uint32_t* chunk_seq, + size_t* event_index) const { *buffer_id = static_cast(handle & 0x1); handle >>= 1; *chunk_seq = static_cast(handle / Capacity()); @@ -94,15 +99,16 @@ void InternalTraceBuffer::ExtractHandle( } NodeTraceBuffer::NodeTraceBuffer(size_t max_chunks, - Agent* agent, uv_loop_t* tracing_loop) + Agent* agent, + uv_loop_t* tracing_loop) : tracing_loop_(tracing_loop), buffer1_(max_chunks, 0, agent), buffer2_(max_chunks, 1, agent) { current_buf_.store(&buffer1_); flush_signal_.data = this; - int err = uv_async_init(tracing_loop_, &flush_signal_, - NonBlockingFlushSignalCb); + int err = + uv_async_init(tracing_loop_, &flush_signal_, NonBlockingFlushSignalCb); CHECK_EQ(err, 0); exit_signal_.data = this; @@ -147,8 +153,8 @@ bool NodeTraceBuffer::TryLoadAvailableBuffer() { InternalTraceBuffer* prev_buf = current_buf_.load(); if (prev_buf->IsFull()) { uv_async_send(&flush_signal_); // trigger flush on a separate thread - InternalTraceBuffer* other_buf = prev_buf == &buffer1_ ? - &buffer2_ : &buffer1_; + InternalTraceBuffer* other_buf = + prev_buf == &buffer1_ ? &buffer2_ : &buffer1_; if (!other_buf->IsFull()) { current_buf_.store(other_buf); } else { @@ -171,26 +177,25 @@ void NodeTraceBuffer::NonBlockingFlushSignalCb(uv_async_t* signal) { // static void NodeTraceBuffer::ExitSignalCb(uv_async_t* signal) { - NodeTraceBuffer* buffer = - ContainerOf(&NodeTraceBuffer::exit_signal_, signal); + NodeTraceBuffer* buffer = ContainerOf(&NodeTraceBuffer::exit_signal_, signal); // Close both flush_signal_ and exit_signal_. uv_close(reinterpret_cast(&buffer->flush_signal_), [](uv_handle_t* signal) { - NodeTraceBuffer* buffer = - ContainerOf(&NodeTraceBuffer::flush_signal_, - reinterpret_cast(signal)); - - uv_close(reinterpret_cast(&buffer->exit_signal_), - [](uv_handle_t* signal) { - NodeTraceBuffer* buffer = - ContainerOf(&NodeTraceBuffer::exit_signal_, - reinterpret_cast(signal)); - Mutex::ScopedLock scoped_lock(buffer->exit_mutex_); - buffer->exited_ = true; - buffer->exit_cond_.Signal(scoped_lock); - }); - }); + NodeTraceBuffer* buffer = + ContainerOf(&NodeTraceBuffer::flush_signal_, + reinterpret_cast(signal)); + + uv_close(reinterpret_cast(&buffer->exit_signal_), + [](uv_handle_t* signal) { + NodeTraceBuffer* buffer = + ContainerOf(&NodeTraceBuffer::exit_signal_, + reinterpret_cast(signal)); + Mutex::ScopedLock scoped_lock(buffer->exit_mutex_); + buffer->exited_ = true; + buffer->exit_cond_.Signal(scoped_lock); + }); + }); } } // namespace tracing diff --git a/src/tracing/node_trace_buffer.h b/src/tracing/node_trace_buffer.h index b59ae4f0a0e4ef..d5d3871cc23083 100644 --- a/src/tracing/node_trace_buffer.h +++ b/src/tracing/node_trace_buffer.h @@ -1,9 +1,9 @@ #ifndef SRC_TRACING_NODE_TRACE_BUFFER_H_ #define SRC_TRACING_NODE_TRACE_BUFFER_H_ -#include "tracing/agent.h" -#include "node_mutex.h" #include "libplatform/v8-tracing.h" +#include "node_mutex.h" +#include "tracing/agent.h" #include @@ -27,15 +27,17 @@ class InternalTraceBuffer { bool IsFull() const { return total_chunks_ == max_chunks_ && chunks_[total_chunks_ - 1]->IsFull(); } - bool IsFlushing() const { - return flushing_; - } + bool IsFlushing() const { return flushing_; } private: - uint64_t MakeHandle(size_t chunk_index, uint32_t chunk_seq, + uint64_t MakeHandle(size_t chunk_index, + uint32_t chunk_seq, size_t event_index) const; - void ExtractHandle(uint64_t handle, uint32_t* buffer_id, size_t* chunk_index, - uint32_t* chunk_seq, size_t* event_index) const; + void ExtractHandle(uint64_t handle, + uint32_t* buffer_id, + size_t* chunk_index, + uint32_t* chunk_seq, + size_t* event_index) const; size_t Capacity() const { return max_chunks_ * TraceBufferChunk::kChunkSize; } Mutex mutex_; diff --git a/src/tracing/node_trace_writer.cc b/src/tracing/node_trace_writer.cc index b93688cc958faa..4ccadedc7f2b8e 100644 --- a/src/tracing/node_trace_writer.cc +++ b/src/tracing/node_trace_writer.cc @@ -1,7 +1,7 @@ #include "tracing/node_trace_writer.h" -#include #include +#include #include "util-inl.h" @@ -16,12 +16,12 @@ void NodeTraceWriter::InitializeOnThread(uv_loop_t* loop) { tracing_loop_ = loop; flush_signal_.data = this; - int err = uv_async_init(tracing_loop_, &flush_signal_, - [](uv_async_t* signal) { - NodeTraceWriter* trace_writer = - ContainerOf(&NodeTraceWriter::flush_signal_, signal); - trace_writer->FlushPrivate(); - }); + int err = + uv_async_init(tracing_loop_, &flush_signal_, [](uv_async_t* signal) { + NodeTraceWriter* trace_writer = + ContainerOf(&NodeTraceWriter::flush_signal_, signal); + trace_writer->FlushPrivate(); + }); CHECK_EQ(err, 0); exit_signal_.data = this; @@ -85,13 +85,18 @@ void NodeTraceWriter::OpenNewFileForStreaming() { uv_fs_req_cleanup(&req); } - fd_ = uv_fs_open(nullptr, &req, filepath.c_str(), - O_CREAT | O_WRONLY | O_TRUNC, 0644, nullptr); + fd_ = uv_fs_open(nullptr, + &req, + filepath.c_str(), + O_CREAT | O_WRONLY | O_TRUNC, + 0644, + nullptr); uv_fs_req_cleanup(&req); if (fd_ < 0) { - fprintf(stderr, "Could not open trace file %s: %s\n", - filepath.c_str(), - uv_strerror(fd_)); + fprintf(stderr, + "Could not open trace file %s: %s\n", + filepath.c_str(), + uv_strerror(fd_)); fd_ = -1; } } @@ -143,8 +148,7 @@ void NodeTraceWriter::Flush(bool blocking) { // protects json_trace_writer_, and without request_mutex_ there might be // a time window in which the stream state changes? Mutex::ScopedLock stream_mutex_lock(stream_mutex_); - if (!json_trace_writer_) - return; + if (!json_trace_writer_) return; } int request_id = ++num_write_requests_; int err = uv_async_send(&flush_signal_); @@ -165,13 +169,10 @@ void NodeTraceWriter::WriteToFile(std::string&& str, int highest_request_id) { uv_buf_t buf = uv_buf_init(nullptr, 0); { Mutex::ScopedLock lock(request_mutex_); - write_req_queue_.emplace(WriteRequest { - std::move(str), highest_request_id - }); + write_req_queue_.emplace(WriteRequest{std::move(str), highest_request_id}); if (write_req_queue_.size() == 1) { - buf = uv_buf_init( - const_cast(write_req_queue_.front().str.c_str()), - write_req_queue_.front().str.length()); + buf = uv_buf_init(const_cast(write_req_queue_.front().str.c_str()), + write_req_queue_.front().str.length()); } } // Only one write request for the same file descriptor should be active at @@ -183,8 +184,7 @@ void NodeTraceWriter::WriteToFile(std::string&& str, int highest_request_id) { void NodeTraceWriter::StartWrite(uv_buf_t buf) { int err = uv_fs_write( - tracing_loop_, &write_req_, fd_, &buf, 1, -1, - [](uv_fs_t* req) { + tracing_loop_, &write_req_, fd_, &buf, 1, -1, [](uv_fs_t* req) { NodeTraceWriter* writer = ContainerOf(&NodeTraceWriter::write_req_, req); writer->AfterWrite(); @@ -204,9 +204,8 @@ void NodeTraceWriter::AfterWrite() { highest_request_id_completed_ = highest_request_id; request_cond_.Broadcast(scoped_lock); if (!write_req_queue_.empty()) { - buf = uv_buf_init( - const_cast(write_req_queue_.front().str.c_str()), - write_req_queue_.front().str.length()); + buf = uv_buf_init(const_cast(write_req_queue_.front().str.c_str()), + write_req_queue_.front().str.length()); } } if (buf.base != nullptr && fd_ != -1) { diff --git a/src/tracing/node_trace_writer.h b/src/tracing/node_trace_writer.h index f412587ab93219..4c9c8e7a07d8a7 100644 --- a/src/tracing/node_trace_writer.h +++ b/src/tracing/node_trace_writer.h @@ -1,8 +1,8 @@ #ifndef SRC_TRACING_NODE_TRACE_WRITER_H_ #define SRC_TRACING_NODE_TRACE_WRITER_H_ -#include #include +#include #include "libplatform/v8-tracing.h" #include "tracing/agent.h" diff --git a/src/tracing/trace_event.h b/src/tracing/trace_event.h index d5d4befb14600a..26140f3618a5cc 100644 --- a/src/tracing/trace_event.h +++ b/src/tracing/trace_event.h @@ -6,14 +6,13 @@ #define SRC_TRACING_TRACE_EVENT_H_ #include "node_platform.h" -#include "v8-platform.h" #include "trace_event_common.h" +#include "v8-platform.h" // This header file defines implementation details of how the trace macros in // trace_event_common.h collect and store trace events. Anything not // implementation-specific should go in trace_macros_common.h instead of here. - // The pointer returned from GetCategoryGroupEnabled() points to a // value with zero or more of the following bits. Used in this class only. // The TRACE_EVENT macros should only use the value as a bool. @@ -42,12 +41,12 @@ enum CategoryGroupEnabledFlags { // By default, trace IDs are eventually converted to a single 64-bit number. Use // this macro to add a scope string. -#define TRACE_ID_WITH_SCOPE(scope, id) \ +#define TRACE_ID_WITH_SCOPE(scope, id) \ trace_event_internal::TraceID::WithScope(scope, id) -#define INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE() \ - *INTERNAL_TRACE_EVENT_UID(category_group_enabled) & \ - (kEnabledForRecording_CategoryGroupEnabledFlags | \ +#define INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE() \ + *INTERNAL_TRACE_EVENT_UID(category_group_enabled) & \ + (kEnabledForRecording_CategoryGroupEnabledFlags | \ kEnabledForEventCallback_CategoryGroupEnabledFlags) // The following macro has no implementation, but it needs to exist since @@ -68,8 +67,8 @@ enum CategoryGroupEnabledFlags { // for best performance when tracing is disabled. // const uint8_t* // TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(const char* category_group) -#define TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED \ - node::tracing::TraceEventHelper::GetTracingController() \ +#define TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED \ + node::tracing::TraceEventHelper::GetTracingController() \ ->GetCategoryGroupEnabled // Get the number of times traces have been recorded. This is used to implement @@ -106,7 +105,7 @@ enum CategoryGroupEnabledFlags { // const uint64_t* arg_values, // unsigned int flags, // int64_t timestamp) -#define TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_TIMESTAMP \ +#define TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_TIMESTAMP \ node::tracing::AddTraceEventWithTimestampImpl // Set the duration field of a COMPLETE trace event. @@ -114,8 +113,8 @@ enum CategoryGroupEnabledFlags { // const uint8_t* category_group_enabled, // const char* name, // uint64_t id) -#define TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION \ - node::tracing::TraceEventHelper::GetTracingController() \ +#define TRACE_EVENT_API_UPDATE_TRACE_EVENT_DURATION \ + node::tracing::TraceEventHelper::GetTracingController() \ ->UpdateTraceEventDuration // Adds a metadata event to the trace log. The |AppendValueAsTraceFormat| method @@ -139,7 +138,7 @@ enum CategoryGroupEnabledFlags { // variable a unique name based on the line number to prevent name collisions. #define INTERNAL_TRACE_EVENT_UID3(a, b) trace_event_unique_##a##b #define INTERNAL_TRACE_EVENT_UID2(a, b) INTERNAL_TRACE_EVENT_UID3(a, b) -#define INTERNAL_TRACE_EVENT_UID(name_prefix) \ +#define INTERNAL_TRACE_EVENT_UID(name_prefix) \ INTERNAL_TRACE_EVENT_UID2(name_prefix, __LINE__) // Implementation detail: internal macro to create static category. @@ -149,154 +148,182 @@ enum CategoryGroupEnabledFlags { // TODO(fmeawad): This implementation contradicts that we can have a different // configuration for each isolate, // https://code.google.com/p/v8/issues/detail?id=4563 -#define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO_CUSTOM_VARIABLES( \ - category_group, atomic, category_group_enabled) \ - category_group_enabled = \ - reinterpret_cast(TRACE_EVENT_API_ATOMIC_LOAD(atomic)); \ - if (!category_group_enabled) { \ - category_group_enabled = \ - TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group); \ - TRACE_EVENT_API_ATOMIC_STORE( \ - atomic, reinterpret_cast( \ - category_group_enabled)); \ +#define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO_CUSTOM_VARIABLES( \ + category_group, atomic, category_group_enabled) \ + category_group_enabled = \ + reinterpret_cast(TRACE_EVENT_API_ATOMIC_LOAD(atomic)); \ + if (!category_group_enabled) { \ + category_group_enabled = \ + TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED(category_group); \ + TRACE_EVENT_API_ATOMIC_STORE( \ + atomic, \ + reinterpret_cast( \ + category_group_enabled)); \ } -#define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group) \ - static TRACE_EVENT_API_ATOMIC_WORD INTERNAL_TRACE_EVENT_UID(atomic) = 0; \ - const uint8_t* INTERNAL_TRACE_EVENT_UID(category_group_enabled); \ - INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO_CUSTOM_VARIABLES( \ - category_group, INTERNAL_TRACE_EVENT_UID(atomic), \ +#define INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group) \ + static TRACE_EVENT_API_ATOMIC_WORD INTERNAL_TRACE_EVENT_UID(atomic) = 0; \ + const uint8_t* INTERNAL_TRACE_EVENT_UID(category_group_enabled); \ + INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO_CUSTOM_VARIABLES( \ + category_group, \ + INTERNAL_TRACE_EVENT_UID(atomic), \ INTERNAL_TRACE_EVENT_UID(category_group_enabled)); // Implementation detail: internal macro to create static category and add // event if the category is enabled. -#define INTERNAL_TRACE_EVENT_ADD(phase, category_group, name, flags, ...) \ - do { \ - INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ - if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ - node::tracing::AddTraceEvent( \ - phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \ - node::tracing::kGlobalScope, node::tracing::kNoId, \ - node::tracing::kNoId, flags, ##__VA_ARGS__); \ - } \ +#define INTERNAL_TRACE_EVENT_ADD(phase, category_group, name, flags, ...) \ + do { \ + INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ + if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ + node::tracing::AddTraceEvent( \ + phase, \ + INTERNAL_TRACE_EVENT_UID(category_group_enabled), \ + name, \ + node::tracing::kGlobalScope, \ + node::tracing::kNoId, \ + node::tracing::kNoId, \ + flags, \ + ##__VA_ARGS__); \ + } \ } while (0) // Implementation detail: internal macro to create static category and add begin // event if the category is enabled. Also adds the end event when the scope // ends. -#define INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name, ...) \ - INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ - node::tracing::ScopedTracer INTERNAL_TRACE_EVENT_UID(tracer); \ - if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ - uint64_t h = node::tracing::AddTraceEvent( \ - TRACE_EVENT_PHASE_COMPLETE, \ - INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \ - node::tracing::kGlobalScope, node::tracing::kNoId, \ - node::tracing::kNoId, TRACE_EVENT_FLAG_NONE, ##__VA_ARGS__); \ - INTERNAL_TRACE_EVENT_UID(tracer) \ - .Initialize(INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \ - h); \ +#define INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name, ...) \ + INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ + node::tracing::ScopedTracer INTERNAL_TRACE_EVENT_UID(tracer); \ + if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ + uint64_t h = node::tracing::AddTraceEvent( \ + TRACE_EVENT_PHASE_COMPLETE, \ + INTERNAL_TRACE_EVENT_UID(category_group_enabled), \ + name, \ + node::tracing::kGlobalScope, \ + node::tracing::kNoId, \ + node::tracing::kNoId, \ + TRACE_EVENT_FLAG_NONE, \ + ##__VA_ARGS__); \ + INTERNAL_TRACE_EVENT_UID(tracer).Initialize( \ + INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, h); \ } -#define INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW(category_group, name, \ - bind_id, flow_flags, ...) \ - INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ - node::tracing::ScopedTracer INTERNAL_TRACE_EVENT_UID(tracer); \ - if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ - unsigned int trace_event_flags = flow_flags; \ - node::tracing::TraceID trace_event_bind_id(bind_id, \ - &trace_event_flags); \ - uint64_t h = node::tracing::AddTraceEvent( \ - TRACE_EVENT_PHASE_COMPLETE, \ - INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \ - node::tracing::kGlobalScope, node::tracing::kNoId, \ - trace_event_bind_id.raw_id(), trace_event_flags, ##__VA_ARGS__); \ - INTERNAL_TRACE_EVENT_UID(tracer) \ - .Initialize(INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \ - h); \ +#define INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW( \ + category_group, name, bind_id, flow_flags, ...) \ + INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ + node::tracing::ScopedTracer INTERNAL_TRACE_EVENT_UID(tracer); \ + if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ + unsigned int trace_event_flags = flow_flags; \ + node::tracing::TraceID trace_event_bind_id(bind_id, &trace_event_flags); \ + uint64_t h = node::tracing::AddTraceEvent( \ + TRACE_EVENT_PHASE_COMPLETE, \ + INTERNAL_TRACE_EVENT_UID(category_group_enabled), \ + name, \ + node::tracing::kGlobalScope, \ + node::tracing::kNoId, \ + trace_event_bind_id.raw_id(), \ + trace_event_flags, \ + ##__VA_ARGS__); \ + INTERNAL_TRACE_EVENT_UID(tracer).Initialize( \ + INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, h); \ } // Implementation detail: internal macro to create static category and add // event if the category is enabled. -#define INTERNAL_TRACE_EVENT_ADD_WITH_ID(phase, category_group, name, id, \ - flags, ...) \ +#define INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ + phase, category_group, name, id, flags, ...) \ do { \ INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ unsigned int trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \ - node::tracing::TraceID trace_event_trace_id(id, \ - &trace_event_flags); \ + node::tracing::TraceID trace_event_trace_id(id, &trace_event_flags); \ node::tracing::AddTraceEvent( \ - phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \ - trace_event_trace_id.scope(), trace_event_trace_id.raw_id(), \ - node::tracing::kNoId, trace_event_flags, ##__VA_ARGS__); \ + phase, \ + INTERNAL_TRACE_EVENT_UID(category_group_enabled), \ + name, \ + trace_event_trace_id.scope(), \ + trace_event_trace_id.raw_id(), \ + node::tracing::kNoId, \ + trace_event_flags, \ + ##__VA_ARGS__); \ } \ } while (0) // Adds a trace event with a given timestamp. -#define INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(phase, category_group, name, \ - timestamp, flags, ...) \ - do { \ - INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ - if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ - node::tracing::AddTraceEventWithTimestamp( \ - phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \ - node::tracing::kGlobalScope, node::tracing::kNoId, \ - node::tracing::kNoId, flags, timestamp, ##__VA_ARGS__); \ - } \ +#define INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \ + phase, category_group, name, timestamp, flags, ...) \ + do { \ + INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ + if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ + node::tracing::AddTraceEventWithTimestamp( \ + phase, \ + INTERNAL_TRACE_EVENT_UID(category_group_enabled), \ + name, \ + node::tracing::kGlobalScope, \ + node::tracing::kNoId, \ + node::tracing::kNoId, \ + flags, \ + timestamp, \ + ##__VA_ARGS__); \ + } \ } while (0) // Adds a trace event with a given id and timestamp. Not Implemented. -#define INTERNAL_TRACE_EVENT_ADD_WITH_ID_AND_TIMESTAMP( \ - phase, category_group, name, id, timestamp, flags, ...) \ +#define INTERNAL_TRACE_EVENT_ADD_WITH_ID_AND_TIMESTAMP( \ + phase, category_group, name, id, timestamp, flags, ...) \ UNIMPLEMENTED() // Adds a trace event with a given id, thread_id, and timestamp. Not // Implemented. -#define INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - phase, category_group, name, id, thread_id, timestamp, flags, ...) \ - do { \ - INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ - if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ - unsigned int trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \ - node::tracing::TraceID trace_event_trace_id(id, \ - &trace_event_flags); \ - node::tracing::AddTraceEventWithTimestamp( \ - phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \ - trace_event_trace_id.scope(), trace_event_trace_id.raw_id(), \ - node::tracing::kNoId, trace_event_flags, timestamp, ##__VA_ARGS__);\ - } \ +#define INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + phase, category_group, name, id, thread_id, timestamp, flags, ...) \ + do { \ + INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ + if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ + unsigned int trace_event_flags = flags | TRACE_EVENT_FLAG_HAS_ID; \ + node::tracing::TraceID trace_event_trace_id(id, &trace_event_flags); \ + node::tracing::AddTraceEventWithTimestamp( \ + phase, \ + INTERNAL_TRACE_EVENT_UID(category_group_enabled), \ + name, \ + trace_event_trace_id.scope(), \ + trace_event_trace_id.raw_id(), \ + node::tracing::kNoId, \ + trace_event_flags, \ + timestamp, \ + ##__VA_ARGS__); \ + } \ } while (0) -#define INTERNAL_TRACE_EVENT_METADATA_ADD(category_group, name, ...) \ - do { \ - INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ - if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ - TRACE_EVENT_API_ADD_METADATA_EVENT( \ - INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \ - ##__VA_ARGS__); \ - } \ - } while(0) +#define INTERNAL_TRACE_EVENT_METADATA_ADD(category_group, name, ...) \ + do { \ + INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ + if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ + TRACE_EVENT_API_ADD_METADATA_EVENT( \ + INTERNAL_TRACE_EVENT_UID(category_group_enabled), \ + name, \ + ##__VA_ARGS__); \ + } \ + } while (0) // Enter and leave a context based on the current scope. -#define INTERNAL_TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context) \ - struct INTERNAL_TRACE_EVENT_UID(ScopedContext) { \ - public: \ - INTERNAL_TRACE_EVENT_UID(ScopedContext)(uint64_t cid) : cid_(cid) { \ - TRACE_EVENT_ENTER_CONTEXT(category_group, name, cid_); \ - } \ - ~INTERNAL_TRACE_EVENT_UID(ScopedContext)() { \ - TRACE_EVENT_LEAVE_CONTEXT(category_group, name, cid_); \ - } \ - \ - private: \ - /* Local class friendly DISALLOW_COPY_AND_ASSIGN */ \ - INTERNAL_TRACE_EVENT_UID(ScopedContext) \ - (const INTERNAL_TRACE_EVENT_UID(ScopedContext)&) {} \ - void operator=(const INTERNAL_TRACE_EVENT_UID(ScopedContext)&) {} \ - uint64_t cid_; \ - }; \ - INTERNAL_TRACE_EVENT_UID(ScopedContext) \ +#define INTERNAL_TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context) \ + struct INTERNAL_TRACE_EVENT_UID(ScopedContext) { \ + public: \ + INTERNAL_TRACE_EVENT_UID(ScopedContext)(uint64_t cid) : cid_(cid) { \ + TRACE_EVENT_ENTER_CONTEXT(category_group, name, cid_); \ + } \ + ~INTERNAL_TRACE_EVENT_UID(ScopedContext)() { \ + TRACE_EVENT_LEAVE_CONTEXT(category_group, name, cid_); \ + } \ + \ + private: \ + /* Local class friendly DISALLOW_COPY_AND_ASSIGN */ \ + INTERNAL_TRACE_EVENT_UID(ScopedContext) \ + (const INTERNAL_TRACE_EVENT_UID(ScopedContext) &) {} \ + void operator=(const INTERNAL_TRACE_EVENT_UID(ScopedContext) &) {} \ + uint64_t cid_; \ + }; \ + INTERNAL_TRACE_EVENT_UID(ScopedContext) \ INTERNAL_TRACE_EVENT_UID(scoped_context)(context); namespace node { @@ -444,11 +471,17 @@ class TraceStringWithCopy { const char* str_; }; -static inline uint64_t AddTraceEventImpl( - char phase, const uint8_t* category_group_enabled, const char* name, - const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args, - const char** arg_names, const uint8_t* arg_types, - const uint64_t* arg_values, unsigned int flags) { +static inline uint64_t AddTraceEventImpl(char phase, + const uint8_t* category_group_enabled, + const char* name, + const char* scope, + uint64_t id, + uint64_t bind_id, + int32_t num_args, + const char** arg_names, + const uint8_t* arg_types, + const uint64_t* arg_values, + unsigned int flags) { std::unique_ptr arg_convertibles[2]; if (num_args > 0 && arg_types[0] == TRACE_VALUE_TYPE_CONVERTABLE) { arg_convertibles[0].reset(reinterpret_cast( @@ -461,16 +494,33 @@ static inline uint64_t AddTraceEventImpl( // DCHECK(num_args, 2); v8::TracingController* controller = node::tracing::TraceEventHelper::GetTracingController(); - return controller->AddTraceEvent(phase, category_group_enabled, name, scope, id, - bind_id, num_args, arg_names, arg_types, - arg_values, arg_convertibles, flags); + return controller->AddTraceEvent(phase, + category_group_enabled, + name, + scope, + id, + bind_id, + num_args, + arg_names, + arg_types, + arg_values, + arg_convertibles, + flags); } -static V8_INLINE uint64_t AddTraceEventWithTimestampImpl( - char phase, const uint8_t* category_group_enabled, const char* name, - const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args, - const char** arg_names, const uint8_t* arg_types, - const uint64_t* arg_values, unsigned int flags, int64_t timestamp) { +static V8_INLINE uint64_t +AddTraceEventWithTimestampImpl(char phase, + const uint8_t* category_group_enabled, + const char* name, + const char* scope, + uint64_t id, + uint64_t bind_id, + int32_t num_args, + const char** arg_names, + const uint8_t* arg_types, + const uint64_t* arg_values, + unsigned int flags, + int64_t timestamp) { std::unique_ptr arg_convertables[2]; if (num_args > 0 && arg_types[0] == TRACE_VALUE_TYPE_CONVERTABLE) { arg_convertables[0].reset(reinterpret_cast( @@ -483,15 +533,29 @@ static V8_INLINE uint64_t AddTraceEventWithTimestampImpl( // DCHECK_LE(num_args, 2); v8::TracingController* controller = node::tracing::TraceEventHelper::GetTracingController(); - return controller->AddTraceEventWithTimestamp( - phase, category_group_enabled, name, scope, id, bind_id, num_args, - arg_names, arg_types, arg_values, arg_convertables, flags, timestamp); + return controller->AddTraceEventWithTimestamp(phase, + category_group_enabled, + name, + scope, + id, + bind_id, + num_args, + arg_names, + arg_types, + arg_values, + arg_convertables, + flags, + timestamp); } static V8_INLINE void AddMetadataEventImpl( - const uint8_t* category_group_enabled, const char* name, int32_t num_args, - const char** arg_names, const uint8_t* arg_types, - const uint64_t* arg_values, unsigned int flags) { + const uint8_t* category_group_enabled, + const char* name, + int32_t num_args, + const char** arg_names, + const uint8_t* arg_types, + const uint64_t* arg_values, + unsigned int flags) { std::unique_ptr arg_convertibles[2]; if (num_args > 0 && arg_types[0] == TRACE_VALUE_TYPE_CONVERTABLE) { arg_convertibles[0].reset(reinterpret_cast( @@ -503,29 +567,34 @@ static V8_INLINE void AddMetadataEventImpl( } node::tracing::TracingController* controller = node::tracing::TraceEventHelper::GetTracingController(); - return controller->AddMetadataEvent( - category_group_enabled, name, num_args, arg_names, arg_types, arg_values, - arg_convertibles, flags); + return controller->AddMetadataEvent(category_group_enabled, + name, + num_args, + arg_names, + arg_types, + arg_values, + arg_convertibles, + flags); } // Define SetTraceValue for each allowed type. It stores the type and // value in the return arguments. This allows this API to avoid declaring any // structures so that it is portable to third_party libraries. -#define INTERNAL_DECLARE_SET_TRACE_VALUE(actual_type, union_member, \ - value_type_id) \ - static inline void SetTraceValue(actual_type arg, unsigned char* type, \ - uint64_t* value) { \ - TraceValueUnion type_value; \ - type_value.union_member = arg; \ - *type = value_type_id; \ - *value = type_value.as_uint; \ +#define INTERNAL_DECLARE_SET_TRACE_VALUE( \ + actual_type, union_member, value_type_id) \ + static inline void SetTraceValue( \ + actual_type arg, unsigned char* type, uint64_t* value) { \ + TraceValueUnion type_value; \ + type_value.union_member = arg; \ + *type = value_type_id; \ + *value = type_value.as_uint; \ } // Simpler form for int types that can be safely casted. -#define INTERNAL_DECLARE_SET_TRACE_VALUE_INT(actual_type, value_type_id) \ - static inline void SetTraceValue(actual_type arg, unsigned char* type, \ - uint64_t* value) { \ - *type = value_type_id; \ - *value = static_cast(arg); \ +#define INTERNAL_DECLARE_SET_TRACE_VALUE_INT(actual_type, value_type_id) \ + static inline void SetTraceValue( \ + actual_type arg, unsigned char* type, uint64_t* value) { \ + *type = value_type_id; \ + *value = static_cast(arg); \ } INTERNAL_DECLARE_SET_TRACE_VALUE_INT(uint64_t, TRACE_VALUE_TYPE_UINT) @@ -538,18 +607,23 @@ INTERNAL_DECLARE_SET_TRACE_VALUE_INT(int16_t, TRACE_VALUE_TYPE_INT) INTERNAL_DECLARE_SET_TRACE_VALUE_INT(signed char, TRACE_VALUE_TYPE_INT) INTERNAL_DECLARE_SET_TRACE_VALUE(bool, as_bool, TRACE_VALUE_TYPE_BOOL) INTERNAL_DECLARE_SET_TRACE_VALUE(double, as_double, TRACE_VALUE_TYPE_DOUBLE) -INTERNAL_DECLARE_SET_TRACE_VALUE(const void*, as_pointer, +INTERNAL_DECLARE_SET_TRACE_VALUE(const void*, + as_pointer, TRACE_VALUE_TYPE_POINTER) -INTERNAL_DECLARE_SET_TRACE_VALUE(const char*, as_string, +INTERNAL_DECLARE_SET_TRACE_VALUE(const char*, + as_string, TRACE_VALUE_TYPE_STRING) -INTERNAL_DECLARE_SET_TRACE_VALUE(const TraceStringWithCopy&, as_string, +INTERNAL_DECLARE_SET_TRACE_VALUE(const TraceStringWithCopy&, + as_string, TRACE_VALUE_TYPE_COPY_STRING) #undef INTERNAL_DECLARE_SET_TRACE_VALUE #undef INTERNAL_DECLARE_SET_TRACE_VALUE_INT -static inline void SetTraceValue(v8::ConvertableToTraceFormat* convertable_value, - unsigned char* type, uint64_t* value) { +static inline void SetTraceValue( + v8::ConvertableToTraceFormat* convertable_value, + unsigned char* type, + uint64_t* value) { *type = TRACE_VALUE_TYPE_CONVERTABLE; *value = static_cast(reinterpret_cast(convertable_value)); } @@ -568,101 +642,190 @@ SetTraceValue(std::unique_ptr ptr, unsigned char* type, uint64_t* value) { // the arg_values must live throughout these procedures. static inline uint64_t AddTraceEvent(char phase, - const uint8_t* category_group_enabled, - const char* name, const char* scope, - uint64_t id, uint64_t bind_id, - unsigned int flags) { - return TRACE_EVENT_API_ADD_TRACE_EVENT(phase, category_group_enabled, name, - scope, id, bind_id, kZeroNumArgs, - nullptr, nullptr, nullptr, flags); + const uint8_t* category_group_enabled, + const char* name, + const char* scope, + uint64_t id, + uint64_t bind_id, + unsigned int flags) { + return TRACE_EVENT_API_ADD_TRACE_EVENT(phase, + category_group_enabled, + name, + scope, + id, + bind_id, + kZeroNumArgs, + nullptr, + nullptr, + nullptr, + flags); } template -static inline uint64_t AddTraceEvent( - char phase, const uint8_t* category_group_enabled, const char* name, - const char* scope, uint64_t id, uint64_t bind_id, unsigned int flags, - const char* arg1_name, ARG1_TYPE&& arg1_val) { +static inline uint64_t AddTraceEvent(char phase, + const uint8_t* category_group_enabled, + const char* name, + const char* scope, + uint64_t id, + uint64_t bind_id, + unsigned int flags, + const char* arg1_name, + ARG1_TYPE&& arg1_val) { const int num_args = 1; uint8_t arg_type; uint64_t arg_value; SetTraceValue(std::forward(arg1_val), &arg_type, &arg_value); - return TRACE_EVENT_API_ADD_TRACE_EVENT( - phase, category_group_enabled, name, scope, id, bind_id, num_args, - &arg1_name, &arg_type, &arg_value, flags); + return TRACE_EVENT_API_ADD_TRACE_EVENT(phase, + category_group_enabled, + name, + scope, + id, + bind_id, + num_args, + &arg1_name, + &arg_type, + &arg_value, + flags); } template -static inline uint64_t AddTraceEvent( - char phase, const uint8_t* category_group_enabled, const char* name, - const char* scope, uint64_t id, uint64_t bind_id, unsigned int flags, - const char* arg1_name, ARG1_TYPE&& arg1_val, const char* arg2_name, - ARG2_TYPE&& arg2_val) { +static inline uint64_t AddTraceEvent(char phase, + const uint8_t* category_group_enabled, + const char* name, + const char* scope, + uint64_t id, + uint64_t bind_id, + unsigned int flags, + const char* arg1_name, + ARG1_TYPE&& arg1_val, + const char* arg2_name, + ARG2_TYPE&& arg2_val) { const int num_args = 2; const char* arg_names[2] = {arg1_name, arg2_name}; unsigned char arg_types[2]; uint64_t arg_values[2]; - SetTraceValue(std::forward(arg1_val), &arg_types[0], - &arg_values[0]); - SetTraceValue(std::forward(arg2_val), &arg_types[1], - &arg_values[1]); - return TRACE_EVENT_API_ADD_TRACE_EVENT( - phase, category_group_enabled, name, scope, id, bind_id, num_args, - arg_names, arg_types, arg_values, flags); + SetTraceValue( + std::forward(arg1_val), &arg_types[0], &arg_values[0]); + SetTraceValue( + std::forward(arg2_val), &arg_types[1], &arg_values[1]); + return TRACE_EVENT_API_ADD_TRACE_EVENT(phase, + category_group_enabled, + name, + scope, + id, + bind_id, + num_args, + arg_names, + arg_types, + arg_values, + flags); } -static V8_INLINE uint64_t AddTraceEventWithTimestamp( - char phase, const uint8_t* category_group_enabled, const char* name, - const char* scope, uint64_t id, uint64_t bind_id, unsigned int flags, - int64_t timestamp) { - return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_TIMESTAMP( - phase, category_group_enabled, name, scope, id, bind_id, kZeroNumArgs, - nullptr, nullptr, nullptr, flags, timestamp); +static V8_INLINE uint64_t +AddTraceEventWithTimestamp(char phase, + const uint8_t* category_group_enabled, + const char* name, + const char* scope, + uint64_t id, + uint64_t bind_id, + unsigned int flags, + int64_t timestamp) { + return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_TIMESTAMP(phase, + category_group_enabled, + name, + scope, + id, + bind_id, + kZeroNumArgs, + nullptr, + nullptr, + nullptr, + flags, + timestamp); } template -static V8_INLINE uint64_t AddTraceEventWithTimestamp( - char phase, const uint8_t* category_group_enabled, const char* name, - const char* scope, uint64_t id, uint64_t bind_id, unsigned int flags, - int64_t timestamp, const char* arg1_name, ARG1_TYPE&& arg1_val) { +static V8_INLINE uint64_t +AddTraceEventWithTimestamp(char phase, + const uint8_t* category_group_enabled, + const char* name, + const char* scope, + uint64_t id, + uint64_t bind_id, + unsigned int flags, + int64_t timestamp, + const char* arg1_name, + ARG1_TYPE&& arg1_val) { const int num_args = 1; uint8_t arg_type; uint64_t arg_value; SetTraceValue(std::forward(arg1_val), &arg_type, &arg_value); - return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_TIMESTAMP( - phase, category_group_enabled, name, scope, id, bind_id, num_args, - &arg1_name, &arg_type, &arg_value, flags, timestamp); + return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_TIMESTAMP(phase, + category_group_enabled, + name, + scope, + id, + bind_id, + num_args, + &arg1_name, + &arg_type, + &arg_value, + flags, + timestamp); } template -static V8_INLINE uint64_t AddTraceEventWithTimestamp( - char phase, const uint8_t* category_group_enabled, const char* name, - const char* scope, uint64_t id, uint64_t bind_id, unsigned int flags, - int64_t timestamp, const char* arg1_name, ARG1_TYPE&& arg1_val, - const char* arg2_name, ARG2_TYPE&& arg2_val) { +static V8_INLINE uint64_t +AddTraceEventWithTimestamp(char phase, + const uint8_t* category_group_enabled, + const char* name, + const char* scope, + uint64_t id, + uint64_t bind_id, + unsigned int flags, + int64_t timestamp, + const char* arg1_name, + ARG1_TYPE&& arg1_val, + const char* arg2_name, + ARG2_TYPE&& arg2_val) { const int num_args = 2; const char* arg_names[2] = {arg1_name, arg2_name}; unsigned char arg_types[2]; uint64_t arg_values[2]; - SetTraceValue(std::forward(arg1_val), &arg_types[0], - &arg_values[0]); - SetTraceValue(std::forward(arg2_val), &arg_types[1], - &arg_values[1]); - return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_TIMESTAMP( - phase, category_group_enabled, name, scope, id, bind_id, num_args, - arg_names, arg_types, arg_values, flags, timestamp); + SetTraceValue( + std::forward(arg1_val), &arg_types[0], &arg_values[0]); + SetTraceValue( + std::forward(arg2_val), &arg_types[1], &arg_values[1]); + return TRACE_EVENT_API_ADD_TRACE_EVENT_WITH_TIMESTAMP(phase, + category_group_enabled, + name, + scope, + id, + bind_id, + num_args, + arg_names, + arg_types, + arg_values, + flags, + timestamp); } template -static V8_INLINE void AddMetadataEvent( - const uint8_t* category_group_enabled, const char* name, - const char* arg1_name, ARG1_TYPE&& arg1_val) { +static V8_INLINE void AddMetadataEvent(const uint8_t* category_group_enabled, + const char* name, + const char* arg1_name, + ARG1_TYPE&& arg1_val) { const int num_args = 1; uint8_t arg_type; uint64_t arg_value; SetTraceValue(std::forward(arg1_val), &arg_type, &arg_value); - AddMetadataEventImpl( - category_group_enabled, name, num_args, &arg1_name, &arg_type, &arg_value, - TRACE_EVENT_FLAG_NONE); + AddMetadataEventImpl(category_group_enabled, + name, + num_args, + &arg1_name, + &arg_type, + &arg_value, + TRACE_EVENT_FLAG_NONE); } // Used by TRACE_EVENTx macros. Do not use directly. @@ -677,7 +840,8 @@ class ScopedTracer { data_.category_group_enabled, data_.name, data_.event_handle); } - void Initialize(const uint8_t* category_group_enabled, const char* name, + void Initialize(const uint8_t* category_group_enabled, + const char* name, uint64_t event_handle) { data_.category_group_enabled = category_group_enabled; data_.name = name; diff --git a/src/tracing/trace_event_common.h b/src/tracing/trace_event_common.h index 18dd6ec18b35f9..6e07be381a39f3 100644 --- a/src/tracing/trace_event_common.h +++ b/src/tracing/trace_event_common.h @@ -204,98 +204,158 @@ // enabled, then this does nothing. // - category and name strings must have application lifetime (statics or // literals). They may not include " chars. -#define TRACE_EVENT0(category_group, name) \ +#define TRACE_EVENT0(category_group, name) \ INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name) -#define TRACE_EVENT_WITH_FLOW0(category_group, name, bind_id, flow_flags) \ - INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW(category_group, name, bind_id, \ - flow_flags) -#define TRACE_EVENT1(category_group, name, arg1_name, arg1_val) \ +#define TRACE_EVENT_WITH_FLOW0(category_group, name, bind_id, flow_flags) \ + INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW( \ + category_group, name, bind_id, flow_flags) +#define TRACE_EVENT1(category_group, name, arg1_name, arg1_val) \ INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name, arg1_name, arg1_val) -#define TRACE_EVENT_WITH_FLOW1(category_group, name, bind_id, flow_flags, \ - arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW(category_group, name, bind_id, \ - flow_flags, arg1_name, arg1_val) -#define TRACE_EVENT2(category_group, name, arg1_name, arg1_val, arg2_name, \ - arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_SCOPED(category_group, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) -#define TRACE_EVENT_WITH_FLOW2(category_group, name, bind_id, flow_flags, \ - arg1_name, arg1_val, arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW(category_group, name, bind_id, \ - flow_flags, arg1_name, arg1_val, \ - arg2_name, arg2_val) +#define TRACE_EVENT_WITH_FLOW1( \ + category_group, name, bind_id, flow_flags, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW( \ + category_group, name, bind_id, flow_flags, arg1_name, arg1_val) +#define TRACE_EVENT2( \ + category_group, name, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_SCOPED( \ + category_group, name, arg1_name, arg1_val, arg2_name, arg2_val) +#define TRACE_EVENT_WITH_FLOW2(category_group, \ + name, \ + bind_id, \ + flow_flags, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_SCOPED_WITH_FLOW(category_group, \ + name, \ + bind_id, \ + flow_flags, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) // Records a single event called "name" immediately, with 0, 1 or 2 // associated arguments. If the category is not enabled, then this // does nothing. // - category and name strings must have application lifetime (statics or // literals). They may not include " chars. -#define TRACE_EVENT_INSTANT0(category_group, name, scope) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \ +#define TRACE_EVENT_INSTANT0(category_group, name, scope) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ + category_group, \ + name, \ TRACE_EVENT_FLAG_NONE | scope) #define TRACE_EVENT_INSTANT1(category_group, name, scope, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \ - TRACE_EVENT_FLAG_NONE | scope, arg1_name, arg1_val) -#define TRACE_EVENT_INSTANT2(category_group, name, scope, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \ - TRACE_EVENT_FLAG_NONE | scope, arg1_name, arg1_val, \ - arg2_name, arg2_val) -#define TRACE_EVENT_COPY_INSTANT0(category_group, name, scope) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ + category_group, \ + name, \ + TRACE_EVENT_FLAG_NONE | scope, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_INSTANT2( \ + category_group, name, scope, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ + category_group, \ + name, \ + TRACE_EVENT_FLAG_NONE | scope, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) +#define TRACE_EVENT_COPY_INSTANT0(category_group, name, scope) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ + category_group, \ + name, \ TRACE_EVENT_FLAG_COPY | scope) -#define TRACE_EVENT_COPY_INSTANT1(category_group, name, scope, arg1_name, \ - arg1_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \ - TRACE_EVENT_FLAG_COPY | scope, arg1_name, arg1_val) -#define TRACE_EVENT_COPY_INSTANT2(category_group, name, scope, arg1_name, \ - arg1_val, arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, category_group, name, \ - TRACE_EVENT_FLAG_COPY | scope, arg1_name, arg1_val, \ - arg2_name, arg2_val) - -#define TRACE_EVENT_INSTANT_WITH_TIMESTAMP0(category_group, name, scope, \ - timestamp) \ - INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \ - TRACE_EVENT_PHASE_INSTANT, category_group, name, timestamp, \ - TRACE_EVENT_FLAG_NONE | scope) - -#define TRACE_EVENT_INSTANT_WITH_TIMESTAMP1(category_group, name, scope, \ - timestamp, arg_name, arg_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \ - TRACE_EVENT_PHASE_INSTANT, category_group, name, timestamp, \ - TRACE_EVENT_FLAG_NONE | scope, arg_name, arg_val) +#define TRACE_EVENT_COPY_INSTANT1( \ + category_group, name, scope, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ + category_group, \ + name, \ + TRACE_EVENT_FLAG_COPY | scope, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_COPY_INSTANT2( \ + category_group, name, scope, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_INSTANT, \ + category_group, \ + name, \ + TRACE_EVENT_FLAG_COPY | scope, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) + +#define TRACE_EVENT_INSTANT_WITH_TIMESTAMP0( \ + category_group, name, scope, timestamp) \ + INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(TRACE_EVENT_PHASE_INSTANT, \ + category_group, \ + name, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE | scope) + +#define TRACE_EVENT_INSTANT_WITH_TIMESTAMP1( \ + category_group, name, scope, timestamp, arg_name, arg_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(TRACE_EVENT_PHASE_INSTANT, \ + category_group, \ + name, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE | scope, \ + arg_name, \ + arg_val) // Records a single BEGIN event called "name" immediately, with 0, 1 or 2 // associated arguments. If the category is not enabled, then this // does nothing. // - category and name strings must have application lifetime (statics or // literals). They may not include " chars. -#define TRACE_EVENT_BEGIN(category_group, name, ...) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \ - TRACE_EVENT_FLAG_NONE, ##__VA_ARGS__) -#define TRACE_EVENT_BEGIN0(category_group, name) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \ - TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_BEGIN1(category_group, name, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_BEGIN2(category_group, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \ - arg2_name, arg2_val) -#define TRACE_EVENT_COPY_BEGIN0(category_group, name) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \ - TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_BEGIN1(category_group, name, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \ - TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val) -#define TRACE_EVENT_COPY_BEGIN2(category_group, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, category_group, name, \ - TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \ - arg2_name, arg2_val) +#define TRACE_EVENT_BEGIN(category_group, name, ...) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ + category_group, \ + name, \ + TRACE_EVENT_FLAG_NONE, \ + ##__VA_ARGS__) +#define TRACE_EVENT_BEGIN0(category_group, name) \ + INTERNAL_TRACE_EVENT_ADD( \ + TRACE_EVENT_PHASE_BEGIN, category_group, name, TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_BEGIN1(category_group, name, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ + category_group, \ + name, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_BEGIN2( \ + category_group, name, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ + category_group, \ + name, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) +#define TRACE_EVENT_COPY_BEGIN0(category_group, name) \ + INTERNAL_TRACE_EVENT_ADD( \ + TRACE_EVENT_PHASE_BEGIN, category_group, name, TRACE_EVENT_FLAG_COPY) +#define TRACE_EVENT_COPY_BEGIN1(category_group, name, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ + category_group, \ + name, \ + TRACE_EVENT_FLAG_COPY, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_COPY_BEGIN2( \ + category_group, name, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_BEGIN, \ + category_group, \ + name, \ + TRACE_EVENT_FLAG_COPY, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) // Similar to TRACE_EVENT_BEGINx but with a custom |at| timestamp provided. // - |id| is used to match the _BEGIN event with the _END event. @@ -303,84 +363,150 @@ // all match. |id| must either be a pointer or an integer value up to 64 bits. // If it's a pointer, the bits will be xored with a hash of the process ID so // that the same pointer on two different processes will not collide. -#define TRACE_EVENT_BEGIN_WITH_ID_TID_AND_TIMESTAMP0(category_group, name, id, \ - thread_id, timestamp) \ +#define TRACE_EVENT_BEGIN_WITH_ID_TID_AND_TIMESTAMP0( \ + category_group, name, id, thread_id, timestamp) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category_group, \ + name, \ + id, \ + thread_id, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_COPY_BEGIN_WITH_ID_TID_AND_TIMESTAMP0( \ + category_group, name, id, thread_id, timestamp) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category_group, \ + name, \ + id, \ + thread_id, \ + timestamp, \ + TRACE_EVENT_FLAG_COPY) +#define TRACE_EVENT_COPY_BEGIN_WITH_ID_TID_AND_TIMESTAMP1( \ + category_group, name, id, thread_id, timestamp, arg1_name, arg1_val) \ INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, thread_id, \ - timestamp, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_COPY_BEGIN_WITH_ID_TID_AND_TIMESTAMP0( \ - category_group, name, id, thread_id, timestamp) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, thread_id, \ - timestamp, TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_BEGIN_WITH_ID_TID_AND_TIMESTAMP1( \ - category_group, name, id, thread_id, timestamp, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, thread_id, \ - timestamp, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val) -#define TRACE_EVENT_COPY_BEGIN_WITH_ID_TID_AND_TIMESTAMP2( \ - category_group, name, id, thread_id, timestamp, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, thread_id, \ - timestamp, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, \ + TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category_group, \ + name, \ + id, \ + thread_id, \ + timestamp, \ + TRACE_EVENT_FLAG_COPY, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_COPY_BEGIN_WITH_ID_TID_AND_TIMESTAMP2(category_group, \ + name, \ + id, \ + thread_id, \ + timestamp, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category_group, \ + name, \ + id, \ + thread_id, \ + timestamp, \ + TRACE_EVENT_FLAG_COPY, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ arg2_val) // Records a single END event for "name" immediately. If the category // is not enabled, then this does nothing. // - category and name strings must have application lifetime (statics or // literals). They may not include " chars. -#define TRACE_EVENT_END(category_group, name, ...) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \ - TRACE_EVENT_FLAG_NONE, ##__VA_ARGS__) -#define TRACE_EVENT_END0(category_group, name) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \ - TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_END1(category_group, name, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_END2(category_group, name, arg1_name, arg1_val, arg2_name, \ - arg2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, \ - arg2_name, arg2_val) -#define TRACE_EVENT_COPY_END0(category_group, name) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \ - TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_END1(category_group, name, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \ - TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val) -#define TRACE_EVENT_COPY_END2(category_group, name, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, category_group, name, \ - TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \ - arg2_name, arg2_val) - -#define TRACE_EVENT_MARK_WITH_TIMESTAMP0(category_group, name, timestamp) \ - INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \ - TRACE_EVENT_PHASE_MARK, category_group, name, timestamp, \ - TRACE_EVENT_FLAG_NONE) - -#define TRACE_EVENT_MARK_WITH_TIMESTAMP1(category_group, name, timestamp, \ - arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \ - TRACE_EVENT_PHASE_MARK, category_group, name, timestamp, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) +#define TRACE_EVENT_END(category_group, name, ...) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ + category_group, \ + name, \ + TRACE_EVENT_FLAG_NONE, \ + ##__VA_ARGS__) +#define TRACE_EVENT_END0(category_group, name) \ + INTERNAL_TRACE_EVENT_ADD( \ + TRACE_EVENT_PHASE_END, category_group, name, TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_END1(category_group, name, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ + category_group, \ + name, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_END2( \ + category_group, name, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ + category_group, \ + name, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) +#define TRACE_EVENT_COPY_END0(category_group, name) \ + INTERNAL_TRACE_EVENT_ADD( \ + TRACE_EVENT_PHASE_END, category_group, name, TRACE_EVENT_FLAG_COPY) +#define TRACE_EVENT_COPY_END1(category_group, name, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ + category_group, \ + name, \ + TRACE_EVENT_FLAG_COPY, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_COPY_END2( \ + category_group, name, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_END, \ + category_group, \ + name, \ + TRACE_EVENT_FLAG_COPY, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) + +#define TRACE_EVENT_MARK_WITH_TIMESTAMP0(category_group, name, timestamp) \ + INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(TRACE_EVENT_PHASE_MARK, \ + category_group, \ + name, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE) + +#define TRACE_EVENT_MARK_WITH_TIMESTAMP1( \ + category_group, name, timestamp, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(TRACE_EVENT_PHASE_MARK, \ + category_group, \ + name, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val) #define TRACE_EVENT_MARK_WITH_TIMESTAMP2( \ category_group, name, timestamp, arg1_name, arg1_val, arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \ - TRACE_EVENT_PHASE_MARK, category_group, name, timestamp, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val) - -#define TRACE_EVENT_COPY_MARK(category_group, name) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_MARK, category_group, name, \ - TRACE_EVENT_FLAG_COPY) + INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(TRACE_EVENT_PHASE_MARK, \ + category_group, \ + name, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) + +#define TRACE_EVENT_COPY_MARK(category_group, name) \ + INTERNAL_TRACE_EVENT_ADD( \ + TRACE_EVENT_PHASE_MARK, category_group, name, TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_MARK_WITH_TIMESTAMP(category_group, name, timestamp) \ - INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \ - TRACE_EVENT_PHASE_MARK, category_group, name, timestamp, \ - TRACE_EVENT_FLAG_COPY) +#define TRACE_EVENT_COPY_MARK_WITH_TIMESTAMP(category_group, name, timestamp) \ + INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(TRACE_EVENT_PHASE_MARK, \ + category_group, \ + name, \ + timestamp, \ + TRACE_EVENT_FLAG_COPY) // Similar to TRACE_EVENT_ENDx but with a custom |at| timestamp provided. // - |id| is used to match the _BEGIN event with the _END event. @@ -388,40 +514,77 @@ // all match. |id| must either be a pointer or an integer value up to 64 bits. // If it's a pointer, the bits will be xored with a hash of the process ID so // that the same pointer on two different processes will not collide. -#define TRACE_EVENT_END_WITH_ID_TID_AND_TIMESTAMP0(category_group, name, id, \ - thread_id, timestamp) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, thread_id, \ - timestamp, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_COPY_END_WITH_ID_TID_AND_TIMESTAMP0( \ - category_group, name, id, thread_id, timestamp) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, thread_id, \ - timestamp, TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_END_WITH_ID_TID_AND_TIMESTAMP1( \ - category_group, name, id, thread_id, timestamp, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, thread_id, \ - timestamp, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val) -#define TRACE_EVENT_COPY_END_WITH_ID_TID_AND_TIMESTAMP2( \ - category_group, name, id, thread_id, timestamp, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, thread_id, \ - timestamp, TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, \ +#define TRACE_EVENT_END_WITH_ID_TID_AND_TIMESTAMP0( \ + category_group, name, id, thread_id, timestamp) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_ASYNC_END, \ + category_group, \ + name, \ + id, \ + thread_id, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_COPY_END_WITH_ID_TID_AND_TIMESTAMP0( \ + category_group, name, id, thread_id, timestamp) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_ASYNC_END, \ + category_group, \ + name, \ + id, \ + thread_id, \ + timestamp, \ + TRACE_EVENT_FLAG_COPY) +#define TRACE_EVENT_COPY_END_WITH_ID_TID_AND_TIMESTAMP1( \ + category_group, name, id, thread_id, timestamp, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_ASYNC_END, \ + category_group, \ + name, \ + id, \ + thread_id, \ + timestamp, \ + TRACE_EVENT_FLAG_COPY, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_COPY_END_WITH_ID_TID_AND_TIMESTAMP2(category_group, \ + name, \ + id, \ + thread_id, \ + timestamp, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_ASYNC_END, \ + category_group, \ + name, \ + id, \ + thread_id, \ + timestamp, \ + TRACE_EVENT_FLAG_COPY, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ arg2_val) // Records the value of a counter called "name" immediately. Value // must be representable as a 32 bit integer. // - category and name strings must have application lifetime (statics or // literals). They may not include " chars. -#define TRACE_COUNTER1(category_group, name, value) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \ - TRACE_EVENT_FLAG_NONE, "value", \ +#define TRACE_COUNTER1(category_group, name, value) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, \ + category_group, \ + name, \ + TRACE_EVENT_FLAG_NONE, \ + "value", \ static_cast(value)) -#define TRACE_COPY_COUNTER1(category_group, name, value) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \ - TRACE_EVENT_FLAG_COPY, "value", \ +#define TRACE_COPY_COUNTER1(category_group, name, value) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, \ + category_group, \ + name, \ + TRACE_EVENT_FLAG_COPY, \ + "value", \ static_cast(value)) // Records the values of a multi-parted counter called "name" immediately. @@ -429,32 +592,53 @@ // values as a stacked-bar chart. // - category and name strings must have application lifetime (statics or // literals). They may not include " chars. -#define TRACE_COUNTER2(category_group, name, value1_name, value1_val, \ - value2_name, value2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \ - TRACE_EVENT_FLAG_NONE, value1_name, \ - static_cast(value1_val), value2_name, \ +#define TRACE_COUNTER2( \ + category_group, name, value1_name, value1_val, value2_name, value2_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, \ + category_group, \ + name, \ + TRACE_EVENT_FLAG_NONE, \ + value1_name, \ + static_cast(value1_val), \ + value2_name, \ static_cast(value2_val)) -#define TRACE_COPY_COUNTER2(category_group, name, value1_name, value1_val, \ - value2_name, value2_val) \ - INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, category_group, name, \ - TRACE_EVENT_FLAG_COPY, value1_name, \ - static_cast(value1_val), value2_name, \ +#define TRACE_COPY_COUNTER2( \ + category_group, name, value1_name, value1_val, value2_name, value2_val) \ + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_COUNTER, \ + category_group, \ + name, \ + TRACE_EVENT_FLAG_COPY, \ + value1_name, \ + static_cast(value1_val), \ + value2_name, \ static_cast(value2_val)) // Similar to TRACE_COUNTERx, but with a custom |timestamp| provided. -#define TRACE_COUNTER_WITH_TIMESTAMP1(category_group, name, timestamp, value) \ - INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \ - TRACE_EVENT_PHASE_COUNTER, category_group, name, timestamp, \ - TRACE_EVENT_FLAG_NONE, "value", static_cast(value)) - -#define TRACE_COUNTER_WITH_TIMESTAMP2(category_group, name, timestamp, \ - value1_name, value1_val, value2_name, \ - value2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \ - TRACE_EVENT_PHASE_COUNTER, category_group, name, timestamp, \ - TRACE_EVENT_FLAG_NONE, value1_name, static_cast(value1_val), \ - value2_name, static_cast(value2_val)) +#define TRACE_COUNTER_WITH_TIMESTAMP1(category_group, name, timestamp, value) \ + INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(TRACE_EVENT_PHASE_COUNTER, \ + category_group, \ + name, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE, \ + "value", \ + static_cast(value)) + +#define TRACE_COUNTER_WITH_TIMESTAMP2(category_group, \ + name, \ + timestamp, \ + value1_name, \ + value1_val, \ + value2_name, \ + value2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(TRACE_EVENT_PHASE_COUNTER, \ + category_group, \ + name, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE, \ + value1_name, \ + static_cast(value1_val), \ + value2_name, \ + static_cast(value2_val)) // Records the value of a counter called "name" immediately. Value // must be representable as a 32 bit integer. @@ -464,13 +648,21 @@ // be a pointer or an integer value up to 64 bits. If it's a pointer, the bits // will be xored with a hash of the process ID so that the same pointer on // two different processes will not collide. -#define TRACE_COUNTER_ID1(category_group, name, id, value) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, category_group, \ - name, id, TRACE_EVENT_FLAG_NONE, "value", \ +#define TRACE_COUNTER_ID1(category_group, name, id, value) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + "value", \ static_cast(value)) -#define TRACE_COPY_COUNTER_ID1(category_group, name, id, value) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, category_group, \ - name, id, TRACE_EVENT_FLAG_COPY, "value", \ +#define TRACE_COPY_COUNTER_ID1(category_group, name, id, value) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_COPY, \ + "value", \ static_cast(value)) // Records the values of a multi-parted counter called "name" immediately. @@ -482,44 +674,90 @@ // be a pointer or an integer value up to 64 bits. If it's a pointer, the bits // will be xored with a hash of the process ID so that the same pointer on // two different processes will not collide. -#define TRACE_COUNTER_ID2(category_group, name, id, value1_name, value1_val, \ - value2_name, value2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, category_group, \ - name, id, TRACE_EVENT_FLAG_NONE, \ - value1_name, static_cast(value1_val), \ - value2_name, static_cast(value2_val)) -#define TRACE_COPY_COUNTER_ID2(category_group, name, id, value1_name, \ - value1_val, value2_name, value2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, category_group, \ - name, id, TRACE_EVENT_FLAG_COPY, \ - value1_name, static_cast(value1_val), \ - value2_name, static_cast(value2_val)) +#define TRACE_COUNTER_ID2(category_group, \ + name, \ + id, \ + value1_name, \ + value1_val, \ + value2_name, \ + value2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + value1_name, \ + static_cast(value1_val), \ + value2_name, \ + static_cast(value2_val)) +#define TRACE_COPY_COUNTER_ID2(category_group, \ + name, \ + id, \ + value1_name, \ + value1_val, \ + value2_name, \ + value2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_COUNTER, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_COPY, \ + value1_name, \ + static_cast(value1_val), \ + value2_name, \ + static_cast(value2_val)) // TRACE_EVENT_SAMPLE_* events are injected by the sampling profiler. -#define TRACE_EVENT_SAMPLE_WITH_TID_AND_TIMESTAMP0(category_group, name, \ - thread_id, timestamp) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_SAMPLE, category_group, name, 0, thread_id, timestamp, \ - TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_SAMPLE_WITH_TID_AND_TIMESTAMP0( \ + category_group, name, thread_id, timestamp) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(TRACE_EVENT_PHASE_SAMPLE, \ + category_group, \ + name, \ + 0, \ + thread_id, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE) #define TRACE_EVENT_SAMPLE_WITH_TID_AND_TIMESTAMP1( \ category_group, name, thread_id, timestamp, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_SAMPLE, category_group, name, 0, thread_id, timestamp, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) - -#define TRACE_EVENT_SAMPLE_WITH_TID_AND_TIMESTAMP2(category_group, name, \ - thread_id, timestamp, \ - arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_SAMPLE, category_group, name, 0, thread_id, timestamp, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val) - -#define TRACE_EVENT_SAMPLE_WITH_ID1(category_group, name, id, arg1_name, \ - arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_SAMPLE, category_group, \ - name, id, TRACE_EVENT_FLAG_NONE, arg1_name, \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(TRACE_EVENT_PHASE_SAMPLE, \ + category_group, \ + name, \ + 0, \ + thread_id, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val) + +#define TRACE_EVENT_SAMPLE_WITH_TID_AND_TIMESTAMP2(category_group, \ + name, \ + thread_id, \ + timestamp, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP(TRACE_EVENT_PHASE_SAMPLE, \ + category_group, \ + name, \ + 0, \ + thread_id, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) + +#define TRACE_EVENT_SAMPLE_WITH_ID1( \ + category_group, name, id, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_SAMPLE, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ arg1_val) // ASYNC_STEP_* APIs should be only used by legacy code. New code should @@ -548,60 +786,113 @@ // drawn on the thread defined in the ASYNC_BEGIN event), but all events in that // operation must use the same |name| and |id|. Each step can have its own // args. -#define TRACE_EVENT_ASYNC_BEGIN0(category_group, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ - category_group, name, id, \ +#define TRACE_EVENT_ASYNC_BEGIN0(category_group, name, id) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category_group, \ + name, \ + id, \ TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_ASYNC_BEGIN1(category_group, name, id, arg1_name, \ - arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ - category_group, name, id, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_ASYNC_BEGIN2(category_group, name, id, arg1_name, \ - arg1_val, arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val) -#define TRACE_EVENT_COPY_ASYNC_BEGIN0(category_group, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ - category_group, name, id, \ +#define TRACE_EVENT_ASYNC_BEGIN1( \ + category_group, name, id, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_ASYNC_BEGIN2( \ + category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) +#define TRACE_EVENT_COPY_ASYNC_BEGIN0(category_group, name, id) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category_group, \ + name, \ + id, \ TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_ASYNC_BEGIN1(category_group, name, id, arg1_name, \ - arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ - category_group, name, id, \ - TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val) -#define TRACE_EVENT_COPY_ASYNC_BEGIN2(category_group, name, id, arg1_name, \ - arg1_val, arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \ - TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, arg2_val) +#define TRACE_EVENT_COPY_ASYNC_BEGIN1( \ + category_group, name, id, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_COPY, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_COPY_ASYNC_BEGIN2( \ + category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_COPY, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) // Similar to TRACE_EVENT_ASYNC_BEGINx but with a custom |at| timestamp // provided. -#define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP0(category_group, name, id, \ - timestamp) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \ - TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( \ - category_group, name, id, timestamp, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \ - TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \ - arg1_name, arg1_val) -#define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP2(category_group, name, id, \ - timestamp, arg1_name, \ - arg1_val, arg2_name, arg2_val) \ +#define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP0( \ + category_group, name, id, timestamp) \ INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \ - TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \ - arg1_name, arg1_val, arg2_name, arg2_val) -#define TRACE_EVENT_COPY_ASYNC_BEGIN_WITH_TIMESTAMP0(category_group, name, id, \ - timestamp) \ + TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_API_CURRENT_THREAD_ID, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP1( \ + category_group, name, id, timestamp, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_API_CURRENT_THREAD_ID, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP2(category_group, \ + name, \ + id, \ + timestamp, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_API_CURRENT_THREAD_ID, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) +#define TRACE_EVENT_COPY_ASYNC_BEGIN_WITH_TIMESTAMP0( \ + category_group, name, id, timestamp) \ INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \ - TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY) + TRACE_EVENT_PHASE_ASYNC_BEGIN, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_API_CURRENT_THREAD_ID, \ + timestamp, \ + TRACE_EVENT_FLAG_COPY) // Records a single ASYNC_STEP_INTO event for |step| immediately. If the // category is not enabled, then this does nothing. The |name| and |id| must @@ -609,24 +900,40 @@ // within the async event. This should be called at the beginning of the next // phase of an asynchronous operation. The ASYNC_BEGIN event must not have any // ASYNC_STEP_PAST events. -#define TRACE_EVENT_ASYNC_STEP_INTO0(category_group, name, id, step) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_INTO, \ - category_group, name, id, \ - TRACE_EVENT_FLAG_NONE, "step", step) -#define TRACE_EVENT_ASYNC_STEP_INTO1(category_group, name, id, step, \ - arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_ASYNC_STEP_INTO, category_group, name, id, \ - TRACE_EVENT_FLAG_NONE, "step", step, arg1_name, arg1_val) +#define TRACE_EVENT_ASYNC_STEP_INTO0(category_group, name, id, step) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_INTO, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + "step", \ + step) +#define TRACE_EVENT_ASYNC_STEP_INTO1( \ + category_group, name, id, step, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_INTO, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + "step", \ + step, \ + arg1_name, \ + arg1_val) // Similar to TRACE_EVENT_ASYNC_STEP_INTOx but with a custom |at| timestamp // provided. -#define TRACE_EVENT_ASYNC_STEP_INTO_WITH_TIMESTAMP0(category_group, name, id, \ - step, timestamp) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_ASYNC_STEP_INTO, category_group, name, id, \ - TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \ - "step", step) +#define TRACE_EVENT_ASYNC_STEP_INTO_WITH_TIMESTAMP0( \ + category_group, name, id, step, timestamp) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_ASYNC_STEP_INTO, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_API_CURRENT_THREAD_ID, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE, \ + "step", \ + step) // Records a single ASYNC_STEP_PAST event for |step| immediately. If the // category is not enabled, then this does nothing. The |name| and |id| must @@ -634,65 +941,123 @@ // within the async event. This should be called at the beginning of the next // phase of an asynchronous operation. The ASYNC_BEGIN event must not have any // ASYNC_STEP_INTO events. -#define TRACE_EVENT_ASYNC_STEP_PAST0(category_group, name, id, step) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_PAST, \ - category_group, name, id, \ - TRACE_EVENT_FLAG_NONE, "step", step) -#define TRACE_EVENT_ASYNC_STEP_PAST1(category_group, name, id, step, \ - arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_ASYNC_STEP_PAST, category_group, name, id, \ - TRACE_EVENT_FLAG_NONE, "step", step, arg1_name, arg1_val) +#define TRACE_EVENT_ASYNC_STEP_PAST0(category_group, name, id, step) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_PAST, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + "step", \ + step) +#define TRACE_EVENT_ASYNC_STEP_PAST1( \ + category_group, name, id, step, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_STEP_PAST, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + "step", \ + step, \ + arg1_name, \ + arg1_val) // Records a single ASYNC_END event for "name" immediately. If the category // is not enabled, then this does nothing. -#define TRACE_EVENT_ASYNC_END0(category_group, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ - category_group, name, id, \ +#define TRACE_EVENT_ASYNC_END0(category_group, name, id) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ + category_group, \ + name, \ + id, \ TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_ASYNC_END1(category_group, name, id, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ - category_group, name, id, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_ASYNC_END2(category_group, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val) -#define TRACE_EVENT_COPY_ASYNC_END0(category_group, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ - category_group, name, id, \ +#define TRACE_EVENT_ASYNC_END1(category_group, name, id, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_ASYNC_END2( \ + category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) +#define TRACE_EVENT_COPY_ASYNC_END0(category_group, name, id) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ + category_group, \ + name, \ + id, \ TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_ASYNC_END1(category_group, name, id, arg1_name, \ - arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ - category_group, name, id, \ - TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val) -#define TRACE_EVENT_COPY_ASYNC_END2(category_group, name, id, arg1_name, \ - arg1_val, arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, \ - TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, arg2_val) +#define TRACE_EVENT_COPY_ASYNC_END1( \ + category_group, name, id, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_COPY, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_COPY_ASYNC_END2( \ + category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ASYNC_END, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_COPY, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) // Similar to TRACE_EVENT_ASYNC_ENDx but with a custom |at| timestamp provided. -#define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP0(category_group, name, id, \ - timestamp) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, \ - TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP1(category_group, name, id, \ - timestamp, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, \ - TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \ - arg1_name, arg1_val) -#define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP2(category_group, name, id, \ - timestamp, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, \ - TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \ - arg1_name, arg1_val, arg2_name, arg2_val) +#define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP0( \ + category_group, name, id, timestamp) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_ASYNC_END, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_API_CURRENT_THREAD_ID, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP1( \ + category_group, name, id, timestamp, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_ASYNC_END, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_API_CURRENT_THREAD_ID, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP2(category_group, \ + name, \ + id, \ + timestamp, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_ASYNC_END, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_API_CURRENT_THREAD_ID, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) // NESTABLE_ASYNC_* APIs are used to describe an async operation, which can // be nested within a NESTABLE_ASYNC event and/or have inner NESTABLE_ASYNC @@ -717,106 +1082,185 @@ // Records a single NESTABLE_ASYNC_BEGIN event called "name" immediately, with // 0, 1 or 2 associated arguments. If the category is not enabled, then this // does nothing. -#define TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(category_group, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \ - category_group, name, id, \ +#define TRACE_EVENT_NESTABLE_ASYNC_BEGIN0(category_group, name, id) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \ + category_group, \ + name, \ + id, \ TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_NESTABLE_ASYNC_BEGIN1(category_group, name, id, arg1_name, \ - arg1_val) \ +#define TRACE_EVENT_NESTABLE_ASYNC_BEGIN1( \ + category_group, name, id, arg1_name, arg1_val) \ INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \ - category_group, name, id, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_NESTABLE_ASYNC_BEGIN2(category_group, name, id, arg1_name, \ - arg1_val, arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val) + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_NESTABLE_ASYNC_BEGIN2( \ + category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) // Records a single NESTABLE_ASYNC_END event called "name" immediately, with 0 // or 2 associated arguments. If the category is not enabled, then this does // nothing. -#define TRACE_EVENT_NESTABLE_ASYNC_END0(category_group, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \ - category_group, name, id, \ +#define TRACE_EVENT_NESTABLE_ASYNC_END0(category_group, name, id) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \ + category_group, \ + name, \ + id, \ TRACE_EVENT_FLAG_NONE) // Records a single NESTABLE_ASYNC_END event called "name" immediately, with 1 // associated argument. If the category is not enabled, then this does nothing. -#define TRACE_EVENT_NESTABLE_ASYNC_END1(category_group, name, id, arg1_name, \ - arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \ - category_group, name, id, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_NESTABLE_ASYNC_END2(category_group, name, id, arg1_name, \ - arg1_val, arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val) +#define TRACE_EVENT_NESTABLE_ASYNC_END1( \ + category_group, name, id, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_NESTABLE_ASYNC_END2( \ + category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) // Records a single NESTABLE_ASYNC_INSTANT event called "name" immediately, // with none, one or two associated argument. If the category is not enabled, // then this does nothing. -#define TRACE_EVENT_NESTABLE_ASYNC_INSTANT0(category_group, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, \ - category_group, name, id, \ +#define TRACE_EVENT_NESTABLE_ASYNC_INSTANT0(category_group, name, id) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, \ + category_group, \ + name, \ + id, \ TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_NESTABLE_ASYNC_INSTANT1(category_group, name, id, \ - arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, \ - category_group, name, id, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) +#define TRACE_EVENT_NESTABLE_ASYNC_INSTANT1( \ + category_group, name, id, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val) -#define TRACE_EVENT_NESTABLE_ASYNC_INSTANT2( \ - category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, category_group, name, id, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val) +#define TRACE_EVENT_NESTABLE_ASYNC_INSTANT2( \ + category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) #define TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN_WITH_TTS2( \ category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \ INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id, \ - TRACE_EVENT_FLAG_ASYNC_TTS | TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \ - arg2_name, arg2_val) + TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_ASYNC_TTS | TRACE_EVENT_FLAG_COPY, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) #define TRACE_EVENT_COPY_NESTABLE_ASYNC_END_WITH_TTS2( \ category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \ INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id, \ - TRACE_EVENT_FLAG_ASYNC_TTS | TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, \ - arg2_name, arg2_val) + TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_ASYNC_TTS | TRACE_EVENT_FLAG_COPY, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) // Similar to TRACE_EVENT_NESTABLE_ASYNC_{BEGIN,END}x but with a custom // |timestamp| provided. -#define TRACE_EVENT_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP0(category_group, name, \ - id, timestamp) \ +#define TRACE_EVENT_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP0( \ + category_group, name, id, timestamp) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_API_CURRENT_THREAD_ID, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_NESTABLE_ASYNC_END_WITH_TIMESTAMP0( \ + category_group, name, id, timestamp) \ INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id, \ - TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_NESTABLE_ASYNC_END_WITH_TIMESTAMP0(category_group, name, \ - id, timestamp) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id, \ - TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_NESTABLE_ASYNC_END_WITH_TIMESTAMP1( \ - category_group, name, id, timestamp, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id, \ - TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \ - arg1_name, arg1_val) -#define TRACE_EVENT_NESTABLE_ASYNC_INSTANT_WITH_TIMESTAMP0( \ - category_group, name, id, timestamp) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, category_group, name, id, \ - TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP0( \ - category_group, name, id, timestamp) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, category_group, name, id, \ - TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_NESTABLE_ASYNC_END_WITH_TIMESTAMP0( \ - category_group, name, id, timestamp) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, category_group, name, id, \ - TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_COPY) + TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_API_CURRENT_THREAD_ID, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_NESTABLE_ASYNC_END_WITH_TIMESTAMP1( \ + category_group, name, id, timestamp, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_API_CURRENT_THREAD_ID, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_NESTABLE_ASYNC_INSTANT_WITH_TIMESTAMP0( \ + category_group, name, id, timestamp) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_NESTABLE_ASYNC_INSTANT, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_API_CURRENT_THREAD_ID, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_COPY_NESTABLE_ASYNC_BEGIN_WITH_TIMESTAMP0( \ + category_group, name, id, timestamp) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_NESTABLE_ASYNC_BEGIN, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_API_CURRENT_THREAD_ID, \ + timestamp, \ + TRACE_EVENT_FLAG_COPY) +#define TRACE_EVENT_COPY_NESTABLE_ASYNC_END_WITH_TIMESTAMP0( \ + category_group, name, id, timestamp) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_NESTABLE_ASYNC_END, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_API_CURRENT_THREAD_ID, \ + timestamp, \ + TRACE_EVENT_FLAG_COPY) // Records a single FLOW_BEGIN event called "name" immediately, with 0, 1 or 2 // associated arguments. If the category is not enabled, then this @@ -837,148 +1281,246 @@ // macros. When the operation completes, call FLOW_END. An async operation can // span threads and processes, but all events in that operation must use the // same |name| and |id|. Each event can have its own args. -#define TRACE_EVENT_FLOW_BEGIN0(category_group, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ - category_group, name, id, \ +#define TRACE_EVENT_FLOW_BEGIN0(category_group, name, id) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ + category_group, \ + name, \ + id, \ TRACE_EVENT_FLAG_NONE) #define TRACE_EVENT_FLOW_BEGIN1(category_group, name, id, arg1_name, arg1_val) \ INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ - category_group, name, id, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val) -#define TRACE_EVENT_FLOW_BEGIN2(category_group, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_FLOW_BEGIN, category_group, name, id, \ - TRACE_EVENT_FLAG_NONE, arg1_name, arg1_val, arg2_name, arg2_val) -#define TRACE_EVENT_COPY_FLOW_BEGIN0(category_group, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ - category_group, name, id, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_FLOW_BEGIN2( \ + category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) +#define TRACE_EVENT_COPY_FLOW_BEGIN0(category_group, name, id) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ + category_group, \ + name, \ + id, \ TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_FLOW_BEGIN1(category_group, name, id, arg1_name, \ - arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ - category_group, name, id, \ - TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val) -#define TRACE_EVENT_COPY_FLOW_BEGIN2(category_group, name, id, arg1_name, \ - arg1_val, arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_FLOW_BEGIN, category_group, name, id, \ - TRACE_EVENT_FLAG_COPY, arg1_name, arg1_val, arg2_name, arg2_val) +#define TRACE_EVENT_COPY_FLOW_BEGIN1( \ + category_group, name, id, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_COPY, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_COPY_FLOW_BEGIN2( \ + category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_BEGIN, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_COPY, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) // Records a single FLOW_STEP event for |step| immediately. If the category // is not enabled, then this does nothing. The |name| and |id| must match the // FLOW_BEGIN event above. The |step| param identifies this step within the // async event. This should be called at the beginning of the next phase of an // asynchronous operation. -#define TRACE_EVENT_FLOW_STEP0(category_group, name, id, step) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ - category_group, name, id, \ - TRACE_EVENT_FLAG_NONE, "step", step) -#define TRACE_EVENT_FLOW_STEP1(category_group, name, id, step, arg1_name, \ - arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_FLOW_STEP, category_group, name, id, \ - TRACE_EVENT_FLAG_NONE, "step", step, arg1_name, arg1_val) -#define TRACE_EVENT_COPY_FLOW_STEP0(category_group, name, id, step) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ - category_group, name, id, \ - TRACE_EVENT_FLAG_COPY, "step", step) -#define TRACE_EVENT_COPY_FLOW_STEP1(category_group, name, id, step, arg1_name, \ - arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_FLOW_STEP, category_group, name, id, \ - TRACE_EVENT_FLAG_COPY, "step", step, arg1_name, arg1_val) +#define TRACE_EVENT_FLOW_STEP0(category_group, name, id, step) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + "step", \ + step) +#define TRACE_EVENT_FLOW_STEP1( \ + category_group, name, id, step, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + "step", \ + step, \ + arg1_name, \ + arg1_val) +#define TRACE_EVENT_COPY_FLOW_STEP0(category_group, name, id, step) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_COPY, \ + "step", \ + step) +#define TRACE_EVENT_COPY_FLOW_STEP1( \ + category_group, name, id, step, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_STEP, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_COPY, \ + "step", \ + step, \ + arg1_name, \ + arg1_val) // Records a single FLOW_END event for "name" immediately. If the category // is not enabled, then this does nothing. #define TRACE_EVENT_FLOW_END0(category_group, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \ - name, id, TRACE_EVENT_FLAG_NONE) + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE) #define TRACE_EVENT_FLOW_END_BIND_TO_ENCLOSING0(category_group, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \ - name, id, \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ + category_group, \ + name, \ + id, \ TRACE_EVENT_FLAG_BIND_TO_ENCLOSING) #define TRACE_EVENT_FLOW_END1(category_group, name, id, arg1_name, arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \ - name, id, TRACE_EVENT_FLAG_NONE, arg1_name, \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ arg1_val) -#define TRACE_EVENT_FLOW_END2(category_group, name, id, arg1_name, arg1_val, \ - arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \ - name, id, TRACE_EVENT_FLAG_NONE, arg1_name, \ - arg1_val, arg2_name, arg2_val) +#define TRACE_EVENT_FLOW_END2( \ + category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) #define TRACE_EVENT_COPY_FLOW_END0(category_group, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \ - name, id, TRACE_EVENT_FLAG_COPY) -#define TRACE_EVENT_COPY_FLOW_END1(category_group, name, id, arg1_name, \ - arg1_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \ - name, id, TRACE_EVENT_FLAG_COPY, arg1_name, \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_COPY) +#define TRACE_EVENT_COPY_FLOW_END1( \ + category_group, name, id, arg1_name, arg1_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_COPY, \ + arg1_name, \ arg1_val) -#define TRACE_EVENT_COPY_FLOW_END2(category_group, name, id, arg1_name, \ - arg1_val, arg2_name, arg2_val) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, category_group, \ - name, id, TRACE_EVENT_FLAG_COPY, arg1_name, \ - arg1_val, arg2_name, arg2_val) +#define TRACE_EVENT_COPY_FLOW_END2( \ + category_group, name, id, arg1_name, arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_FLOW_END, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_COPY, \ + arg1_name, \ + arg1_val, \ + arg2_name, \ + arg2_val) // Special trace event macro to trace task execution with the location where it // was posted from. -#define TRACE_TASK_EXECUTION(run_function, task) \ +#define TRACE_TASK_EXECUTION(run_function, task) \ INTERNAL_TRACE_TASK_EXECUTION(run_function, task) // TRACE_EVENT_METADATA* events are information related to other // injected events, not events in their own right. -#define TRACE_EVENT_METADATA1(category_group, name, arg1_name, arg1_val) \ +#define TRACE_EVENT_METADATA1(category_group, name, arg1_name, arg1_val) \ INTERNAL_TRACE_EVENT_METADATA_ADD(category_group, name, arg1_name, arg1_val) // Records a clock sync event. #define TRACE_EVENT_CLOCK_SYNC_RECEIVER(sync_id) \ - INTERNAL_TRACE_EVENT_ADD( \ - TRACE_EVENT_PHASE_CLOCK_SYNC, "__metadata", "clock_sync", \ - TRACE_EVENT_FLAG_NONE, "sync_id", sync_id) + INTERNAL_TRACE_EVENT_ADD(TRACE_EVENT_PHASE_CLOCK_SYNC, \ + "__metadata", \ + "clock_sync", \ + TRACE_EVENT_FLAG_NONE, \ + "sync_id", \ + sync_id) #define TRACE_EVENT_CLOCK_SYNC_ISSUER(sync_id, issue_ts, issue_end_ts) \ - INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP( \ - TRACE_EVENT_PHASE_CLOCK_SYNC, "__metadata", "clock_sync", \ - issue_end_ts, TRACE_EVENT_FLAG_NONE, \ - "sync_id", sync_id, "issue_ts", issue_ts) + INTERNAL_TRACE_EVENT_ADD_WITH_TIMESTAMP(TRACE_EVENT_PHASE_CLOCK_SYNC, \ + "__metadata", \ + "clock_sync", \ + issue_end_ts, \ + TRACE_EVENT_FLAG_NONE, \ + "sync_id", \ + sync_id, \ + "issue_ts", \ + issue_ts) // Macros to track the life time and value of arbitrary client objects. // See also TraceTrackableObject. -#define TRACE_EVENT_OBJECT_CREATED_WITH_ID(category_group, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_CREATE_OBJECT, category_group, name, id, \ - TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_OBJECT_CREATED_WITH_ID(category_group, name, id) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_CREATE_OBJECT, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(category_group, name, id, \ - snapshot) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_SNAPSHOT_OBJECT, category_group, name, \ - id, TRACE_EVENT_FLAG_NONE, "snapshot", snapshot) +#define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID( \ + category_group, name, id, snapshot) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_SNAPSHOT_OBJECT, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE, \ + "snapshot", \ + snapshot) #define TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID_AND_TIMESTAMP( \ category_group, name, id, timestamp, snapshot) \ INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ - TRACE_EVENT_PHASE_SNAPSHOT_OBJECT, category_group, name, \ - id, TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \ - "snapshot", snapshot) - -#define TRACE_EVENT_OBJECT_DELETED_WITH_ID(category_group, name, id) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_DELETE_OBJECT, category_group, name, id, \ - TRACE_EVENT_FLAG_NONE) + TRACE_EVENT_PHASE_SNAPSHOT_OBJECT, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_API_CURRENT_THREAD_ID, \ + timestamp, \ + TRACE_EVENT_FLAG_NONE, \ + "snapshot", \ + snapshot) + +#define TRACE_EVENT_OBJECT_DELETED_WITH_ID(category_group, name, id) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_DELETE_OBJECT, \ + category_group, \ + name, \ + id, \ + TRACE_EVENT_FLAG_NONE) // Records entering and leaving trace event contexts. |category_group| and // |name| specify the context category and type. |context| is a // snapshotted context object id. -#define TRACE_EVENT_ENTER_CONTEXT(category_group, name, context) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_ENTER_CONTEXT, category_group, name, context, \ - TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_LEAVE_CONTEXT(category_group, name, context) \ - INTERNAL_TRACE_EVENT_ADD_WITH_ID( \ - TRACE_EVENT_PHASE_LEAVE_CONTEXT, category_group, name, context, \ - TRACE_EVENT_FLAG_NONE) -#define TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context) \ +#define TRACE_EVENT_ENTER_CONTEXT(category_group, name, context) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_ENTER_CONTEXT, \ + category_group, \ + name, \ + context, \ + TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_LEAVE_CONTEXT(category_group, name, context) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID(TRACE_EVENT_PHASE_LEAVE_CONTEXT, \ + category_group, \ + name, \ + context, \ + TRACE_EVENT_FLAG_NONE) +#define TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context) \ INTERNAL_TRACE_EVENT_SCOPED_CONTEXT(category_group, name, context) // Macro to specify that two trace IDs are identical. For example, @@ -989,18 +1531,18 @@ // tells the trace consumer that events with ID ("net::URLRequest", 0x1000) from // the current process have the same ID as events with ID // ("blink::ResourceFetcher::FetchRequest", 0x2000). -#define TRACE_LINK_IDS(category_group, name, id, linked_id) \ +#define TRACE_LINK_IDS(category_group, name, id, linked_id) \ INTERNAL_TRACE_EVENT_ADD_LINK_IDS(category_group, name, id, linked_id); // Macro to efficiently determine if a given category group is enabled. -#define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category_group, ret) \ - do { \ - INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ - if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ - *ret = true; \ - } else { \ - *ret = false; \ - } \ +#define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category_group, ret) \ + do { \ + INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ + if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ + *ret = true; \ + } else { \ + *ret = false; \ + } \ } while (0) // Macro to explicitly warm up a given category group. This could be useful in @@ -1008,22 +1550,22 @@ // for that category group is reported. For example, to have a category group // always show up in the "record categories" list for manually selecting // settings in about://tracing. -#define TRACE_EVENT_WARMUP_CATEGORY(category_group) \ +#define TRACE_EVENT_WARMUP_CATEGORY(category_group) \ INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group) // Macro to efficiently determine, through polling, if a new trace has begun. -#define TRACE_EVENT_IS_NEW_TRACE(ret) \ - do { \ - static int INTERNAL_TRACE_EVENT_UID(lastRecordingNumber) = 0; \ - int num_traces_recorded = TRACE_EVENT_API_GET_NUM_TRACES_RECORDED(); \ - if (num_traces_recorded != -1 && \ - num_traces_recorded != \ - INTERNAL_TRACE_EVENT_UID(lastRecordingNumber)) { \ - INTERNAL_TRACE_EVENT_UID(lastRecordingNumber) = num_traces_recorded; \ - *ret = true; \ - } else { \ - *ret = false; \ - } \ +#define TRACE_EVENT_IS_NEW_TRACE(ret) \ + do { \ + static int INTERNAL_TRACE_EVENT_UID(lastRecordingNumber) = 0; \ + int num_traces_recorded = TRACE_EVENT_API_GET_NUM_TRACES_RECORDED(); \ + if (num_traces_recorded != -1 && \ + num_traces_recorded != \ + INTERNAL_TRACE_EVENT_UID(lastRecordingNumber)) { \ + INTERNAL_TRACE_EVENT_UID(lastRecordingNumber) = num_traces_recorded; \ + *ret = true; \ + } else { \ + *ret = false; \ + } \ } while (0) // Notes regarding the following definitions: @@ -1077,8 +1619,8 @@ #define TRACE_EVENT_FLAG_HAS_LOCAL_ID (static_cast(1 << 12)) #define TRACE_EVENT_FLAG_HAS_GLOBAL_ID (static_cast(1 << 13)) -#define TRACE_EVENT_FLAG_SCOPE_MASK \ - (static_cast(TRACE_EVENT_FLAG_SCOPE_OFFSET | \ +#define TRACE_EVENT_FLAG_SCOPE_MASK \ + (static_cast(TRACE_EVENT_FLAG_SCOPE_OFFSET | \ TRACE_EVENT_FLAG_SCOPE_EXTRA)) // Type values for identifying types in the TraceValue union. diff --git a/src/tracing/traced_value.cc b/src/tracing/traced_value.cc index b2a1badad1247d..4c99e18a63a2c5 100644 --- a/src/tracing/traced_value.cc +++ b/src/tracing/traced_value.cc @@ -4,9 +4,9 @@ #include "tracing/traced_value.h" +#include #include #include -#include #include #if defined(NODE_HAVE_I18N_SUPPORT) @@ -38,18 +38,33 @@ std::string EscapeString(const char* value) { UChar32 c; U8_NEXT_OR_FFFD(value, i, len, c); switch (c) { - case '\b': result += "\\b"; break; - case '\f': result += "\\f"; break; - case '\n': result += "\\n"; break; - case '\r': result += "\\r"; break; - case '\t': result += "\\t"; break; - case '\\': result += "\\\\"; break; - case '"': result += "\\\""; break; + case '\b': + result += "\\b"; + break; + case '\f': + result += "\\f"; + break; + case '\n': + result += "\\n"; + break; + case '\r': + result += "\\r"; + break; + case '\t': + result += "\\t"; + break; + case '\\': + result += "\\\\"; + break; + case '"': + result += "\\\""; + break; default: if (c < 32 || c > 126) { - snprintf( - number_buffer, arraysize(number_buffer), "\\u%04X", - static_cast(static_cast(c))); + snprintf(number_buffer, + arraysize(number_buffer), + "\\u%04X", + static_cast(static_cast(c))); result += number_buffer; } else { result.append(value + p, i - p); @@ -63,18 +78,33 @@ std::string EscapeString(const char* value) { while (*value) { char c = *value++; switch (c) { - case '\b': result += "\\b"; break; - case '\f': result += "\\f"; break; - case '\n': result += "\\n"; break; - case '\r': result += "\\r"; break; - case '\t': result += "\\t"; break; - case '\\': result += "\\\\"; break; - case '"': result += "\\\""; break; + case '\b': + result += "\\b"; + break; + case '\f': + result += "\\f"; + break; + case '\n': + result += "\\n"; + break; + case '\r': + result += "\\r"; + break; + case '\t': + result += "\\t"; + break; + case '\\': + result += "\\\\"; + break; + case '"': + result += "\\\""; + break; default: if (c < '\x20') { - snprintf( - number_buffer, arraysize(number_buffer), "\\u%04X", - static_cast(static_cast(c))); + snprintf(number_buffer, + arraysize(number_buffer), + "\\u%04X", + static_cast(static_cast(c))); result += number_buffer; } else { result += c; @@ -88,9 +118,12 @@ std::string EscapeString(const char* value) { std::string DoubleToCString(double v) { switch (FPCLASSIFY_NAMESPACE::fpclassify(v)) { - case FP_NAN: return "\"NaN\""; - case FP_INFINITE: return (v < 0.0 ? "\"-Infinity\"" : "\"Infinity\""); - case FP_ZERO: return "0"; + case FP_NAN: + return "\"NaN\""; + case FP_INFINITE: + return (v < 0.0 ? "\"-Infinity\"" : "\"Infinity\""); + case FP_ZERO: + return "0"; default: // This is a far less sophisticated version than the one used inside v8. std::ostringstream stream; @@ -110,8 +143,8 @@ std::unique_ptr TracedValue::CreateArray() { return std::unique_ptr(new TracedValue(true)); } -TracedValue::TracedValue(bool root_is_array) : - first_item_(true), root_is_array_(root_is_array) {} +TracedValue::TracedValue(bool root_is_array) + : first_item_(true), root_is_array_(root_is_array) {} TracedValue::~TracedValue() {} diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc index dc9dc3514238bc..425c17a7370856 100644 --- a/src/tty_wrap.cc +++ b/src/tty_wrap.cc @@ -40,7 +40,6 @@ using v8::Object; using v8::String; using v8::Value; - void TTYWrap::Initialize(Local target, Local unused, Local context, @@ -60,13 +59,14 @@ void TTYWrap::Initialize(Local target, env->SetMethodNoSideEffect(target, "isTTY", IsTTY); env->SetMethodNoSideEffect(target, "guessHandleType", GuessHandleType); - target->Set(env->context(), - ttyString, - t->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + ttyString, + t->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); env->set_tty_constructor_template(t); } - void TTYWrap::GuessHandleType(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); int fd; @@ -77,20 +77,31 @@ void TTYWrap::GuessHandleType(const FunctionCallbackInfo& args) { const char* type = nullptr; switch (t) { - case UV_TCP: type = "TCP"; break; - case UV_TTY: type = "TTY"; break; - case UV_UDP: type = "UDP"; break; - case UV_FILE: type = "FILE"; break; - case UV_NAMED_PIPE: type = "PIPE"; break; - case UV_UNKNOWN_HANDLE: type = "UNKNOWN"; break; - default: - ABORT(); + case UV_TCP: + type = "TCP"; + break; + case UV_TTY: + type = "TTY"; + break; + case UV_UDP: + type = "UDP"; + break; + case UV_FILE: + type = "FILE"; + break; + case UV_NAMED_PIPE: + type = "PIPE"; + break; + case UV_UNKNOWN_HANDLE: + type = "UNKNOWN"; + break; + default: + ABORT(); } args.GetReturnValue().Set(OneByteString(env->isolate(), type)); } - void TTYWrap::IsTTY(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); int fd; @@ -100,14 +111,12 @@ void TTYWrap::IsTTY(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(rc); } - void TTYWrap::GetWindowSize(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); TTYWrap* wrap; - ASSIGN_OR_RETURN_UNWRAP(&wrap, - args.Holder(), - args.GetReturnValue().Set(UV_EBADF)); + ASSIGN_OR_RETURN_UNWRAP( + &wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); CHECK(args[0]->IsArray()); int width, height; @@ -122,17 +131,14 @@ void TTYWrap::GetWindowSize(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(err); } - void TTYWrap::SetRawMode(const FunctionCallbackInfo& args) { TTYWrap* wrap; - ASSIGN_OR_RETURN_UNWRAP(&wrap, - args.Holder(), - args.GetReturnValue().Set(UV_EBADF)); + ASSIGN_OR_RETURN_UNWRAP( + &wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); int err = uv_tty_set_mode(&wrap->handle_, args[0]->IsTrue()); args.GetReturnValue().Set(err); } - void TTYWrap::New(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); @@ -153,7 +159,6 @@ void TTYWrap::New(const FunctionCallbackInfo& args) { } } - TTYWrap::TTYWrap(Environment* env, Local object, int fd, @@ -165,8 +170,7 @@ TTYWrap::TTYWrap(Environment* env, AsyncWrap::PROVIDER_TTYWRAP) { *init_err = uv_tty_init(env->event_loop(), &handle_, fd, readable); set_fd(fd); - if (*init_err != 0) - MarkAsUninitialized(); + if (*init_err != 0) MarkAsUninitialized(); } } // namespace node diff --git a/src/tty_wrap.h b/src/tty_wrap.h index 63a340fd8d5388..1718dedc0a17d1 100644 --- a/src/tty_wrap.h +++ b/src/tty_wrap.h @@ -25,8 +25,8 @@ #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS #include "env.h" -#include "uv.h" #include "stream_wrap.h" +#include "uv.h" namespace node { diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc index e4aca28c89500e..81b22a0e072830 100644 --- a/src/udp_wrap.cc +++ b/src/udp_wrap.cc @@ -21,8 +21,8 @@ #include "udp_wrap.h" #include "env-inl.h" -#include "node_buffer.h" #include "handle_wrap.h" +#include "node_buffer.h" #include "req_wrap-inl.h" #include "util-inl.h" @@ -46,7 +46,6 @@ using v8::Value; using AsyncHooks = Environment::AsyncHooks; - class SendWrap : public ReqWrap { public: SendWrap(Environment* env, Local req_wrap_obj, bool have_callback); @@ -61,20 +60,16 @@ class SendWrap : public ReqWrap { const bool have_callback_; }; - SendWrap::SendWrap(Environment* env, Local req_wrap_obj, bool have_callback) : ReqWrap(env, req_wrap_obj, AsyncWrap::PROVIDER_UDPSENDWRAP), - have_callback_(have_callback) { -} - + have_callback_(have_callback) {} inline bool SendWrap::have_callback() const { return have_callback_; } - UDPWrap::UDPWrap(Environment* env, Local object) : HandleWrap(env, object, @@ -84,7 +79,6 @@ UDPWrap::UDPWrap(Environment* env, Local object) CHECK_EQ(r, 0); // can't fail anyway } - void UDPWrap::Initialize(Local target, Local unused, Local context, @@ -93,8 +87,7 @@ void UDPWrap::Initialize(Local target, Local t = env->NewFunctionTemplate(New); t->InstanceTemplate()->SetInternalFieldCount(1); - Local udpString = - FIXED_ONE_BYTE_STRING(env->isolate(), "UDP"); + Local udpString = FIXED_ONE_BYTE_STRING(env->isolate(), "UDP"); t->SetClassName(udpString); enum PropertyAttribute attributes = @@ -102,16 +95,11 @@ void UDPWrap::Initialize(Local target, Local signature = Signature::New(env->isolate(), t); - Local get_fd_templ = - FunctionTemplate::New(env->isolate(), - UDPWrap::GetFD, - env->as_external(), - signature); + Local get_fd_templ = FunctionTemplate::New( + env->isolate(), UDPWrap::GetFD, env->as_external(), signature); - t->PrototypeTemplate()->SetAccessorProperty(env->fd_string(), - get_fd_templ, - Local(), - attributes); + t->PrototypeTemplate()->SetAccessorProperty( + env->fd_string(), get_fd_templ, Local(), attributes); env->SetProtoMethod(t, "open", Open); env->SetProtoMethod(t, "bind", Bind); @@ -120,8 +108,8 @@ void UDPWrap::Initialize(Local target, env->SetProtoMethod(t, "send6", Send6); env->SetProtoMethod(t, "recvStart", RecvStart); env->SetProtoMethod(t, "recvStop", RecvStop); - env->SetProtoMethod(t, "getsockname", - GetSockOrPeerName); + env->SetProtoMethod( + t, "getsockname", GetSockOrPeerName); env->SetProtoMethod(t, "addMembership", AddMembership); env->SetProtoMethod(t, "dropMembership", DropMembership); env->SetProtoMethod(t, "setMulticastInterface", SetMulticastInterface); @@ -133,9 +121,11 @@ void UDPWrap::Initialize(Local target, t->Inherit(HandleWrap::GetConstructorTemplate(env)); - target->Set(env->context(), - udpString, - t->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + udpString, + t->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); env->set_udp_constructor_function( t->GetFunction(env->context()).ToLocalChecked()); @@ -146,25 +136,23 @@ void UDPWrap::Initialize(Local target, Local sendWrapString = FIXED_ONE_BYTE_STRING(env->isolate(), "SendWrap"); swt->SetClassName(sendWrapString); - target->Set(env->context(), - sendWrapString, - swt->GetFunction(env->context()).ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + sendWrapString, + swt->GetFunction(env->context()).ToLocalChecked()) + .FromJust(); Local constants = Object::New(env->isolate()); NODE_DEFINE_CONSTANT(constants, UV_UDP_IPV6ONLY); - target->Set(context, - env->constants_string(), - constants).FromJust(); + target->Set(context, env->constants_string(), constants).FromJust(); } - void UDPWrap::New(const FunctionCallbackInfo& args) { CHECK(args.IsConstructCall()); Environment* env = Environment::GetCurrent(args); new UDPWrap(env, args.This()); } - void UDPWrap::GetFD(const FunctionCallbackInfo& args) { int fd = UV_EBADF; #if !defined(_WIN32) @@ -175,12 +163,10 @@ void UDPWrap::GetFD(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(fd); } - void UDPWrap::DoBind(const FunctionCallbackInfo& args, int family) { UDPWrap* wrap; - ASSIGN_OR_RETURN_UNWRAP(&wrap, - args.Holder(), - args.GetReturnValue().Set(UV_EBADF)); + ASSIGN_OR_RETURN_UNWRAP( + &wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); // bind(ip, port, flags) CHECK_EQ(args.Length(), 3); @@ -195,32 +181,29 @@ void UDPWrap::DoBind(const FunctionCallbackInfo& args, int family) { int err; switch (family) { - case AF_INET: - err = uv_ip4_addr(*address, port, reinterpret_cast(&addr)); - break; - case AF_INET6: - err = uv_ip6_addr(*address, port, reinterpret_cast(&addr)); - break; - default: - CHECK(0 && "unexpected address family"); - ABORT(); + case AF_INET: + err = uv_ip4_addr(*address, port, reinterpret_cast(&addr)); + break; + case AF_INET6: + err = uv_ip6_addr(*address, port, reinterpret_cast(&addr)); + break; + default: + CHECK(0 && "unexpected address family"); + ABORT(); } if (err == 0) { - err = uv_udp_bind(&wrap->handle_, - reinterpret_cast(&addr), - flags); + err = uv_udp_bind( + &wrap->handle_, reinterpret_cast(&addr), flags); } args.GetReturnValue().Set(err); } - void UDPWrap::Open(const FunctionCallbackInfo& args) { UDPWrap* wrap; - ASSIGN_OR_RETURN_UNWRAP(&wrap, - args.Holder(), - args.GetReturnValue().Set(UV_EBADF)); + ASSIGN_OR_RETURN_UNWRAP( + &wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); CHECK(args[0]->IsNumber()); int fd = static_cast(args[0].As()->Value()); int err = uv_udp_open(&wrap->handle_, fd); @@ -228,29 +211,25 @@ void UDPWrap::Open(const FunctionCallbackInfo& args) { args.GetReturnValue().Set(err); } - void UDPWrap::Bind(const FunctionCallbackInfo& args) { DoBind(args, AF_INET); } - void UDPWrap::Bind6(const FunctionCallbackInfo& args) { DoBind(args, AF_INET6); } - void UDPWrap::BufferSize(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); UDPWrap* wrap; - ASSIGN_OR_RETURN_UNWRAP(&wrap, - args.Holder(), - args.GetReturnValue().Set(UV_EBADF)); + ASSIGN_OR_RETURN_UNWRAP( + &wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); CHECK(args[0]->IsUint32()); CHECK(args[1]->IsBoolean()); bool is_recv = args[1].As()->Value(); - const char* uv_func_name = is_recv ? "uv_recv_buffer_size" : - "uv_send_buffer_size"; + const char* uv_func_name = + is_recv ? "uv_recv_buffer_size" : "uv_send_buffer_size"; if (!args[0]->IsInt32()) { env->CollectUVExceptionInfo(args[2], UV_EINVAL, uv_func_name); @@ -296,9 +275,8 @@ X(SetMulticastLoopback, uv_udp_set_multicast_loop) void UDPWrap::SetMulticastInterface(const FunctionCallbackInfo& args) { UDPWrap* wrap; - ASSIGN_OR_RETURN_UNWRAP(&wrap, - args.Holder(), - args.GetReturnValue().Set(UV_EBADF)); + ASSIGN_OR_RETURN_UNWRAP( + &wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); CHECK_EQ(args.Length(), 1); CHECK(args[0]->IsString()); @@ -314,9 +292,8 @@ void UDPWrap::SetMulticastInterface(const FunctionCallbackInfo& args) { void UDPWrap::SetMembership(const FunctionCallbackInfo& args, uv_membership membership) { UDPWrap* wrap; - ASSIGN_OR_RETURN_UNWRAP(&wrap, - args.Holder(), - args.GetReturnValue().Set(UV_EBADF)); + ASSIGN_OR_RETURN_UNWRAP( + &wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); CHECK_EQ(args.Length(), 2); @@ -325,34 +302,28 @@ void UDPWrap::SetMembership(const FunctionCallbackInfo& args, const char* iface_cstr = *iface; if (args[1]->IsUndefined() || args[1]->IsNull()) { - iface_cstr = nullptr; + iface_cstr = nullptr; } - int err = uv_udp_set_membership(&wrap->handle_, - *address, - iface_cstr, - membership); + int err = + uv_udp_set_membership(&wrap->handle_, *address, iface_cstr, membership); args.GetReturnValue().Set(err); } - void UDPWrap::AddMembership(const FunctionCallbackInfo& args) { SetMembership(args, UV_JOIN_GROUP); } - void UDPWrap::DropMembership(const FunctionCallbackInfo& args) { SetMembership(args, UV_LEAVE_GROUP); } - void UDPWrap::DoSend(const FunctionCallbackInfo& args, int family) { Environment* env = Environment::GetCurrent(args); UDPWrap* wrap; - ASSIGN_OR_RETURN_UNWRAP(&wrap, - args.Holder(), - args.GetReturnValue().Set(UV_EBADF)); + ASSIGN_OR_RETURN_UNWRAP( + &wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); // send(req, list, list.length, port, address, hasCallback) CHECK(args[0]->IsObject()); @@ -396,15 +367,15 @@ void UDPWrap::DoSend(const FunctionCallbackInfo& args, int family) { int err; switch (family) { - case AF_INET: - err = uv_ip4_addr(*address, port, reinterpret_cast(&addr)); - break; - case AF_INET6: - err = uv_ip6_addr(*address, port, reinterpret_cast(&addr)); - break; - default: - CHECK(0 && "unexpected address family"); - ABORT(); + case AF_INET: + err = uv_ip4_addr(*address, port, reinterpret_cast(&addr)); + break; + case AF_INET6: + err = uv_ip6_addr(*address, port, reinterpret_cast(&addr)); + break; + default: + CHECK(0 && "unexpected address family"); + ABORT(); } if (err == 0) { @@ -416,46 +387,37 @@ void UDPWrap::DoSend(const FunctionCallbackInfo& args, int family) { OnSend); } - if (err) - delete req_wrap; + if (err) delete req_wrap; args.GetReturnValue().Set(err); } - void UDPWrap::Send(const FunctionCallbackInfo& args) { DoSend(args, AF_INET); } - void UDPWrap::Send6(const FunctionCallbackInfo& args) { DoSend(args, AF_INET6); } - void UDPWrap::RecvStart(const FunctionCallbackInfo& args) { UDPWrap* wrap; - ASSIGN_OR_RETURN_UNWRAP(&wrap, - args.Holder(), - args.GetReturnValue().Set(UV_EBADF)); + ASSIGN_OR_RETURN_UNWRAP( + &wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); int err = uv_udp_recv_start(&wrap->handle_, OnAlloc, OnRecv); // UV_EALREADY means that the socket is already bound but that's okay - if (err == UV_EALREADY) - err = 0; + if (err == UV_EALREADY) err = 0; args.GetReturnValue().Set(err); } - void UDPWrap::RecvStop(const FunctionCallbackInfo& args) { UDPWrap* wrap; - ASSIGN_OR_RETURN_UNWRAP(&wrap, - args.Holder(), - args.GetReturnValue().Set(UV_EBADF)); + ASSIGN_OR_RETURN_UNWRAP( + &wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); int r = uv_udp_recv_stop(&wrap->handle_); args.GetReturnValue().Set(r); } - void UDPWrap::OnSend(uv_udp_send_t* req, int status) { SendWrap* req_wrap = static_cast(req->data); if (req_wrap->have_callback()) { @@ -463,15 +425,14 @@ void UDPWrap::OnSend(uv_udp_send_t* req, int status) { HandleScope handle_scope(env->isolate()); Context::Scope context_scope(env->context()); Local arg[] = { - Integer::New(env->isolate(), status), - Integer::New(env->isolate(), req_wrap->msg_size), + Integer::New(env->isolate(), status), + Integer::New(env->isolate(), req_wrap->msg_size), }; req_wrap->MakeCallback(env->oncomplete_string(), 2, arg); } delete req_wrap; } - void UDPWrap::OnAlloc(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf) { @@ -479,15 +440,13 @@ void UDPWrap::OnAlloc(uv_handle_t* handle, buf->len = suggested_size; } - void UDPWrap::OnRecv(uv_udp_t* handle, ssize_t nread, const uv_buf_t* buf, const struct sockaddr* addr, unsigned int flags) { if (nread == 0 && addr == nullptr) { - if (buf->base != nullptr) - free(buf->base); + if (buf->base != nullptr) free(buf->base); return; } @@ -498,16 +457,13 @@ void UDPWrap::OnRecv(uv_udp_t* handle, Context::Scope context_scope(env->context()); Local wrap_obj = wrap->object(); - Local argv[] = { - Integer::New(env->isolate(), nread), - wrap_obj, - Undefined(env->isolate()), - Undefined(env->isolate()) - }; + Local argv[] = {Integer::New(env->isolate(), nread), + wrap_obj, + Undefined(env->isolate()), + Undefined(env->isolate())}; if (nread < 0) { - if (buf->base != nullptr) - free(buf->base); + if (buf->base != nullptr) free(buf->base); wrap->MakeCallback(env->onmessage_string(), arraysize(argv), argv); return; } @@ -528,7 +484,6 @@ MaybeLocal UDPWrap::Instantiate(Environment* env, return env->udp_constructor_function()->NewInstance(env->context()); } - } // namespace node NODE_MODULE_CONTEXT_AWARE_INTERNAL(udp_wrap, node::UDPWrap::Initialize) diff --git a/src/udp_wrap.h b/src/udp_wrap.h index 97d95b57d3dd84..fc2278e7971151 100644 --- a/src/udp_wrap.h +++ b/src/udp_wrap.h @@ -32,11 +32,9 @@ namespace node { -class UDPWrap: public HandleWrap { +class UDPWrap : public HandleWrap { public: - enum SocketType { - SOCKET - }; + enum SocketType { SOCKET }; static void Initialize(v8::Local target, v8::Local unused, v8::Local context, diff --git a/src/util-inl.h b/src/util-inl.h index 182c50268d3e0a..161f710c6cc35a 100644 --- a/src/util-inl.h +++ b/src/util-inl.h @@ -34,20 +34,17 @@ #define BSWAP_8(x) _byteswap_uint64(x) #else #define BSWAP_2(x) ((x) << 8) | ((x) >> 8) -#define BSWAP_4(x) \ - (((x) & 0xFF) << 24) | \ - (((x) & 0xFF00) << 8) | \ - (((x) >> 8) & 0xFF00) | \ - (((x) >> 24) & 0xFF) -#define BSWAP_8(x) \ - (((x) & 0xFF00000000000000ull) >> 56) | \ - (((x) & 0x00FF000000000000ull) >> 40) | \ - (((x) & 0x0000FF0000000000ull) >> 24) | \ - (((x) & 0x000000FF00000000ull) >> 8) | \ - (((x) & 0x00000000FF000000ull) << 8) | \ - (((x) & 0x0000000000FF0000ull) << 24) | \ - (((x) & 0x000000000000FF00ull) << 40) | \ - (((x) & 0x00000000000000FFull) << 56) +#define BSWAP_4(x) \ + (((x)&0xFF) << 24) | (((x)&0xFF00) << 8) | (((x) >> 8) & 0xFF00) | \ + (((x) >> 24) & 0xFF) +#define BSWAP_8(x) \ + (((x)&0xFF00000000000000ull) >> 56) | (((x)&0x00FF000000000000ull) >> 40) | \ + (((x)&0x0000FF0000000000ull) >> 24) | \ + (((x)&0x000000FF00000000ull) >> 8) | \ + (((x)&0x00000000FF000000ull) << 8) | \ + (((x)&0x0000000000FF0000ull) << 24) | \ + (((x)&0x000000000000FF00ull) << 40) | \ + (((x)&0x00000000000000FFull) << 56) #endif namespace node { @@ -73,33 +70,32 @@ bool ListNode::IsEmpty() const { return prev_ == this; } -template (T::*M)> +template (T::*M)> ListHead::Iterator::Iterator(ListNode* node) : node_(node) {} -template (T::*M)> +template (T::*M)> T* ListHead::Iterator::operator*() const { return ContainerOf(M, node_); } -template (T::*M)> -const typename ListHead::Iterator& -ListHead::Iterator::operator++() { +template (T::*M)> +const typename ListHead::Iterator& ListHead::Iterator:: +operator++() { node_ = node_->next_; return *this; } -template (T::*M)> +template (T::*M)> bool ListHead::Iterator::operator!=(const Iterator& that) const { return node_ != that.node_; } -template (T::*M)> +template (T::*M)> ListHead::~ListHead() { - while (IsEmpty() == false) - head_.next_->Remove(); + while (IsEmpty() == false) head_.next_->Remove(); } -template (T::*M)> +template (T::*M)> void ListHead::PushBack(T* element) { ListNode* that = &(element->*M); head_.prev_->next_ = that; @@ -108,7 +104,7 @@ void ListHead::PushBack(T* element) { head_.prev_ = that; } -template (T::*M)> +template (T::*M)> void ListHead::PushFront(T* element) { ListNode* that = &(element->*M); head_.next_->prev_ = that; @@ -117,26 +113,25 @@ void ListHead::PushFront(T* element) { head_.next_ = that; } -template (T::*M)> +template (T::*M)> bool ListHead::IsEmpty() const { return head_.IsEmpty(); } -template (T::*M)> +template (T::*M)> T* ListHead::PopFront() { - if (IsEmpty()) - return nullptr; + if (IsEmpty()) return nullptr; ListNode* node = head_.next_; node->Remove(); return ContainerOf(M, node); } -template (T::*M)> +template (T::*M)> typename ListHead::Iterator ListHead::begin() const { return Iterator(head_.next_); } -template (T::*M)> +template (T::*M)> typename ListHead::Iterator ListHead::end() const { return Iterator(const_cast*>(&head_)); } @@ -149,9 +144,8 @@ constexpr uintptr_t OffsetOf(Inner Outer::*field) { template ContainerOfHelper::ContainerOfHelper(Inner Outer::*field, Inner* pointer) - : pointer_( - reinterpret_cast( - reinterpret_cast(pointer) - OffsetOf(field))) {} + : pointer_(reinterpret_cast(reinterpret_cast(pointer) - + OffsetOf(field))) {} template template @@ -171,7 +165,8 @@ inline v8::Local OneByteString(v8::Isolate* isolate, return v8::String::NewFromOneByte(isolate, reinterpret_cast(data), v8::NewStringType::kNormal, - length).ToLocalChecked(); + length) + .ToLocalChecked(); } inline v8::Local OneByteString(v8::Isolate* isolate, @@ -180,7 +175,8 @@ inline v8::Local OneByteString(v8::Isolate* isolate, return v8::String::NewFromOneByte(isolate, reinterpret_cast(data), v8::NewStringType::kNormal, - length).ToLocalChecked(); + length) + .ToLocalChecked(); } inline v8::Local OneByteString(v8::Isolate* isolate, @@ -189,7 +185,8 @@ inline v8::Local OneByteString(v8::Isolate* isolate, return v8::String::NewFromOneByte(isolate, reinterpret_cast(data), v8::NewStringType::kNormal, - length).ToLocalChecked(); + length) + .ToLocalChecked(); } void SwapBytes16(char* data, size_t nbytes) { @@ -270,27 +267,22 @@ char ToLower(char c) { std::string ToLower(const std::string& in) { std::string out(in.size(), 0); - for (size_t i = 0; i < in.size(); ++i) - out[i] = ToLower(in[i]); + for (size_t i = 0; i < in.size(); ++i) out[i] = ToLower(in[i]); return out; } bool StringEqualNoCase(const char* a, const char* b) { do { - if (*a == '\0') - return *b == '\0'; - if (*b == '\0') - return *a == '\0'; + if (*a == '\0') return *b == '\0'; + if (*b == '\0') return *a == '\0'; } while (ToLower(*a++) == ToLower(*b++)); return false; } bool StringEqualNoCaseN(const char* a, const char* b, size_t length) { for (size_t i = 0; i < length; i++) { - if (ToLower(a[i]) != ToLower(b[i])) - return false; - if (a[i] == '\0') - return true; + if (ToLower(a[i]) != ToLower(b[i])) return false; + if (a[i] == '\0') return true; } return true; } @@ -298,8 +290,7 @@ bool StringEqualNoCaseN(const char* a, const char* b, size_t length) { template inline T MultiplyWithOverflowCheck(T a, T b) { auto ret = a * b; - if (a != 0) - CHECK_EQ(b, ret / a); + if (a != 0) CHECK_EQ(b, ret / a); return ret; } @@ -367,10 +358,18 @@ inline T* Calloc(size_t n) { } // Shortcuts for char*. -inline char* Malloc(size_t n) { return Malloc(n); } -inline char* Calloc(size_t n) { return Calloc(n); } -inline char* UncheckedMalloc(size_t n) { return UncheckedMalloc(n); } -inline char* UncheckedCalloc(size_t n) { return UncheckedCalloc(n); } +inline char* Malloc(size_t n) { + return Malloc(n); +} +inline char* Calloc(size_t n) { + return Calloc(n); +} +inline char* UncheckedMalloc(size_t n) { + return UncheckedMalloc(n); +} +inline char* UncheckedCalloc(size_t n) { + return UncheckedCalloc(n); +} // This is a helper in the .cc file so including util-inl.h doesn't include more // headers than we really need to. @@ -429,7 +428,7 @@ v8::MaybeLocal ToV8Value(v8::Local context, return handle_scope.Escape(ret); } -template +template v8::MaybeLocal ToV8Value(v8::Local context, const T& number, v8::Isolate* isolate) { @@ -441,14 +440,16 @@ v8::MaybeLocal ToV8Value(v8::Local context, if (static_cast(Limits::max()) <= std::numeric_limits::max() && static_cast(Limits::min()) >= - std::numeric_limits::min() && Limits::is_exact) { + std::numeric_limits::min() && + Limits::is_exact) { return v8::Integer::NewFromUnsigned(isolate, static_cast(number)); } if (static_cast(Limits::max()) <= std::numeric_limits::max() && static_cast(Limits::min()) >= - std::numeric_limits::min() && Limits::is_exact) { + std::numeric_limits::min() && + Limits::is_exact) { return v8::Integer::New(isolate, static_cast(number)); } @@ -462,8 +463,7 @@ SlicedArguments::SlicedArguments( const size_t size = length - start; AllocateSufficientStorage(size); - for (size_t i = 0; i < size; ++i) - (*this)[i] = args[i + start]; + for (size_t i = 0; i < size; ++i) (*this)[i] = args[i + start]; } } // namespace node diff --git a/src/util.cc b/src/util.cc index 9f32814a8599ec..4d56a03ae99216 100644 --- a/src/util.cc +++ b/src/util.cc @@ -35,9 +35,7 @@ using v8::String; using v8::Value; template -static void MakeUtf8String(Isolate* isolate, - Local value, - T* target) { +static void MakeUtf8String(Isolate* isolate, Local value, T* target) { Local string; if (!value->ToString(isolate->GetCurrentContext()).ToLocal(&string)) return; @@ -45,21 +43,18 @@ static void MakeUtf8String(Isolate* isolate, if (!StringBytes::StorageSize(isolate, string, UTF8).To(&storage)) return; storage += 1; target->AllocateSufficientStorage(storage); - const int flags = - String::NO_NULL_TERMINATION | String::REPLACE_INVALID_UTF8; + const int flags = String::NO_NULL_TERMINATION | String::REPLACE_INVALID_UTF8; const int length = string->WriteUtf8(isolate, target->out(), storage, 0, flags); target->SetLengthAndZeroTerminate(length); } Utf8Value::Utf8Value(Isolate* isolate, Local value) { - if (value.IsEmpty()) - return; + if (value.IsEmpty()) return; MakeUtf8String(isolate, value, this); } - TwoByteValue::TwoByteValue(Isolate* isolate, Local value) { if (value.IsEmpty()) { return; @@ -124,8 +119,7 @@ void GetHumanReadableProcessName(char (*name)[1024]) { std::vector SplitString(const std::string& in, char delim) { std::vector out; - if (in.empty()) - return out; + if (in.empty()) return out; std::istringstream in_stream(in); while (in_stream.good()) { std::string item; diff --git a/src/util.h b/src/util.h index b199476aa246bf..5ea0bf7bf8e615 100644 --- a/src/util.h +++ b/src/util.h @@ -34,11 +34,11 @@ #include #include +#include #include // std::function #include #include #include -#include #include namespace node { @@ -96,8 +96,8 @@ struct AssertionInfo { [[noreturn]] void Abort(); void DumpBacktrace(FILE* fp); -#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ - TypeName(const TypeName&) = delete; \ +#define DISALLOW_COPY_AND_ASSIGN(TypeName) \ + TypeName(const TypeName&) = delete; \ TypeName& operator=(const TypeName&) = delete // Windows 8+ does not like abort() in Release mode @@ -122,16 +122,15 @@ void DumpBacktrace(FILE* fp); #define STRINGIFY_(x) #x #define STRINGIFY(x) STRINGIFY_(x) -#define CHECK(expr) \ - do { \ - if (UNLIKELY(!(expr))) { \ - /* Make sure that this struct does not end up in inline code, but */ \ - /* rather in a read-only data section when modifying this code. */ \ - static const node::AssertionInfo args = { \ - __FILE__ ":" STRINGIFY(__LINE__), #expr, PRETTY_FUNCTION_NAME \ - }; \ - node::Assert(args); \ - } \ +#define CHECK(expr) \ + do { \ + if (UNLIKELY(!(expr))) { \ + /* Make sure that this struct does not end up in inline code, but */ \ + /* rather in a read-only data section when modifying this code. */ \ + static const node::AssertionInfo args = { \ + __FILE__ ":" STRINGIFY(__LINE__), #expr, PRETTY_FUNCTION_NAME}; \ + node::Assert(args); \ + } \ } while (0) #define CHECK_EQ(a, b) CHECK((a) == (b)) @@ -145,30 +144,29 @@ void DumpBacktrace(FILE* fp); #define CHECK_IMPLIES(a, b) CHECK(!(a) || (b)) #ifdef DEBUG - #define DCHECK(expr) CHECK(expr) - #define DCHECK_EQ(a, b) CHECK((a) == (b)) - #define DCHECK_GE(a, b) CHECK((a) >= (b)) - #define DCHECK_GT(a, b) CHECK((a) > (b)) - #define DCHECK_LE(a, b) CHECK((a) <= (b)) - #define DCHECK_LT(a, b) CHECK((a) < (b)) - #define DCHECK_NE(a, b) CHECK((a) != (b)) - #define DCHECK_NULL(val) CHECK((val) == nullptr) - #define DCHECK_NOT_NULL(val) CHECK((val) != nullptr) - #define DCHECK_IMPLIES(a, b) CHECK(!(a) || (b)) +#define DCHECK(expr) CHECK(expr) +#define DCHECK_EQ(a, b) CHECK((a) == (b)) +#define DCHECK_GE(a, b) CHECK((a) >= (b)) +#define DCHECK_GT(a, b) CHECK((a) > (b)) +#define DCHECK_LE(a, b) CHECK((a) <= (b)) +#define DCHECK_LT(a, b) CHECK((a) < (b)) +#define DCHECK_NE(a, b) CHECK((a) != (b)) +#define DCHECK_NULL(val) CHECK((val) == nullptr) +#define DCHECK_NOT_NULL(val) CHECK((val) != nullptr) +#define DCHECK_IMPLIES(a, b) CHECK(!(a) || (b)) #else - #define DCHECK(expr) - #define DCHECK_EQ(a, b) - #define DCHECK_GE(a, b) - #define DCHECK_GT(a, b) - #define DCHECK_LE(a, b) - #define DCHECK_LT(a, b) - #define DCHECK_NE(a, b) - #define DCHECK_NULL(val) - #define DCHECK_NOT_NULL(val) - #define DCHECK_IMPLIES(a, b) +#define DCHECK(expr) +#define DCHECK_EQ(a, b) +#define DCHECK_GE(a, b) +#define DCHECK_GT(a, b) +#define DCHECK_LE(a, b) +#define DCHECK_LT(a, b) +#define DCHECK_NE(a, b) +#define DCHECK_NULL(val) +#define DCHECK_NOT_NULL(val) +#define DCHECK_IMPLIES(a, b) #endif - #define UNREACHABLE() ABORT() // TAILQ-style intrusive list node. @@ -176,7 +174,7 @@ template class ListNode; // TAILQ-style intrusive list head. -template (T::*M)> +template (T::*M)> class ListHead; template @@ -188,14 +186,15 @@ class ListNode { inline bool IsEmpty() const; private: - template (U::*M)> friend class ListHead; + template (U::*M)> + friend class ListHead; friend int GenDebugSymbols(); ListNode* prev_; ListNode* next_; DISALLOW_COPY_AND_ASSIGN(ListNode); }; -template (T::*M)> +template (T::*M)> class ListHead { public: class Iterator { @@ -232,6 +231,7 @@ class ContainerOfHelper { inline ContainerOfHelper(Inner Outer::*field, Inner* pointer); template inline operator TypeName*() const; + private: Outer* const pointer_; }; @@ -258,21 +258,17 @@ inline v8::Local OneByteString(v8::Isolate* isolate, // Used to be a macro, hence the uppercase name. template -inline v8::Local FIXED_ONE_BYTE_STRING( - v8::Isolate* isolate, - const char(&data)[N]) { +inline v8::Local FIXED_ONE_BYTE_STRING(v8::Isolate* isolate, + const char (&data)[N]) { return OneByteString(isolate, data, N - 1); } template inline v8::Local FIXED_ONE_BYTE_STRING( - v8::Isolate* isolate, - const std::array& arr) { + v8::Isolate* isolate, const std::array& arr) { return OneByteString(isolate, arr.data(), N - 1); } - - // Swaps bytes in place. nbytes is the number of bytes to swap and must be a // multiple of the word size (checked by function). inline void SwapBytes16(char* data, size_t nbytes); @@ -294,22 +290,14 @@ inline bool StringEqualNoCaseN(const char* a, const char* b, size_t length); template class MaybeStackBuffer { public: - const T* out() const { - return buf_; - } + const T* out() const { return buf_; } - T* out() { - return buf_; - } + T* out() { return buf_; } // operator* for compatibility with `v8::String::(Utf8)Value` - T* operator*() { - return buf_; - } + T* operator*() { return buf_; } - const T* operator*() const { - return buf_; - } + const T* operator*() const { return buf_; } T& operator[](size_t index) { CHECK_LT(index, length()); @@ -321,15 +309,12 @@ class MaybeStackBuffer { return buf_[index]; } - size_t length() const { - return length_; - } + size_t length() const { return length_; } // Current maximum capacity of the buffer with which SetLength() can be used // without first calling AllocateSufficientStorage(). size_t capacity() const { - return IsAllocated() ? capacity_ : - IsInvalidated() ? 0 : kStackStorageSize; + return IsAllocated() ? capacity_ : IsInvalidated() ? 0 : kStackStorageSize; } // Make sure enough space for `storage` entries is available. @@ -376,14 +361,10 @@ class MaybeStackBuffer { } // If the buffer is stored in the heap rather than on the stack. - bool IsAllocated() const { - return !IsInvalidated() && buf_ != buf_st_; - } + bool IsAllocated() const { return !IsInvalidated() && buf_ != buf_st_; } // If Invalidate() has been called. - bool IsInvalidated() const { - return buf_ == nullptr; - } + bool IsInvalidated() const { return buf_ == nullptr; } // Release ownership of the malloc'd buffer. // Note: This does not free the buffer. @@ -404,8 +385,7 @@ class MaybeStackBuffer { } ~MaybeStackBuffer() { - if (IsAllocated()) - free(buf_); + if (IsAllocated()) free(buf_); } private: @@ -431,20 +411,20 @@ class BufferValue : public MaybeStackBuffer { explicit BufferValue(v8::Isolate* isolate, v8::Local value); }; -#define SPREAD_BUFFER_ARG(val, name) \ - CHECK((val)->IsArrayBufferView()); \ - v8::Local name = (val).As(); \ - v8::ArrayBuffer::Contents name##_c = name->Buffer()->GetContents(); \ - const size_t name##_offset = name->ByteOffset(); \ - const size_t name##_length = name->ByteLength(); \ - char* const name##_data = \ - static_cast(name##_c.Data()) + name##_offset; \ - if (name##_length > 0) \ - CHECK_NE(name##_data, nullptr); +#define SPREAD_BUFFER_ARG(val, name) \ + CHECK((val)->IsArrayBufferView()); \ + v8::Local name = (val).As(); \ + v8::ArrayBuffer::Contents name##_c = name->Buffer()->GetContents(); \ + const size_t name##_offset = name->ByteOffset(); \ + const size_t name##_length = name->ByteLength(); \ + char* const name##_data = \ + static_cast(name##_c.Data()) + name##_offset; \ + if (name##_length > 0) CHECK_NE(name##_data, nullptr); // Use this when a variable or parameter is unused in order to explicitly // silence a compiler warning about that. -template inline void USE(T&&) {} +template +inline void USE(T&&) {} // Run a function when exiting the current scope. struct OnScopeLeave { @@ -481,11 +461,9 @@ struct MallocedBuffer { } MallocedBuffer& operator=(MallocedBuffer&& other) { this->~MallocedBuffer(); - return *new(this) MallocedBuffer(std::move(other)); - } - ~MallocedBuffer() { - free(data); + return *new (this) MallocedBuffer(std::move(other)); } + ~MallocedBuffer() { free(data); } MallocedBuffer(const MallocedBuffer&) = delete; MallocedBuffer& operator=(const MallocedBuffer&) = delete; }; @@ -495,12 +473,9 @@ class NonCopyableMaybe { public: NonCopyableMaybe() : empty_(true) {} explicit NonCopyableMaybe(T&& value) - : empty_(false), - value_(std::move(value)) {} + : empty_(false), value_(std::move(value)) {} - bool IsEmpty() const { - return empty_; - } + bool IsEmpty() const { return empty_; } T&& Release() { CHECK_EQ(empty_, false); @@ -515,12 +490,14 @@ class NonCopyableMaybe { // Test whether some value can be called with (). template -struct is_callable : std::is_function { }; +struct is_callable : std::is_function {}; template -struct is_callable::value - >::type> : std::true_type { }; +struct is_callable< + T, + typename std::enable_if< + std::is_same::value>::type> + : std::true_type {}; template struct FunctionDeleter { @@ -536,8 +513,9 @@ std::vector SplitString(const std::string& in, char delim); inline v8::MaybeLocal ToV8Value(v8::Local context, const std::string& str, v8::Isolate* isolate = nullptr); -template ::is_specialized, bool>::type> +template ::is_specialized, bool>::type> inline v8::MaybeLocal ToV8Value(v8::Local context, const T& number, v8::Isolate* isolate = nullptr); diff --git a/src/uv.cc b/src/uv.cc index 59469fc3075a52..15b7afcd01ae0e 100644 --- a/src/uv.cc +++ b/src/uv.cc @@ -63,12 +63,13 @@ void ErrName(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); if (env->options()->pending_deprecation && env->EmitErrNameWarning()) { if (ProcessEmitDeprecationWarning( - env, - "Directly calling process.binding('uv').errname() is being" - " deprecated. " - "Please make sure to use util.getSystemErrorName() instead.", - "DEP0119").IsNothing()) - return; + env, + "Directly calling process.binding('uv').errname() is being" + " deprecated. " + "Please make sure to use util.getSystemErrorName() instead.", + "DEP0119") + .IsNothing()) + return; } int err; if (!args[0]->Int32Value(env->context()).To(&err)) return; @@ -107,11 +108,13 @@ void Initialize(Local target, void* priv) { Environment* env = Environment::GetCurrent(context); Isolate* isolate = env->isolate(); - target->Set(env->context(), - FIXED_ONE_BYTE_STRING(isolate, "errname"), - env->NewFunctionTemplate(ErrName) - ->GetFunction(env->context()) - .ToLocalChecked()).FromJust(); + target + ->Set(env->context(), + FIXED_ONE_BYTE_STRING(isolate, "errname"), + env->NewFunctionTemplate(ErrName) + ->GetFunction(env->context()) + .ToLocalChecked()) + .FromJust(); // TODO(joyeecheung): This should be deprecated in user land in favor of // `util.getSystemErrorName(err)`. diff --git a/src/v8abbr.h b/src/v8abbr.h index 3cfcb37c907f61..51c51628a19b2b 100644 --- a/src/v8abbr.h +++ b/src/v8abbr.h @@ -1,24 +1,24 @@ /** Copyright Joyent, Inc. and other Node contributors. -* -* Permission is hereby granted, free of charge, to any person obtaining a -* copy of this software and associated documentation files (the -* "Software"), to deal in the Software without restriction, including -* without limitation the rights to use, copy, modify, merge, publish, -* distribute, sublicense, and/or sell copies of the Software, and to permit -* persons to whom the Software is furnished to do so, subject to the -* following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -* USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to permit + * persons to whom the Software is furnished to do so, subject to the + * following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN + * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + */ /* * This header defines short names for V8 constants for use by the ustack @@ -29,95 +29,83 @@ #define SRC_V8ABBR_H_ /* Frame pointer offsets */ -#define V8_OFF_FP_FUNC V8DBG_OFF_FP_FUNCTION -#define V8_OFF_FP_CONTEXT V8DBG_OFF_FP_CONTEXT -#define V8_OFF_FP_MARKER V8DBG_OFF_FP_MARKER +#define V8_OFF_FP_FUNC V8DBG_OFF_FP_FUNCTION +#define V8_OFF_FP_CONTEXT V8DBG_OFF_FP_CONTEXT +#define V8_OFF_FP_MARKER V8DBG_OFF_FP_MARKER /* Stack frame types */ -#define V8_FT_ENTRY V8DBG_FRAMETYPE_ENTRYFRAME -#define V8_FT_ENTRYCONSTRUCT V8DBG_FRAMETYPE_CONSTRUCTENTRYFRAME -#define V8_FT_EXIT V8DBG_FRAMETYPE_EXITFRAME -#define V8_FT_JAVASCRIPT V8DBG_FRAMETYPE_JAVASCRIPTFRAME -#define V8_FT_OPTIMIZED V8DBG_FRAMETYPE_OPTIMIZEDFRAME -#define V8_FT_INTERNAL V8DBG_FRAMETYPE_INTERNALFRAME -#define V8_FT_CONSTRUCT V8DBG_FRAMETYPE_CONSTRUCTFRAME -#define V8_FT_ADAPTOR V8DBG_FRAMETYPE_ARGUMENTSADAPTORFRAME -#define V8_FT_STUB V8DBG_FRAMETYPE_STUBFRAME +#define V8_FT_ENTRY V8DBG_FRAMETYPE_ENTRYFRAME +#define V8_FT_ENTRYCONSTRUCT V8DBG_FRAMETYPE_CONSTRUCTENTRYFRAME +#define V8_FT_EXIT V8DBG_FRAMETYPE_EXITFRAME +#define V8_FT_JAVASCRIPT V8DBG_FRAMETYPE_JAVASCRIPTFRAME +#define V8_FT_OPTIMIZED V8DBG_FRAMETYPE_OPTIMIZEDFRAME +#define V8_FT_INTERNAL V8DBG_FRAMETYPE_INTERNALFRAME +#define V8_FT_CONSTRUCT V8DBG_FRAMETYPE_CONSTRUCTFRAME +#define V8_FT_ADAPTOR V8DBG_FRAMETYPE_ARGUMENTSADAPTORFRAME +#define V8_FT_STUB V8DBG_FRAMETYPE_STUBFRAME /* Identification masks and tags */ -#define V8_SmiTagMask (V8DBG_SMITAGMASK) -#define V8_SmiTag (V8DBG_SMITAG) -#define V8_SmiValueShift (V8DBG_SMISHIFTSIZE + V8DBG_SMITAGMASK) +#define V8_SmiTagMask (V8DBG_SMITAGMASK) +#define V8_SmiTag (V8DBG_SMITAG) +#define V8_SmiValueShift (V8DBG_SMISHIFTSIZE + V8DBG_SMITAGMASK) -#define V8_HeapObjectTagMask V8DBG_HEAPOBJECTTAGMASK -#define V8_HeapObjectTag V8DBG_HEAPOBJECTTAG +#define V8_HeapObjectTagMask V8DBG_HEAPOBJECTTAGMASK +#define V8_HeapObjectTag V8DBG_HEAPOBJECTTAG -#define V8_IsNotStringMask V8DBG_ISNOTSTRINGMASK -#define V8_StringTag V8DBG_STRINGTAG +#define V8_IsNotStringMask V8DBG_ISNOTSTRINGMASK +#define V8_StringTag V8DBG_STRINGTAG -#define V8_StringEncodingMask V8DBG_STRINGENCODINGMASK -#define V8_AsciiStringTag V8DBG_ONEBYTESTRINGTAG +#define V8_StringEncodingMask V8DBG_STRINGENCODINGMASK +#define V8_AsciiStringTag V8DBG_ONEBYTESTRINGTAG #define V8_StringRepresentationMask V8DBG_STRINGREPRESENTATIONMASK -#define V8_SeqStringTag V8DBG_SEQSTRINGTAG -#define V8_ConsStringTag V8DBG_CONSSTRINGTAG -#define V8_ExternalStringTag V8DBG_EXTERNALSTRINGTAG +#define V8_SeqStringTag V8DBG_SEQSTRINGTAG +#define V8_ConsStringTag V8DBG_CONSSTRINGTAG +#define V8_ExternalStringTag V8DBG_EXTERNALSTRINGTAG /* Instance types */ -#define V8_IT_FIXEDARRAY V8DBG_TYPE_FIXEDARRAY__FIXED_ARRAY_TYPE -#define V8_IT_CODE V8DBG_TYPE_CODE__CODE_TYPE -#define V8_IT_SCRIPT V8DBG_TYPE_SCRIPT__SCRIPT_TYPE +#define V8_IT_FIXEDARRAY V8DBG_TYPE_FIXEDARRAY__FIXED_ARRAY_TYPE +#define V8_IT_CODE V8DBG_TYPE_CODE__CODE_TYPE +#define V8_IT_SCRIPT V8DBG_TYPE_SCRIPT__SCRIPT_TYPE /* Node-specific offsets */ -#define NODE_OFF_EXTSTR_DATA sizeof(void*) +#define NODE_OFF_EXTSTR_DATA sizeof(void*) /* * Not all versions of V8 have the offset for the "chars" array in the * SeqTwoByteString class, but it's the same as the one for SeqOneByteString. */ #ifndef V8DBG_CLASS_SEQTWOBYTESTRING__CHARS__CHAR -#define V8DBG_CLASS_SEQTWOBYTESTRING__CHARS__CHAR \ +#define V8DBG_CLASS_SEQTWOBYTESTRING__CHARS__CHAR \ V8DBG_CLASS_SEQONEBYTESTRING__CHARS__CHAR #endif /* Heap class->field offsets */ -#define V8_OFF_HEAP(off) ((off) - 1) +#define V8_OFF_HEAP(off) ((off)-1) -#define V8_OFF_FUNC_SHARED \ - V8_OFF_HEAP(V8DBG_CLASS_JSFUNCTION__SHARED__SHAREDFUNCTIONINFO) -#define V8_OFF_RAW_NAME \ - V8_OFF_HEAP(V8DBG_CLASS_SHAREDFUNCTIONINFO__NAME_OR_SCOPE_INFO__OBJECT) -#define V8_OFF_SHARED_IDENT \ - V8_OFF_HEAP( \ - V8DBG_CLASS_SHAREDFUNCTIONINFO__NAME_OR_SCOPE_INFO__OBJECT) -#define V8_OFF_SHARED_SCRIPT \ - V8_OFF_HEAP(V8DBG_CLASS_SHAREDFUNCTIONINFO__SCRIPT_OR_DEBUG_INFO__OBJECT) -#define V8_OFF_SHARED_FUNIDENT \ - V8_OFF_HEAP( \ - V8DBG_CLASS_SHAREDFUNCTIONINFO__NAME_OR_SCOPE_INFO__OBJECT) -#define V8_OFF_SCRIPT_NAME \ - V8_OFF_HEAP(V8DBG_CLASS_SCRIPT__NAME__OBJECT) -#define V8_OFF_SCRIPT_LENDS \ - V8_OFF_HEAP(V8DBG_CLASS_SCRIPT__LINE_ENDS__OBJECT) -#define V8_OFF_STR_LENGTH \ - V8_OFF_HEAP(V8DBG_CLASS_STRING__LENGTH__INT32_T) -#define V8_OFF_STR_CHARS \ - V8_OFF_HEAP(V8DBG_CLASS_SEQONEBYTESTRING__CHARS__CHAR) -#define V8_OFF_CONSSTR_CAR \ - V8_OFF_HEAP(V8DBG_CLASS_CONSSTRING__FIRST__STRING) -#define V8_OFF_CONSSTR_CDR \ - V8_OFF_HEAP(V8DBG_CLASS_CONSSTRING__SECOND__STRING) -#define V8_OFF_EXTSTR_RSRC \ - V8_OFF_HEAP(V8DBG_CLASS_EXTERNALSTRING__RESOURCE__OBJECT) -#define V8_OFF_FA_SIZE \ - V8_OFF_HEAP(V8DBG_CLASS_FIXEDARRAYBASE__LENGTH__SMI) -#define V8_OFF_FA_DATA \ - V8_OFF_HEAP(V8DBG_CLASS_FIXEDARRAY__DATA__UINTPTR_T) -#define V8_OFF_HEAPOBJ_MAP \ - V8_OFF_HEAP(V8DBG_CLASS_HEAPOBJECT__MAP__MAP) -#define V8_OFF_MAP_ATTRS \ - V8_OFF_HEAP(V8DBG_CLASS_MAP__INSTANCE_TYPE__UINT16_T) -#define V8_OFF_TWOBYTESTR_CHARS \ - V8_OFF_HEAP(V8DBG_CLASS_SEQTWOBYTESTRING__CHARS__CHAR) +#define V8_OFF_FUNC_SHARED \ + V8_OFF_HEAP(V8DBG_CLASS_JSFUNCTION__SHARED__SHAREDFUNCTIONINFO) +#define V8_OFF_RAW_NAME \ + V8_OFF_HEAP(V8DBG_CLASS_SHAREDFUNCTIONINFO__NAME_OR_SCOPE_INFO__OBJECT) +#define V8_OFF_SHARED_IDENT \ + V8_OFF_HEAP(V8DBG_CLASS_SHAREDFUNCTIONINFO__NAME_OR_SCOPE_INFO__OBJECT) +#define V8_OFF_SHARED_SCRIPT \ + V8_OFF_HEAP(V8DBG_CLASS_SHAREDFUNCTIONINFO__SCRIPT_OR_DEBUG_INFO__OBJECT) +#define V8_OFF_SHARED_FUNIDENT \ + V8_OFF_HEAP(V8DBG_CLASS_SHAREDFUNCTIONINFO__NAME_OR_SCOPE_INFO__OBJECT) +#define V8_OFF_SCRIPT_NAME V8_OFF_HEAP(V8DBG_CLASS_SCRIPT__NAME__OBJECT) +#define V8_OFF_SCRIPT_LENDS V8_OFF_HEAP(V8DBG_CLASS_SCRIPT__LINE_ENDS__OBJECT) +#define V8_OFF_STR_LENGTH V8_OFF_HEAP(V8DBG_CLASS_STRING__LENGTH__INT32_T) +#define V8_OFF_STR_CHARS V8_OFF_HEAP(V8DBG_CLASS_SEQONEBYTESTRING__CHARS__CHAR) +#define V8_OFF_CONSSTR_CAR V8_OFF_HEAP(V8DBG_CLASS_CONSSTRING__FIRST__STRING) +#define V8_OFF_CONSSTR_CDR V8_OFF_HEAP(V8DBG_CLASS_CONSSTRING__SECOND__STRING) +#define V8_OFF_EXTSTR_RSRC \ + V8_OFF_HEAP(V8DBG_CLASS_EXTERNALSTRING__RESOURCE__OBJECT) +#define V8_OFF_FA_SIZE V8_OFF_HEAP(V8DBG_CLASS_FIXEDARRAYBASE__LENGTH__SMI) +#define V8_OFF_FA_DATA V8_OFF_HEAP(V8DBG_CLASS_FIXEDARRAY__DATA__UINTPTR_T) +#define V8_OFF_HEAPOBJ_MAP V8_OFF_HEAP(V8DBG_CLASS_HEAPOBJECT__MAP__MAP) +#define V8_OFF_MAP_ATTRS V8_OFF_HEAP(V8DBG_CLASS_MAP__INSTANCE_TYPE__UINT16_T) +#define V8_OFF_TWOBYTESTR_CHARS \ + V8_OFF_HEAP(V8DBG_CLASS_SEQTWOBYTESTRING__CHARS__CHAR) -#endif /* SRC_V8ABBR_H_ */ +#endif /* SRC_V8ABBR_H_ */ diff --git a/test/cctest/node_test_fixture.h b/test/cctest/node_test_fixture.h index f4c97b05027895..f22b868d972a03 100644 --- a/test/cctest/node_test_fixture.h +++ b/test/cctest/node_test_fixture.h @@ -2,19 +2,19 @@ #define TEST_CCTEST_NODE_TEST_FIXTURE_H_ #include +#include "env.h" #include "gtest/gtest.h" +#include "libplatform/libplatform.h" #include "node.h" -#include "node_platform.h" #include "node_internals.h" -#include "env.h" +#include "node_platform.h" #include "v8.h" -#include "libplatform/libplatform.h" struct Argv { public: Argv() : Argv({"node", "-p", "process.version"}) {} - Argv(const std::initializer_list &args) { + Argv(const std::initializer_list& args) { nr_args_ = args.size(); int total_len = 0; for (auto it = args.begin(); it != args.end(); ++it) { @@ -40,21 +40,18 @@ struct Argv { free(argv_); } - int nr_args() const { - return nr_args_; - } + int nr_args() const { return nr_args_; } - char** operator*() const { - return argv_; - } + char** operator*() const { return argv_; } private: char** argv_; int nr_args_; }; -using ArrayBufferUniquePtr = std::unique_ptr; +using ArrayBufferUniquePtr = + std::unique_ptr; using TracingAgentUniquePtr = std::unique_ptr; using NodePlatformUniquePtr = std::unique_ptr; @@ -70,8 +67,8 @@ class NodeTestFixture : public ::testing::Test { tracing_agent.reset(new node::tracing::Agent()); node::tracing::TraceEventHelper::SetAgent(tracing_agent.get()); CHECK_EQ(0, uv_loop_init(¤t_loop)); - platform.reset(static_cast( - node::InitializeV8Platform(4))); + platform.reset( + static_cast(node::InitializeV8Platform(4))); v8::V8::Initialize(); } @@ -98,7 +95,6 @@ class NodeTestFixture : public ::testing::Test { } }; - class EnvironmentTestFixture : public NodeTestFixture { public: class Env { @@ -109,14 +105,11 @@ class EnvironmentTestFixture : public NodeTestFixture { CHECK(!context_.IsEmpty()); context_->Enter(); - isolate_data_ = node::CreateIsolateData(isolate, - &NodeTestFixture::current_loop, - platform.get()); + isolate_data_ = node::CreateIsolateData( + isolate, &NodeTestFixture::current_loop, platform.get()); CHECK_NE(nullptr, isolate_data_); - environment_ = node::CreateEnvironment(isolate_data_, - context_, - 1, *argv, - argv.nr_args(), *argv); + environment_ = node::CreateEnvironment( + isolate_data_, context_, 1, *argv, argv.nr_args(), *argv); CHECK_NE(nullptr, environment_); } @@ -126,13 +119,9 @@ class EnvironmentTestFixture : public NodeTestFixture { context_->Exit(); } - node::Environment* operator*() const { - return environment_; - } + node::Environment* operator*() const { return environment_; } - v8::Local context() const { - return context_; - } + v8::Local context() const { return context_; } private: v8::Local context_; diff --git a/test/cctest/test_aliased_buffer.cc b/test/cctest/test_aliased_buffer.cc index bfbf7294db612b..f717bf43fc6dee 100644 --- a/test/cctest/test_aliased_buffer.cc +++ b/test/cctest/test_aliased_buffer.cc @@ -1,7 +1,7 @@ -#include "v8.h" #include "aliased_buffer.h" #include "node_test_fixture.h" +#include "v8.h" using node::AliasedBuffer; @@ -47,9 +47,8 @@ void ReadAndValidate(v8::Isolate* isolate, // validate size of JS Buffer EXPECT_TRUE(aliasedBuffer->GetJSArray()->Length() == oracle.size()); - EXPECT_TRUE( - aliasedBuffer->GetJSArray()->ByteLength() == - (oracle.size() * sizeof(NativeT))); + EXPECT_TRUE(aliasedBuffer->GetJSArray()->ByteLength() == + (oracle.size() * sizeof(NativeT))); // validate operator * and GetBuffer are the same EXPECT_TRUE(aliasedBuffer->GetNativeBuffer() == *(*aliasedBuffer)); @@ -92,15 +91,16 @@ void ReadWriteTest(v8::Isolate* isolate) { ReadAndValidate(isolate, context, &ab, oracle); } -template < - class NativeT_A, class V8T_A, - class NativeT_B, class V8T_B, - class NativeT_C, class V8T_C> -void SharedBufferTest( - v8::Isolate* isolate, - size_t count_A, - size_t count_B, - size_t count_C) { +template +void SharedBufferTest(v8::Isolate* isolate, + size_t count_A, + size_t count_B, + size_t count_C) { v8::Isolate::Scope isolate_scope(isolate); v8::HandleScope handle_scope(isolate); v8::Local context = v8::Context::New(isolate); @@ -112,8 +112,7 @@ void SharedBufferTest( AliasedBuffer rootBuffer( isolate, sizeInBytes_A + sizeInBytes_B + sizeInBytes_C); - AliasedBuffer ab_A( - isolate, 0, count_A, rootBuffer); + AliasedBuffer ab_A(isolate, 0, count_A, rootBuffer); AliasedBuffer ab_B( isolate, sizeInBytes_A, count_B, rootBuffer); AliasedBuffer ab_C( @@ -176,31 +175,39 @@ TEST_F(AliasBufferTest, Float64Array) { } TEST_F(AliasBufferTest, SharedArrayBuffer1) { - SharedBufferTest< - uint32_t, v8::Uint32Array, - double, v8::Float64Array, - int8_t, v8::Int8Array>(isolate_, 100, 80, 8); + SharedBufferTest(isolate_, 100, 80, 8); } TEST_F(AliasBufferTest, SharedArrayBuffer2) { - SharedBufferTest< - double, v8::Float64Array, - int8_t, v8::Int8Array, - double, v8::Float64Array>(isolate_, 100, 8, 8); + SharedBufferTest(isolate_, 100, 8, 8); } TEST_F(AliasBufferTest, SharedArrayBuffer3) { - SharedBufferTest< - int8_t, v8::Int8Array, - int8_t, v8::Int8Array, - double, v8::Float64Array>(isolate_, 1, 7, 8); + SharedBufferTest(isolate_, 1, 7, 8); } TEST_F(AliasBufferTest, SharedArrayBuffer4) { - SharedBufferTest< - int8_t, v8::Int8Array, - int8_t, v8::Int8Array, - int32_t, v8::Int32Array>(isolate_, 1, 3, 1); + SharedBufferTest(isolate_, 1, 3, 1); } TEST_F(AliasBufferTest, OperatorOverloads) { diff --git a/test/cctest/test_base64.cc b/test/cctest/test_base64.cc index fbdb969b4cbe46..5414ff177ac917 100644 --- a/test/cctest/test_base64.cc +++ b/test/cctest/test_base64.cc @@ -5,8 +5,8 @@ #include "gtest/gtest.h" -using node::base64_encode; using node::base64_decode; +using node::base64_encode; TEST(Base64Test, Encode) { auto test = [](const char* string, const char* base64_string) { @@ -93,7 +93,8 @@ TEST(Base64Test, Decode) { "biByZXByZWhlbmRlcml0IGluIHZvbHVwdGF0ZSB2ZWxpdCBlc3NlIGNpbGx1bSBkb2xv" "cmUgZXUgZnVnaWF0IG51bGxhIHBhcmlhdHVyLiBFeGNlcHRldXIgc2ludCBvY2NhZWNh" "dCBjdXBpZGF0YXQgbm9uIHByb2lkZW50LCBzdW50IGluIGN1bHBhIHF1aSBvZmZpY2lh" - "IGRlc2VydW50IG1vbGxpdCBhbmltIGlkIGVzdCBsYWJvcnVtLg==", text); + "IGRlc2VydW50IG1vbGxpdCBhbmltIGlkIGVzdCBsYWJvcnVtLg==", + text); test("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2Npbmcg" "ZWxpdCwgc2VkIGRvIGVpdXNtb2QgdGVtcG9yIGluY2lkaWR1bnQgdXQgbGFib3JlIGV0" @@ -103,7 +104,8 @@ TEST(Base64Test, Decode) { "biByZXByZWhlbmRlcml0IGluIHZvbHVwdGF0ZSB2ZWxpdCBlc3NlIGNpbGx1bSBkb2xv" "cmUgZXUgZnVnaWF0IG51bGxhIHBhcmlhdHVyLiBFeGNlcHRldXIgc2ludCBvY2NhZWNh" "dCBjdXBpZGF0YXQgbm9uIHByb2lkZW50LCBzdW50IGluIGN1bHBhIHF1aSBvZmZpY2lh" - "IGRlc2VydW50IG1vbGxpdCBhbmltIGlkIGVzdCBsYWJvcnVtLg", text); + "IGRlc2VydW50IG1vbGxpdCBhbmltIGlkIGVzdCBsYWJvcnVtLg", + text); test("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2Npbmcg\n" "ZWxpdCwgc2VkIGRvIGVpdXNtb2QgdGVtcG9yIGluY2lkaWR1bnQgdXQgbGFib3JlIGV0\n" @@ -113,7 +115,8 @@ TEST(Base64Test, Decode) { "biByZXByZWhlbmRlcml0IGluIHZvbHVwdGF0ZSB2ZWxpdCBlc3NlIGNpbGx1bSBkb2xv\n" "cmUgZXUgZnVnaWF0IG51bGxhIHBhcmlhdHVyLiBFeGNlcHRldXIgc2ludCBvY2NhZWNh\n" "dCBjdXBpZGF0YXQgbm9uIHByb2lkZW50LCBzdW50IGluIGN1bHBhIHF1aSBvZmZpY2lh\n" - "IGRlc2VydW50IG1vbGxpdCBhbmltIGlkIGVzdCBsYWJvcnVtLg==", text); + "IGRlc2VydW50IG1vbGxpdCBhbmltIGlkIGVzdCBsYWJvcnVtLg==", + text); test("TG9yZW0gaXBzdW0gZG9sb3Igc2l0IGFtZXQsIGNvbnNlY3RldHVyIGFkaXBpc2Npbmcg\n" "ZWxpdCwgc2VkIGRvIGVpdXNtb2QgdGVtcG9yIGluY2lkaWR1bnQgdXQgbGFib3JlIGV0\n" @@ -123,5 +126,6 @@ TEST(Base64Test, Decode) { "biByZXByZWhlbmRlcml0IGluIHZvbHVwdGF0ZSB2ZWxpdCBlc3NlIGNpbGx1bSBkb2xv\n" "cmUgZXUgZnVnaWF0IG51bGxhIHBhcmlhdHVyLiBFeGNlcHRldXIgc2ludCBvY2NhZWNh\n" "dCBjdXBpZGF0YXQgbm9uIHByb2lkZW50LCBzdW50IGluIGN1bHBhIHF1aSBvZmZpY2lh\n" - "IGRlc2VydW50IG1vbGxpdCBhbmltIGlkIGVzdCBsYWJvcnVtLg", text); + "IGRlc2VydW50IG1vbGxpdCBhbmltIGlkIGVzdCBsYWJvcnVtLg", + text); } diff --git a/test/cctest/test_environment.cc b/test/cctest/test_environment.cc index 49dc700bb57716..8f214b1d141f6b 100644 --- a/test/cctest/test_environment.cc +++ b/test/cctest/test_environment.cc @@ -1,5 +1,5 @@ -#include "node_internals.h" #include "libplatform/libplatform.h" +#include "node_internals.h" #include #include "gtest/gtest.h" @@ -26,7 +26,7 @@ class EnvironmentTest : public EnvironmentTestFixture { TEST_F(EnvironmentTest, AtExitWithEnvironment) { const v8::HandleScope handle_scope(isolate_); const Argv argv; - Env env {handle_scope, argv}; + Env env{handle_scope, argv}; AtExit(*env, at_exit_callback1); RunAtExit(*env); @@ -36,7 +36,7 @@ TEST_F(EnvironmentTest, AtExitWithEnvironment) { TEST_F(EnvironmentTest, AtExitWithoutEnvironment) { const v8::HandleScope handle_scope(isolate_); const Argv argv; - Env env {handle_scope, argv}; + Env env{handle_scope, argv}; AtExit(at_exit_callback1); // No Environment is passed to AtExit. RunAtExit(*env); @@ -46,7 +46,7 @@ TEST_F(EnvironmentTest, AtExitWithoutEnvironment) { TEST_F(EnvironmentTest, AtExitWithArgument) { const v8::HandleScope handle_scope(isolate_); const Argv argv; - Env env {handle_scope, argv}; + Env env{handle_scope, argv}; std::string arg{"some args"}; AtExit(*env, at_exit_callback1, static_cast(&arg)); @@ -57,8 +57,8 @@ TEST_F(EnvironmentTest, AtExitWithArgument) { TEST_F(EnvironmentTest, MultipleEnvironmentsPerIsolate) { const v8::HandleScope handle_scope(isolate_); const Argv argv; - Env env1 {handle_scope, argv}; - Env env2 {handle_scope, argv}; + Env env1{handle_scope, argv}; + Env env2{handle_scope, argv}; AtExit(*env1, at_exit_callback1); AtExit(*env2, at_exit_callback2); @@ -73,7 +73,7 @@ TEST_F(EnvironmentTest, MultipleEnvironmentsPerIsolate) { TEST_F(EnvironmentTest, NonNodeJSContext) { const v8::HandleScope handle_scope(isolate_); const Argv argv; - Env test_env {handle_scope, argv}; + Env test_env{handle_scope, argv}; EXPECT_EQ(node::Environment::GetCurrent(v8::Local()), nullptr); diff --git a/test/cctest/test_inspector_socket.cc b/test/cctest/test_inspector_socket.cc index b96489db1f49d3..3d10e49d584875 100644 --- a/test/cctest/test_inspector_socket.cc +++ b/test/cctest/test_inspector_socket.cc @@ -1,5 +1,5 @@ -#include "inspector_socket.h" #include "gtest/gtest.h" +#include "inspector_socket.h" #include @@ -38,7 +38,7 @@ class Timeout { static void mark_done(uv_handle_t* timer) { Timeout* t = node::ContainerOf(&Timeout::timer_, - reinterpret_cast(timer)); + reinterpret_cast(timer)); t->done_ = true; } @@ -98,14 +98,16 @@ static void assert_is_delegate(TestInspectorDelegate* d) { class TestInspectorDelegate : public InspectorSocket::Delegate { public: - using delegate_fn = void(*)(inspector_handshake_event, const std::string&, - bool* should_continue); + using delegate_fn = void (*)(inspector_handshake_event, + const std::string&, + bool* should_continue); - TestInspectorDelegate() : inspector_ready(false), - last_event(kInspectorHandshakeNoEvents), - handshake_events(0), - handshake_delegate_(stop_if_stop_path), - fail_on_ws_frame_(false) { } + TestInspectorDelegate() + : inspector_ready(false), + last_event(kInspectorHandshakeNoEvents), + handshake_events(0), + handshake_delegate_(stop_if_stop_path), + fail_on_ws_frame_(false) {} ~TestInspectorDelegate() { assert_is_delegate(this); @@ -116,7 +118,8 @@ class TestInspectorDelegate : public InspectorSocket::Delegate { process(kInspectorHandshakeHttpGet, path); } - void OnSocketUpgrade(const std::string& host, const std::string& path, + void OnSocketUpgrade(const std::string& host, + const std::string& path, const std::string& ws_key) override { ws_key_ = ws_key; process(kInspectorHandshakeUpgraded, path); @@ -127,17 +130,13 @@ class TestInspectorDelegate : public InspectorSocket::Delegate { frames.push(buffer); } - void SetDelegate(delegate_fn d) { - handshake_delegate_ = d; - } + void SetDelegate(delegate_fn d) { handshake_delegate_ = d; } void SetInspector(InspectorSocket::Pointer inspector) { socket_ = std::move(inspector); } - void Write(const char* buf, size_t len) { - socket_->Write(buf, len); - } + void Write(const char* buf, size_t len) { socket_->Write(buf, len); } void ExpectReadError() { SPIN_WHILE(frames.empty() || !frames.back().empty()); @@ -160,17 +159,11 @@ class TestInspectorDelegate : public InspectorSocket::Delegate { } } - void FailOnWsFrame() { - fail_on_ws_frame_ = true; - } + void FailOnWsFrame() { fail_on_ws_frame_ = true; } - void WaitForDispose() { - SPIN_WHILE(delegate != nullptr); - } + void WaitForDispose() { SPIN_WHILE(delegate != nullptr); } - void Close() { - socket_.reset(); - } + void Close() { socket_.reset(); } bool inspector_ready; std::string last_path; // NOLINT(runtime/string) @@ -180,7 +173,8 @@ class TestInspectorDelegate : public InspectorSocket::Delegate { private: static void stop_if_stop_path(enum inspector_handshake_event state, - const std::string& path, bool* cont) { + const std::string& path, + bool* cont) { *cont = path.empty() || path != "/close"; } @@ -224,8 +218,7 @@ void TestInspectorDelegate::process(inspector_handshake_event event, bool should_continue = true; handshake_delegate_(event, path, &should_continue); if (should_continue) { - if (inspector_ready) - socket_->AcceptUpgrade(ws_key_); + if (inspector_ready) socket_->AcceptUpgrade(ws_key_); } else { socket_->CancelHandshake(); } @@ -235,13 +228,14 @@ static void on_new_connection(uv_stream_t* server, int status) { GTEST_ASSERT_EQ(0, status); connected = true; delegate = new TestInspectorDelegate(); - delegate->SetInspector( - InspectorSocket::Accept(server, - InspectorSocket::DelegatePointer(delegate))); + delegate->SetInspector(InspectorSocket::Accept( + server, InspectorSocket::DelegatePointer(delegate))); GTEST_ASSERT_NE(nullptr, delegate); } -void write_done(uv_write_t* req, int status) { req->data = nullptr; } +void write_done(uv_write_t* req, int status) { + req->data = nullptr; +} static void do_write(const char* data, int len) { uv_write_t req; @@ -251,13 +245,18 @@ static void do_write(const char* data, int len) { buf[0].base = const_cast(data); buf[0].len = len; GTEST_ASSERT_EQ(0, - uv_write(&req, reinterpret_cast(&client_socket), - buf, 1, write_done)); + uv_write(&req, + reinterpret_cast(&client_socket), + buf, + 1, + write_done)); SPIN_WHILE(req.data); } -static void check_data_cb(read_expects* expectation, ssize_t nread, - const uv_buf_t* buf, bool* retval) { +static void check_data_cb(read_expects* expectation, + ssize_t nread, + const uv_buf_t* buf, + bool* retval) { *retval = false; EXPECT_TRUE(nread >= 0 && nread != UV_EOF); ssize_t i; @@ -267,7 +266,8 @@ static void check_data_cb(read_expects* expectation, ssize_t nread, c = expectation->expected[expectation->pos++]; actual = buf->base[i]; if (c != actual) { - fprintf(stderr, "Unexpected character at position %zd\n", + fprintf(stderr, + "Unexpected character at position %zd\n", expectation->pos - 1); GTEST_ASSERT_EQ(c, actual); } @@ -280,7 +280,8 @@ static void check_data_cb(read_expects* expectation, ssize_t nread, } } -static void check_data_cb(uv_stream_t* stream, ssize_t nread, +static void check_data_cb(uv_stream_t* stream, + ssize_t nread, const uv_buf_t* buf) { bool retval = false; read_expects* expects = static_cast(stream->data); @@ -302,7 +303,8 @@ static read_expects prepare_expects(const char* data, size_t len) { return expectation; } -static void fail_callback(uv_stream_t* stream, ssize_t nread, +static void fail_callback(uv_stream_t* stream, + ssize_t nread, const uv_buf_t* buf) { if (nread < 0) { fprintf(stderr, "IO error: %s\n", uv_strerror(nread)); @@ -316,8 +318,7 @@ static void expect_nothing_on_client() { uv_stream_t* stream = reinterpret_cast(&client_socket); int err = uv_read_start(stream, buffer_alloc_cb, fail_callback); GTEST_ASSERT_EQ(0, err); - for (int i = 0; i < MAX_LOOP_ITERATIONS; i++) - uv_run(&loop, UV_RUN_NOWAIT); + for (int i = 0; i < MAX_LOOP_ITERATIONS; i++) uv_run(&loop, UV_RUN_NOWAIT); uv_read_stop(stream); } @@ -325,7 +326,8 @@ static void expect_on_client(const char* data, size_t len) { read_expects expectation = prepare_expects(data, len); client_socket.data = ℰ uv_read_start(reinterpret_cast(&client_socket), - buffer_alloc_cb, check_data_cb); + buffer_alloc_cb, + check_data_cb); SPIN_WHILE(!expectation.read_expected); } @@ -363,13 +365,17 @@ class InspectorSocketTest : public ::testing::Test { uv_tcp_init(&loop, &client_socket); GTEST_ASSERT_EQ(0, uv_ip4_addr("127.0.0.1", PORT, &addr)); uv_tcp_bind(&server, reinterpret_cast(&addr), 0); - GTEST_ASSERT_EQ(0, uv_listen(reinterpret_cast(&server), - 1, on_new_connection)); + GTEST_ASSERT_EQ( + 0, + uv_listen( + reinterpret_cast(&server), 1, on_new_connection)); uv_connect_t connect; connect.data = nullptr; - GTEST_ASSERT_EQ(0, uv_tcp_connect(&connect, &client_socket, - reinterpret_cast(&addr), - on_connection)); + GTEST_ASSERT_EQ(0, + uv_tcp_connect(&connect, + &client_socket, + reinterpret_cast(&addr), + on_connection)); uv_tcp_nodelay(&client_socket, 1); // The buffering messes up the test SPIN_WHILE(!connect.data || !connected); really_close(reinterpret_cast(&server)); @@ -399,20 +405,28 @@ TEST_F(InspectorSocketTest, ReadsAndWritesInspectorMessage) { delegate->Write(SERVER_MESSAGE, sizeof(SERVER_MESSAGE) - 1); expect_on_client(CLIENT_FRAME, sizeof(CLIENT_FRAME)); - const char SERVER_FRAME[] = {'\x81', '\x84', '\x7F', '\xC2', '\x66', - '\x31', '\x4E', '\xF0', '\x55', '\x05'}; + const char SERVER_FRAME[] = {'\x81', + '\x84', + '\x7F', + '\xC2', + '\x66', + '\x31', + '\x4E', + '\xF0', + '\x55', + '\x05'}; const char CLIENT_MESSAGE[] = "1234"; do_write(SERVER_FRAME, sizeof(SERVER_FRAME)); delegate->ExpectData(CLIENT_MESSAGE, sizeof(CLIENT_MESSAGE) - 1); // 3. Close - const char CLIENT_CLOSE_FRAME[] = {'\x88', '\x80', '\x2D', - '\x0E', '\x1E', '\xFA'}; + const char CLIENT_CLOSE_FRAME[] = { + '\x88', '\x80', '\x2D', '\x0E', '\x1E', '\xFA'}; const char SERVER_CLOSE_FRAME[] = {'\x88', '\x00'}; do_write(CLIENT_CLOSE_FRAME, sizeof(CLIENT_CLOSE_FRAME)); expect_on_client(SERVER_CLOSE_FRAME, sizeof(SERVER_CLOSE_FRAME)); - GTEST_ASSERT_EQ(0, uv_is_active( - reinterpret_cast(&client_socket))); + GTEST_ASSERT_EQ(0, + uv_is_active(reinterpret_cast(&client_socket))); } TEST_F(InspectorSocketTest, BufferEdgeCases) { @@ -535,15 +549,23 @@ TEST_F(InspectorSocketTest, CanStopReadingFromInspector) { ASSERT_TRUE(delegate->inspector_ready); // 2. Brief exchange - const char SERVER_FRAME[] = {'\x81', '\x84', '\x7F', '\xC2', '\x66', - '\x31', '\x4E', '\xF0', '\x55', '\x05'}; + const char SERVER_FRAME[] = {'\x81', + '\x84', + '\x7F', + '\xC2', + '\x66', + '\x31', + '\x4E', + '\xF0', + '\x55', + '\x05'}; const char CLIENT_MESSAGE[] = "1234"; do_write(SERVER_FRAME, sizeof(SERVER_FRAME)); delegate->ExpectData(CLIENT_MESSAGE, sizeof(CLIENT_MESSAGE) - 1); do_write(SERVER_FRAME, sizeof(SERVER_FRAME)); - GTEST_ASSERT_EQ(uv_is_active( - reinterpret_cast(&client_socket)), 0); + GTEST_ASSERT_EQ(uv_is_active(reinterpret_cast(&client_socket)), + 0); } TEST_F(InspectorSocketTest, CloseDoesNotNotifyReadCallback) { @@ -553,8 +575,8 @@ TEST_F(InspectorSocketTest, CloseDoesNotNotifyReadCallback) { delegate->Close(); char CLOSE_FRAME[] = {'\x88', '\x00'}; expect_on_client(CLOSE_FRAME, sizeof(CLOSE_FRAME)); - const char CLIENT_CLOSE_FRAME[] = {'\x88', '\x80', '\x2D', - '\x0E', '\x1E', '\xFA'}; + const char CLIENT_CLOSE_FRAME[] = { + '\x88', '\x80', '\x2D', '\x0E', '\x1E', '\xFA'}; delegate->FailOnWsFrame(); do_write(CLIENT_CLOSE_FRAME, sizeof(CLIENT_CLOSE_FRAME)); SPIN_WHILE(delegate != nullptr); @@ -566,8 +588,8 @@ TEST_F(InspectorSocketTest, CloseWorksWithoutReadEnabled) { delegate->Close(); char CLOSE_FRAME[] = {'\x88', '\x00'}; expect_on_client(CLOSE_FRAME, sizeof(CLOSE_FRAME)); - const char CLIENT_CLOSE_FRAME[] = {'\x88', '\x80', '\x2D', - '\x0E', '\x1E', '\xFA'}; + const char CLIENT_CLOSE_FRAME[] = { + '\x88', '\x80', '\x2D', '\x0E', '\x1E', '\xFA'}; do_write(CLIENT_CLOSE_FRAME, sizeof(CLIENT_CLOSE_FRAME)); } @@ -588,27 +610,28 @@ static const char TEST_SUCCESS[] = "Test Success\n\n"; static int ReportsHttpGet_eventsCount = 0; static void ReportsHttpGet_handshake(enum inspector_handshake_event state, - const std::string& path, bool* cont) { + const std::string& path, + bool* cont) { *cont = true; enum inspector_handshake_event expected_state = kInspectorHandshakeHttpGet; std::string expected_path; switch (delegate->handshake_events) { - case 1: - expected_path = "/some/path"; - break; - case 2: - expected_path = "/respond/withtext"; - delegate->Write(TEST_SUCCESS, sizeof(TEST_SUCCESS) - 1); - break; - case 3: - expected_path = "/some/path2"; - break; - case 4: - expected_path = "/close"; - *cont = false; - break; - default: - ASSERT_TRUE(false); + case 1: + expected_path = "/some/path"; + break; + case 2: + expected_path = "/respond/withtext"; + delegate->Write(TEST_SUCCESS, sizeof(TEST_SUCCESS) - 1); + break; + case 3: + expected_path = "/some/path2"; + break; + case 4: + expected_path = "/close"; + *cont = false; + break; + default: + ASSERT_TRUE(false); } EXPECT_EQ(expected_state, state); EXPECT_EQ(expected_path, path); @@ -646,17 +669,16 @@ TEST_F(InspectorSocketTest, ReportsHttpGet) { static int HandshakeCanBeCanceled_eventCount = 0; -static -void HandshakeCanBeCanceled_handshake(enum inspector_handshake_event state, - const std::string& path, bool* cont) { +static void HandshakeCanBeCanceled_handshake( + enum inspector_handshake_event state, const std::string& path, bool* cont) { switch (delegate->handshake_events - 1) { - case 0: - EXPECT_EQ(kInspectorHandshakeUpgraded, state); - EXPECT_EQ("/ws/path", path); - break; - default: - EXPECT_TRUE(false); - break; + case 0: + EXPECT_EQ(kInspectorHandshakeUpgraded, state); + EXPECT_EQ("/ws/path", path); + break; + default: + EXPECT_TRUE(false); + break; } *cont = false; HandshakeCanBeCanceled_eventCount = delegate->handshake_events; @@ -673,21 +695,22 @@ TEST_F(InspectorSocketTest, HandshakeCanBeCanceled) { } static void GetThenHandshake_handshake(enum inspector_handshake_event state, - const std::string& path, bool* cont) { + const std::string& path, + bool* cont) { *cont = true; std::string expected_path = "/ws/path"; switch (delegate->handshake_events - 1) { - case 0: - EXPECT_EQ(kInspectorHandshakeHttpGet, state); - expected_path = "/respond/withtext"; - delegate->Write(TEST_SUCCESS, sizeof(TEST_SUCCESS) - 1); - break; - case 1: - EXPECT_EQ(kInspectorHandshakeUpgraded, state); - break; - default: - EXPECT_TRUE(false); - break; + case 0: + EXPECT_EQ(kInspectorHandshakeHttpGet, state); + expected_path = "/respond/withtext"; + delegate->Write(TEST_SUCCESS, sizeof(TEST_SUCCESS) - 1); + break; + case 1: + EXPECT_EQ(kInspectorHandshakeUpgraded, state); + break; + default: + EXPECT_TRUE(false); + break; } EXPECT_EQ(expected_path, path); } @@ -744,7 +767,8 @@ static void fill_message(std::string* buffer) { } static void mask_message(const std::string& message, - char* buffer, const char mask[]) { + char* buffer, + const char mask[]) { const size_t mask_len = 4; for (size_t i = 0; i < message.size(); i += 1) { buffer[i] = message[i] ^ mask[i % mask_len]; @@ -763,10 +787,16 @@ TEST_F(InspectorSocketTest, Send1Mb) { fill_message(&message); // 1000000 is 0xF4240 hex - const char EXPECTED_FRAME_HEADER[] = { - '\x81', '\x7f', '\x00', '\x00', '\x00', '\x00', '\x00', '\x0F', - '\x42', '\x40' - }; + const char EXPECTED_FRAME_HEADER[] = {'\x81', + '\x7f', + '\x00', + '\x00', + '\x00', + '\x00', + '\x00', + '\x0F', + '\x42', + '\x40'}; std::string expected(EXPECTED_FRAME_HEADER, sizeof(EXPECTED_FRAME_HEADER)); expected.append(message); @@ -775,10 +805,20 @@ TEST_F(InspectorSocketTest, Send1Mb) { char MASK[4] = {'W', 'h', 'O', 'a'}; - const char FRAME_TO_SERVER_HEADER[] = { - '\x81', '\xff', '\x00', '\x00', '\x00', '\x00', '\x00', '\x0F', - '\x42', '\x40', MASK[0], MASK[1], MASK[2], MASK[3] - }; + const char FRAME_TO_SERVER_HEADER[] = {'\x81', + '\xff', + '\x00', + '\x00', + '\x00', + '\x00', + '\x00', + '\x0F', + '\x42', + '\x40', + MASK[0], + MASK[1], + MASK[2], + MASK[3]}; std::string outgoing(FRAME_TO_SERVER_HEADER, sizeof(FRAME_TO_SERVER_HEADER)); outgoing.resize(outgoing.size() + message.size()); @@ -788,12 +828,12 @@ TEST_F(InspectorSocketTest, Send1Mb) { delegate->ExpectData(&message[0], message.size()); // 3. Close - const char CLIENT_CLOSE_FRAME[] = {'\x88', '\x80', '\x2D', - '\x0E', '\x1E', '\xFA'}; + const char CLIENT_CLOSE_FRAME[] = { + '\x88', '\x80', '\x2D', '\x0E', '\x1E', '\xFA'}; do_write(CLIENT_CLOSE_FRAME, sizeof(CLIENT_CLOSE_FRAME)); expect_on_client(SERVER_CLOSE_FRAME, sizeof(SERVER_CLOSE_FRAME)); - GTEST_ASSERT_EQ(0, uv_is_active( - reinterpret_cast(&client_socket))); + GTEST_ASSERT_EQ(0, + uv_is_active(reinterpret_cast(&client_socket))); } TEST_F(InspectorSocketTest, ErrorCleansUpTheSocket) { @@ -820,15 +860,16 @@ TEST_F(InspectorSocketTest, NoCloseResponseFromClient) { delegate->Close(); expect_on_client(SERVER_CLOSE_FRAME, sizeof(SERVER_CLOSE_FRAME)); uv_close(reinterpret_cast(&client_socket), nullptr); - GTEST_ASSERT_EQ(0, uv_is_active( - reinterpret_cast(&client_socket))); + GTEST_ASSERT_EQ(0, + uv_is_active(reinterpret_cast(&client_socket))); delegate->WaitForDispose(); } static bool delegate_called = false; void shouldnt_be_called(enum inspector_handshake_event state, - const std::string& path, bool* cont) { + const std::string& path, + bool* cont) { delegate_called = true; } diff --git a/test/cctest/test_inspector_socket_server.cc b/test/cctest/test_inspector_socket_server.cc index 349356ef56c9fc..63d48e29598529 100644 --- a/test/cctest/test_inspector_socket_server.cc +++ b/test/cctest/test_inspector_socket_server.cc @@ -1,7 +1,7 @@ #include "inspector_socket_server.h" -#include "node.h" #include "gtest/gtest.h" +#include "node.h" #include #include @@ -60,7 +60,7 @@ class Timeout { static void mark_done(uv_handle_t* timer) { Timeout* t = node::ContainerOf(&Timeout::timer_, - reinterpret_cast(timer)); + reinterpret_cast(timer)); t->done_ = true; } @@ -70,9 +70,7 @@ class Timeout { class InspectorSocketServerTest : public ::testing::Test { protected: - void SetUp() override { - EXPECT_EQ(0, uv_loop_init(&loop)); - } + void SetUp() override { EXPECT_EQ(0, uv_loop_init(&loop)); } void TearDown() override { const int err = uv_loop_close(&loop); @@ -85,12 +83,13 @@ class InspectorSocketServerTest : public ::testing::Test { class SocketWrapper { public: - explicit SocketWrapper(uv_loop_t* loop) : closed_(false), - eof_(false), - loop_(loop), - socket_(uv_tcp_t()), - connected_(false), - sending_(false) { } + explicit SocketWrapper(uv_loop_t* loop) + : closed_(false), + eof_(false), + loop_(loop), + socket_(uv_tcp_t()), + connected_(false), + sending_(false) {} void Connect(std::string host, int port, bool v6 = false) { closed_ = false; @@ -99,7 +98,11 @@ class SocketWrapper { eof_ = false; contents_.clear(); uv_tcp_init(loop_, &socket_); - union {sockaddr generic; sockaddr_in v4; sockaddr_in6 v6;} addr; + union { + sockaddr generic; + sockaddr_in v4; + sockaddr_in6 v6; + } addr; int err = 0; if (v6) { err = uv_ip6_addr(host.c_str(), port, &addr.v6); @@ -110,8 +113,8 @@ class SocketWrapper { err = uv_tcp_connect(&connect_, &socket_, &addr.generic, Connected_); CHECK_EQ(0, err); SPIN_WHILE(!connected_) - uv_read_start(reinterpret_cast(&socket_), AllocCallback, - ReadCallback); + uv_read_start( + reinterpret_cast(&socket_), AllocCallback, ReadCallback); } void ExpectFailureToConnect(std::string host, int port) { @@ -124,13 +127,14 @@ class SocketWrapper { sockaddr_in addr; int err = uv_ip4_addr(host.c_str(), port, &addr); CHECK_EQ(0, err); - err = uv_tcp_connect(&connect_, &socket_, + err = uv_tcp_connect(&connect_, + &socket_, reinterpret_cast(&addr), ConnectionMustFail_); CHECK_EQ(0, err); SPIN_WHILE(!connection_failed_) - uv_read_start(reinterpret_cast(&socket_), AllocCallback, - ReadCallback); + uv_read_start( + reinterpret_cast(&socket_), AllocCallback, ReadCallback); } void Close() { @@ -159,7 +163,8 @@ class SocketWrapper { "Content-Length: "; expectations << expected_reply.length() + 2; expectations << "\r\n\r\n" << expected_reply << "\n\n"; - Write("GET " + path + " HTTP/1.1\r\n" + Write("GET " + path + + " HTTP/1.1\r\n" "Host: localhost:9229\r\n\r\n"); Expect(expectations.str()); } @@ -170,8 +175,8 @@ class SocketWrapper { buf[0].base = const_cast(data.data()); buf[0].len = data.length(); sending_ = true; - int err = uv_write(&write_, reinterpret_cast(&socket_), - buf, 1, WriteDone_); + int err = uv_write( + &write_, reinterpret_cast(&socket_), buf, 1, WriteDone_); CHECK_EQ(err, 0); SPIN_WHILE(sending_); } @@ -182,9 +187,8 @@ class SocketWrapper { } static void ClosedCallback(uv_handle_t* handle) { - SocketWrapper* wrapper = - node::ContainerOf(&SocketWrapper::socket_, - reinterpret_cast(handle)); + SocketWrapper* wrapper = node::ContainerOf( + &SocketWrapper::socket_, reinterpret_cast(handle)); ASSERT_FALSE(wrapper->closed_); wrapper->closed_ = true; } @@ -203,23 +207,22 @@ class SocketWrapper { wrapper->connection_failed_ = true; } - static void ReadCallback(uv_stream_t* stream, ssize_t read, + static void ReadCallback(uv_stream_t* stream, + ssize_t read, const uv_buf_t* buf) { - SocketWrapper* wrapper = - node::ContainerOf(&SocketWrapper::socket_, - reinterpret_cast(stream)); + SocketWrapper* wrapper = node::ContainerOf( + &SocketWrapper::socket_, reinterpret_cast(stream)); if (read == UV_EOF) { wrapper->eof_ = true; } else { - wrapper->contents_.insert(wrapper->contents_.end(), buf->base, - buf->base + read); + wrapper->contents_.insert( + wrapper->contents_.end(), buf->base, buf->base + read); } delete[] buf->base; } static void WriteDone_(uv_write_t* req, int err) { CHECK_EQ(0, err); - SocketWrapper* wrapper = - node::ContainerOf(&SocketWrapper::write_, req); + SocketWrapper* wrapper = node::ContainerOf(&SocketWrapper::write_, req); ASSERT_TRUE(wrapper->sending_); wrapper->sending_ = false; } @@ -240,30 +243,23 @@ class SocketWrapper { class ServerHolder { public: ServerHolder(bool has_targets, uv_loop_t* loop, int port) - : ServerHolder(has_targets, loop, HOST, port, nullptr) { } + : ServerHolder(has_targets, loop, HOST, port, nullptr) {} - ServerHolder(bool has_targets, uv_loop_t* loop, - const std::string host, int port, FILE* out); + ServerHolder(bool has_targets, + uv_loop_t* loop, + const std::string host, + int port, + FILE* out); - InspectorSocketServer* operator->() { - return server_.get(); - } + InspectorSocketServer* operator->() { return server_.get(); } - int port() { - return server_->Port(); - } + int port() { return server_->Port(); } - bool done() { - return server_->done(); - } + bool done() { return server_->done(); } - void Disconnected() { - disconnected++; - } + void Disconnected() { disconnected++; } - void Done() { - delegate_done = true; - } + void Done() { delegate_done = true; } void Connected(int id) { buffer_.clear(); @@ -298,16 +294,11 @@ class ServerHolder { class TestSocketServerDelegate : public SocketServerDelegate { public: - explicit TestSocketServerDelegate( - ServerHolder* server, - const std::vector& target_ids) - : harness_(server), - targets_(target_ids), - session_id_(0) {} + explicit TestSocketServerDelegate(ServerHolder* server, + const std::vector& target_ids) + : harness_(server), targets_(target_ids), session_id_(0) {} - ~TestSocketServerDelegate() { - harness_->Done(); - } + ~TestSocketServerDelegate() { harness_->Done(); } void AssignServer(InspectorSocketServer* server) override { server_ = server; @@ -330,9 +321,7 @@ class TestSocketServerDelegate : public SocketServerDelegate { harness_->Disconnected(); } - std::vector GetTargetIds() override { - return targets_; - } + std::vector GetTargetIds() override { return targets_; } std::string GetTargetTitle(const std::string& id) override { return id + " Target Title"; @@ -349,18 +338,21 @@ class TestSocketServerDelegate : public SocketServerDelegate { int session_id_; }; -ServerHolder::ServerHolder(bool has_targets, uv_loop_t* loop, - const std::string host, int port, FILE* out) { +ServerHolder::ServerHolder(bool has_targets, + uv_loop_t* loop, + const std::string host, + int port, + FILE* out) { std::vector targets; - if (has_targets) - targets = { MAIN_TARGET_ID }; + if (has_targets) targets = {MAIN_TARGET_ID}; std::unique_ptr delegate( new TestSocketServerDelegate(this, targets)); server_.reset( new InspectorSocketServer(std::move(delegate), loop, host, port, out)); } -static void TestHttpRequest(int port, const std::string& path, +static void TestHttpRequest(int port, + const std::string& path, const std::string& expected_body) { SocketWrapper socket(&loop); socket.Connect(HOST, port); @@ -369,7 +361,8 @@ static void TestHttpRequest(int port, const std::string& path, } static const std::string WsHandshakeRequest(const std::string& target_id) { - return "GET /" + target_id + " HTTP/1.1\r\n" + return "GET /" + target_id + + " HTTP/1.1\r\n" "Host: localhost:9229\r\n" "Upgrade: websocket\r\n" "Connection: Upgrade\r\n" @@ -378,7 +371,6 @@ static const std::string WsHandshakeRequest(const std::string& target_id) { } } // anonymous namespace - TEST_F(InspectorSocketServerTest, InspectorSessions) { ServerHolder server(true, &loop, 0); ASSERT_TRUE(server->Start()); @@ -396,7 +388,8 @@ TEST_F(InspectorSocketServerTest, InspectorSessions) { server.Expect("1234"); server.Write("5678"); - well_behaved_socket.Expect("\x81\x4" "5678"); + well_behaved_socket.Expect("\x81\x4" + "5678"); well_behaved_socket.Write(CLIENT_CLOSE_FRAME); well_behaved_socket.Expect(SERVER_CLOSE_FRAME); @@ -422,7 +415,8 @@ TEST_F(InspectorSocketServerTest, InspectorSessions) { EXPECT_EQ(2, server.connected); server.Write("5678"); - dropped_connection_socket.Expect("\x81\x4" "5678"); + dropped_connection_socket.Expect("\x81\x4" + "5678"); dropped_connection_socket.Close(); SPIN_WHILE(server.disconnected < 2); @@ -436,10 +430,11 @@ TEST_F(InspectorSocketServerTest, InspectorSessions) { SPIN_WHILE(3 != server.connected); server.Write("5678"); - stays_till_termination_socket.Expect("\x81\x4" "5678"); + stays_till_termination_socket.Expect("\x81\x4" + "5678"); - stays_till_termination_socket - .Write("\x81\x84\x7F\xC2\x66\x31\x4E\xF0\x55\x05"); + stays_till_termination_socket.Write( + "\x81\x84\x7F\xC2\x66\x31\x4E\xF0\x55\x05"); server.Expect("1234"); server->Stop(); diff --git a/test/cctest/test_node_postmortem_metadata.cc b/test/cctest/test_node_postmortem_metadata.cc index 79b766939b9d0d..99df19d14aaadb 100644 --- a/test/cctest/test_node_postmortem_metadata.cc +++ b/test/cctest/test_node_postmortem_metadata.cc @@ -28,10 +28,8 @@ extern uintptr_t nodedbg_offset_BaseObject__persistent_handle___v8_Persistent_v8_Object; } - class DebugSymbolsTest : public EnvironmentTestFixture {}; - class TestHandleWrap : public node::HandleWrap { public: SET_NO_MEMORY_INFO() @@ -47,7 +45,6 @@ class TestHandleWrap : public node::HandleWrap { node::AsyncWrap::PROVIDER_TCPWRAP) {} }; - class TestReqWrap : public node::ReqWrap { public: SET_NO_MEMORY_INFO() @@ -55,9 +52,8 @@ class TestReqWrap : public node::ReqWrap { SET_SELF_SIZE(TestReqWrap) TestReqWrap(node::Environment* env, v8::Local object) - : node::ReqWrap(env, - object, - node::AsyncWrap::PROVIDER_FSREQCALLBACK) {} + : node::ReqWrap( + env, object, node::AsyncWrap::PROVIDER_FSREQCALLBACK) {} }; TEST_F(DebugSymbolsTest, ContextEmbedderEnvironmentIndex) { @@ -73,8 +69,8 @@ TEST_F(DebugSymbolsTest, ExternalStringDataOffset) { class DummyBaseObject : public node::BaseObject { public: - DummyBaseObject(node::Environment* env, v8::Local obj) : - BaseObject(env, obj) {} + DummyBaseObject(node::Environment* env, v8::Local obj) + : BaseObject(env, obj) {} SET_NO_MEMORY_INFO() SET_MEMORY_INFO_NAME(DummyBaseObject) @@ -94,21 +90,22 @@ TEST_F(DebugSymbolsTest, BaseObjectPersistentHandle) { DummyBaseObject obj(*env, object); auto expected = reinterpret_cast(&obj.persistent()); - auto calculated = reinterpret_cast(&obj) + + auto calculated = + reinterpret_cast(&obj) + nodedbg_offset_BaseObject__persistent_handle___v8_Persistent_v8_Object; EXPECT_EQ(expected, calculated); obj.persistent().Reset(); // ~BaseObject() expects an empty handle. } - TEST_F(DebugSymbolsTest, EnvironmentHandleWrapQueue) { const v8::HandleScope handle_scope(isolate_); const Argv argv; Env env{handle_scope, argv}; auto expected = reinterpret_cast((*env)->handle_wrap_queue()); - auto calculated = reinterpret_cast(*env) + + auto calculated = + reinterpret_cast(*env) + nodedbg_offset_Environment__handle_wrap_queue___Environment_HandleWrapQueue; // NOLINT(whitespace/line_length) EXPECT_EQ(expected, calculated); } @@ -119,7 +116,8 @@ TEST_F(DebugSymbolsTest, EnvironmentReqWrapQueue) { Env env{handle_scope, argv}; auto expected = reinterpret_cast((*env)->req_wrap_queue()); - auto calculated = reinterpret_cast(*env) + + auto calculated = + reinterpret_cast(*env) + nodedbg_offset_Environment__req_wrap_queue___Environment_ReqWrapQueue; EXPECT_EQ(expected, calculated); } @@ -141,15 +139,15 @@ TEST_F(DebugSymbolsTest, HandleWrapList) { TestHandleWrap obj(*env, object, &handle); auto queue = reinterpret_cast((*env)->handle_wrap_queue()); - auto head = queue + + auto head = + queue + nodedbg_offset_Environment_HandleWrapQueue__head___ListNode_HandleWrap; - auto next = - head + nodedbg_offset_ListNode_HandleWrap__next___uintptr_t; + auto next = head + nodedbg_offset_ListNode_HandleWrap__next___uintptr_t; next = *reinterpret_cast(next); auto expected = reinterpret_cast(&obj); - auto calculated = next - - nodedbg_offset_HandleWrap__handle_wrap_queue___ListNode_HandleWrap; + auto calculated = + next - nodedbg_offset_HandleWrap__handle_wrap_queue___ListNode_HandleWrap; EXPECT_EQ(expected, calculated); obj.persistent().Reset(); // ~HandleWrap() expects an empty handle. @@ -172,13 +170,13 @@ TEST_F(DebugSymbolsTest, ReqWrapList) { // NOTE (mmarchini): Workaround to fix failing tests on ARM64 machines with // older GCC. Should be removed once we upgrade the GCC version used on our // ARM64 CI machinies. - for (auto it : *(*env)->req_wrap_queue()) (void) ⁢ + for (auto it : *(*env)->req_wrap_queue()) (void)⁢ auto queue = reinterpret_cast((*env)->req_wrap_queue()); - auto head = queue + + auto head = + queue + nodedbg_offset_Environment_ReqWrapQueue__head___ListNode_ReqWrapQueue; - auto next = - head + nodedbg_offset_ListNode_ReqWrap__next___uintptr_t; + auto next = head + nodedbg_offset_ListNode_ReqWrap__next___uintptr_t; next = *reinterpret_cast(next); auto expected = reinterpret_cast(&obj); diff --git a/test/cctest/test_platform.cc b/test/cctest/test_platform.cc index 876547480b7032..b5bac89187df99 100644 --- a/test/cctest/test_platform.cc +++ b/test/cctest/test_platform.cc @@ -1,5 +1,5 @@ -#include "node_internals.h" #include "libplatform/libplatform.h" +#include "node_internals.h" #include #include "gtest/gtest.h" @@ -23,7 +23,8 @@ class RepostingTask : public v8::Task { ++*run_count_; if (repost_count_ > 0) { --repost_count_; - platform_->CallOnForegroundThread(isolate_, + platform_->CallOnForegroundThread( + isolate_, new RepostingTask(repost_count_, run_count_, isolate_, platform_)); } } @@ -41,7 +42,7 @@ TEST_F(PlatformTest, SkipNewTasksInFlushForegroundTasks) { v8::Isolate::Scope isolate_scope(isolate_); const v8::HandleScope handle_scope(isolate_); const Argv argv; - Env env {handle_scope, argv}; + Env env{handle_scope, argv}; int run_count = 0; platform->CallOnForegroundThread( isolate_, new RepostingTask(2, &run_count, isolate_, platform.get())); diff --git a/test/cctest/test_report_util.cc b/test/cctest/test_report_util.cc index e32558ef75b5e8..df68474d24df65 100644 --- a/test/cctest/test_report_util.cc +++ b/test/cctest/test_report_util.cc @@ -12,13 +12,13 @@ TEST(ReportUtilTest, EscapeJsonChars) { const std::string expected[0x20] = { "\\u0000", "\\u0001", "\\u0002", "\\u0003", "\\u0004", "\\u0005", - "\\u0006", "\\u0007", "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", - "\\u000e", "\\u000f", "\\u0010", "\\u0011", "\\u0012", "\\u0013", - "\\u0014", "\\u0015", "\\u0016", "\\u0017", "\\u0018", "\\u0019", - "\\u001a", "\\u001b", "\\u001c", "\\u001d", "\\u001e", "\\u001f" - }; + "\\u0006", "\\u0007", "\\b", "\\t", "\\n", "\\v", + "\\f", "\\r", "\\u000e", "\\u000f", "\\u0010", "\\u0011", + "\\u0012", "\\u0013", "\\u0014", "\\u0015", "\\u0016", "\\u0017", + "\\u0018", "\\u0019", "\\u001a", "\\u001b", "\\u001c", "\\u001d", + "\\u001e", "\\u001f"}; for (int i = 0; i < 0x20; ++i) { - char symbols[1] = { static_cast(i) }; + char symbols[1] = {static_cast(i)}; std::string input(symbols, 1); EXPECT_EQ(expected[i], EscapeJsonChars(input)); EXPECT_EQ("a" + expected[i], EscapeJsonChars("a" + input)); diff --git a/test/cctest/test_traced_value.cc b/test/cctest/test_traced_value.cc index 5329c78446ca6f..3cc1978dc50356 100644 --- a/test/cctest/test_traced_value.cc +++ b/test/cctest/test_traced_value.cc @@ -62,13 +62,14 @@ TEST(TracedValue, Array) { EXPECT_EQ(check, string); } -#define UTF8_SEQUENCE "1" "\xE2\x82\xAC" "23\"\x01\b\f\n\r\t\\" +#define UTF8_SEQUENCE \ + "1" \ + "\xE2\x82\xAC" \ + "23\"\x01\b\f\n\r\t\\" #if defined(NODE_HAVE_I18N_SUPPORT) -# define UTF8_RESULT \ - "\"1\\u20AC23\\\"\\u0001\\b\\f\\n\\r\\t\\\\\"" +#define UTF8_RESULT "\"1\\u20AC23\\\"\\u0001\\b\\f\\n\\r\\t\\\\\"" #else -# define UTF8_RESULT \ - "\"1\\u00E2\\u0082\\u00AC23\\\"\\u0001\\b\\f\\n\\r\\t\\\\\"" +#define UTF8_RESULT "\"1\\u00E2\\u0082\\u00AC23\\\"\\u0001\\b\\f\\n\\r\\t\\\\\"" #endif TEST(TracedValue, EscapingObject) { diff --git a/test/cctest/test_url.cc b/test/cctest/test_url.cc index ddef534b57485f..977d572bd5d56d 100644 --- a/test/cctest/test_url.cc +++ b/test/cctest/test_url.cc @@ -1,5 +1,5 @@ -#include "node_url.h" #include "node_i18n.h" +#include "node_url.h" #include "gtest/gtest.h" diff --git a/test/cctest/test_util.cc b/test/cctest/test_util.cc index db19d92cbd9c19..6163c6bfea2867 100644 --- a/test/cctest/test_util.cc +++ b/test/cctest/test_util.cc @@ -1,10 +1,12 @@ -#include "util.h" #include "util-inl.h" +#include "util.h" #include "gtest/gtest.h" TEST(UtilTest, ListHead) { - struct Item { node::ListNode node_; }; + struct Item { + node::ListNode node_; + }; typedef node::ListHead List; List list; @@ -90,11 +92,11 @@ TEST(UtilTest, ToLower) { EXPECT_EQ('a', ToLower('A')); } -#define TEST_AND_FREE(expression) \ - do { \ - auto pointer = expression; \ - EXPECT_NE(nullptr, pointer); \ - free(pointer); \ +#define TEST_AND_FREE(expression) \ + do { \ + auto pointer = expression; \ + EXPECT_NE(nullptr, pointer); \ + free(pointer); \ } while (0) TEST(UtilTest, Malloc) { @@ -152,8 +154,7 @@ static void MaybeStackBufferBasic() { EXPECT_EQ(&buf[0], *buf); /* Basic I/O */ - for (size_t i = 0; i < buf.length(); i++) - buf[i] = static_cast(i); + for (size_t i = 0; i < buf.length(); i++) buf[i] = static_cast(i); for (size_t i = 0; i < buf.length(); i++) EXPECT_EQ(static_cast(i), buf[i]); @@ -171,13 +172,11 @@ static void MaybeStackBufferBasic() { buf.AllocateSufficientStorage(buf.capacity() * 2); EXPECT_EQ(buf.capacity(), buf.length()); EXPECT_TRUE(buf.IsAllocated()); - for (size_t i = 0; i < old_length; i++) - EXPECT_EQ(static_cast(i), buf[i]); + for (size_t i = 0; i < old_length; i++) EXPECT_EQ(static_cast(i), buf[i]); EXPECT_EQ(0, buf[old_length]); /* SetLength() reduction and expansion */ - for (size_t i = 0; i < buf.length(); i++) - buf[i] = static_cast(i); + for (size_t i = 0; i < buf.length(); i++) buf[i] = static_cast(i); buf.SetLength(10); for (size_t i = 0; i < buf.length(); i++) EXPECT_EQ(static_cast(i), buf[i]); @@ -192,12 +191,10 @@ static void MaybeStackBufferBasic() { EXPECT_EQ(buf.capacity(), buf.length()); EXPECT_EQ(static_cast(old_capacity * 1.5), buf.length()); EXPECT_TRUE(buf.IsAllocated()); - for (size_t i = 0; i < old_length; i++) - EXPECT_EQ(static_cast(i), buf[i]); + for (size_t i = 0; i < old_length; i++) EXPECT_EQ(static_cast(i), buf[i]); /* Basic I/O on Realloc'd buffer */ - for (size_t i = 0; i < buf.length(); i++) - buf[i] = static_cast(i); + for (size_t i = 0; i < buf.length(); i++) buf[i] = static_cast(i); for (size_t i = 0; i < buf.length(); i++) EXPECT_EQ(static_cast(i), buf[i]); diff --git a/test/js-native-api/common.h b/test/js-native-api/common.h index b16f944771c1df..3a0458b841787f 100644 --- a/test/js-native-api/common.h +++ b/test/js-native-api/common.h @@ -1,60 +1,57 @@ // Empty value so that macros here are able to return NULL or void #define NAPI_RETVAL_NOTHING // Intentionally blank #define -#define GET_AND_THROW_LAST_ERROR(env) \ - do { \ - const napi_extended_error_info *error_info; \ - napi_get_last_error_info((env), &error_info); \ - bool is_pending; \ - napi_is_exception_pending((env), &is_pending); \ - /* If an exception is already pending, don't rethrow it */ \ - if (!is_pending) { \ - const char* error_message = error_info->error_message != NULL ? \ - error_info->error_message : \ - "empty error message"; \ - napi_throw_error((env), NULL, error_message); \ - } \ +#define GET_AND_THROW_LAST_ERROR(env) \ + do { \ + const napi_extended_error_info* error_info; \ + napi_get_last_error_info((env), &error_info); \ + bool is_pending; \ + napi_is_exception_pending((env), &is_pending); \ + /* If an exception is already pending, don't rethrow it */ \ + if (!is_pending) { \ + const char* error_message = error_info->error_message != NULL \ + ? error_info->error_message \ + : "empty error message"; \ + napi_throw_error((env), NULL, error_message); \ + } \ } while (0) -#define NAPI_ASSERT_BASE(env, assertion, message, ret_val) \ - do { \ - if (!(assertion)) { \ - napi_throw_error( \ - (env), \ - NULL, \ - "assertion (" #assertion ") failed: " message); \ - return ret_val; \ - } \ +#define NAPI_ASSERT_BASE(env, assertion, message, ret_val) \ + do { \ + if (!(assertion)) { \ + napi_throw_error( \ + (env), NULL, "assertion (" #assertion ") failed: " message); \ + return ret_val; \ + } \ } while (0) // Returns NULL on failed assertion. // This is meant to be used inside napi_callback methods. -#define NAPI_ASSERT(env, assertion, message) \ +#define NAPI_ASSERT(env, assertion, message) \ NAPI_ASSERT_BASE(env, assertion, message, NULL) // Returns empty on failed assertion. // This is meant to be used inside functions with void return type. -#define NAPI_ASSERT_RETURN_VOID(env, assertion, message) \ +#define NAPI_ASSERT_RETURN_VOID(env, assertion, message) \ NAPI_ASSERT_BASE(env, assertion, message, NAPI_RETVAL_NOTHING) -#define NAPI_CALL_BASE(env, the_call, ret_val) \ - do { \ - if ((the_call) != napi_ok) { \ - GET_AND_THROW_LAST_ERROR((env)); \ - return ret_val; \ - } \ +#define NAPI_CALL_BASE(env, the_call, ret_val) \ + do { \ + if ((the_call) != napi_ok) { \ + GET_AND_THROW_LAST_ERROR((env)); \ + return ret_val; \ + } \ } while (0) // Returns NULL if the_call doesn't return napi_ok. -#define NAPI_CALL(env, the_call) \ - NAPI_CALL_BASE(env, the_call, NULL) +#define NAPI_CALL(env, the_call) NAPI_CALL_BASE(env, the_call, NULL) // Returns empty if the_call doesn't return napi_ok. -#define NAPI_CALL_RETURN_VOID(env, the_call) \ +#define NAPI_CALL_RETURN_VOID(env, the_call) \ NAPI_CALL_BASE(env, the_call, NAPI_RETVAL_NOTHING) -#define DECLARE_NAPI_PROPERTY(name, func) \ +#define DECLARE_NAPI_PROPERTY(name, func) \ { (name), NULL, (func), NULL, NULL, NULL, napi_default, NULL } -#define DECLARE_NAPI_GETTER(name, func) \ +#define DECLARE_NAPI_GETTER(name, func) \ { (name), NULL, NULL, (func), NULL, NULL, napi_default, NULL }