diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-03-11 01:03:15 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-03-21 21:09:45 +0300 |
commit | 96c3224de0e938d308ab579e4cf7336e87c67d88 (patch) | |
tree | 3f556d5c7bfb5d9be23fb20c8ebe0514a33a5d5e /src/node_internals.h | |
parent | 1500e5de64e4f7cfb482ad353293645a5599d93f (diff) |
src: remove `AddPromiseHook()`
Remove this, as the underlying `Isolate::SetPromiseHook()` may be
removed as well in its current form in the future, and `async_hooks`
also serves this use case.
Refs: https://docs.google.com/document/d/1g8OrG5lMIUhRn1zbkutgY83MiTSMx-0NHDs8Bf-nXxM/
Refs: https://github.com/nodejs/node/pull/26529
PR-URL: https://github.com/nodejs/node/pull/26574
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Diffstat (limited to 'src/node_internals.h')
-rw-r--r-- | src/node_internals.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/node_internals.h b/src/node_internals.h index bc6a36d9db4..a6994099537 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -301,7 +301,6 @@ v8::MaybeLocal<v8::Object> GetPerContextExports(v8::Local<v8::Context> context); namespace profiler { void StartCoverageCollection(Environment* env); } - #ifdef _WIN32 typedef SYSTEMTIME TIME_TYPE; #else // UNIX, OSX @@ -336,6 +335,23 @@ class DiagnosticFilename { std::string filename_; }; +class TraceEventScope { + public: + 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_); + } + + private: + const char* category_; + const char* name_; + void* id_; +}; + } // namespace node #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS |