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

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: review comments addressed 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..52887c826004e1db61207d96db8aee6e3869430b 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
@@ -71,37 +71,42 @@ 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)
- : m_debugger(enabled ? ThreadDebugger::from(toIsolate(context)) : nullptr),
- m_task(task) {
- TRACE_EVENT_FLOW_END0("devtools.timeline.async", "AsyncTask", task);
+AsyncTask::AsyncTask(ExecutionContext* context, void* task, const char* step)
+ : m_debugger(ThreadDebugger::from(toIsolate(context))),
+ m_task(task),
+ m_recurring(step) {
+ TRACE_EVENT_FLOW_STEP0("devtools.timeline.async", "AsyncTask", task,
caseq 2017/03/14 02:09:43 I think we eventually need to emit END event.
pfeldman 2017/03/14 02:29:24 not really, i don't think we do. if we have to, we
+ step ? step : "");
if (m_debugger)
alph 2017/03/14 01:40:42 Isn't is always true?
pfeldman 2017/03/14 02:29:24 that's now fixed
m_debugger->asyncTaskStarted(m_task);
alph 2017/03/14 01:40:42 So you called asyncTaskStarted, but will never cal
pfeldman 2017/03/14 02:29:24 Done.
}
+void AsyncTask::setEnabled(bool enabled) {
+ if (!enabled)
+ m_debugger = nullptr;
+}
+
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);
}

Powered by Google App Engine
This is Rietveld 408576698