From: Cheng Zhao Date: Fri, 7 Aug 2015 07:10:14 +0000 (+0800) Subject: Perform microtask checkpoint after diving into libuv X-Git-Tag: v0.30.3~1^2~6 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=ab44edd2948b2e133b6ba64b717ac974935618f5;p=electron.git Perform microtask checkpoint after diving into libuv --- diff --git a/atom/common/node_bindings.cc b/atom/common/node_bindings.cc index 8f5dd074..b3295895 100644 --- a/atom/common/node_bindings.cc +++ b/atom/common/node_bindings.cc @@ -19,6 +19,7 @@ #include "content/public/common/content_paths.h" #include "native_mate/locker.h" #include "native_mate/dictionary.h" +#include "third_party/WebKit/public/web/WebScopedMicrotaskSuppression.h" #include "atom/common/node_includes.h" @@ -227,6 +228,10 @@ void NodeBindings::UvRunOnce() { // Enter node context while dealing with uv events. v8::Context::Scope context_scope(env->context()); + // Perform microtask checkpoint after running JavaScript. + scoped_ptr script_scope( + is_browser_ ? nullptr : new blink::WebScopedRunV8Script(env->isolate())); + // Deal with uv events. int r = uv_run(uv_loop_, UV_RUN_NOWAIT); if (r == 0 || uv_loop_->stop_flag != 0)