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

Unified Diff: third_party/WebKit/Source/core/frame/DOMTimer.cpp

Issue 2694743004: Reset the nesting level for setInterval after completion. (Closed)
Patch Set: Created 3 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
Index: third_party/WebKit/Source/core/frame/DOMTimer.cpp
diff --git a/third_party/WebKit/Source/core/frame/DOMTimer.cpp b/third_party/WebKit/Source/core/frame/DOMTimer.cpp
index e38ac74e6489aa12c3e4eb579ca5f997bd5976ab..b473d26bcd1ee414ace004b4c4ef82026609b651 100644
--- a/third_party/WebKit/Source/core/frame/DOMTimer.cpp
+++ b/third_party/WebKit/Source/core/frame/DOMTimer.cpp
@@ -157,8 +157,18 @@ void DOMTimer::fired() {
augmentRepeatInterval(minimumInterval - repeatInterval());
}
+ // Get ExecutionContext early as it might be cleared during
+ // action->execute().
+ ExecutionContext* executionContext = getExecutionContext();
+
// No access to member variables after this point, it can delete the timer.
m_action->execute(context);
+
+ if (!executionContext)
+ return;
+
+ executionContext->timers()->setTimerNestingLevel(0);
+
return;
}

Powered by Google App Engine
This is Rietveld 408576698