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

Side by Side Diff: third_party/WebKit/Source/core/svg/animation/SMILTimeContainer.cpp

Issue 2191533003: Refactor Timer classes in preparation for landing FrameTimers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android build fix 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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 m_wakeupTimer.stop(); 284 m_wakeupTimer.stop();
285 } 285 }
286 286
287 void SMILTimeContainer::scheduleWakeUp(double delayTime, FrameSchedulingState fr ameSchedulingState) 287 void SMILTimeContainer::scheduleWakeUp(double delayTime, FrameSchedulingState fr ameSchedulingState)
288 { 288 {
289 ASSERT(frameSchedulingState == SynchronizeAnimations || frameSchedulingState == FutureAnimationFrame); 289 ASSERT(frameSchedulingState == SynchronizeAnimations || frameSchedulingState == FutureAnimationFrame);
290 m_wakeupTimer.startOneShot(delayTime, BLINK_FROM_HERE); 290 m_wakeupTimer.startOneShot(delayTime, BLINK_FROM_HERE);
291 m_frameSchedulingState = frameSchedulingState; 291 m_frameSchedulingState = frameSchedulingState;
292 } 292 }
293 293
294 void SMILTimeContainer::wakeupTimerFired(Timer<SMILTimeContainer>*) 294 void SMILTimeContainer::wakeupTimerFired(TimerBase*)
295 { 295 {
296 ASSERT(m_frameSchedulingState == SynchronizeAnimations || m_frameSchedulingS tate == FutureAnimationFrame); 296 ASSERT(m_frameSchedulingState == SynchronizeAnimations || m_frameSchedulingS tate == FutureAnimationFrame);
297 if (m_frameSchedulingState == FutureAnimationFrame) { 297 if (m_frameSchedulingState == FutureAnimationFrame) {
298 ASSERT(isTimelineRunning()); 298 ASSERT(isTimelineRunning());
299 m_frameSchedulingState = Idle; 299 m_frameSchedulingState = Idle;
300 serviceOnNextFrame(); 300 serviceOnNextFrame();
301 } else { 301 } else {
302 m_frameSchedulingState = Idle; 302 m_frameSchedulingState = Idle;
303 updateAnimationsAndScheduleFrameIfNeeded(elapsed()); 303 updateAnimationsAndScheduleFrameIfNeeded(elapsed());
304 } 304 }
305 } 305 }
306 306
307 void SMILTimeContainer::scheduleAnimationPolicyTimer() 307 void SMILTimeContainer::scheduleAnimationPolicyTimer()
308 { 308 {
309 m_animationPolicyOnceTimer.startOneShot(animationPolicyOnceDuration, BLINK_F ROM_HERE); 309 m_animationPolicyOnceTimer.startOneShot(animationPolicyOnceDuration, BLINK_F ROM_HERE);
310 } 310 }
311 311
312 void SMILTimeContainer::cancelAnimationPolicyTimer() 312 void SMILTimeContainer::cancelAnimationPolicyTimer()
313 { 313 {
314 if (m_animationPolicyOnceTimer.isActive()) 314 if (m_animationPolicyOnceTimer.isActive())
315 m_animationPolicyOnceTimer.stop(); 315 m_animationPolicyOnceTimer.stop();
316 } 316 }
317 317
318 void SMILTimeContainer::animationPolicyTimerFired(Timer<SMILTimeContainer>*) 318 void SMILTimeContainer::animationPolicyTimerFired(TimerBase*)
319 { 319 {
320 pause(); 320 pause();
321 } 321 }
322 322
323 ImageAnimationPolicy SMILTimeContainer::animationPolicy() const 323 ImageAnimationPolicy SMILTimeContainer::animationPolicy() const
324 { 324 {
325 Settings* settings = document().settings(); 325 Settings* settings = document().settings();
326 if (!settings) 326 if (!settings)
327 return ImageAnimationPolicyAllowed; 327 return ImageAnimationPolicyAllowed;
328 328
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 setElapsed(elapsed().value() + initialFrameDelay); 546 setElapsed(elapsed().value() + initialFrameDelay);
547 } 547 }
548 548
549 DEFINE_TRACE(SMILTimeContainer) 549 DEFINE_TRACE(SMILTimeContainer)
550 { 550 {
551 visitor->trace(m_scheduledAnimations); 551 visitor->trace(m_scheduledAnimations);
552 visitor->trace(m_ownerSVGElement); 552 visitor->trace(m_ownerSVGElement);
553 } 553 }
554 554
555 } // namespace blink 555 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698