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

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

Issue 2616593002: Move core/animation timers to frame-specific task runners. (Closed)
Patch Set: Created 3 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/CompositorPendingAnimations.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 18 matching lines...) Expand all
29 */ 29 */
30 30
31 #ifndef AnimationTimeline_h 31 #ifndef AnimationTimeline_h
32 #define AnimationTimeline_h 32 #define AnimationTimeline_h
33 33
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 "core/dom/TaskRunnerHelper.h"
39 #include "platform/Timer.h" 40 #include "platform/Timer.h"
40 #include "platform/animation/CompositorAnimationTimeline.h" 41 #include "platform/animation/CompositorAnimationTimeline.h"
41 #include "platform/heap/Handle.h" 42 #include "platform/heap/Handle.h"
42 #include "wtf/RefPtr.h" 43 #include "wtf/RefPtr.h"
43 #include "wtf/Vector.h" 44 #include "wtf/Vector.h"
44 #include <memory> 45 #include <memory>
45 46
46 namespace blink { 47 namespace blink {
47 48
48 class Document; 49 class Document;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 132
132 Member<PlatformTiming> m_timing; 133 Member<PlatformTiming> m_timing;
133 double m_lastCurrentTimeInternal; 134 double m_lastCurrentTimeInternal;
134 135
135 std::unique_ptr<CompositorAnimationTimeline> m_compositorTimeline; 136 std::unique_ptr<CompositorAnimationTimeline> m_compositorTimeline;
136 137
137 class AnimationTimelineTiming final : public PlatformTiming { 138 class AnimationTimelineTiming final : public PlatformTiming {
138 public: 139 public:
139 AnimationTimelineTiming(AnimationTimeline* timeline) 140 AnimationTimelineTiming(AnimationTimeline* timeline)
140 : m_timeline(timeline), 141 : m_timeline(timeline),
141 m_timer(this, &AnimationTimelineTiming::timerFired) { 142 m_timer(TaskRunnerHelper::get(TaskType::UnspecedTimer,
143 timeline->document()),
144 this,
145 &AnimationTimelineTiming::timerFired) {
142 DCHECK(m_timeline); 146 DCHECK(m_timeline);
143 } 147 }
144 148
145 void wakeAfter(double duration) override; 149 void wakeAfter(double duration) override;
146 void serviceOnNextFrame() override; 150 void serviceOnNextFrame() override;
147 151
148 void timerFired(TimerBase*) { m_timeline->wake(); } 152 void timerFired(TimerBase*) { m_timeline->wake(); }
149 153
150 DECLARE_VIRTUAL_TRACE(); 154 DECLARE_VIRTUAL_TRACE();
151 155
152 private: 156 private:
153 Member<AnimationTimeline> m_timeline; 157 Member<AnimationTimeline> m_timeline;
154 Timer<AnimationTimelineTiming> m_timer; 158 TaskRunnerTimer<AnimationTimelineTiming> m_timer;
155 }; 159 };
156 160
157 friend class AnimationAnimationTimelineTest; 161 friend class AnimationAnimationTimelineTest;
158 }; 162 };
159 163
160 } // namespace blink 164 } // namespace blink
161 165
162 #endif 166 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/CompositorPendingAnimations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698