summaryrefslogtreecommitdiff
path: root/src/node_internals.h
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-11-03 13:28:34 +0100
committerAnna Henningsen <anna@addaleax.net>2019-11-06 13:57:57 +0100
commit4aca277f16b8649b5fc21d41f340fad0a47c2e61 (patch)
treed7bc9d32f1065cd8200b841d5f6d27320514edf5 /src/node_internals.h
parentd80e49d6801501a0f2b93c442d5e425ed6fc73fb (diff)
downloadandroid-node-v8-4aca277f16b8649b5fc21d41f340fad0a47c2e61.tar.gz
android-node-v8-4aca277f16b8649b5fc21d41f340fad0a47c2e61.tar.bz2
android-node-v8-4aca277f16b8649b5fc21d41f340fad0a47c2e61.zip
src: remove AsyncScope and AsyncCallbackScope
Reduce the number of different scopes we use for async callbacks. PR-URL: https://github.com/nodejs/node/pull/30236 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_internals.h')
-rw-r--r--src/node_internals.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/node_internals.h b/src/node_internals.h
index 106f6613f1..055042377c 100644
--- a/src/node_internals.h
+++ b/src/node_internals.h
@@ -204,17 +204,23 @@ v8::MaybeLocal<v8::Value> InternalMakeCallback(
class InternalCallbackScope {
public:
enum Flags {
+ kNoFlags = 0,
// Tell the constructor whether its `object` parameter may be empty or not.
kAllowEmptyResource = 1,
// Indicates whether 'before' and 'after' hooks should be skipped.
- kSkipAsyncHooks = 2
+ kSkipAsyncHooks = 2,
+ // Indicates whether nextTick and microtask queues should be skipped.
+ // This should only be used when there is no call into JS in this scope.
+ // (The HTTP parser also uses it for some weird backwards
+ // compatibility issues, but it shouldn't.)
+ kSkipTaskQueues = 4
};
InternalCallbackScope(Environment* env,
v8::Local<v8::Object> object,
const async_context& asyncContext,
- int flags = 0);
+ int flags = kNoFlags);
// Utility that can be used by AsyncWrap classes.
- explicit InternalCallbackScope(AsyncWrap* async_wrap);
+ explicit InternalCallbackScope(AsyncWrap* async_wrap, int flags = 0);
~InternalCallbackScope();
void Close();
@@ -225,8 +231,8 @@ class InternalCallbackScope {
Environment* env_;
async_context async_context_;
v8::Local<v8::Object> object_;
- AsyncCallbackScope callback_scope_;
bool skip_hooks_;
+ bool skip_task_queues_;
bool failed_ = false;
bool pushed_ids_ = false;
bool closed_ = false;