Index: src/inspector/v8-debugger.cc |
diff --git a/src/inspector/v8-debugger.cc b/src/inspector/v8-debugger.cc |
index e9997126eba10b98348a85b85c74d46ef7d2ad40..6fd005bcc0060680ea8bbae14529cff6f64f34e2 100644 |
--- a/src/inspector/v8-debugger.cc |
+++ b/src/inspector/v8-debugger.cc |
@@ -20,8 +20,10 @@ namespace { |
const char stepIntoV8MethodName[] = "stepIntoStatement"; |
const char stepOutV8MethodName[] = "stepOutOfFunction"; |
static const char v8AsyncTaskEventEnqueue[] = "enqueue"; |
+static const char v8AsyncTaskEventEnqueueRecurring[] = "enqueueRecurring"; |
static const char v8AsyncTaskEventWillHandle[] = "willHandle"; |
static const char v8AsyncTaskEventDidHandle[] = "didHandle"; |
+static const char v8AsyncTaskEventCancel[] = "cancel"; |
inline v8::Local<v8::Boolean> v8Boolean(bool value, v8::Isolate* isolate) { |
return value ? v8::True(isolate) : v8::False(isolate); |
@@ -653,10 +655,14 @@ void V8Debugger::handleV8AsyncTaskEvent(v8::Local<v8::Context> context, |
void* ptr = reinterpret_cast<void*>(id * 2 + 1); |
if (type == v8AsyncTaskEventEnqueue) |
asyncTaskScheduled(name, ptr, false); |
+ else if (type == v8AsyncTaskEventEnqueueRecurring) |
+ asyncTaskScheduled(name, ptr, true, 1); |
else if (type == v8AsyncTaskEventWillHandle) |
asyncTaskStarted(ptr); |
else if (type == v8AsyncTaskEventDidHandle) |
asyncTaskFinished(ptr); |
+ else if (type == v8AsyncTaskEventCancel) |
+ asyncTaskCanceled(ptr); |
else |
UNREACHABLE(); |
} |
@@ -891,20 +897,20 @@ void V8Debugger::setAsyncCallStackDepth(V8DebuggerAgentImpl* agent, int depth) { |
} |
void V8Debugger::asyncTaskScheduled(const StringView& taskName, void* task, |
- bool recurring) { |
+ bool recurring, int skipInitialFrames) { |
if (!m_maxAsyncCallStackDepth) return; |
asyncTaskScheduled(toString16(taskName), task, recurring); |
} |
void V8Debugger::asyncTaskScheduled(const String16& taskName, void* task, |
- bool recurring) { |
+ bool recurring, int skipInitialFrames) { |
if (!m_maxAsyncCallStackDepth) return; |
v8::HandleScope scope(m_isolate); |
int contextGroupId = |
m_isolate->InContext() ? getGroupId(m_isolate->GetCurrentContext()) : 0; |
std::unique_ptr<V8StackTraceImpl> chain = V8StackTraceImpl::capture( |
this, contextGroupId, V8StackTraceImpl::maxCallStackSizeToCapture, |
- taskName); |
+ taskName, skipInitialFrames); |
if (chain) { |
m_asyncTaskStacks[task] = std::move(chain); |
if (recurring) m_recurringTasks.insert(task); |