Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(288)

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp

Issue 1733083002: Execute end of scope tasks in isolate's MicrotasksCompletedCallback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/V8RecursionScope.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp b/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp
index 7baff2fe98124552efbb5b6bb6ed8c9a2e6a1af7..0a2cfcb91e350d51b0e373a3f71707588fbdf081 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp
@@ -48,6 +48,11 @@ static void beforeCallEnteredCallback(v8::Isolate* isolate)
RELEASE_ASSERT(!ScriptForbiddenScope::isScriptForbidden());
}
+static void microtasksCompletedCallback(v8::Isolate* isolate)
+{
+ V8PerIsolateData::from(isolate)->runEndOfScopeTasks();
+}
+
#if ENABLE(ASSERT)
static void assertV8RecursionScope(v8::Isolate* isolate)
{
@@ -158,6 +163,7 @@ V8PerIsolateData::V8PerIsolateData()
isolate()->AddCallCompletedCallback(&assertV8RecursionScope);
#endif
isolate()->AddBeforeCallEnteredCallback(&beforeCallEnteredCallback);
+ isolate()->AddMicrotasksCompletedCallback(&microtasksCompletedCallback);
if (isMainThread())
mainThreadPerIsolateData = this;
isolate()->SetUseCounterCallback(&useCounterCallback);
@@ -218,6 +224,7 @@ void V8PerIsolateData::destroy(v8::Isolate* isolate)
isolate->RemoveCallCompletedCallback(&assertV8RecursionScope);
#endif
isolate->RemoveBeforeCallEnteredCallback(&beforeCallEnteredCallback);
+ isolate->RemoveMicrotasksCompletedCallback(&microtasksCompletedCallback);
V8PerIsolateData* data = from(isolate);
// Clear everything before exiting the Isolate.
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/V8RecursionScope.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698