diff options
author | Anatoli Papirovski <apapirovski@mac.com> | 2017-12-11 17:55:17 -0500 |
---|---|---|
committer | Anatoli Papirovski <apapirovski@mac.com> | 2017-12-18 09:58:02 -0500 |
commit | d36e1b4fed57b34d93e70d3408d753e00b8ed754 (patch) | |
tree | 03e0a12b194453231ad7391ff16b2c7cf3a489f2 /src/tls_wrap.h | |
parent | 68c63a9fa362138bed852714862ac37b85c06adb (diff) | |
download | android-node-v8-d36e1b4fed57b34d93e70d3408d753e00b8ed754.tar.gz android-node-v8-d36e1b4fed57b34d93e70d3408d753e00b8ed754.tar.bz2 android-node-v8-d36e1b4fed57b34d93e70d3408d753e00b8ed754.zip |
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 <anna@addaleax.net>
Diffstat (limited to 'src/tls_wrap.h')
-rw-r--r-- | src/tls_wrap.h | 5 |
1 files changed, 2 insertions, 3 deletions
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<v8::Value>& args); + static void GetWriteQueueSize( + const v8::FunctionCallbackInfo<v8::Value>& info); }; } // namespace node |