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

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

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 23 matching lines...) Expand all
34 #include "bindings/core/v8/ScriptWrappable.h" 34 #include "bindings/core/v8/ScriptWrappable.h"
35 #include "core/CoreExport.h" 35 #include "core/CoreExport.h"
36 #include "core/animation/Animation.h" 36 #include "core/animation/Animation.h"
37 #include "core/animation/EffectModel.h" 37 #include "core/animation/EffectModel.h"
38 #include "core/dom/Element.h" 38 #include "core/dom/Element.h"
39 #include "platform/Timer.h" 39 #include "platform/Timer.h"
40 #include "platform/animation/CompositorAnimationTimeline.h" 40 #include "platform/animation/CompositorAnimationTimeline.h"
41 #include "platform/heap/Handle.h" 41 #include "platform/heap/Handle.h"
42 #include "wtf/RefPtr.h" 42 #include "wtf/RefPtr.h"
43 #include "wtf/Vector.h" 43 #include "wtf/Vector.h"
44 #include <memory>
45 44
46 namespace blink { 45 namespace blink {
47 46
48 class Document; 47 class Document;
49 class AnimationEffect; 48 class AnimationEffect;
50 49
51 // 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.
52 class CORE_EXPORT AnimationTimeline final : public GarbageCollectedFinalized<Ani mationTimeline>, public ScriptWrappable { 51 class CORE_EXPORT AnimationTimeline final : public GarbageCollectedFinalized<Ani mationTimeline>, public ScriptWrappable {
53 DEFINE_WRAPPERTYPEINFO(); 52 DEFINE_WRAPPERTYPEINFO();
54 USING_PRE_FINALIZER(AnimationTimeline, dispose); 53 USING_PRE_FINALIZER(AnimationTimeline, dispose);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 HeapHashSet<WeakMember<Animation>> m_animations; 116 HeapHashSet<WeakMember<Animation>> m_animations;
118 117
119 double m_playbackRate; 118 double m_playbackRate;
120 119
121 friend class SMILTimeContainer; 120 friend class SMILTimeContainer;
122 static const double s_minimumDelay; 121 static const double s_minimumDelay;
123 122
124 Member<PlatformTiming> m_timing; 123 Member<PlatformTiming> m_timing;
125 double m_lastCurrentTimeInternal; 124 double m_lastCurrentTimeInternal;
126 125
127 std::unique_ptr<CompositorAnimationTimeline> m_compositorTimeline; 126 OwnPtr<CompositorAnimationTimeline> m_compositorTimeline;
128 127
129 class AnimationTimelineTiming final : public PlatformTiming { 128 class AnimationTimelineTiming final : public PlatformTiming {
130 public: 129 public:
131 AnimationTimelineTiming(AnimationTimeline* timeline) 130 AnimationTimelineTiming(AnimationTimeline* timeline)
132 : m_timeline(timeline) 131 : m_timeline(timeline)
133 , m_timer(this, &AnimationTimelineTiming::timerFired) 132 , m_timer(this, &AnimationTimelineTiming::timerFired)
134 { 133 {
135 ASSERT(m_timeline); 134 ASSERT(m_timeline);
136 } 135 }
137 136
138 void wakeAfter(double duration) override; 137 void wakeAfter(double duration) override;
139 void serviceOnNextFrame() override; 138 void serviceOnNextFrame() override;
140 139
141 void timerFired(Timer<AnimationTimelineTiming>*) { m_timeline->wake(); } 140 void timerFired(Timer<AnimationTimelineTiming>*) { m_timeline->wake(); }
142 141
143 DECLARE_VIRTUAL_TRACE(); 142 DECLARE_VIRTUAL_TRACE();
144 143
145 private: 144 private:
146 Member<AnimationTimeline> m_timeline; 145 Member<AnimationTimeline> m_timeline;
147 Timer<AnimationTimelineTiming> m_timer; 146 Timer<AnimationTimelineTiming> m_timer;
148 }; 147 };
149 148
150 friend class AnimationAnimationTimelineTest; 149 friend class AnimationAnimationTimelineTest;
151 }; 150 };
152 151
153 } // namespace blink 152 } // namespace blink
154 153
155 #endif 154 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698