diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/page/DOMTimer.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebCore/page/DOMTimer.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/src/3rdparty/webkit/WebCore/page/DOMTimer.cpp b/src/3rdparty/webkit/WebCore/page/DOMTimer.cpp index 1cc77304c..c42a0dce6 100644 --- a/src/3rdparty/webkit/WebCore/page/DOMTimer.cpp +++ b/src/3rdparty/webkit/WebCore/page/DOMTimer.cpp @@ -54,7 +54,7 @@ DOMTimer::DOMTimer(ScriptExecutionContext* context, ScheduledAction* action, int if (lastUsedTimeoutId <= 0) lastUsedTimeoutId = 1; m_timeoutId = lastUsedTimeoutId; - + m_nestingLevel = timerNestingLevel + 1; scriptExecutionContext()->addTimeout(m_timeoutId, this); @@ -74,11 +74,10 @@ DOMTimer::DOMTimer(ScriptExecutionContext* context, ScheduledAction* action, int DOMTimer::~DOMTimer() { - if (scriptExecutionContext()) { + if (scriptExecutionContext()) scriptExecutionContext()->removeTimeout(m_timeoutId); - } } - + int DOMTimer::install(ScriptExecutionContext* context, ScheduledAction* action, int timeout, bool singleShot) { // DOMTimer constructor links the new timer into a list of ActiveDOMObjects held by the 'context'. @@ -110,7 +109,7 @@ void DOMTimer::fired() if (m_nestingLevel >= maxTimerNestingLevel) augmentRepeatInterval(s_minTimerInterval - repeatInterval()); } - + // No access to member variables after this point, it can delete the timer. m_action->execute(context); return; @@ -121,7 +120,7 @@ void DOMTimer::fired() // No access to member variables after this point. delete this; - + action->execute(context); delete action; timerNestingLevel = 0; @@ -147,24 +146,24 @@ void DOMTimer::stop() m_action.clear(); } -void DOMTimer::suspend() -{ - ASSERT(m_nextFireInterval == 0 && m_repeatInterval == 0); +void DOMTimer::suspend() +{ + ASSERT(!m_nextFireInterval && !m_repeatInterval); m_nextFireInterval = nextFireInterval(); m_repeatInterval = repeatInterval(); TimerBase::stop(); -} - -void DOMTimer::resume() -{ +} + +void DOMTimer::resume() +{ start(m_nextFireInterval, m_repeatInterval); m_nextFireInterval = 0; m_repeatInterval = 0; -} - - -bool DOMTimer::canSuspend() const -{ +} + + +bool DOMTimer::canSuspend() const +{ return true; } |