void EventManager::addHandler(void (*handlerFunction)(), unsigned int period, unsigned int delay) { EventHandler* handler = static_cast<EventHandler*>(malloc(sizeof(EventHandler))); handler->callback_ = functionCallback(handlerFunction); handler->period_ = period; handler->countdown_ = delay; addHandler(handler); }
void WheelEventTestTrigger::triggerTestTimerFired() { std::function<void()> functionCallback; { std::lock_guard<std::mutex> lock(m_testTriggerMutex); if (!m_deferTestTriggerReasons.isEmpty()) return; functionCallback = WTF::move(m_testNotificationCallback); m_testNotificationCallback = std::function<void()>(); } m_testTriggerTimer.stop(); if (functionCallback) functionCallback(); }