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 fb0477cea5b03593ae1caa19cb1de556f4263c9d..14e943b712a8a8c4b7ab44eea2ec38b6e52d4155 100644 |
--- a/third_party/WebKit/Source/core/probe/CoreProbes.cpp |
+++ b/third_party/WebKit/Source/core/probe/CoreProbes.cpp |
@@ -52,7 +52,8 @@ 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) { |
@@ -64,8 +65,13 @@ AsyncTask::AsyncTask(ExecutionContext* context, |
TRACE_EVENT_FLOW_END0("devtools.timeline.async", "AsyncTask", |
TRACE_ID_LOCAL(reinterpret_cast<uintptr_t>(task))); |
} |
- if (debugger_) |
+ if (debugger_) { |
+ if (optional && debugger_->IsRunningAsyncTask()) { |
dgozman
2017/05/10 18:36:30
Instead of calling this, pass optional to AsyncTas
kozy
2017/05/10 21:24:01
Done.
|
+ debugger_ = nullptr; |
+ return; |
+ } |
debugger_->AsyncTaskStarted(task_); |
+ } |
} |
AsyncTask::~AsyncTask() { |