mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
Use InternalCallbackScope for ticking event loop
This commit is contained in:
@@ -97,16 +97,11 @@ void AtomBindings::OnCallNextTick(uv_async_t* handle) {
|
||||
for (std::list<node::Environment*>::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<v8::Object> process = env->process_object();
|
||||
env->tick_callback_function()->Call(process, 0, nullptr).IsEmpty();
|
||||
node::InternalCallbackScope scope(
|
||||
*it,
|
||||
v8::Local<v8::Object>(),
|
||||
{0, 0},
|
||||
node::InternalCallbackScope::kAllowEmptyResource);
|
||||
}
|
||||
|
||||
self->pending_next_ticks_.clear();
|
||||
|
||||
Reference in New Issue
Block a user