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

Unified Diff: Source/core/animation/TimedItem.h

Issue 225073004: Oilpan: Completely move core/animations/ to oilpan's heap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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
Index: Source/core/animation/TimedItem.h
diff --git a/Source/core/animation/TimedItem.h b/Source/core/animation/TimedItem.h
index ba568cfc32825049a70242df35170c70daf92039..dc6a076787d78ee15a7da1b0a3c717c20e1aba52 100644
--- a/Source/core/animation/TimedItem.h
+++ b/Source/core/animation/TimedItem.h
@@ -32,6 +32,7 @@
#define TimedItem_h
#include "core/animation/Timing.h"
+#include "platform/heap/Handle.h"
#include "wtf/OwnPtr.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/RefCounted.h"
@@ -52,7 +53,7 @@ static inline double nullValue()
return std::numeric_limits<double>::quiet_NaN();
}
-class TimedItem : public RefCounted<TimedItem> {
+class TimedItem : public RefCountedWillBeGarbageCollectedFinalized<TimedItem> {
friend class AnimationPlayer; // Calls attach/detach, updateInheritedTime.
public:
// Note that logic in CSSAnimations depends on the order of these values.
@@ -91,14 +92,16 @@ public:
AnimationPlayer* player() { return m_player; }
AnimationPlayer* player(bool& isNull) { isNull = !m_player; return m_player; }
const Timing& specifiedTiming() const { return m_specified; }
- PassRefPtr<TimedItemTiming> specified();
+ PassRefPtrWillBeRawPtr<TimedItemTiming> specified();
void updateSpecifiedTiming(const Timing&);
double localTime(bool& isNull) const { isNull = !m_player; return ensureCalculated().localTime; }
double currentIteration(bool& isNull) const { isNull = !ensureCalculated().isInEffect; return ensureCalculated().currentIteration; }
+ virtual void trace(Visitor*);
+
protected:
- TimedItem(const Timing&, PassOwnPtr<EventDelegate> = nullptr);
+ explicit TimedItem(const Timing&, PassOwnPtr<EventDelegate> = nullptr);
// When TimedItem receives a new inherited time via updateInheritedTime
// it will (if necessary) recalculate timings and (if necessary) call
@@ -107,35 +110,30 @@ protected:
void invalidate() const { m_needsUpdate = true; };
bool hasEvents() const { return m_eventDelegate; }
-private:
+ virtual void attach(AnimationPlayer* player)
+ {
+ m_player = player;
+ }
+ virtual void detach()
+ {
+ ASSERT(m_player);
+ m_player = nullptr;
+ }
+
+private:
double iterationDuration() const;
double repeatedDuration() const;
virtual void updateChildrenAndEffects() const = 0;
virtual double intrinsicIterationDuration() const { return 0; };
virtual double calculateTimeToEffectChange(bool forwards, double localTime, double timeToNextIteration) const = 0;
- virtual void didAttach() { };
- virtual void willDetach() { };
- virtual void specifiedTimingChanged() { };
-
- void attach(AnimationPlayer* player)
- {
- m_player = player;
- didAttach();
- };
-
- void detach()
- {
- ASSERT(m_player);
- willDetach();
- m_player = 0;
- };
+ virtual void specifiedTimingChanged() { }
// FIXME: m_parent and m_startTime are placeholders, they depend on timing groups.
- TimedItem* const m_parent;
+ RawPtrWillBeMember<TimedItem> m_parent;
const double m_startTime;
- AnimationPlayer* m_player;
+ RawPtrWillBeMember<AnimationPlayer> m_player;
Timing m_specified;
OwnPtr<EventDelegate> m_eventDelegate;

Powered by Google App Engine
This is Rietveld 408576698