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

Side by Side Diff: Source/core/animation/AnimationPlayer.h

Issue 284323004: Web Animations: Make AnimationPlayer an ActiveDOMObject (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 6 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 | Annotate | Revision Log
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 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef AnimationPlayer_h 31 #ifndef AnimationPlayer_h
32 #define AnimationPlayer_h 32 #define AnimationPlayer_h
33 33
34 #include "core/animation/AnimationSource.h" 34 #include "core/animation/AnimationSource.h"
35 #include "core/dom/ActiveDOMObject.h"
35 #include "core/events/EventTarget.h" 36 #include "core/events/EventTarget.h"
36 #include "wtf/RefPtr.h" 37 #include "wtf/RefPtr.h"
37 38
38 namespace WebCore { 39 namespace WebCore {
39 40
40 class AnimationTimeline; 41 class AnimationTimeline;
41 class ExceptionState; 42 class ExceptionState;
42 43
43 class AnimationPlayer FINAL : public RefCountedWillBeRefCountedGarbageCollected< AnimationPlayer>, public EventTargetWithInlineData { 44 class AnimationPlayer FINAL : public RefCountedWillBeRefCountedGarbageCollected< AnimationPlayer>
45 , public ActiveDOMObject
46 , public EventTargetWithInlineData {
44 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<A nimationPlayer>); 47 DEFINE_EVENT_TARGET_REFCOUNTING(RefCountedWillBeRefCountedGarbageCollected<A nimationPlayer>);
45 public: 48 public:
46 49
47 ~AnimationPlayer(); 50 ~AnimationPlayer();
48 static PassRefPtrWillBeRawPtr<AnimationPlayer> create(AnimationTimeline&, An imationSource*); 51 static PassRefPtrWillBeRawPtr<AnimationPlayer> create(AnimationTimeline&, An imationSource*);
49 52
50 // Returns whether the player is finished. 53 // Returns whether the player is finished.
51 bool update(TimingUpdateReason); 54 bool update(TimingUpdateReason);
52 55
53 // timeToEffectChange returns: 56 // timeToEffectChange returns:
(...skipping 17 matching lines...) Expand all
71 void finish(ExceptionState&); 74 void finish(ExceptionState&);
72 bool finished() { return limited(currentTimeInternal()); } 75 bool finished() { return limited(currentTimeInternal()); }
73 // FIXME: Resolve whether finished() should just return the flag, and 76 // FIXME: Resolve whether finished() should just return the flag, and
74 // remove this method. 77 // remove this method.
75 bool finishedInternal() const { return m_finished; } 78 bool finishedInternal() const { return m_finished; }
76 79
77 DEFINE_ATTRIBUTE_EVENT_LISTENER(finish); 80 DEFINE_ATTRIBUTE_EVENT_LISTENER(finish);
78 81
79 virtual const AtomicString& interfaceName() const OVERRIDE; 82 virtual const AtomicString& interfaceName() const OVERRIDE;
80 virtual ExecutionContext* executionContext() const OVERRIDE; 83 virtual ExecutionContext* executionContext() const OVERRIDE;
84 virtual bool hasPendingActivity() const OVERRIDE;
haraken 2014/05/23 07:15:05 Don't we need to override ActiveDOMObject::stop()/
dstockwell 2014/05/26 00:47:50 Yes, I suppose stop() is necessary. suspend/resume
haraken 2014/05/26 01:16:09 Makes sense. - I'm just curious, but why are susp
dstockwell 2014/05/26 01:32:40 There's nothing that we need to suspend here. Anim
85 virtual bool dispatchEvent(PassRefPtrWillBeRawPtr<Event>) OVERRIDE;
81 86
82 double playbackRate() const { return m_playbackRate; } 87 double playbackRate() const { return m_playbackRate; }
83 void setPlaybackRate(double); 88 void setPlaybackRate(double);
84 const AnimationTimeline* timeline() const { return m_timeline; } 89 const AnimationTimeline* timeline() const { return m_timeline; }
85 AnimationTimeline* timeline() { return m_timeline; } 90 AnimationTimeline* timeline() { return m_timeline; }
86 91
87 #if !ENABLE(OILPAN) 92 #if !ENABLE(OILPAN)
88 void timelineDestroyed() { m_timeline = nullptr; } 93 void timelineDestroyed() { m_timeline = nullptr; }
89 #endif 94 #endif
90 95
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // Reflects all pausing, including via pauseForTesting(). 175 // Reflects all pausing, including via pauseForTesting().
171 bool m_paused; 176 bool m_paused;
172 bool m_held; 177 bool m_held;
173 bool m_isPausedForTesting; 178 bool m_isPausedForTesting;
174 179
175 // This indicates timing information relevant to the player has changed by 180 // This indicates timing information relevant to the player has changed by
176 // means other than the ordinary progression of time 181 // means other than the ordinary progression of time
177 bool m_outdated; 182 bool m_outdated;
178 183
179 bool m_finished; 184 bool m_finished;
185 // Holds a 'finished' event queued for asynchronous dispatch via the
186 // ScriptedAnimationController. This object remains active until the
187 // event is actually dispatched.
188 RefPtrWillBeMember<Event> m_pendingFinishedEvent;
180 }; 189 };
181 190
182 } // namespace 191 } // namespace
183 192
184 #endif 193 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698