| OLD | NEW |
| 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 16 matching lines...) Expand all Loading... |
| 27 #include "core/frame/SuspendableTimer.h" | 27 #include "core/frame/SuspendableTimer.h" |
| 28 | 28 |
| 29 namespace blink { | 29 namespace blink { |
| 30 | 30 |
| 31 namespace { | 31 namespace { |
| 32 // The lowest value returned by TimerBase::nextUnalignedFireInterval is 0.0 | 32 // The lowest value returned by TimerBase::nextUnalignedFireInterval is 0.0 |
| 33 const double kNextFireIntervalInvalid = -1.0; | 33 const double kNextFireIntervalInvalid = -1.0; |
| 34 } | 34 } |
| 35 | 35 |
| 36 SuspendableTimer::SuspendableTimer(ExecutionContext* context) | 36 SuspendableTimer::SuspendableTimer(ExecutionContext* context) |
| 37 : ActiveDOMObject(context) | 37 : TimerBase(TimerBase::getTimerTaskRunner()) |
| 38 , ActiveDOMObject(context) |
| 38 , m_nextFireInterval(kNextFireIntervalInvalid) | 39 , m_nextFireInterval(kNextFireIntervalInvalid) |
| 39 , m_repeatInterval(0) | 40 , m_repeatInterval(0) |
| 40 #if ENABLE(ASSERT) | 41 #if ENABLE(ASSERT) |
| 41 , m_suspended(false) | 42 , m_suspended(false) |
| 42 #endif | 43 #endif |
| 43 { | 44 { |
| 44 } | 45 } |
| 45 | 46 |
| 46 SuspendableTimer::~SuspendableTimer() | 47 SuspendableTimer::~SuspendableTimer() |
| 47 { | 48 { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 75 #endif | 76 #endif |
| 76 if (m_nextFireInterval >= 0.0) { | 77 if (m_nextFireInterval >= 0.0) { |
| 77 // start() was called before, therefore location() is already set. | 78 // start() was called before, therefore location() is already set. |
| 78 // m_nextFireInterval is only set in suspend() if the Timer was active. | 79 // m_nextFireInterval is only set in suspend() if the Timer was active. |
| 79 start(m_nextFireInterval, m_repeatInterval, location()); | 80 start(m_nextFireInterval, m_repeatInterval, location()); |
| 80 m_nextFireInterval = kNextFireIntervalInvalid; | 81 m_nextFireInterval = kNextFireIntervalInvalid; |
| 81 } | 82 } |
| 82 } | 83 } |
| 83 | 84 |
| 84 } // namespace blink | 85 } // namespace blink |
| OLD | NEW |