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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp

Issue 2746333002: DevTools: move recurring flag into AsyncTask, control cancelation from embedder only. (Closed)
Patch Set: using _END now Created 3 years, 9 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/inspector/InspectorInstrumentation.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp b/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
index cb3d3139124b93b4dc15f7ae6ac3dbbd43f8054e..a16579ec05cf0abcb08ebc34bd17cf40f51bfa84 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
@@ -71,43 +71,51 @@ double ProbeBase::duration() const {
return captureEndTime() - m_startTime;
}
-AsyncTask::AsyncTask(ExecutionContext* context, void* task)
- : AsyncTask(context, task, true) {}
-
-AsyncTask::AsyncTask(ExecutionContext* context, void* task, bool enabled)
+AsyncTask::AsyncTask(ExecutionContext* context,
+ void* task,
+ const char* step,
+ bool enabled)
: m_debugger(enabled ? ThreadDebugger::from(toIsolate(context)) : nullptr),
- m_task(task) {
- TRACE_EVENT_FLOW_END0("devtools.timeline.async", "AsyncTask", task);
+ m_task(task),
+ m_recurring(step) {
+ if (m_recurring) {
+ TRACE_EVENT_FLOW_STEP0("devtools.timeline.async", "AsyncTask", task,
+ step ? step : "");
+ } else {
+ TRACE_EVENT_FLOW_END0("devtools.timeline.async", "AsyncTask", task);
+ }
if (m_debugger)
m_debugger->asyncTaskStarted(m_task);
}
AsyncTask::~AsyncTask() {
- if (m_debugger)
+ if (m_debugger) {
m_debugger->asyncTaskFinished(m_task);
+ if (!m_recurring)
+ m_debugger->asyncTaskCanceled(m_task);
+ }
}
void asyncTaskScheduled(ExecutionContext* context,
const String& name,
- void* task,
- bool recurring) {
+ void* task) {
TRACE_EVENT_FLOW_BEGIN1("devtools.timeline.async", "AsyncTask", task, "data",
InspectorAsyncTask::data(name));
if (ThreadDebugger* debugger = ThreadDebugger::from(toIsolate(context)))
- debugger->asyncTaskScheduled(name, task, recurring);
+ debugger->asyncTaskScheduled(name, task, true);
}
void asyncTaskScheduledBreakable(ExecutionContext* context,
const char* name,
- void* task,
- bool recurring) {
- asyncTaskScheduled(context, name, task, recurring);
+ void* task) {
+ asyncTaskScheduled(context, name, task);
breakableLocation(context, name);
}
void asyncTaskCanceled(ExecutionContext* context, void* task) {
if (ThreadDebugger* debugger = ThreadDebugger::from(toIsolate(context)))
debugger->asyncTaskCanceled(task);
+ TRACE_EVENT_FLOW_END0("devtools.timeline.async", "AsyncTask", task);
}
void asyncTaskCanceledBreakable(ExecutionContext* context,

Powered by Google App Engine
This is Rietveld 408576698