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

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: rebased 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 | « Source/core/dom/ScriptedAnimationController.cpp ('k') | Source/core/inspector/AsyncCallStackTracker.h » ('j') | 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..ec3986138a92c3e2a58e5353250958cd626a61eb 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::didRemoveEvent(event->target(), event);
m_queuedEvents.remove(it);
+ }
if (m_queuedEvents.isEmpty())
m_pendingEventTimer->stop();
return found;
@@ -101,6 +106,11 @@ void DOMWindowEventQueue::close()
{
m_isClosed = true;
m_pendingEventTimer->stop();
+ if (InspectorInstrumentation::hasFrontends()) {
+ WillBeHeapListHashSet<RefPtrWillBeMember<Event>, 16>::iterator it = m_queuedEvents.begin();
+ for (; it != m_queuedEvents.end(); ++it)
+ InspectorInstrumentation::didRemoveEvent((*it)->target(), it->get());
+ }
m_queuedEvents.clear();
}
@@ -123,6 +133,7 @@ void DOMWindowEventQueue::pendingEventTimerFired()
if (!event)
break;
dispatchEvent(event.get());
+ InspectorInstrumentation::didRemoveEvent(event->target(), event.get());
}
}
« no previous file with comments | « Source/core/dom/ScriptedAnimationController.cpp ('k') | Source/core/inspector/AsyncCallStackTracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698