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

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

Issue 2188623006: Add pre finalizer to Animation to ensure compositor handles get cleaned up (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove AnimationTimeline pre-finalizer Created 4 years, 4 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
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include <memory> 44 #include <memory>
45 45
46 namespace blink { 46 namespace blink {
47 47
48 class Document; 48 class Document;
49 class AnimationEffect; 49 class AnimationEffect;
50 50
51 // AnimationTimeline is constructed and owned by Document, and tied to its lifec ycle. 51 // AnimationTimeline is constructed and owned by Document, and tied to its lifec ycle.
52 class CORE_EXPORT AnimationTimeline final : public GarbageCollectedFinalized<Ani mationTimeline>, public ScriptWrappable { 52 class CORE_EXPORT AnimationTimeline final : public GarbageCollectedFinalized<Ani mationTimeline>, public ScriptWrappable {
53 DEFINE_WRAPPERTYPEINFO(); 53 DEFINE_WRAPPERTYPEINFO();
54 USING_PRE_FINALIZER(AnimationTimeline, dispose);
55 public: 54 public:
56 class PlatformTiming : public GarbageCollectedFinalized<PlatformTiming> { 55 class PlatformTiming : public GarbageCollectedFinalized<PlatformTiming> {
57 public: 56 public:
58 // Calls AnimationTimeline's wake() method after duration seconds. 57 // Calls AnimationTimeline's wake() method after duration seconds.
59 virtual void wakeAfter(double duration) = 0; 58 virtual void wakeAfter(double duration) = 0;
60 virtual void serviceOnNextFrame() = 0; 59 virtual void serviceOnNextFrame() = 0;
61 virtual ~PlatformTiming() { } 60 virtual ~PlatformTiming() { }
62 DEFINE_INLINE_VIRTUAL_TRACE() { } 61 DEFINE_INLINE_VIRTUAL_TRACE() { }
63 }; 62 };
64 63
65 static AnimationTimeline* create(Document*, PlatformTiming* = nullptr); 64 static AnimationTimeline* create(Document*, PlatformTiming* = nullptr);
66 ~AnimationTimeline(); 65 ~AnimationTimeline();
67 void dispose();
68 66
69 void serviceAnimations(TimingUpdateReason); 67 void serviceAnimations(TimingUpdateReason);
70 void scheduleNextService(); 68 void scheduleNextService();
71 69
72 Animation* play(AnimationEffect*); 70 Animation* play(AnimationEffect*);
73 HeapVector<Member<Animation>> getAnimations(); 71 HeapVector<Member<Animation>> getAnimations();
74 72
75 void animationAttached(Animation&); 73 void animationAttached(Animation&);
76 74
77 bool isActive(); 75 bool isActive();
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 Member<AnimationTimeline> m_timeline; 145 Member<AnimationTimeline> m_timeline;
148 Timer<AnimationTimelineTiming> m_timer; 146 Timer<AnimationTimelineTiming> m_timer;
149 }; 147 };
150 148
151 friend class AnimationAnimationTimelineTest; 149 friend class AnimationAnimationTimelineTest;
152 }; 150 };
153 151
154 } // namespace blink 152 } // namespace blink
155 153
156 #endif 154 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698