From 26ab769940e59646386bd15bbafb9378b8b56aed Mon Sep 17 00:00:00 2001 From: Sam Roberts Date: Tue, 30 May 2017 16:34:59 -0700 Subject: inspector: refactor to rename and comment methods Pure refactor, makes no functional changes but the renaming helped me see more clearly what the relationship was between methods and variables. * Renamed methods to reduce number of slightly different names for the same thing ("thread" vs "io thread", etc.). * Added comments where it was useful to me. PR-URL: https://github.com/nodejs/node/pull/13321 Reviewed-By: Eugene Ostroukhov Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- src/inspector_socket.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/inspector_socket.h') diff --git a/src/inspector_socket.h b/src/inspector_socket.h index 558d87bcb7..7cd8254fb3 100644 --- a/src/inspector_socket.h +++ b/src/inspector_socket.h @@ -48,6 +48,7 @@ struct ws_state_s { bool received_close; }; +// HTTP Wrapper around a uv_tcp_t class InspectorSocket { public: InspectorSocket() : data(nullptr), http_parsing_state(nullptr), @@ -58,7 +59,7 @@ class InspectorSocket { struct http_parsing_state_s* http_parsing_state; struct ws_state_s* ws_state; std::vector buffer; - uv_tcp_t client; + uv_tcp_t tcp; bool ws_mode; bool shutting_down; bool connection_eof; @@ -82,7 +83,7 @@ void inspector_write(InspectorSocket* inspector, bool inspector_is_active(const InspectorSocket* inspector); inline InspectorSocket* inspector_from_stream(uv_tcp_t* stream) { - return node::ContainerOf(&InspectorSocket::client, stream); + return node::ContainerOf(&InspectorSocket::tcp, stream); } inline InspectorSocket* inspector_from_stream(uv_stream_t* stream) { -- cgit v1.2.3