From d36e1b4fed57b34d93e70d3408d753e00b8ed754 Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Mon, 11 Dec 2017 17:55:17 -0500 Subject: net,src: refactor writeQueueSize tracking Currently, writeQueueSize is never used in C++ and barely used within JS. Instead of constantly updating the value on the JS object, create a getter that will retrieve the most up-to-date value from C++. For the vast majority of cases though, create a new prop on Socket.prototype[kLastWriteQueueSize] using a Symbol. Use this to track the current write size, entirely in JS land. PR-URL: https://github.com/nodejs/node/pull/17650 Reviewed-By: Anna Henningsen --- src/tls_wrap.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/tls_wrap.h') diff --git a/src/tls_wrap.h b/src/tls_wrap.h index 87eac75779..2ca9d53137 100644 --- a/src/tls_wrap.h +++ b/src/tls_wrap.h @@ -131,7 +131,6 @@ class TLSWrap : public AsyncWrap, AsyncWrap* GetAsyncWrap() override; bool IsIPCPipe() override; - uint32_t UpdateWriteQueueSize(uint32_t write_queue_size = 0); // Resource implementation static void OnAfterWriteImpl(WriteWrap* w, int status, void* ctx); @@ -189,8 +188,8 @@ class TLSWrap : public AsyncWrap, bool eof_; private: - static void UpdateWriteQueueSize( - const v8::FunctionCallbackInfo& args); + static void GetWriteQueueSize( + const v8::FunctionCallbackInfo& info); }; } // namespace node -- cgit v1.2.3