NO_SANITIZE_ADDRESS void TimerBase::runInternal() { if (!canFire()) return; m_weakPtrFactory.revokeAll(); TRACE_EVENT0("blink", "TimerBase::run"); #if DCHECK_IS_ON() DCHECK_EQ(m_thread, currentThread()) << "Timer posted by " << m_location.function_name() << " " << m_location.file_name() << " was run on a different thread"; #endif if (m_repeatInterval) { double now = timerMonotonicallyIncreasingTime(); // This computation should be drift free, and it will cope if we miss a // beat, which can easily happen if the thread is busy. It will also cope // if we get called slightly before m_unalignedNextFireTime, which can // happen due to lack of timer precision. double intervalToNextFireTime = m_repeatInterval - fmod(now - m_nextFireTime, m_repeatInterval); setNextFireTime(timerMonotonicallyIncreasingTime(), intervalToNextFireTime); } else { m_nextFireTime = 0; } fired(); }
void TimerBase::start(double nextFireInterval, double repeatInterval) { ASSERT(m_thread == currentThread()); m_repeatInterval = repeatInterval; setNextFireTime(currentTime() + nextFireInterval); }
void TimerBase::start(double nextFireInterval, double repeatInterval) { ASSERT(m_thread == currentThread() || (isMainThread() || pthread_main_np()) && WebCoreWebThreadIsLockedOrDisabled()); m_repeatInterval = repeatInterval; setNextFireTime(currentTime() + nextFireInterval); }
void TimerBase::start(double nextFireInterval, double repeatInterval) { ASSERT(canAccessThreadLocalDataForThread(m_thread)); m_repeatInterval = repeatInterval; setNextFireTime(monotonicallyIncreasingTime() + nextFireInterval); }
void TimerBase::start(double nextFireInterval, double repeatInterval, const WebTraceLocation& caller) { ASSERT(m_thread == currentThread()); m_location = caller; m_repeatInterval = repeatInterval; setNextFireTime(monotonicallyIncreasingTime(), nextFireInterval); }
void TimerBase::stop() { m_repeatInterval = 0; setNextFireTime(0); ASSERT(m_nextFireTime == 0); ASSERT(m_repeatInterval == 0); ASSERT(!inHeap()); }
void TimerBase::stop() { ASSERT(m_thread == currentThread()); m_repeatInterval = 0; setNextFireTime(0); ASSERT(m_nextFireTime == 0); ASSERT(m_repeatInterval == 0); ASSERT(!inHeap()); }
void TimerBase::stop() { ASSERT(m_thread == currentThread() || (isMainThread() || pthread_main_np()) && WebCoreWebThreadIsLockedOrDisabled()); m_repeatInterval = 0; setNextFireTime(0); ASSERT(m_nextFireTime == 0); ASSERT(m_repeatInterval == 0); ASSERT(!inHeap()); }
void TimerBase::start(double nextFireInterval, double repeatInterval, const WebTraceLocation& caller) { #if DCHECK_IS_ON() DCHECK_EQ(m_thread, currentThread()); #endif m_location = caller; m_repeatInterval = repeatInterval; setNextFireTime(timerMonotonicallyIncreasingTime(), nextFireInterval); }
void TimerBase::stop() { ASSERT(canAccessThreadLocalDataForThread(m_thread)); m_repeatInterval = 0; setNextFireTime(0); ASSERT(m_nextFireTime == 0); ASSERT(m_repeatInterval == 0); ASSERT(!inHeap()); }
void TimerBase::moveToNewTaskRunner(WebTaskRunner* taskRunner) { #if DCHECK_IS_ON() DCHECK_EQ(m_thread, currentThread()); DCHECK(taskRunner->runsTasksOnCurrentThread()); #endif // If the underlying task runner stays the same, ignore it. if (m_webTaskRunner->toSingleThreadTaskRunner() == taskRunner->toSingleThreadTaskRunner()) { return; } m_weakPtrFactory.revokeAll(); m_webTaskRunner = taskRunner->clone(); double now = timerMonotonicallyIncreasingTime(); double nextFireTime = m_nextFireTime; m_nextFireTime = 0; setNextFireTime(now, nextFireTime - now); }
NO_LAZY_SWEEP_SANITIZE_ADDRESS void TimerBase::runInternal() { if (!canFire()) return; TRACE_EVENT0("blink", "TimerBase::run"); ASSERT_WITH_MESSAGE(m_thread == currentThread(), "Timer posted by %s %s was run on a different thread", m_location.functionName(), m_location.fileName()); TRACE_EVENT_SET_SAMPLING_STATE("blink", "BlinkInternal"); if (m_repeatInterval) { double now = monotonicallyIncreasingTime(); // This computation should be drift free, and it will cope if we miss a beat, // which can easily happen if the thread is busy. It will also cope if we get // called slightly before m_unalignedNextFireTime, which can happen due to lack // of timer precision. double intervalToNextFireTime = m_repeatInterval - fmod(now - m_nextFireTime, m_repeatInterval); setNextFireTime(monotonicallyIncreasingTime(), intervalToNextFireTime); } else { m_nextFireTime = 0; } fired(); TRACE_EVENT_SET_SAMPLING_STATE("blink", "Sleeping"); }
void TimerBase::start(double nextFireInterval, double repeatInterval) { m_repeatInterval = repeatInterval; setNextFireTime(currentTime() + nextFireInterval); }
void TimerBase::didChangeAlignmentInterval() { setNextFireTime(m_unalignedNextFireTime); }