Chromium Code Reviews| Index: Source/core/events/DOMWindowEventQueue.cpp |
| diff --git a/Source/core/events/DOMWindowEventQueue.cpp b/Source/core/events/DOMWindowEventQueue.cpp |
| index 64fc172b6db95a7b453b840ac778b8ebe94ad994..f8a448f3368e62198f9d6051b605f71f530441e9 100644 |
| --- a/Source/core/events/DOMWindowEventQueue.cpp |
| +++ b/Source/core/events/DOMWindowEventQueue.cpp |
| @@ -31,6 +31,7 @@ |
| #include "core/events/Event.h" |
| #include "core/frame/DOMWindow.h" |
| #include "core/frame/SuspendableTimer.h" |
| +#include "core/inspector/InspectorInstrumentation.h" |
| namespace WebCore { |
| @@ -77,6 +78,8 @@ bool DOMWindowEventQueue::enqueueEvent(PassRefPtrWillBeRawPtr<Event> event) |
| return false; |
| ASSERT(event->target()); |
| + InspectorInstrumentation::didEnqueueEvent(event->target(), event.get()); |
| + |
| bool wasAdded = m_queuedEvents.add(event).isNewEntry; |
| ASSERT_UNUSED(wasAdded, wasAdded); // It should not have already been in the list. |
| @@ -90,8 +93,10 @@ bool DOMWindowEventQueue::cancelEvent(Event* event) |
| { |
| WillBeHeapListHashSet<RefPtrWillBeMember<Event>, 16>::iterator it = m_queuedEvents.find(event); |
| bool found = it != m_queuedEvents.end(); |
| - if (found) |
| + if (found) { |
| + InspectorInstrumentation::didDispatchEvent(event->target(), event); |
|
yurys
2014/06/17 07:34:26
Don't we need to distinguish cancel operation from
aandrey
2014/06/17 10:34:18
Renamed to didRemoveEvent.
|
| m_queuedEvents.remove(it); |
| + } |
| if (m_queuedEvents.isEmpty()) |
| m_pendingEventTimer->stop(); |
| return found; |
| @@ -101,6 +106,10 @@ void DOMWindowEventQueue::close() |
| { |
| m_isClosed = true; |
| m_pendingEventTimer->stop(); |
| + |
| + WillBeHeapListHashSet<RefPtrWillBeMember<Event>, 16>::iterator it = m_queuedEvents.begin(); |
| + for (; it != m_queuedEvents.end(); ++it) |
| + InspectorInstrumentation::didDispatchEvent((*it)->target(), it->get()); |
|
yurys
2014/06/17 07:34:26
We shouldn't iterate over the queued events unless
aandrey
2014/06/17 10:34:18
Done.
|
| m_queuedEvents.clear(); |
| } |
| @@ -123,6 +132,7 @@ void DOMWindowEventQueue::pendingEventTimerFired() |
| if (!event) |
| break; |
| dispatchEvent(event.get()); |
| + InspectorInstrumentation::didDispatchEvent(event->target(), event.get()); |
| } |
| } |