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

Side by Side Diff: Source/core/animation/css/CSSAnimations.h

Issue 1120003002: [Oilpan] Migrate most classes under core/animations to Oilpan heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 WTF_MAKE_NONCOPYABLE(CSSAnimations); 53 WTF_MAKE_NONCOPYABLE(CSSAnimations);
54 DISALLOW_ALLOCATION(); 54 DISALLOW_ALLOCATION();
55 public: 55 public:
56 CSSAnimations(); 56 CSSAnimations();
57 57
58 const AtomicString getAnimationNameForInspector(const AnimationPlayer&); 58 const AtomicString getAnimationNameForInspector(const AnimationPlayer&);
59 bool isTransitionAnimationForInspector(const AnimationPlayer&) const; 59 bool isTransitionAnimationForInspector(const AnimationPlayer&) const;
60 60
61 static const StylePropertyShorthand& propertiesForTransitionAll(); 61 static const StylePropertyShorthand& propertiesForTransitionAll();
62 static bool isAllowedAnimation(CSSPropertyID); 62 static bool isAllowedAnimation(CSSPropertyID);
63 static PassOwnPtrWillBeRawPtr<CSSAnimationUpdate> calculateUpdate(const Elem ent* animatingElement, Element&, const ComputedStyle&, ComputedStyle* parentStyl e, StyleResolver*); 63 static CSSAnimationUpdate* calculateUpdate(const Element* animatingElement, Element&, const ComputedStyle&, ComputedStyle* parentStyle, StyleResolver*);
64 64
65 void setPendingUpdate(PassOwnPtrWillBeRawPtr<CSSAnimationUpdate> update) { m _pendingUpdate = update; } 65 void setPendingUpdate(CSSAnimationUpdate* update) { m_pendingUpdate = update ; }
66 void maybeApplyPendingUpdate(Element*); 66 void maybeApplyPendingUpdate(Element*);
67 bool isEmpty() const { return m_animations.isEmpty() && m_transitions.isEmpt y() && !m_pendingUpdate; } 67 bool isEmpty() const { return m_animations.isEmpty() && m_transitions.isEmpt y() && !m_pendingUpdate; }
68 void cancel(); 68 void cancel();
69 69
70 DECLARE_TRACE(); 70 DECLARE_TRACE();
71 71
72 private: 72 private:
73 class RunningAnimation final : public RefCountedWillBeGarbageCollectedFinali zed<RunningAnimation> { 73 class RunningAnimation final : public GarbageCollectedFinalized<RunningAnima tion> {
74 public: 74 public:
75 RunningAnimation(PassRefPtrWillBeRawPtr<AnimationPlayer> player, CSSAnim ationUpdate::NewAnimation animation) 75 RunningAnimation(PassRefPtrWillBeRawPtr<AnimationPlayer> player, CSSAnim ationUpdate::NewAnimation animation)
76 : player(player) 76 : player(player)
77 , specifiedTiming(animation.timing) 77 , specifiedTiming(animation.timing)
78 , styleRule(animation.styleRule) 78 , styleRule(animation.styleRule)
79 , styleRuleVersion(animation.styleRuleVersion) 79 , styleRuleVersion(animation.styleRuleVersion)
80 { 80 {
81 } 81 }
82 82
83 void update(CSSAnimationUpdate::UpdatedAnimation update) 83 void update(CSSAnimationUpdate::UpdatedAnimation update)
(...skipping 19 matching lines...) Expand all
103 ALLOW_ONLY_INLINE_ALLOCATION(); 103 ALLOW_ONLY_INLINE_ALLOCATION();
104 public: 104 public:
105 DEFINE_INLINE_TRACE() 105 DEFINE_INLINE_TRACE()
106 { 106 {
107 visitor->trace(player); 107 visitor->trace(player);
108 visitor->trace(from); 108 visitor->trace(from);
109 visitor->trace(to); 109 visitor->trace(to);
110 } 110 }
111 111
112 RefPtrWillBeMember<AnimationPlayer> player; 112 RefPtrWillBeMember<AnimationPlayer> player;
113 RawPtrWillBeMember<const AnimatableValue> from; 113 Member<const AnimatableValue> from;
114 RawPtrWillBeMember<const AnimatableValue> to; 114 Member<const AnimatableValue> to;
115 }; 115 };
116 116
117 using AnimationMap = WillBeHeapHashMap<AtomicString, RefPtrWillBeMember<Runn ingAnimation>>; 117 using AnimationMap = HeapHashMap<AtomicString, Member<RunningAnimation>>;
118 AnimationMap m_animations; 118 AnimationMap m_animations;
119 119
120 using TransitionMap = WillBeHeapHashMap<CSSPropertyID, RunningTransition>; 120 using TransitionMap = HeapHashMap<CSSPropertyID, RunningTransition>;
121 TransitionMap m_transitions; 121 TransitionMap m_transitions;
122 122
123 OwnPtrWillBeMember<CSSAnimationUpdate> m_pendingUpdate; 123 Member<CSSAnimationUpdate> m_pendingUpdate;
124 124
125 ActiveInterpolationMap m_previousActiveInterpolationsForAnimations; 125 ActiveInterpolationMap m_previousActiveInterpolationsForAnimations;
126 126
127 static void calculateAnimationUpdate(CSSAnimationUpdate*, const Element* ani matingElement, Element&, const ComputedStyle&, ComputedStyle* parentStyle, Style Resolver*); 127 static void calculateAnimationUpdate(CSSAnimationUpdate*, const Element* ani matingElement, Element&, const ComputedStyle&, ComputedStyle* parentStyle, Style Resolver*);
128 static void calculateTransitionUpdate(CSSAnimationUpdate*, const Element* an imatingElement, const ComputedStyle&); 128 static void calculateTransitionUpdate(CSSAnimationUpdate*, const Element* an imatingElement, const ComputedStyle&);
129 static void calculateTransitionUpdateForProperty(CSSPropertyID, CSSPropertyI D eventId, const CSSTransitionData&, size_t transitionIndex, const ComputedStyle & oldStyle, const ComputedStyle&, const TransitionMap* activeTransitions, CSSAni mationUpdate*, const Element*); 129 static void calculateTransitionUpdateForProperty(CSSPropertyID, CSSPropertyI D eventId, const CSSTransitionData&, size_t transitionIndex, const ComputedStyle & oldStyle, const ComputedStyle&, const TransitionMap* activeTransitions, CSSAni mationUpdate*, const Element*);
130 130
131 static void calculateAnimationActiveInterpolations(CSSAnimationUpdate*, cons t Element* animatingElement, double timelineCurrentTime); 131 static void calculateAnimationActiveInterpolations(CSSAnimationUpdate*, cons t Element* animatingElement, double timelineCurrentTime);
132 static void calculateTransitionActiveInterpolations(CSSAnimationUpdate*, con st Element* animatingElement, double timelineCurrentTime); 132 static void calculateTransitionActiveInterpolations(CSSAnimationUpdate*, con st Element* animatingElement, double timelineCurrentTime);
133 133
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 176
177 RawPtrWillBeMember<Element> m_transitionTarget; 177 RawPtrWillBeMember<Element> m_transitionTarget;
178 const CSSPropertyID m_property; 178 const CSSPropertyID m_property;
179 AnimationNode::Phase m_previousPhase; 179 AnimationNode::Phase m_previousPhase;
180 }; 180 };
181 }; 181 };
182 182
183 } // namespace blink 183 } // namespace blink
184 184
185 #endif 185 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698