summaryrefslogtreecommitdiff
path: root/src/tcp_wrap.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-03-07 13:48:52 +0100
committerAnna Henningsen <anna@addaleax.net>2018-03-11 18:20:38 +0100
commitd3f174faab55662226ced53bef6bb2040352a825 (patch)
tree06724215b97d8efa9ce0538a5113b1bdb2766827 /src/tcp_wrap.cc
parentddcc00bc1e8cc5815c942e1c4713ce92e7a27d40 (diff)
downloadnode-new-d3f174faab55662226ced53bef6bb2040352a825.tar.gz
src: add convenience ctor for async trigger id scope
PR-URL: https://github.com/nodejs/node/pull/19204 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Diffstat (limited to 'src/tcp_wrap.cc')
-rw-r--r--src/tcp_wrap.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc
index 61b08217b8..cd6ed3cef0 100644
--- a/src/tcp_wrap.cc
+++ b/src/tcp_wrap.cc
@@ -57,8 +57,7 @@ Local<Object> TCPWrap::Instantiate(Environment* env,
AsyncWrap* parent,
TCPWrap::SocketType type) {
EscapableHandleScope handle_scope(env->isolate());
- AsyncHooks::DefaultTriggerAsyncIdScope trigger_scope(
- env, parent->get_async_id());
+ AsyncHooks::DefaultTriggerAsyncIdScope trigger_scope(parent);
CHECK_EQ(env->tcp_constructor_template().IsEmpty(), false);
Local<Function> constructor = env->tcp_constructor_template()->GetFunction();
CHECK_EQ(constructor.IsEmpty(), false);
@@ -289,8 +288,7 @@ void TCPWrap::Connect(const FunctionCallbackInfo<Value>& args) {
int err = uv_ip4_addr(*ip_address, port, &addr);
if (err == 0) {
- AsyncHooks::DefaultTriggerAsyncIdScope trigger_scope(
- env, wrap->get_async_id());
+ AsyncHooks::DefaultTriggerAsyncIdScope trigger_scope(wrap);
ConnectWrap* req_wrap =
new ConnectWrap(env, req_wrap_obj, AsyncWrap::PROVIDER_TCPCONNECTWRAP);
err = uv_tcp_connect(req_wrap->req(),
@@ -326,8 +324,7 @@ void TCPWrap::Connect6(const FunctionCallbackInfo<Value>& args) {
int err = uv_ip6_addr(*ip_address, port, &addr);
if (err == 0) {
- AsyncHooks::DefaultTriggerAsyncIdScope trigger_scope(
- env, wrap->get_async_id());
+ AsyncHooks::DefaultTriggerAsyncIdScope trigger_scope(wrap);
ConnectWrap* req_wrap =
new ConnectWrap(env, req_wrap_obj, AsyncWrap::PROVIDER_TCPCONNECTWRAP);
err = uv_tcp_connect(req_wrap->req(),