summaryrefslogtreecommitdiff
path: root/src/inspector_socket.h
diff options
context:
space:
mode:
authorSam Roberts <vieuxtech@gmail.com>2017-05-30 16:34:59 -0700
committerJames M Snell <jasnell@gmail.com>2017-06-01 15:54:34 -0700
commit26ab769940e59646386bd15bbafb9378b8b56aed (patch)
treeb2f6ff05c598326b065bc46cea59d71aca21dcd9 /src/inspector_socket.h
parentce5745bf92f586c58366e9f738441d69118f2c18 (diff)
downloadandroid-node-v8-26ab769940e59646386bd15bbafb9378b8b56aed.tar.gz
android-node-v8-26ab769940e59646386bd15bbafb9378b8b56aed.tar.bz2
android-node-v8-26ab769940e59646386bd15bbafb9378b8b56aed.zip
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 <eostroukhov@google.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/inspector_socket.h')
-rw-r--r--src/inspector_socket.h5
1 files changed, 3 insertions, 2 deletions
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<char> 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) {