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

Unified Diff: Source/WebCore/page/SuspendableTimer.cpp

Issue 6349095: Merge 77355 - 2011-02-01 Mihai Parparita <mihaip@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/page/SuspendableTimer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/page/SuspendableTimer.cpp
===================================================================
--- Source/WebCore/page/SuspendableTimer.cpp (revision 77575)
+++ Source/WebCore/page/SuspendableTimer.cpp (working copy)
@@ -36,6 +36,7 @@
, m_nextFireInterval(0)
, m_repeatInterval(0)
#if !ASSERT_DISABLED
+ , m_active(false)
, m_suspended(false)
#endif
{
@@ -61,9 +62,12 @@
ASSERT(!m_suspended);
m_suspended = true;
#endif
- m_nextFireInterval = nextFireInterval();
- m_repeatInterval = repeatInterval();
- TimerBase::stop();
+ m_active = isActive();
+ if (m_active) {
+ m_nextFireInterval = nextFireInterval();
+ m_repeatInterval = repeatInterval();
+ TimerBase::stop();
+ }
}
void SuspendableTimer::resume()
@@ -72,7 +76,8 @@
ASSERT(m_suspended);
m_suspended = false;
#endif
- start(m_nextFireInterval, m_repeatInterval);
+ if (m_active)
+ start(m_nextFireInterval, m_repeatInterval);
}
bool SuspendableTimer::canSuspend() const
« no previous file with comments | « Source/WebCore/page/SuspendableTimer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698