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

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

Issue 1298253003: Merge the multiple frame tree walks in PageAnimator::serviceScriptedAnimations. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/PageAnimator.cpp
diff --git a/Source/core/page/PageAnimator.cpp b/Source/core/page/PageAnimator.cpp
index bfd7ddf2396f221d0f5287d0a7fc4844da1707f0..93b0e21b80b05b9b7dfee899b61685aae28cf4b0 100644
--- a/Source/core/page/PageAnimator.cpp
+++ b/Source/core/page/PageAnimator.cpp
@@ -43,11 +43,11 @@ void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime)
documents.append(toLocalFrame(frame)->document());
}
- for (size_t i = 0; i < documents.size(); ++i) {
- if (documents[i]->view()) {
- documents[i]->view()->scrollableArea()->serviceScrollAnimations(monotonicAnimationStartTime);
+ for (auto& document : documents) {
+ if (document->view()) {
+ document->view()->scrollableArea()->serviceScrollAnimations(monotonicAnimationStartTime);
- if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = documents[i]->view()->animatingScrollableAreas()) {
+ if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = document->view()->animatingScrollableAreas()) {
// Iterate over a copy, since ScrollableAreas may deregister
// themselves during the iteration.
Vector<ScrollableArea*> animatingScrollableAreasCopy;
@@ -56,17 +56,14 @@ void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime)
scrollableArea->serviceScrollAnimations(monotonicAnimationStartTime);
}
}
+ DocumentAnimations::updateAnimationTimingForAnimationFrame(*document, monotonicAnimationStartTime);
+ SVGDocumentExtensions::serviceOnAnimationFrame(*document, monotonicAnimationStartTime);
+ document->serviceScriptedAnimations(monotonicAnimationStartTime);
}
- for (size_t i = 0; i < documents.size(); ++i) {
- DocumentAnimations::updateAnimationTimingForAnimationFrame(*documents[i], monotonicAnimationStartTime);
- SVGDocumentExtensions::serviceOnAnimationFrame(*documents[i], monotonicAnimationStartTime);
- }
-
- for (size_t i = 0; i < documents.size(); ++i)
- documents[i]->serviceScriptedAnimations(monotonicAnimationStartTime);
-
#if ENABLE(OILPAN)
+ // TODO(esprehn): Why is this here? It doesn't make sense to explicitly
+ // clear a stack allocated vector.
documents.clear();
#endif
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698