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

Side by Side Diff: Source/core/animation/KeyframeEffect.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: Intentional nullptr access 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 class KeyframeEffectOptions; 44 class KeyframeEffectOptions;
45 class Dictionary; 45 class Dictionary;
46 class Element; 46 class Element;
47 class ExceptionState; 47 class ExceptionState;
48 class PropertyHandle; 48 class PropertyHandle;
49 class SampledEffect; 49 class SampledEffect;
50 50
51 class CORE_EXPORT KeyframeEffect final : public AnimationEffect { 51 class CORE_EXPORT KeyframeEffect final : public AnimationEffect {
52 DEFINE_WRAPPERTYPEINFO(); 52 DEFINE_WRAPPERTYPEINFO();
53 USING_PRE_FINALIZER(KeyframeEffect, dispose);
53 public: 54 public:
54 enum Priority { DefaultPriority, TransitionPriority }; 55 enum Priority { DefaultPriority, TransitionPriority };
55 56
56 static PassRefPtrWillBeRawPtr<KeyframeEffect> create(Element*, PassRefPtrWil lBeRawPtr<EffectModel>, const Timing&, Priority = DefaultPriority, PassOwnPtrWil lBeRawPtr<EventDelegate> = nullptr); 57 static KeyframeEffect* create(Element*, EffectModel*, const Timing&, Priorit y = DefaultPriority, EventDelegate* = nullptr);
57 // Web Animations API Bindings constructors. 58 // Web Animations API Bindings constructors.
58 static PassRefPtrWillBeRawPtr<KeyframeEffect> create(Element*, const Vector< Dictionary>& keyframeDictionaryVector, double duration, ExceptionState&); 59 static KeyframeEffect* create(Element*, const Vector<Dictionary>& keyframeDi ctionaryVector, double duration, ExceptionState&);
59 static PassRefPtrWillBeRawPtr<KeyframeEffect> create(Element*, const Vector< Dictionary>& keyframeDictionaryVector, const KeyframeEffectOptions& timingInput, ExceptionState&); 60 static KeyframeEffect* create(Element*, const Vector<Dictionary>& keyframeDi ctionaryVector, const KeyframeEffectOptions& timingInput, ExceptionState&);
60 static PassRefPtrWillBeRawPtr<KeyframeEffect> create(Element*, const Vector< Dictionary>& keyframeDictionaryVector, ExceptionState&); 61 static KeyframeEffect* create(Element*, const Vector<Dictionary>& keyframeDi ctionaryVector, ExceptionState&);
61 62
62 virtual ~KeyframeEffect(); 63 virtual ~KeyframeEffect();
64 void dispose();
63 65
64 virtual bool isAnimation() const override { return true; } 66 virtual bool isAnimation() const override { return true; }
65 67
66 bool affects(PropertyHandle) const; 68 bool affects(PropertyHandle) const;
67 const EffectModel* model() const { return m_model.get(); } 69 const EffectModel* model() const { return m_model.get(); }
68 EffectModel* model() { return m_model.get(); } 70 EffectModel* model() { return m_model.get(); }
69 void setModel(PassRefPtrWillBeRawPtr<EffectModel> model) { m_model = model; } 71 void setModel(EffectModel* model) { m_model = model; }
70 Priority priority() const { return m_priority; } 72 Priority priority() const { return m_priority; }
71 Element* target() const { return m_target; } 73 Element* target() const { return m_target; }
72 74
73 #if !ENABLE(OILPAN) 75 #if !ENABLE(OILPAN)
74 void notifyElementDestroyed(); 76 void notifyElementDestroyed();
75 #endif 77 #endif
76 78
77 bool isCandidateForAnimationOnCompositor(double animationPlaybackRate) const ; 79 bool isCandidateForAnimationOnCompositor(double animationPlaybackRate) const ;
78 // Must only be called once. 80 // Must only be called once.
79 bool maybeStartAnimationOnCompositor(int group, double startTime, double tim eOffset, double animationPlaybackRate); 81 bool maybeStartAnimationOnCompositor(int group, double startTime, double tim eOffset, double animationPlaybackRate);
(...skipping 16 matching lines...) Expand all
96 protected: 98 protected:
97 void applyEffects(); 99 void applyEffects();
98 void clearEffects(); 100 void clearEffects();
99 virtual void updateChildrenAndEffects() const override; 101 virtual void updateChildrenAndEffects() const override;
100 virtual void attach(Animation*) override; 102 virtual void attach(Animation*) override;
101 virtual void detach() override; 103 virtual void detach() override;
102 virtual void specifiedTimingChanged() override; 104 virtual void specifiedTimingChanged() override;
103 virtual double calculateTimeToEffectChange(bool forwards, double inheritedTi me, double timeToNextIteration) const override; 105 virtual double calculateTimeToEffectChange(bool forwards, double inheritedTi me, double timeToNextIteration) const override;
104 106
105 private: 107 private:
106 KeyframeEffect(Element*, PassRefPtrWillBeRawPtr<EffectModel>, const Timing&, Priority, PassOwnPtrWillBeRawPtr<EventDelegate>); 108 KeyframeEffect(Element*, EffectModel*, const Timing&, Priority, EventDelegat e*);
107 109
108 RawPtrWillBeMember<Element> m_target; 110 RawPtrWillBeMember<Element> m_target;
109 RefPtrWillBeMember<EffectModel> m_model; 111 Member<EffectModel> m_model;
110 RawPtrWillBeMember<SampledEffect> m_sampledEffect; 112 Member<SampledEffect> m_sampledEffect;
111 113
112 Priority m_priority; 114 Priority m_priority;
113 115
114 Vector<int> m_compositorAnimationIds; 116 Vector<int> m_compositorAnimationIds;
115 117
116 friend class AnimationAnimationV8Test; 118 friend class AnimationAnimationV8Test;
117 }; 119 };
118 120
119 DEFINE_TYPE_CASTS(KeyframeEffect, AnimationEffect, animationNode, animationNode- >isAnimation(), animationNode.isAnimation()); 121 DEFINE_TYPE_CASTS(KeyframeEffect, AnimationEffect, animationNode, animationNode- >isAnimation(), animationNode.isAnimation());
120 122
121 } // namespace blink 123 } // namespace blink
122 124
123 #endif // KeyframeEffect_h 125 #endif // KeyframeEffect_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698