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

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: same with scriptpromiseresolver 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..b52f7b2a2d7ee197095d89c9854469e9e5e15697 100644
--- a/third_party/WebKit/Source/core/dom/FrameRequestCallbackCollection.cpp
+++ b/third_party/WebKit/Source/core/dom/FrameRequestCallbackCollection.cpp
@@ -23,7 +23,7 @@ FrameRequestCallbackCollection::CallbackId FrameRequestCallbackCollection::regis
m_callbacks.append(callback);
TRACE_EVENT_INSTANT1("devtools.timeline", "RequestAnimationFrame", TRACE_EVENT_SCOPE_THREAD, "data", InspectorAnimationFrameEvent::data(m_context, id));
- InspectorInstrumentation::didRequestAnimationFrame(m_context, id);
+ InspectorInstrumentation::scheduleAsyncTask(m_context, "requestAnimationFrame", callback);
dgozman 2016/04/06 02:31:08 Do we want to turn such async description strings
pfeldman 2016/04/06 04:51:35 I'm looking at the ones above an am wondering if i
return id;
}
@@ -32,16 +32,16 @@ void FrameRequestCallbackCollection::cancelCallback(CallbackId id)
{
for (size_t i = 0; i < m_callbacks.size(); ++i) {
if (m_callbacks[i]->m_id == id) {
- m_callbacks.remove(i);
+ InspectorInstrumentation::cancelAsyncTask(m_context, m_callbacks[i]);
TRACE_EVENT_INSTANT1("devtools.timeline", "CancelAnimationFrame", TRACE_EVENT_SCOPE_THREAD, "data", InspectorAnimationFrameEvent::data(m_context, id));
- InspectorInstrumentation::didCancelAnimationFrame(m_context, id);
+ m_callbacks.remove(i);
return;
}
}
for (size_t i = 0; i < m_callbacksToInvoke.size(); ++i) {
if (m_callbacksToInvoke[i]->m_id == id) {
+ InspectorInstrumentation::cancelAsyncTask(m_context, m_callbacks[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;
// will be removed at the end of executeCallbacks()
return;
@@ -60,12 +60,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());
}
}

Powered by Google App Engine
This is Rietveld 408576698