Index: third_party/WebKit/Source/core/probe/CoreProbes.cpp |
diff --git a/third_party/WebKit/Source/core/probe/CoreProbes.cpp b/third_party/WebKit/Source/core/probe/CoreProbes.cpp |
index 27d41ba1e9d9a11650a4b1234a7afa85121ed9e7..23d6dcb8bed2fabc85de52e617c6bb086fa79e9c 100644 |
--- a/third_party/WebKit/Source/core/probe/CoreProbes.cpp |
+++ b/third_party/WebKit/Source/core/probe/CoreProbes.cpp |
@@ -53,10 +53,12 @@ namespace probe { |
AsyncTask::AsyncTask(ExecutionContext* context, |
void* task, |
const char* step, |
- bool enabled) |
+ bool enabled, |
+ bool optional) |
: debugger_(enabled ? ThreadDebugger::From(ToIsolate(context)) : nullptr), |
task_(task), |
- recurring_(step) { |
+ recurring_(step), |
+ started_(false) { |
if (recurring_) { |
TRACE_EVENT_FLOW_STEP0("devtools.timeline.async", "AsyncTask", |
TRACE_ID_LOCAL(reinterpret_cast<uintptr_t>(task)), |
@@ -65,13 +67,15 @@ AsyncTask::AsyncTask(ExecutionContext* context, |
TRACE_EVENT_FLOW_END0("devtools.timeline.async", "AsyncTask", |
TRACE_ID_LOCAL(reinterpret_cast<uintptr_t>(task))); |
} |
- if (debugger_) |
- debugger_->AsyncTaskStarted(task_); |
+ if (debugger_) { |
+ started_ = debugger_->AsyncTaskStarted(task_, optional); |
+ } |
} |
AsyncTask::~AsyncTask() { |
if (debugger_) { |
- debugger_->AsyncTaskFinished(task_); |
+ if (started_) |
+ debugger_->AsyncTaskFinished(task_); |
if (!recurring_) |
debugger_->AsyncTaskCanceled(task_); |
} |