diff options
author | Anna Henningsen <anna@addaleax.net> | 2020-05-17 08:13:16 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2020-05-22 03:47:56 +0300 |
commit | b6b82cba27da9ef83bfef67cac9d3593bd72c0e2 (patch) | |
tree | 843e46d86bff3bb5e858298bf698b2254908fb04 /src/callback_queue-inl.h | |
parent | 6f6bf010a7bfde32f4015758ae2f2af8b45cb612 (diff) |
src: use enum for refed flag on native immediates
Refs: https://github.com/nodejs/node/pull/33320#discussion_r423141443
PR-URL: https://github.com/nodejs/node/pull/33444
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/callback_queue-inl.h')
-rw-r--r-- | src/callback_queue-inl.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/callback_queue-inl.h b/src/callback_queue-inl.h index e83c81cd0dd..13561864027 100644 --- a/src/callback_queue-inl.h +++ b/src/callback_queue-inl.h @@ -10,8 +10,8 @@ namespace node { template <typename R, typename... Args> template <typename Fn> std::unique_ptr<typename CallbackQueue<R, Args...>::Callback> -CallbackQueue<R, Args...>::CreateCallback(Fn&& fn, bool refed) { - return std::make_unique<CallbackImpl<Fn>>(std::move(fn), refed); +CallbackQueue<R, Args...>::CreateCallback(Fn&& fn, CallbackFlags::Flags flags) { + return std::make_unique<CallbackImpl<Fn>>(std::move(fn), flags); } template <typename R, typename... Args> @@ -57,12 +57,12 @@ size_t CallbackQueue<R, Args...>::size() const { } template <typename R, typename... Args> -CallbackQueue<R, Args...>::Callback::Callback(bool refed) - : refed_(refed) {} +CallbackQueue<R, Args...>::Callback::Callback(CallbackFlags::Flags flags) + : flags_(flags) {} template <typename R, typename... Args> -bool CallbackQueue<R, Args...>::Callback::is_refed() const { - return refed_; +CallbackFlags::Flags CallbackQueue<R, Args...>::Callback::flags() const { + return flags_; } template <typename R, typename... Args> @@ -80,8 +80,8 @@ void CallbackQueue<R, Args...>::Callback::set_next( template <typename R, typename... Args> template <typename Fn> CallbackQueue<R, Args...>::CallbackImpl<Fn>::CallbackImpl( - Fn&& callback, bool refed) - : Callback(refed), + Fn&& callback, CallbackFlags::Flags flags) + : Callback(flags), callback_(std::move(callback)) {} template <typename R, typename... Args> |