From 5d2452608d02e261218ff914fba45cb912e85275 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 9 Mar 2018 14:54:25 +0900 Subject: [PATCH] Use InternalCallbackScope for ticking event loop --- atom/common/api/atom_bindings.cc | 15 +++++---------- common.gypi | 2 ++ vendor/node | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/atom/common/api/atom_bindings.cc b/atom/common/api/atom_bindings.cc index 967ee5a1ddd9..1a52a9d3cebd 100644 --- a/atom/common/api/atom_bindings.cc +++ b/atom/common/api/atom_bindings.cc @@ -97,16 +97,11 @@ void AtomBindings::OnCallNextTick(uv_async_t* handle) { for (std::list::const_iterator it = self->pending_next_ticks_.begin(); it != self->pending_next_ticks_.end(); ++it) { - node::Environment* env = *it; - // KickNextTick, copied from node.cc: - node::Environment::AsyncCallbackScope callback_scope(env); - if (callback_scope.in_makecallback()) - continue; - node::Environment::TickInfo* tick_info = env->tick_info(); - if (!tick_info->has_scheduled()) - env->isolate()->RunMicrotasks(); - v8::Local process = env->process_object(); - env->tick_callback_function()->Call(process, 0, nullptr).IsEmpty(); + node::InternalCallbackScope scope( + *it, + v8::Local(), + {0, 0}, + node::InternalCallbackScope::kAllowEmptyResource); } self->pending_next_ticks_.clear(); diff --git a/common.gypi b/common.gypi index e47b30776947..056bd3616595 100644 --- a/common.gypi +++ b/common.gypi @@ -61,6 +61,7 @@ 4055, # 'type cast' : from data pointer 'void *' to function pointer 4057, # 'function' : 'volatile LONG *' differs in indirection to slightly different base types from 'unsigned long *' 4065, # switch statement contains 'default' but no 'case' labels + 4129, # unrecognized character escape sequence 4189, # 4131, # uses old-style declarator 4133, # incompatible types @@ -74,6 +75,7 @@ 4232, # address of dllimport 'free' is not static, identity not guaranteed 4291, # no matching operator delete found 4295, # array is too small to include a terminating null character + 4309, # 'static_cast': truncation of constant value 4311, # 'type cast': pointer truncation from 'void *const ' to 'unsigned long' 4389, # '==' : signed/unsigned mismatch 4456, # declaration of 'm' hides previous local declaration diff --git a/vendor/node b/vendor/node index ac00467c8b69..668f3cd06e0b 160000 --- a/vendor/node +++ b/vendor/node @@ -1 +1 @@ -Subproject commit ac00467c8b6954cbb6b9b64c4643af522a1c207e +Subproject commit 668f3cd06e0b9c24a1aa2d913f22626fff7decd2