summaryrefslogtreecommitdiff
path: root/src/tcp_wrap.h
diff options
context:
space:
mode:
authorJoyee Cheung <joyeec9h3@gmail.com>2018-07-22 09:12:19 +0800
committerJoyee Cheung <joyeec9h3@gmail.com>2018-07-27 15:51:19 +0800
commit28a3e280eca67f906ae3b47730fe21a389b7bccb (patch)
tree18a051e45196e6d8a677dd9122470d285e3e34aa /src/tcp_wrap.h
parent48e5b350b3dd236353e3e8e1196a09f5c5bcda77 (diff)
downloadandroid-node-v8-28a3e280eca67f906ae3b47730fe21a389b7bccb.tar.gz
android-node-v8-28a3e280eca67f906ae3b47730fe21a389b7bccb.tar.bz2
android-node-v8-28a3e280eca67f906ae3b47730fe21a389b7bccb.zip
src: add proper MemoryInfoName to wrappers
- 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 <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'src/tcp_wrap.h')
-rw-r--r--src/tcp_wrap.h11
1 files changed, 11 insertions, 0 deletions
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<TCPWrap, uv_tcp_t> {
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;