OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 11 matching lines...) Expand all Loading... | |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef SMILTimeContainer_h | 26 #ifndef SMILTimeContainer_h |
27 #define SMILTimeContainer_h | 27 #define SMILTimeContainer_h |
28 | 28 |
29 #include "core/dom/QualifiedName.h" | 29 #include "core/dom/QualifiedName.h" |
30 #include "core/svg/animation/SMILTime.h" | 30 #include "core/svg/animation/SMILTime.h" |
31 #include "platform/Timer.h" | 31 #include "platform/Timer.h" |
32 #include "platform/heap/Handle.h" | |
32 #include "wtf/HashMap.h" | 33 #include "wtf/HashMap.h" |
33 #include "wtf/HashSet.h" | 34 #include "wtf/HashSet.h" |
34 #include "wtf/PassRefPtr.h" | 35 #include "wtf/PassRefPtr.h" |
35 #include "wtf/RefCounted.h" | 36 #include "wtf/RefCounted.h" |
36 #include "wtf/text/StringHash.h" | 37 #include "wtf/text/StringHash.h" |
37 #include "wtf/text/WTFString.h" | 38 #include "wtf/text/WTFString.h" |
38 | 39 |
39 namespace WebCore { | 40 namespace WebCore { |
40 | 41 |
41 class Document; | 42 class Document; |
42 class SVGElement; | 43 class SVGElement; |
43 class SVGSMILElement; | 44 class SVGSMILElement; |
44 class SVGSVGElement; | 45 class SVGSVGElement; |
45 | 46 |
46 class SMILTimeContainer : public RefCounted<SMILTimeContainer> { | 47 class SMILTimeContainer : public RefCountedWillBeGarbageCollectedFinalized<SMILT imeContainer> { |
47 public: | 48 public: |
48 static PassRefPtr<SMILTimeContainer> create(SVGSVGElement& owner) { return a doptRef(new SMILTimeContainer(owner)); } | 49 static PassRefPtrWillBeRawPtr<SMILTimeContainer> create(SVGSVGElement& owner ) { return adoptRefWillBeNoop(new SMILTimeContainer(owner)); } |
49 ~SMILTimeContainer(); | 50 ~SMILTimeContainer(); |
50 | 51 |
51 void schedule(SVGSMILElement*, SVGElement*, const QualifiedName&); | 52 void schedule(SVGSMILElement*, SVGElement*, const QualifiedName&); |
52 void unschedule(SVGSMILElement*, SVGElement*, const QualifiedName&); | 53 void unschedule(SVGSMILElement*, SVGElement*, const QualifiedName&); |
53 void notifyIntervalsChanged(); | 54 void notifyIntervalsChanged(); |
54 | 55 |
55 SMILTime elapsed() const; | 56 SMILTime elapsed() const; |
56 | 57 |
57 bool isPaused() const; | 58 bool isPaused() const; |
58 bool isStarted() const; | 59 bool isStarted() const; |
59 | 60 |
60 void begin(); | 61 void begin(); |
61 void pause(); | 62 void pause(); |
62 void resume(); | 63 void resume(); |
63 void setElapsed(SMILTime); | 64 void setElapsed(SMILTime); |
64 | 65 |
65 void serviceAnimations(double monotonicAnimationStartTime); | 66 void serviceAnimations(double monotonicAnimationStartTime); |
66 bool hasAnimations() const; | 67 bool hasAnimations() const; |
67 | 68 |
68 void setDocumentOrderIndexesDirty() { m_documentOrderIndexesDirty = true; } | 69 void setDocumentOrderIndexesDirty() { m_documentOrderIndexesDirty = true; } |
69 | 70 |
71 void trace(Visitor*); | |
72 | |
70 private: | 73 private: |
71 SMILTimeContainer(SVGSVGElement& owner); | 74 explicit SMILTimeContainer(SVGSVGElement& owner); |
72 | 75 |
73 enum FrameSchedulingState { | 76 enum FrameSchedulingState { |
74 // No frame scheduled. | 77 // No frame scheduled. |
75 Idle, | 78 Idle, |
76 // Scheduled a wakeup to update the animation values. | 79 // Scheduled a wakeup to update the animation values. |
77 SynchronizeAnimations, | 80 SynchronizeAnimations, |
78 // Scheduled a wakeup to trigger an animation frame. | 81 // Scheduled a wakeup to trigger an animation frame. |
79 FutureAnimationFrame, | 82 FutureAnimationFrame, |
80 // Scheduled a animation frame for continuous update. | 83 // Scheduled a animation frame for continuous update. |
81 AnimationFrame | 84 AnimationFrame |
(...skipping 19 matching lines...) Expand all Loading... | |
101 double m_pauseTime; | 104 double m_pauseTime; |
102 double m_resumeTime; | 105 double m_resumeTime; |
103 double m_accumulatedActiveTime; | 106 double m_accumulatedActiveTime; |
104 double m_presetStartTime; | 107 double m_presetStartTime; |
105 | 108 |
106 FrameSchedulingState m_frameSchedulingState; | 109 FrameSchedulingState m_frameSchedulingState; |
107 bool m_documentOrderIndexesDirty; | 110 bool m_documentOrderIndexesDirty; |
108 | 111 |
109 Timer<SMILTimeContainer> m_wakeupTimer; | 112 Timer<SMILTimeContainer> m_wakeupTimer; |
110 | 113 |
111 typedef pair<SVGElement*, QualifiedName> ElementAttributePair; | 114 typedef pair<RawPtrWillBeWeakMember<SVGElement>, QualifiedName> ElementAttri butePair; |
112 typedef Vector<SVGSMILElement*> AnimationsVector; | 115 typedef WillBeHeapLinkedHashSet<RawPtrWillBeWeakMember<SVGSMILElement> > Ani mationsLinkedHashSet; |
113 typedef HashMap<ElementAttributePair, OwnPtr<AnimationsVector> > GroupedAnim ationsMap; | 116 typedef WillBeHeapVector<RefPtrWillBeMember<SVGSMILElement> > AnimationsVect or; |
haraken
2014/05/27 08:25:56
Can we move this typedef to the cpp file?
kouhei (in TOK)
2014/05/28 01:00:50
Done.
| |
117 typedef WillBeHeapHashMap<ElementAttributePair, OwnPtrWillBeMember<Animation sLinkedHashSet> > GroupedAnimationsMap; | |
114 GroupedAnimationsMap m_scheduledAnimations; | 118 GroupedAnimationsMap m_scheduledAnimations; |
115 | 119 |
116 SVGSVGElement& m_ownerSVGElement; | 120 SVGSVGElement& m_ownerSVGElement; |
117 | 121 |
118 #ifndef NDEBUG | 122 #ifndef NDEBUG |
119 bool m_preventScheduledAnimationsChanges; | 123 bool m_preventScheduledAnimationsChanges; |
120 #endif | 124 #endif |
121 }; | 125 }; |
122 } | 126 } |
123 | 127 |
124 #endif // SMILTimeContainer_h | 128 #endif // SMILTimeContainer_h |
OLD | NEW |