Esempio n. 1
0
void GenericEventQueue::cancelAllEvents()
{
    m_timer.stop();

    for (size_t i = 0; i < m_pendingEvents.size(); ++i) {
        Event* event = m_pendingEvents[i].get();
        TRACE_EVENT_ASYNC_END2("event", "GenericEventQueue:enqueueEvent", event, "type", event->type().ascii(), "status", "cancelled");
    }
    m_pendingEvents.clear();
}
void GenericEventQueue::cancelAllEvents()
{
    m_timer.stop();

    for (const auto& pendingEvent : m_pendingEvents) {
        Event* event = pendingEvent.get();
        TRACE_EVENT_ASYNC_END2("event", "GenericEventQueue:enqueueEvent", event, "type", event->type().ascii(), "status", "cancelled");
        EventTarget* target = event->target() ? event->target() : m_owner.get();
        InspectorInstrumentation::asyncTaskCanceled(target->getExecutionContext(), event);
    }
    m_pendingEvents.clear();
}
Esempio n. 3
0
bool GenericEventQueue::cancelEvent(Event* event)
{
    bool found = m_pendingEvents.contains(event);

    if (found) {
        m_pendingEvents.remove(m_pendingEvents.find(event));
        TRACE_EVENT_ASYNC_END2("event", "GenericEventQueue:enqueueEvent", event, "type", event->type().ascii(), "status", "cancelled");
    }

    if (m_pendingEvents.isEmpty())
        m_timer.stop();

    return found;
}
bool GenericEventQueue::cancelEvent(Event* event)
{
    bool found = m_pendingEvents.contains(event);

    if (found) {
        EventTarget* target = event->target() ? event->target() : m_owner.get();
        InspectorInstrumentation::asyncTaskCanceled(target->getExecutionContext(), event);
        m_pendingEvents.remove(m_pendingEvents.find(event));
        TRACE_EVENT_ASYNC_END2("event", "GenericEventQueue:enqueueEvent", event, "type", event->type().ascii(), "status", "cancelled");
    }

    if (m_pendingEvents.isEmpty())
        m_timer.stop();

    return found;
}