-#elif PLATFORM(BLACKBERRY)
-
-HeapTimer::HeapTimer(VM* vm)
- : m_vm(vm)
- , m_timer(this, &HeapTimer::timerDidFire)
-{
- // FIXME: Implement HeapTimer for other threads.
- if (WTF::isMainThread() && !m_timer.tryCreateClient())
- CRASH();
-}
-
-HeapTimer::~HeapTimer()
-{
-}
-
-void HeapTimer::timerDidFire()
-{
- doWork();
-}
-
-void HeapTimer::invalidate()
-{
-}
-
-#elif PLATFORM(QT)
-
-HeapTimer::HeapTimer(VM* vm)
- : m_vm(vm)
- , m_newThread(0)
- , m_mutex(QMutex::NonRecursive)
-{
- // The HeapTimer might be created before the runLoop is started,
- // but we need to ensure the thread has an eventDispatcher already.
- QEventLoop fakeLoop(this);
-}
-
-HeapTimer::~HeapTimer()
-{
- QMutexLocker lock(&m_mutex);
- m_timer.stop();
-}
-
-void HeapTimer::timerEvent(QTimerEvent*)
-{
- QMutexLocker lock(&m_mutex);
- if (m_newThread) {
- // We need to wait with processing until we are on the right thread.
- return;
- }
-
- APIEntryShim shim(m_vm);
- doWork();
-}
-
-void HeapTimer::customEvent(QEvent*)
-{
- ASSERT(m_newThread);
- QMutexLocker lock(&m_mutex);
- moveToThread(m_newThread);
- m_newThread = 0;
-}
-