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

Unified Diff: third_party/WebKit/Source/core/events/GenericEventQueue.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/GenericEventQueue.cpp
diff --git a/third_party/WebKit/Source/core/events/GenericEventQueue.cpp b/third_party/WebKit/Source/core/events/GenericEventQueue.cpp
index f6298b429daaecc99653ee0357883298472ac164..f32e9e68b04a30e8848184f63f806416fe0fade7 100644
--- a/third_party/WebKit/Source/core/events/GenericEventQueue.cpp
+++ b/third_party/WebKit/Source/core/events/GenericEventQueue.cpp
@@ -63,7 +63,8 @@ bool GenericEventQueue::enqueueEvent(Event* event)
event->setTarget(nullptr);
TRACE_EVENT_ASYNC_BEGIN1("event", "GenericEventQueue:enqueueEvent", event, "type", event->type().ascii());
- InspectorInstrumentation::didEnqueueEvent(event->target() ? event->target() : m_owner.get(), event);
+ EventTarget* target = event->target() ? event->target() : m_owner.get();
+ InspectorInstrumentation::asyncTaskScheduled(target->getExecutionContext(), event->type(), event);
m_pendingEvents.append(event);
if (!m_timer.isActive())
@@ -77,7 +78,8 @@ bool GenericEventQueue::cancelEvent(Event* event)
bool found = m_pendingEvents.contains(event);
if (found) {
- InspectorInstrumentation::didRemoveEvent(event->target() ? event->target() : m_owner.get(), event);
+ EventTarget* target = event->target() ? event->target() : m_owner.get();
+ InspectorInstrumentation::asyncTaskCanceled(target->getExecutionContext(), event);
m_pendingEvents.remove(m_pendingEvents.find(event));
TRACE_EVENT_ASYNC_END2("event", "GenericEventQueue:enqueueEvent", event, "type", event->type().ascii(), "status", "cancelled");
}
@@ -100,10 +102,10 @@ void GenericEventQueue::timerFired(Timer<GenericEventQueue>*)
Event* event = pendingEvent.get();
EventTarget* target = event->target() ? event->target() : m_owner.get();
CString type(event->type().ascii());
+ InspectorInstrumentation::AsyncTask asyncTask(target->getExecutionContext(), event);
TRACE_EVENT_ASYNC_STEP_INTO1("event", "GenericEventQueue:enqueueEvent", event, "dispatch", "type", type);
target->dispatchEvent(pendingEvent);
TRACE_EVENT_ASYNC_END1("event", "GenericEventQueue:enqueueEvent", event, "type", type);
- InspectorInstrumentation::didRemoveEvent(target, event);
}
}
@@ -120,7 +122,8 @@ void GenericEventQueue::cancelAllEvents()
for (const auto& pendingEvent : m_pendingEvents) {
Event* event = pendingEvent.get();
TRACE_EVENT_ASYNC_END2("event", "GenericEventQueue:enqueueEvent", event, "type", event->type().ascii(), "status", "cancelled");
- InspectorInstrumentation::didRemoveEvent(event->target() ? event->target() : m_owner.get(), event);
+ EventTarget* target = event->target() ? event->target() : m_owner.get();
+ InspectorInstrumentation::asyncTaskCanceled(target->getExecutionContext(), event);
}
m_pendingEvents.clear();
}
« no previous file with comments | « third_party/WebKit/Source/core/events/DOMWindowEventQueue.cpp ('k') | third_party/WebKit/Source/core/fileapi/FileReader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698