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

Unified Diff: third_party/WebKit/Source/core/dom/FrameRequestCallbackCollection.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/dom/FrameRequestCallbackCollection.cpp
diff --git a/third_party/WebKit/Source/core/dom/FrameRequestCallbackCollection.cpp b/third_party/WebKit/Source/core/dom/FrameRequestCallbackCollection.cpp
index e6f451f966fa1a9a02b3e628ef486382c1338456..94afac154cf7ac12e0616a4c96cc8b5fac7cf508 100644
--- a/third_party/WebKit/Source/core/dom/FrameRequestCallbackCollection.cpp
+++ b/third_party/WebKit/Source/core/dom/FrameRequestCallbackCollection.cpp
@@ -24,6 +24,7 @@ FrameRequestCallbackCollection::CallbackId FrameRequestCallbackCollection::regis
TRACE_EVENT_INSTANT1("devtools.timeline", "RequestAnimationFrame", TRACE_EVENT_SCOPE_THREAD, "data", InspectorAnimationFrameEvent::data(m_context, id));
InspectorInstrumentation::didRequestAnimationFrame(m_context, id);
+ InspectorInstrumentation::asyncTaskScheduled(m_context, "requestAnimationFrame", callback);
return id;
}
@@ -32,6 +33,7 @@ void FrameRequestCallbackCollection::cancelCallback(CallbackId id)
{
for (size_t i = 0; i < m_callbacks.size(); ++i) {
if (m_callbacks[i]->m_id == id) {
+ InspectorInstrumentation::asyncTaskCanceled(m_context, m_callbacks[i]);
m_callbacks.remove(i);
TRACE_EVENT_INSTANT1("devtools.timeline", "CancelAnimationFrame", TRACE_EVENT_SCOPE_THREAD, "data", InspectorAnimationFrameEvent::data(m_context, id));
InspectorInstrumentation::didCancelAnimationFrame(m_context, id);
@@ -40,6 +42,7 @@ void FrameRequestCallbackCollection::cancelCallback(CallbackId id)
}
for (size_t i = 0; i < m_callbacksToInvoke.size(); ++i) {
if (m_callbacksToInvoke[i]->m_id == id) {
+ InspectorInstrumentation::asyncTaskCanceled(m_context, m_callbacksToInvoke[i]);
TRACE_EVENT_INSTANT1("devtools.timeline", "CancelAnimationFrame", TRACE_EVENT_SCOPE_THREAD, "data", InspectorAnimationFrameEvent::data(m_context, id));
InspectorInstrumentation::didCancelAnimationFrame(m_context, id);
m_callbacksToInvoke[i]->m_cancelled = true;
@@ -60,12 +63,11 @@ void FrameRequestCallbackCollection::executeCallbacks(double highResNowMs, doubl
FrameRequestCallback* callback = m_callbacksToInvoke[i].get();
if (!callback->m_cancelled) {
TRACE_EVENT1("devtools.timeline", "FireAnimationFrame", "data", InspectorAnimationFrameEvent::data(m_context, callback->m_id));
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::willFireAnimationFrame(m_context, callback->m_id);
+ InspectorInstrumentation::AsyncTask asyncTask(m_context, callback);
if (callback->m_useLegacyTimeBase)
callback->handleEvent(highResNowMsLegacy);
else
callback->handleEvent(highResNowMs);
- InspectorInstrumentation::didFireAnimationFrame(cookie);
TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "UpdateCounters", TRACE_EVENT_SCOPE_THREAD, "data", InspectorUpdateCountersEvent::data());
}
}
« no previous file with comments | « third_party/WebKit/Source/core/core.gypi ('k') | third_party/WebKit/Source/core/dom/MainThreadTaskRunner.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698