From 69f1a2bb85b523619cdb7f673b1603d8e8391713 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Sun, 30 Sep 2018 12:27:48 -0400 Subject: [PATCH] src: fix indentation for `AsyncResource` This un-breaks the linter, which currently does not seem to run on this part of the file. PR-URL: https://github.com/nodejs/node/pull/23177 Reviewed-By: Colin Ihrig Reviewed-By: Joyee Cheung Reviewed-By: Refael Ackermann Reviewed-By: Denys Otrishko Reviewed-By: Luigi Pinca Reviewed-By: Sakthipriyan Vairamani Reviewed-By: James M Snell Reviewed-By: Ruben Bridgewater --- src/node.h | 156 ++++++++++++++++++++++++++--------------------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/src/node.h b/src/node.h index d9b070d14ad469..965a849c6be25f 100644 --- a/src/node.h +++ b/src/node.h @@ -755,84 +755,84 @@ v8::MaybeLocal MakeCallback(v8::Isolate* isolate, * `AsyncResource::MakeCallback()` is used, then all four callbacks will be * called automatically. */ class AsyncResource { - public: - AsyncResource(v8::Isolate* isolate, - 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); - } - - AsyncResource(v8::Isolate* isolate, - v8::Local resource, - v8::Local name, - async_id trigger_async_id = -1) - : isolate_(isolate), - resource_(isolate, resource) { - async_context_ = EmitAsyncInit(isolate, resource, name, - trigger_async_id); - } - - virtual ~AsyncResource() { - EmitAsyncDestroy(isolate_, async_context_); - 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( - 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::Local get_resource() { - return resource_.Get(isolate_); - } - - async_id get_async_id() const { - return async_context_.async_id; - } - - async_id get_trigger_async_id() const { - return async_context_.trigger_async_id; - } - - protected: - class CallbackScope : public node::CallbackScope { - public: - explicit CallbackScope(AsyncResource* res) - : node::CallbackScope(res->isolate_, - res->resource_.Get(res->isolate_), - res->async_context_) {} - }; - - private: - v8::Isolate* isolate_; - v8::Persistent resource_; - async_context async_context_; + public: + AsyncResource(v8::Isolate* isolate, + 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); + } + + AsyncResource(v8::Isolate* isolate, + v8::Local resource, + v8::Local name, + async_id trigger_async_id = -1) + : isolate_(isolate), + resource_(isolate, resource) { + async_context_ = EmitAsyncInit(isolate, resource, name, + trigger_async_id); + } + + virtual ~AsyncResource() { + EmitAsyncDestroy(isolate_, async_context_); + 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( + 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::Local get_resource() { + return resource_.Get(isolate_); + } + + async_id get_async_id() const { + return async_context_.async_id; + } + + async_id get_trigger_async_id() const { + return async_context_.trigger_async_id; + } + + protected: + class CallbackScope : public node::CallbackScope { + public: + explicit CallbackScope(AsyncResource* res) + : node::CallbackScope(res->isolate_, + res->resource_.Get(res->isolate_), + res->async_context_) {} + }; + + private: + v8::Isolate* isolate_; + v8::Persistent resource_; + async_context async_context_; }; } // namespace node