| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Victor Carbune (victor@rosedu.org) | 2 * Copyright (C) 2012 Victor Carbune (victor@rosedu.org) |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 m_pendingEvents.remove(m_pendingEvents.find(event)); | 83 m_pendingEvents.remove(m_pendingEvents.find(event)); |
| 84 TRACE_EVENT_ASYNC_END2("event", "GenericEventQueue:enqueueEvent", event,
"type", event->type().ascii(), "status", "cancelled"); | 84 TRACE_EVENT_ASYNC_END2("event", "GenericEventQueue:enqueueEvent", event,
"type", event->type().ascii(), "status", "cancelled"); |
| 85 } | 85 } |
| 86 | 86 |
| 87 if (m_pendingEvents.isEmpty()) | 87 if (m_pendingEvents.isEmpty()) |
| 88 m_timer.stop(); | 88 m_timer.stop(); |
| 89 | 89 |
| 90 return found; | 90 return found; |
| 91 } | 91 } |
| 92 | 92 |
| 93 void GenericEventQueue::timerFired(Timer<GenericEventQueue>*) | 93 void GenericEventQueue::timerFired(TimerBase*) |
| 94 { | 94 { |
| 95 ASSERT(!m_timer.isActive()); | 95 ASSERT(!m_timer.isActive()); |
| 96 ASSERT(!m_pendingEvents.isEmpty()); | 96 ASSERT(!m_pendingEvents.isEmpty()); |
| 97 | 97 |
| 98 HeapVector<Member<Event>> pendingEvents; | 98 HeapVector<Member<Event>> pendingEvents; |
| 99 m_pendingEvents.swap(pendingEvents); | 99 m_pendingEvents.swap(pendingEvents); |
| 100 | 100 |
| 101 for (const auto& pendingEvent : pendingEvents) { | 101 for (const auto& pendingEvent : pendingEvents) { |
| 102 Event* event = pendingEvent.get(); | 102 Event* event = pendingEvent.get(); |
| 103 EventTarget* target = event->target() ? event->target() : m_owner.get(); | 103 EventTarget* target = event->target() ? event->target() : m_owner.get(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 127 } | 127 } |
| 128 m_pendingEvents.clear(); | 128 m_pendingEvents.clear(); |
| 129 } | 129 } |
| 130 | 130 |
| 131 bool GenericEventQueue::hasPendingEvents() const | 131 bool GenericEventQueue::hasPendingEvents() const |
| 132 { | 132 { |
| 133 return m_pendingEvents.size(); | 133 return m_pendingEvents.size(); |
| 134 } | 134 } |
| 135 | 135 |
| 136 } // namespace blink | 136 } // namespace blink |
| OLD | NEW |