diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-03-07 15:48:52 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-03-11 20:20:38 +0300 |
commit | d3f174faab55662226ced53bef6bb2040352a825 (patch) | |
tree | 06724215b97d8efa9ce0538a5113b1bdb2766827 /src/stream_base-inl.h | |
parent | ddcc00bc1e8cc5815c942e1c4713ce92e7a27d40 (diff) |
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/stream_base-inl.h')
-rw-r--r-- | src/stream_base-inl.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/stream_base-inl.h b/src/stream_base-inl.h index 81adf7a866b..1534dcd1d53 100644 --- a/src/stream_base-inl.h +++ b/src/stream_base-inl.h @@ -164,8 +164,7 @@ inline int StreamBase::Shutdown(v8::Local<v8::Object> req_wrap_obj) { ->NewInstance(env->context()).ToLocalChecked(); } - AsyncHooks::DefaultTriggerAsyncIdScope trigger_scope( - env, GetAsyncWrap()->get_async_id()); + AsyncHooks::DefaultTriggerAsyncIdScope trigger_scope(GetAsyncWrap()); ShutdownWrap* req_wrap = CreateShutdownWrap(req_wrap_obj); int err = DoShutdown(req_wrap); @@ -202,8 +201,7 @@ inline StreamWriteResult StreamBase::Write( ->NewInstance(env->context()).ToLocalChecked(); } - AsyncHooks::DefaultTriggerAsyncIdScope trigger_scope( - env, GetAsyncWrap()->get_async_id()); + AsyncHooks::DefaultTriggerAsyncIdScope trigger_scope(GetAsyncWrap()); WriteWrap* req_wrap = CreateWriteWrap(req_wrap_obj); err = DoWrite(req_wrap, bufs, count, send_handle); @@ -383,8 +381,7 @@ void StreamBase::JSMethod(const FunctionCallbackInfo<Value>& args) { if (!wrap->IsAlive()) return args.GetReturnValue().Set(UV_EINVAL); - AsyncHooks::DefaultTriggerAsyncIdScope trigger_scope( - handle->env(), handle->get_async_id()); + AsyncHooks::DefaultTriggerAsyncIdScope trigger_scope(handle); args.GetReturnValue().Set((wrap->*Method)(args)); } |