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

Side by Side Diff: third_party/WebKit/Source/core/page/PageAnimator.cpp

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
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"
11 #include "core/page/Page.h" 11 #include "core/page/Page.h"
12 #include "core/svg/SVGDocumentExtensions.h" 12 #include "core/svg/SVGDocumentExtensions.h"
13 #include "platform/Logging.h" 13 #include "platform/Logging.h"
14 14
15 namespace blink { 15 namespace blink {
16 16
17 PageAnimator::PageAnimator(Page& page) 17 PageAnimator::PageAnimator(Page& page)
18 : m_page(page) 18 : m_page(page)
19 , m_servicingAnimations(false) 19 , m_servicingAnimations(false)
20 , m_updatingLayoutAndStyleForPainting(false) 20 , m_updatingLayoutAndStyleForPainting(false)
21 { 21 {
22 } 22 }
23 23
24 PassRefPtrWillBeRawPtr<PageAnimator> PageAnimator::create(Page& page) 24 RawPtr<PageAnimator> PageAnimator::create(Page& page)
25 { 25 {
26 return adoptRefWillBeNoop(new PageAnimator(page)); 26 return (new PageAnimator(page));
27 } 27 }
28 28
29 DEFINE_TRACE(PageAnimator) 29 DEFINE_TRACE(PageAnimator)
30 { 30 {
31 visitor->trace(m_page); 31 visitor->trace(m_page);
32 } 32 }
33 33
34 void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime) 34 void PageAnimator::serviceScriptedAnimations(double monotonicAnimationStartTime)
35 { 35 {
36 RefPtrWillBeRawPtr<PageAnimator> protector(this); 36 RawPtr<PageAnimator> protector(this);
37 TemporaryChange<bool> servicing(m_servicingAnimations, true); 37 TemporaryChange<bool> servicing(m_servicingAnimations, true);
38 clock().updateTime(monotonicAnimationStartTime); 38 clock().updateTime(monotonicAnimationStartTime);
39 39
40 WillBeHeapVector<RefPtrWillBeMember<Document>> documents; 40 HeapVector<Member<Document>> documents;
41 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver seNext()) { 41 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver seNext()) {
42 if (frame->isLocalFrame()) 42 if (frame->isLocalFrame())
43 documents.append(toLocalFrame(frame)->document()); 43 documents.append(toLocalFrame(frame)->document());
44 } 44 }
45 45
46 for (auto& document : documents) { 46 for (auto& document : documents) {
47 DocumentAnimations::updateAnimationTimingForAnimationFrame(*document); 47 DocumentAnimations::updateAnimationTimingForAnimationFrame(*document);
48 if (document->view()) { 48 if (document->view()) {
49 if (document->view()->shouldThrottleRendering()) 49 if (document->view()->shouldThrottleRendering())
50 continue; 50 continue;
51 document->view()->scrollableArea()->serviceScrollAnimations(monotoni cAnimationStartTime); 51 document->view()->scrollableArea()->serviceScrollAnimations(monotoni cAnimationStartTime);
52 52
53 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = d ocument->view()->animatingScrollableAreas()) { 53 if (const FrameView::ScrollableAreaSet* animatingScrollableAreas = d ocument->view()->animatingScrollableAreas()) {
54 // Iterate over a copy, since ScrollableAreas may deregister 54 // Iterate over a copy, since ScrollableAreas may deregister
55 // themselves during the iteration. 55 // themselves during the iteration.
56 WillBeHeapVector<RawPtrWillBeMember<ScrollableArea>> animatingSc rollableAreasCopy; 56 HeapVector<Member<ScrollableArea>> animatingScrollableAreasCopy;
57 copyToVector(*animatingScrollableAreas, animatingScrollableAreas Copy); 57 copyToVector(*animatingScrollableAreas, animatingScrollableAreas Copy);
58 for (ScrollableArea* scrollableArea : animatingScrollableAreasCo py) 58 for (ScrollableArea* scrollableArea : animatingScrollableAreasCo py)
59 scrollableArea->serviceScrollAnimations(monotonicAnimationSt artTime); 59 scrollableArea->serviceScrollAnimations(monotonicAnimationSt artTime);
60 } 60 }
61 } 61 }
62 // TODO(skyostil): These functions should not run for documents without views. 62 // TODO(skyostil): These functions should not run for documents without views.
63 SVGDocumentExtensions::serviceOnAnimationFrame(*document, monotonicAnima tionStartTime); 63 SVGDocumentExtensions::serviceOnAnimationFrame(*document, monotonicAnima tionStartTime);
64 document->serviceScriptedAnimations(monotonicAnimationStartTime); 64 document->serviceScriptedAnimations(monotonicAnimationStartTime);
65 } 65 }
66 66
67 #if ENABLE(OILPAN) 67 #if ENABLE(OILPAN)
68 // TODO(esprehn): Why is this here? It doesn't make sense to explicitly 68 // TODO(esprehn): Why is this here? It doesn't make sense to explicitly
69 // clear a stack allocated vector. 69 // clear a stack allocated vector.
70 documents.clear(); 70 documents.clear();
71 #endif 71 #endif
72 } 72 }
73 73
74 void PageAnimator::scheduleVisualUpdate(LocalFrame* frame) 74 void PageAnimator::scheduleVisualUpdate(LocalFrame* frame)
75 { 75 {
76 if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting) 76 if (m_servicingAnimations || m_updatingLayoutAndStyleForPainting)
77 return; 77 return;
78 m_page->chromeClient().scheduleAnimation(frame->view()); 78 m_page->chromeClient().scheduleAnimation(frame->view());
79 } 79 }
80 80
81 void PageAnimator::updateAllLifecyclePhases(LocalFrame& rootFrame) 81 void PageAnimator::updateAllLifecyclePhases(LocalFrame& rootFrame)
82 { 82 {
83 RefPtrWillBeRawPtr<FrameView> view = rootFrame.view(); 83 RawPtr<FrameView> view = rootFrame.view();
84 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true); 84 TemporaryChange<bool> servicing(m_updatingLayoutAndStyleForPainting, true);
85 view->updateAllLifecyclePhases(); 85 view->updateAllLifecyclePhases();
86 } 86 }
87 87
88 } // namespace blink 88 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698