From 28a3e280eca67f906ae3b47730fe21a389b7bccb Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Sun, 22 Jul 2018 09:12:19 +0800 Subject: src: add proper MemoryInfoName to wrappers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use camel case names for memory retainers inherited from AsyncWrap instead of their provider names (which are all in upper case) - Assign class names to wraps so that they appear in the heap snapshot as nodes with class names as node names. Previously some nodes are named with reference names, which are supposed to be edge names instead. PR-URL: https://github.com/nodejs/node/pull/21939 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Gus Caplan Reviewed-By: James M Snell Reviewed-By: Tobias Nießen --- src/tcp_wrap.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/tcp_wrap.h') diff --git a/src/tcp_wrap.h b/src/tcp_wrap.h index d6ca930609..829c1b22bf 100644 --- a/src/tcp_wrap.h +++ b/src/tcp_wrap.h @@ -48,6 +48,17 @@ class TCPWrap : public ConnectionWrap { tracker->TrackThis(this); } + std::string MemoryInfoName() const override { + switch (provider_type()) { + case ProviderType::PROVIDER_TCPWRAP: + return "TCPSocketWrap"; + case ProviderType::PROVIDER_TCPSERVERWRAP: + return "TCPServerWrap"; + default: + UNREACHABLE(); + } + } + private: typedef uv_tcp_t HandleType; -- cgit v1.2.3