diff options
Diffstat (limited to 'src')
32 files changed, 38 insertions, 50 deletions
diff --git a/src/debug_utils.h b/src/debug_utils.h index 05a9370e56..ef5a4c0c47 100644 --- a/src/debug_utils.h +++ b/src/debug_utils.h @@ -100,7 +100,7 @@ class NativeSymbolDebuggingContext { }; NativeSymbolDebuggingContext() = default; - virtual ~NativeSymbolDebuggingContext() {} + virtual ~NativeSymbolDebuggingContext() = default; virtual SymbolInfo LookupSymbol(void* address) { return {}; } virtual bool IsMapped(void* address) { return false; } @@ -540,7 +540,7 @@ struct AllocatedBuffer { class AsyncRequest : public MemoryRetainer { public: - AsyncRequest() {} + AsyncRequest() = default; ~AsyncRequest(); void Install(Environment* env, void* data, uv_async_cb target); void Uninstall(); diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc index b5807dd3ff..5033f027b1 100644 --- a/src/fs_event_wrap.cc +++ b/src/fs_event_wrap.cc @@ -65,7 +65,7 @@ class FSEventWrap: public HandleWrap { static const encoding kDefaultEncoding = UTF8; FSEventWrap(Environment* env, Local<Object> object); - ~FSEventWrap() override; + ~FSEventWrap() = default; static void OnEvent(uv_fs_event_t* handle, const char* filename, int events, int status); @@ -84,9 +84,6 @@ FSEventWrap::FSEventWrap(Environment* env, Local<Object> object) } -FSEventWrap::~FSEventWrap() { -} - void FSEventWrap::GetInitialized(const FunctionCallbackInfo<Value>& args) { FSEventWrap* wrap = Unwrap<FSEventWrap>(args.This()); CHECK_NOT_NULL(wrap); diff --git a/src/inspector/main_thread_interface.h b/src/inspector/main_thread_interface.h index e3f2a7fb16..9a48192cd3 100644 --- a/src/inspector/main_thread_interface.h +++ b/src/inspector/main_thread_interface.h @@ -26,12 +26,12 @@ class MainThreadInterface; class Request { public: virtual void Call(MainThreadInterface*) = 0; - virtual ~Request() {} + virtual ~Request() = default; }; class Deletable { public: - virtual ~Deletable() {} + virtual ~Deletable() = default; }; std::unique_ptr<v8_inspector::StringBuffer> Utf8ToStringView( diff --git a/src/inspector/worker_inspector.h b/src/inspector/worker_inspector.h index c1d3b8a571..9f5604e79a 100644 --- a/src/inspector/worker_inspector.h +++ b/src/inspector/worker_inspector.h @@ -21,7 +21,7 @@ class WorkerDelegate { const std::string& url, bool waiting, std::shared_ptr<MainThreadHandle> worker) = 0; - virtual ~WorkerDelegate() {} + virtual ~WorkerDelegate() = default; }; class WorkerManagerEventHandle { diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc index cda5cdbbd8..10b607ff6c 100644 --- a/src/inspector_agent.cc +++ b/src/inspector_agent.cc @@ -354,7 +354,7 @@ class InspectorTimer { // Unique_ptr goes out of scope here and pointer is deleted. } - ~InspectorTimer() {} + ~InspectorTimer() = default; Environment* env_; uv_timer_t timer_; diff --git a/src/inspector_agent.h b/src/inspector_agent.h index aa89fbba6b..b079ea675f 100644 --- a/src/inspector_agent.h +++ b/src/inspector_agent.h @@ -30,7 +30,7 @@ class WorkerManager; class InspectorSession { public: - virtual ~InspectorSession() {} + virtual ~InspectorSession() = default; virtual void Dispatch(const v8_inspector::StringView& message) = 0; }; diff --git a/src/inspector_io.cc b/src/inspector_io.cc index 20785fc677..75bcfff5f7 100644 --- a/src/inspector_io.cc +++ b/src/inspector_io.cc @@ -217,8 +217,7 @@ class InspectorIoDelegate: public node::inspector::SocketServerDelegate { const std::string& target_id, const std::string& script_path, const std::string& script_name); - ~InspectorIoDelegate() override { - } + ~InspectorIoDelegate() override = default; void StartSession(int session_id, const std::string& target_id) override; void MessageReceived(int session_id, const std::string& message) override; diff --git a/src/inspector_socket.h b/src/inspector_socket.h index 3f4fc0c295..649b7f445d 100644 --- a/src/inspector_socket.h +++ b/src/inspector_socket.h @@ -25,7 +25,7 @@ class InspectorSocket { const std::string& path, const std::string& accept_key) = 0; virtual void OnWsFrame(const std::vector<char>& frame) = 0; - virtual ~Delegate() {} + virtual ~Delegate() = default; }; using DelegatePointer = std::unique_ptr<Delegate>; diff --git a/src/inspector_socket_server.h b/src/inspector_socket_server.h index 1ee9cce8f3..8d38cd5054 100644 --- a/src/inspector_socket_server.h +++ b/src/inspector_socket_server.h @@ -31,7 +31,7 @@ class SocketServerDelegate { virtual std::vector<std::string> GetTargetIds() = 0; virtual std::string GetTargetTitle(const std::string& id) = 0; virtual std::string GetTargetUrl(const std::string& id) = 0; - virtual ~SocketServerDelegate() {} + virtual ~SocketServerDelegate() = default; }; // HTTP Server, writes messages requested as TransportActions, and responds diff --git a/src/js_native_api_v8.h b/src/js_native_api_v8.h index 4e1779e8f0..9d896ae1f2 100644 --- a/src/js_native_api_v8.h +++ b/src/js_native_api_v8.h @@ -12,7 +12,7 @@ struct napi_env__ { context_persistent(isolate, context) { CHECK_EQ(isolate, context->GetIsolate()); } - virtual ~napi_env__() {} + virtual ~napi_env__() = default; v8::Isolate* const isolate; // Shortcut for context()->GetIsolate() v8impl::Persistent<v8::Context> context_persistent; @@ -167,8 +167,7 @@ class Finalizer { _finalize_hint(finalize_hint) { } - ~Finalizer() { - } + ~Finalizer() = default; public: static Finalizer* New(napi_env env, diff --git a/src/memory_tracker.h b/src/memory_tracker.h index 07b1b47216..6a5ab15511 100644 --- a/src/memory_tracker.h +++ b/src/memory_tracker.h @@ -109,7 +109,7 @@ class CleanupHookCallback; */ class MemoryRetainer { public: - virtual ~MemoryRetainer() {} + virtual ~MemoryRetainer() = default; // Subclasses should implement these methods to provide information // for the V8 heap snapshot generator. diff --git a/src/node.h b/src/node.h index e638ff2418..cbf9b938f1 100644 --- a/src/node.h +++ b/src/node.h @@ -248,7 +248,7 @@ NODE_EXTERN void FreeArrayBufferAllocator(ArrayBufferAllocator* allocator); class NODE_EXTERN MultiIsolatePlatform : public v8::Platform { public: - ~MultiIsolatePlatform() override { } + ~MultiIsolatePlatform() override = default; // Returns true if work was dispatched or executed. New tasks that are // posted during flushing of the queue are postponed until the next // flushing. diff --git a/src/node_api.cc b/src/node_api.cc index fa68323b3c..ecacd7013f 100644 --- a/src/node_api.cc +++ b/src/node_api.cc @@ -841,7 +841,7 @@ class Work : public node::AsyncResource, public node::ThreadPoolWork { _complete(complete) { } - ~Work() override { } + ~Work() override = default; public: static Work* New(node_napi_env env, diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 70d873eeb6..49d1d41779 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -6069,7 +6069,7 @@ class KeyPairGenerationConfig { virtual bool Configure(const EVPKeyCtxPointer& ctx) { return true; } - virtual ~KeyPairGenerationConfig() {} + virtual ~KeyPairGenerationConfig() = default; }; class RSAKeyPairGenerationConfig : public KeyPairGenerationConfig { diff --git a/src/node_env_var.cc b/src/node_env_var.cc index b7b862304d..abcf918506 100644 --- a/src/node_env_var.cc +++ b/src/node_env_var.cc @@ -50,7 +50,7 @@ class MapKVStore final : public KVStore { std::shared_ptr<KVStore> Clone(Isolate* isolate) const override; - MapKVStore() {} + MapKVStore() = default; MapKVStore(const MapKVStore& other) : map_(other.map_) {} private: diff --git a/src/node_file.cc b/src/node_file.cc index 5d3b48cfa4..acdf01a5fe 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -681,7 +681,7 @@ void AfterScanDirWithTypes(uv_fs_t* req) { // For async calls FSReqCallback is used. class FSReqWrapSync { public: - FSReqWrapSync() {} + FSReqWrapSync() = default; ~FSReqWrapSync() { uv_fs_req_cleanup(&req); } uv_fs_t req; diff --git a/src/node_http2.h b/src/node_http2.h index 06adfd55cd..c8ffa69f2e 100644 --- a/src/node_http2.h +++ b/src/node_http2.h @@ -1208,7 +1208,7 @@ class ExternalHeader : class Headers { public: Headers(Isolate* isolate, Local<Context> context, Local<Array> headers); - ~Headers() {} + ~Headers() = default; nghttp2_nv* operator*() { return reinterpret_cast<nghttp2_nv*>(*buf_); @@ -1229,7 +1229,7 @@ class Origins { Local<Context> context, Local<v8::String> origin_string, size_t origin_count); - ~Origins() {} + ~Origins() = default; nghttp2_origin_entry* operator*() { return reinterpret_cast<nghttp2_origin_entry*>(*buf_); diff --git a/src/node_i18n.cc b/src/node_i18n.cc index 1ea7efc7d2..0c565c447f 100644 --- a/src/node_i18n.cc +++ b/src/node_i18n.cc @@ -152,7 +152,7 @@ class ConverterObject : public BaseObject, Converter { CONVERTER_FLAGS_IGNORE_BOM = 0x4 }; - ~ConverterObject() override {} + ~ConverterObject() override = default; static void Has(const FunctionCallbackInfo<Value>& args) { Environment* env = Environment::GetCurrent(args); diff --git a/src/node_options.h b/src/node_options.h index f922615690..3b2513a183 100644 --- a/src/node_options.h +++ b/src/node_options.h @@ -47,7 +47,7 @@ class HostPort { class Options { public: virtual void CheckOptions(std::vector<std::string>* errors) {} - virtual ~Options() {} + virtual ~Options() = default; }; // These options are currently essentially per-Environment, but it can be nice @@ -240,7 +240,7 @@ enum OptionType { template <typename Options> class OptionsParser { public: - virtual ~OptionsParser() {} + virtual ~OptionsParser() = default; typedef Options TargetType; @@ -338,7 +338,7 @@ class OptionsParser { // Represents a field within `Options`. class BaseOptionField { public: - virtual ~BaseOptionField() {} + virtual ~BaseOptionField() = default; virtual void* LookupImpl(Options* options) const = 0; template <typename T> diff --git a/src/node_perf.h b/src/node_perf.h index 2e77c6f25e..4c7585d65f 100644 --- a/src/node_perf.h +++ b/src/node_perf.h @@ -71,7 +71,7 @@ class PerformanceEntry { startTime_(startTime), endTime_(endTime) { } - virtual ~PerformanceEntry() { } + virtual ~PerformanceEntry() = default; virtual v8::MaybeLocal<Object> ToObject() const; diff --git a/src/node_platform.h b/src/node_platform.h index c3a1fb04fa..66f86cfa7e 100644 --- a/src/node_platform.h +++ b/src/node_platform.h @@ -24,7 +24,7 @@ template <class T> class TaskQueue { public: TaskQueue(); - ~TaskQueue() {} + ~TaskQueue() = default; void Push(std::unique_ptr<T> task); std::unique_ptr<T> Pop(); @@ -134,7 +134,7 @@ class NodePlatform : public MultiIsolatePlatform { public: NodePlatform(int thread_pool_size, node::tracing::TracingController* tracing_controller); - ~NodePlatform() override {} + ~NodePlatform() override = default; void DrainTasks(v8::Isolate* isolate) override; void CancelPendingDelayedTasks(v8::Isolate* isolate) override; diff --git a/src/node_serdes.cc b/src/node_serdes.cc index 682f90f0c3..6e4bab5ce1 100644 --- a/src/node_serdes.cc +++ b/src/node_serdes.cc @@ -33,7 +33,7 @@ class SerializerContext : public BaseObject, SerializerContext(Environment* env, Local<Object> wrap); - ~SerializerContext() override {} + ~SerializerContext() override = default; void ThrowDataCloneError(Local<String> message) override; Maybe<bool> WriteHostObject(Isolate* isolate, Local<Object> object) override; @@ -68,7 +68,7 @@ class DeserializerContext : public BaseObject, Local<Object> wrap, Local<Value> buffer); - ~DeserializerContext() override {} + ~DeserializerContext() override = default; MaybeLocal<Object> ReadHostObject(Isolate* isolate) override; diff --git a/src/node_v8_platform-inl.h b/src/node_v8_platform-inl.h index 8b642caf93..e36f0a7d88 100644 --- a/src/node_v8_platform-inl.h +++ b/src/node_v8_platform-inl.h @@ -72,7 +72,7 @@ class NodeTraceStateObserver explicit NodeTraceStateObserver(v8::TracingController* controller) : controller_(controller) {} - ~NodeTraceStateObserver() override {} + ~NodeTraceStateObserver() override = default; private: v8::TracingController* controller_; diff --git a/src/req_wrap.h b/src/req_wrap.h index 890eb6cb61..c20912cc95 100644 --- a/src/req_wrap.h +++ b/src/req_wrap.h @@ -14,7 +14,7 @@ class ReqWrapBase { public: explicit inline ReqWrapBase(Environment* env); - virtual ~ReqWrapBase() {} + virtual ~ReqWrapBase() = default; virtual void Cancel() = 0; virtual AsyncWrap* GetAsyncWrap() = 0; diff --git a/src/spawn_sync.cc b/src/spawn_sync.cc index fb233a07da..4c8885f04a 100644 --- a/src/spawn_sync.cc +++ b/src/spawn_sync.cc @@ -49,11 +49,6 @@ using v8::Object; using v8::String; using v8::Value; - -SyncProcessOutputBuffer::SyncProcessOutputBuffer() { -} - - void SyncProcessOutputBuffer::OnAlloc(size_t suggested_size, uv_buf_t* buf) const { if (used() == kBufferSize) diff --git a/src/spawn_sync.h b/src/spawn_sync.h index 0ed6b9dff3..81a2f2aaa8 100644 --- a/src/spawn_sync.h +++ b/src/spawn_sync.h @@ -41,7 +41,7 @@ class SyncProcessOutputBuffer { static const unsigned int kBufferSize = 65536; public: - inline SyncProcessOutputBuffer(); + inline SyncProcessOutputBuffer() = default; inline void OnAlloc(size_t suggested_size, uv_buf_t* buf) const; inline void OnRead(const uv_buf_t* buf, size_t nread); diff --git a/src/stream_base.h b/src/stream_base.h index b61c742971..3550233290 100644 --- a/src/stream_base.h +++ b/src/stream_base.h @@ -36,7 +36,7 @@ class StreamReq { AttachToObject(req_wrap_obj); } - virtual ~StreamReq() {} + virtual ~StreamReq() = default; virtual AsyncWrap* GetAsyncWrap() = 0; v8::Local<v8::Object> object(); diff --git a/src/tracing/agent.h b/src/tracing/agent.h index 0039cc3679..a129f954d7 100644 --- a/src/tracing/agent.h +++ b/src/tracing/agent.h @@ -22,7 +22,7 @@ class Agent; class AsyncTraceWriter { public: - virtual ~AsyncTraceWriter() {} + virtual ~AsyncTraceWriter() = default; virtual void AppendTraceEvent(TraceObject* trace_event) = 0; virtual void Flush(bool blocking) = 0; virtual void InitializeOnThread(uv_loop_t* loop) {} @@ -48,7 +48,7 @@ class TracingController : public v8::platform::tracing::TracingController { class AgentWriterHandle { public: - inline AgentWriterHandle() {} + inline AgentWriterHandle() = default; inline ~AgentWriterHandle() { reset(); } inline AgentWriterHandle(AgentWriterHandle&& other); diff --git a/src/tracing/traced_value.cc b/src/tracing/traced_value.cc index df4d862fb6..dfc11658e7 100644 --- a/src/tracing/traced_value.cc +++ b/src/tracing/traced_value.cc @@ -113,8 +113,6 @@ std::unique_ptr<TracedValue> TracedValue::CreateArray() { TracedValue::TracedValue(bool root_is_array) : first_item_(true), root_is_array_(root_is_array) {} -TracedValue::~TracedValue() {} - void TracedValue::SetInteger(const char* name, int value) { WriteName(name); data_ += std::to_string(value); diff --git a/src/tracing/traced_value.h b/src/tracing/traced_value.h index 62782b238f..aa1dcd15c6 100644 --- a/src/tracing/traced_value.h +++ b/src/tracing/traced_value.h @@ -18,7 +18,7 @@ namespace tracing { class TracedValue : public v8::ConvertableToTraceFormat { public: - ~TracedValue() override; + ~TracedValue() = default; static std::unique_ptr<TracedValue> Create(); static std::unique_ptr<TracedValue> CreateArray(); diff --git a/src/util.h b/src/util.h index 7d371809cb..3a6cef2e35 100644 --- a/src/util.h +++ b/src/util.h @@ -427,7 +427,7 @@ class MaybeStackBuffer { template <typename T, size_t kStackStorageSize = 64> class ArrayBufferViewContents { public: - ArrayBufferViewContents() {} + ArrayBufferViewContents() = default; explicit inline ArrayBufferViewContents(v8::Local<v8::Value> value); explicit inline ArrayBufferViewContents(v8::Local<v8::ArrayBufferView> abv); |