summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/Timer.cpp
diff options
context:
space:
mode:
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);