summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/Timer.cpp
diff options
context:
space:
mode:
authorFeng Qian <fqian@google.com>2009-06-17 12:12:20 -0700
committerFeng Qian <fqian@google.com>2009-06-17 12:12:20 -0700
commit5f1ab04193ad0130ca8204aadaceae083aca9881 (patch)
tree5a92cd389e2cfe7fb67197ce14b38469462379f8 /WebCore/platform/Timer.cpp
parent194315e5a908cc8ed67d597010544803eef1ac59 (diff)
downloadexternal_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.zip
external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.tar.gz
external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.tar.bz2
Get WebKit r44544.
Diffstat (limited to 'WebCore/platform/Timer.cpp')
-rw-r--r--WebCore/platform/Timer.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/WebCore/platform/Timer.cpp b/WebCore/platform/Timer.cpp
index 353a2a7..d4235d9 100644
--- a/WebCore/platform/Timer.cpp
+++ b/WebCore/platform/Timer.cpp
@@ -169,6 +169,9 @@ TimerBase::TimerBase()
: m_nextFireTime(0)
, m_repeatInterval(0)
, m_heapIndex(-1)
+#ifndef NDEBUG
+ , m_thread(currentThread())
+#endif
{
}
@@ -180,12 +183,16 @@ TimerBase::~TimerBase()
void TimerBase::start(double nextFireInterval, double repeatInterval)
{
+ ASSERT(m_thread == currentThread());
+
m_repeatInterval = repeatInterval;
setNextFireTime(currentTime() + nextFireInterval);
}
void TimerBase::stop()
{
+ ASSERT(m_thread == currentThread());
+
m_repeatInterval = 0;
setNextFireTime(0);
@@ -196,6 +203,8 @@ void TimerBase::stop()
bool TimerBase::isActive() const
{
+ ASSERT(m_thread == currentThread());
+
return m_nextFireTime || timersReadyToFire().contains(this);
}
@@ -284,6 +293,8 @@ void TimerBase::heapPopMin()
void TimerBase::setNextFireTime(double newTime)
{
+ ASSERT(m_thread == currentThread());
+
// Keep heap valid while changing the next-fire time.
timersReadyToFire().remove(this);