| Index: Source/core/animation/DocumentTimeline.h
|
| diff --git a/Source/core/animation/DocumentTimeline.h b/Source/core/animation/DocumentTimeline.h
|
| index 2dfda4a93ea52df352d385a5568d43961fddd19c..741599a1a637e03cdf71f730bb5d6ad586272c97 100644
|
| --- a/Source/core/animation/DocumentTimeline.h
|
| +++ b/Source/core/animation/DocumentTimeline.h
|
| @@ -36,6 +36,7 @@
|
| #include "core/dom/Element.h"
|
| #include "core/events/Event.h"
|
| #include "platform/Timer.h"
|
| +#include "platform/heap/Handle.h"
|
| #include "wtf/RefCounted.h"
|
| #include "wtf/RefPtr.h"
|
| #include "wtf/Vector.h"
|
| @@ -46,9 +47,9 @@ class Document;
|
| class TimedItem;
|
|
|
| // DocumentTimeline is constructed and owned by Document, and tied to its lifecycle.
|
| -class DocumentTimeline : public RefCounted<DocumentTimeline> {
|
| +class DocumentTimeline : public RefCountedWillBeGarbageCollectedFinalized<DocumentTimeline> {
|
| public:
|
| - class PlatformTiming {
|
| + class PlatformTiming : public NoBaseWillBeGarbageCollectedFinalized<PlatformTiming> {
|
|
|
| public:
|
| // Calls DocumentTimeline's wake() method after duration seconds.
|
| @@ -56,10 +57,10 @@ public:
|
| virtual void cancelWake() = 0;
|
| virtual void serviceOnNextFrame() = 0;
|
| virtual ~PlatformTiming() { }
|
| -
|
| + virtual void trace(Visitor*) = 0;
|
| };
|
|
|
| - static PassRefPtr<DocumentTimeline> create(Document*, PassOwnPtr<PlatformTiming> = nullptr);
|
| + static PassRefPtrWillBeRawPtr<DocumentTimeline> create(Document*, PassOwnPtrWillBeRawPtr<PlatformTiming> = nullptr);
|
| ~DocumentTimeline();
|
|
|
| void serviceAnimations(AnimationPlayer::UpdateReason);
|
| @@ -68,11 +69,13 @@ public:
|
| AnimationPlayer* createAnimationPlayer(TimedItem*);
|
| AnimationPlayer* play(TimedItem*);
|
|
|
| +#if !ENABLE(OILPAN)
|
| void playerDestroyed(AnimationPlayer* player)
|
| {
|
| ASSERT(m_players.contains(player));
|
| m_players.remove(player);
|
| }
|
| +#endif
|
|
|
| // Called from setReadyState() in Document.cpp to set m_zeroTime to
|
| // performance.timing.domInteractive
|
| @@ -92,16 +95,20 @@ public:
|
| Document* document() { return m_document; }
|
| void detachFromDocument();
|
|
|
| + void trace(Visitor*);
|
| +
|
| protected:
|
| - DocumentTimeline(Document*, PassOwnPtr<PlatformTiming>);
|
| + DocumentTimeline(Document*, PassOwnPtrWillBeRawPtr<PlatformTiming>);
|
|
|
| private:
|
| double m_zeroTime;
|
| + // FIXME: oilpan: This should be a Member once the Document is moved to the heap.
|
| + // DocumentTimeline should keep the Document alive.
|
| Document* m_document;
|
| // AnimationPlayers which will be updated on the next frame
|
| // i.e. current, in effect, or had timing changed
|
| - HashSet<RefPtr<AnimationPlayer> > m_playersNeedingUpdate;
|
| - HashSet<AnimationPlayer*> m_players;
|
| + WillBeHeapHashSet<RefPtrWillBeMember<AnimationPlayer> > m_playersNeedingUpdate;
|
| + WillBeHeapHashSet<RawPtrWillBeWeakMember<AnimationPlayer> > m_players;
|
| bool m_hasOutdatedAnimationPlayer;
|
|
|
| void wake();
|
| @@ -109,7 +116,7 @@ private:
|
| friend class SMILTimeContainer;
|
| static const double s_minimumDelay;
|
|
|
| - OwnPtr<PlatformTiming> m_timing;
|
| + OwnPtrWillBeMember<PlatformTiming> m_timing;
|
|
|
| class DocumentTimelineTiming FINAL : public PlatformTiming {
|
| public:
|
| @@ -126,10 +133,11 @@ private:
|
|
|
| void timerFired(Timer<DocumentTimelineTiming>*) { m_timeline->wake(); }
|
|
|
| + virtual void trace(Visitor*) OVERRIDE;
|
| +
|
| private:
|
| - DocumentTimeline* m_timeline;
|
| + RawPtrWillBeMember<DocumentTimeline> m_timeline;
|
| Timer<DocumentTimelineTiming> m_timer;
|
| -
|
| };
|
|
|
| friend class AnimationDocumentTimelineTest;
|
|
|