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

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

Issue 1857713004: DevTools: simplify the async instrumentation harness. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
Index: third_party/WebKit/Source/core/events/DOMWindowEventQueue.cpp
diff --git a/third_party/WebKit/Source/core/events/DOMWindowEventQueue.cpp b/third_party/WebKit/Source/core/events/DOMWindowEventQueue.cpp
index ecda176e6e7fc149f603926caddb7cd86c082231..2a39790892191a0b3af088c7fa54e4b2491c1427 100644
--- a/third_party/WebKit/Source/core/events/DOMWindowEventQueue.cpp
+++ b/third_party/WebKit/Source/core/events/DOMWindowEventQueue.cpp
@@ -87,7 +87,7 @@ bool DOMWindowEventQueue::enqueueEvent(Event* event)
return false;
ASSERT(event->target());
- InspectorInstrumentation::didEnqueueEvent(event->target(), event);
+ InspectorInstrumentation::asyncTaskScheduled(event->target()->getExecutionContext(), event->type(), event);
bool wasAdded = m_queuedEvents.add(event).isNewEntry;
ASSERT_UNUSED(wasAdded, wasAdded); // It should not have already been in the list.
@@ -103,7 +103,7 @@ bool DOMWindowEventQueue::cancelEvent(Event* event)
HeapListHashSet<Member<Event>, 16>::iterator it = m_queuedEvents.find(event);
bool found = it != m_queuedEvents.end();
if (found) {
- InspectorInstrumentation::didRemoveEvent(event->target(), event);
+ InspectorInstrumentation::asyncTaskCanceled(event->target()->getExecutionContext(), event);
m_queuedEvents.remove(it);
}
if (m_queuedEvents.isEmpty())
@@ -117,9 +117,8 @@ void DOMWindowEventQueue::close()
m_pendingEventTimer->stop();
if (InspectorInstrumentation::hasFrontends()) {
for (const auto& queuedEvent : m_queuedEvents) {
- Event* event = queuedEvent;
- if (event)
- InspectorInstrumentation::didRemoveEvent(event->target(), event);
+ if (queuedEvent)
+ InspectorInstrumentation::asyncTaskCanceled(queuedEvent->target()->getExecutionContext(), queuedEvent);
}
}
m_queuedEvents.clear();
@@ -142,13 +141,13 @@ void DOMWindowEventQueue::pendingEventTimerFired()
if (!event)
break;
dispatchEvent(event);
- InspectorInstrumentation::didRemoveEvent(event->target(), event);
}
}
void DOMWindowEventQueue::dispatchEvent(Event* event)
{
EventTarget* eventTarget = event->target();
+ InspectorInstrumentation::AsyncTask asyncTask(eventTarget->getExecutionContext(), event);
if (eventTarget->toDOMWindow())
eventTarget->toDOMWindow()->dispatchEvent(event, nullptr);
else

Powered by Google App Engine
This is Rietveld 408576698