diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-04-18 00:16:22 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-04-30 01:23:33 +0300 |
commit | 723d5c058fa180684df13bd2a83bbf3ca6201957 (patch) | |
tree | 6aeb4bc88e6c437853327cced05ab797827c22f2 /src/memory_tracker.h | |
parent | 095bd569aef4fec433ddb26e681eaabff1f7fd10 (diff) |
src: prefer v8::Global over node::Persistent
`v8::Global` is essentially a nicer variant of `node::Persistent` that,
in addition to reset-on-destroy, also implements move semantics.
This commit makes the necessary replacements, removes
`node::Persistent` and (now-)unnecessary inclusions of the
`node_persistent.h` header, and makes some of the functions that
take Persistents as arguments more generic so that they work with all
`v8::PersistentBase` flavours.
PR-URL: https://github.com/nodejs/node/pull/27287
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'src/memory_tracker.h')
-rw-r--r-- | src/memory_tracker.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/memory_tracker.h b/src/memory_tracker.h index 032c9a984e5..d22116918af 100644 --- a/src/memory_tracker.h +++ b/src/memory_tracker.h @@ -90,9 +90,9 @@ class CleanupHookCallback; * NonPointerRetainerClass non_pointer_retainer; * InternalClass internal_member_; * std::vector<uv_async_t> vector_; - * node::Persistent<Object> target_; + * v8::Global<Object> target_; * - * node::Persistent<Object> wrapped_; + * v8::Global<Object> wrapped_; * } * * This creates the following graph: @@ -185,9 +185,9 @@ class MemoryTracker { void TrackField(const char* edge_name, const v8::Eternal<T>& value, const char* node_name); - template <typename T, typename Traits> + template <typename T> inline void TrackField(const char* edge_name, - const v8::Persistent<T, Traits>& value, + const v8::PersistentBase<T>& value, const char* node_name = nullptr); template <typename T> inline void TrackField(const char* edge_name, |