Chromium Code Reviews| Index: Source/core/animation/TimedItem.h |
| diff --git a/Source/core/animation/TimedItem.h b/Source/core/animation/TimedItem.h |
| index 9e32eb7b06048028651c692c7dddc1eabb6e04fd..680cc111f74c87e5b286463cc8ea6ad967499eb0 100644 |
| --- a/Source/core/animation/TimedItem.h |
| +++ b/Source/core/animation/TimedItem.h |
| @@ -36,6 +36,8 @@ |
| namespace WebCore { |
| +class Player; |
| + |
| static inline bool isNull(double value) |
| { |
| return std::isnan(value); |
| @@ -47,6 +49,7 @@ static inline double nullValue() |
| } |
| class TimedItem : public RefCounted<TimedItem> { |
| + friend class Player; // calls attach/detach |
| public: |
| virtual ~TimedItem() { } |
| @@ -60,6 +63,7 @@ public: |
| double currentIteration() const { return ensureCalculated().currentIteration; } |
| double activeDuration() const { return ensureCalculated().activeDuration; } |
| double timeFraction() const { return ensureCalculated().timeFraction; } |
| + Player* player() const { return m_player; } |
| protected: |
| TimedItem(const Timing&); |
| @@ -70,14 +74,23 @@ protected: |
| void updateInheritedTime(double inheritedTime) const; |
| virtual void updateChildrenAndEffects(bool wasActiveOrInEffect) const = 0; |
| virtual double intrinsicIterationDuration() const { return 0; }; |
| + virtual void willDetach() { }; |
|
esprehn
2013/07/17 06:48:01
= 0; or you plan to have ones that do nothing?
dstockwell
2013/07/17 13:10:19
Done.
|
| friend class Player; // Calls updateInheritedTime. |
| private: |
| + void attach(Player* player) { m_player = player; }; |
| + void detach(Player* player) |
| + { |
| + ASSERT(m_player == player); |
|
esprehn
2013/07/17 06:48:01
This is really weird, why store it in here if you
dstockwell
2013/07/17 13:10:19
Done.
|
| + willDetach(); |
| + m_player = 0; |
| + }; |
| + |
| // FIXME: m_parent and m_startTime are placeholders, they depend on timing groups. |
| TimedItem* const m_parent; |
| const double m_startTime; |
| - |
| + Player* m_player; |
| Timing m_specified; |
| // FIXME: Should be versioned by monotonic value on player. |