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

Side by Side Diff: third_party/WebKit/Source/core/animation/AnimationTimeline.h

Issue 1515573002: Safely finalize an AnimationTimeline's still-attached Animations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unconditonally register prefinalizer Created 5 years 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
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "wtf/Vector.h" 43 #include "wtf/Vector.h"
44 44
45 namespace blink { 45 namespace blink {
46 46
47 class Document; 47 class Document;
48 class AnimationEffect; 48 class AnimationEffect;
49 49
50 // AnimationTimeline is constructed and owned by Document, and tied to its lifec ycle. 50 // AnimationTimeline is constructed and owned by Document, and tied to its lifec ycle.
51 class CORE_EXPORT AnimationTimeline : public GarbageCollectedFinalized<Animation Timeline>, public ScriptWrappable { 51 class CORE_EXPORT AnimationTimeline : public GarbageCollectedFinalized<Animation Timeline>, public ScriptWrappable {
52 DEFINE_WRAPPERTYPEINFO(); 52 DEFINE_WRAPPERTYPEINFO();
53 USING_PRE_FINALIZER(AnimationTimeline, dispose);
53 public: 54 public:
54 class PlatformTiming : public GarbageCollectedFinalized<PlatformTiming> { 55 class PlatformTiming : public GarbageCollectedFinalized<PlatformTiming> {
55 public: 56 public:
56 // Calls AnimationTimeline's wake() method after duration seconds. 57 // Calls AnimationTimeline's wake() method after duration seconds.
57 virtual void wakeAfter(double duration) = 0; 58 virtual void wakeAfter(double duration) = 0;
58 virtual void serviceOnNextFrame() = 0; 59 virtual void serviceOnNextFrame() = 0;
59 virtual ~PlatformTiming() { } 60 virtual ~PlatformTiming() { }
60 DEFINE_INLINE_VIRTUAL_TRACE() { } 61 DEFINE_INLINE_VIRTUAL_TRACE() { }
61 }; 62 };
62 63
63 static AnimationTimeline* create(Document*, PlatformTiming* = nullptr); 64 static AnimationTimeline* create(Document*, PlatformTiming* = nullptr);
64 ~AnimationTimeline(); 65 ~AnimationTimeline();
66 void dispose();
65 67
66 void serviceAnimations(TimingUpdateReason); 68 void serviceAnimations(TimingUpdateReason);
67 void scheduleNextService(); 69 void scheduleNextService();
68 70
69 Animation* play(AnimationEffect*); 71 Animation* play(AnimationEffect*);
70 HeapVector<Member<Animation>> getAnimations(); 72 HeapVector<Member<Animation>> getAnimations();
71 73
72 void animationAttached(Animation&); 74 void animationAttached(Animation&);
73 75
74 bool isActive(); 76 bool isActive();
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 Member<AnimationTimeline> m_timeline; 148 Member<AnimationTimeline> m_timeline;
147 Timer<AnimationTimelineTiming> m_timer; 149 Timer<AnimationTimelineTiming> m_timer;
148 }; 150 };
149 151
150 friend class AnimationAnimationTimelineTest; 152 friend class AnimationAnimationTimelineTest;
151 }; 153 };
152 154
153 } // namespace blink 155 } // namespace blink
154 156
155 #endif 157 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/animation/Animation.cpp ('k') | third_party/WebKit/Source/core/animation/AnimationTimeline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698