Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Unified Diff: Source/core/events/DOMWindowEventQueue.cpp

Issue 333333002: DevTools: Instrument DOMWindowEventQueue for async stacks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/inspector/sources/debugger/async-callstack-events-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
}
« no previous file with comments | « LayoutTests/inspector/sources/debugger/async-callstack-events-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698