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/tty_wrap.cc | |
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/tty_wrap.cc')
-rw-r--r-- | src/tty_wrap.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc index df512bfcd3..fae39158ef 100644 --- a/src/tty_wrap.cc +++ b/src/tty_wrap.cc @@ -153,12 +153,11 @@ void TTYWrap::New(const FunctionCallbackInfo<Value>& args) { CHECK_GE(fd, 0); int err = 0; - TTYWrap* wrap = new TTYWrap(env, args.This(), fd, args[1]->IsTrue(), &err); + new TTYWrap(env, args.This(), fd, args[1]->IsTrue(), &err); if (err != 0) { env->CollectUVExceptionInfo(args[2], err, "uv_tty_init"); args.GetReturnValue().SetUndefined(); } - wrap->UpdateWriteQueueSize(); } |