| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/page/PageAnimator.h" | 5 #include "core/page/PageAnimator.h" |
| 6 | 6 |
| 7 #include "core/animation/DocumentAnimations.h" | 7 #include "core/animation/DocumentAnimations.h" |
| 8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
| 9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
| 10 #include "core/page/ChromeClient.h" | 10 #include "core/page/ChromeClient.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 void PageAnimator::serviceScriptedAnimations( | 31 void PageAnimator::serviceScriptedAnimations( |
| 32 double monotonicAnimationStartTime) { | 32 double monotonicAnimationStartTime) { |
| 33 AutoReset<bool> servicing(&m_servicingAnimations, true); | 33 AutoReset<bool> servicing(&m_servicingAnimations, true); |
| 34 clock().updateTime(monotonicAnimationStartTime); | 34 clock().updateTime(monotonicAnimationStartTime); |
| 35 | 35 |
| 36 HeapVector<Member<Document>, 32> documents; | 36 HeapVector<Member<Document>, 32> documents; |
| 37 for (Frame* frame = m_page->mainFrame(); frame; | 37 for (Frame* frame = m_page->mainFrame(); frame; |
| 38 frame = frame->tree().traverseNext()) { | 38 frame = frame->tree().traverseNext()) { |
| 39 if (frame->isLocalFrame()) | 39 if (frame->isLocalFrame()) |
| 40 documents.append(toLocalFrame(frame)->document()); | 40 documents.push_back(toLocalFrame(frame)->document()); |
| 41 } | 41 } |
| 42 | 42 |
| 43 for (auto& document : documents) { | 43 for (auto& document : documents) { |
| 44 ScopedFrameBlamer frameBlamer(document->frame()); | 44 ScopedFrameBlamer frameBlamer(document->frame()); |
| 45 TRACE_EVENT0("blink,rail", "PageAnimator::serviceScriptedAnimations"); | 45 TRACE_EVENT0("blink,rail", "PageAnimator::serviceScriptedAnimations"); |
| 46 DocumentAnimations::updateAnimationTimingForAnimationFrame(*document); | 46 DocumentAnimations::updateAnimationTimingForAnimationFrame(*document); |
| 47 if (document->view()) { | 47 if (document->view()) { |
| 48 if (document->view()->shouldThrottleRendering()) | 48 if (document->view()->shouldThrottleRendering()) |
| 49 continue; | 49 continue; |
| 50 // Disallow throttling in case any script needs to do a synchronous | 50 // Disallow throttling in case any script needs to do a synchronous |
| (...skipping 29 matching lines...) Expand all Loading... |
| 80 m_page->chromeClient().scheduleAnimation(frame->view()); | 80 m_page->chromeClient().scheduleAnimation(frame->view()); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void PageAnimator::updateAllLifecyclePhases(LocalFrame& rootFrame) { | 83 void PageAnimator::updateAllLifecyclePhases(LocalFrame& rootFrame) { |
| 84 FrameView* view = rootFrame.view(); | 84 FrameView* view = rootFrame.view(); |
| 85 AutoReset<bool> servicing(&m_updatingLayoutAndStyleForPainting, true); | 85 AutoReset<bool> servicing(&m_updatingLayoutAndStyleForPainting, true); |
| 86 view->updateAllLifecyclePhases(); | 86 view->updateAllLifecyclePhases(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 } // namespace blink | 89 } // namespace blink |
| OLD | NEW |