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

Unified Diff: third_party/WebKit/Source/core/page/PageAnimator.cpp

Issue 2003993002: Disallow throttling while running requestAnimationFrame callbacks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 7 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/page/PageAnimator.cpp
diff --git a/third_party/WebKit/Source/core/page/PageAnimator.cpp b/third_party/WebKit/Source/core/page/PageAnimator.cpp
index 19a7dd327567a1e4b1395fd9ef8b42f30c62d302..570396d652f4ba167d4f1c224f06673693ba8799 100644
--- a/third_party/WebKit/Source/core/page/PageAnimator.cpp
+++ b/third_party/WebKit/Source/core/page/PageAnimator.cpp
@@ -47,6 +47,9 @@ void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime)
if (document->view()) {
if (document->view()->shouldThrottleRendering())
continue;
+ // Disallow throttling in case any script needs to do a synchronous
+ // lifecycle update in other frames which are throttled.
+ DocumentLifecycle::DisallowThrottlingScope noThrottlingScope(document->lifecycle());
document->view()->getScrollableArea()->serviceScrollAnimations(monotonicAnimationStartTime);
if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = document->view()->animatingScrollableAreas()) {
@@ -60,6 +63,7 @@ void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime)
SVGDocumentExtensions::serviceOnAnimationFrame(*document);
}
// TODO(skyostil): This function should not run for documents without views.
+ DocumentLifecycle::DisallowThrottlingScope noThrottlingScope(document->lifecycle());
document->serviceScriptedAnimations(monotonicAnimationStartTime);
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/DocumentLifecycle.cpp ('k') | third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698