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

Unified Diff: src/inspector/v8-debugger.cc

Issue 2868493002: [inspector] use creation stack trace as parent for async call chains (Closed)
Patch Set: removed DCHECK for now Created 3 years, 7 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
« no previous file with comments | « no previous file | src/inspector/v8-stack-trace-impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/v8-debugger.cc
diff --git a/src/inspector/v8-debugger.cc b/src/inspector/v8-debugger.cc
index f65b590b04cf4979036a40af5a309efeeaa96065..a65cc738e34f2acc4e3f3fae9dc9acb847a1bac4 100644
--- a/src/inspector/v8-debugger.cc
+++ b/src/inspector/v8-debugger.cc
@@ -683,12 +683,15 @@ void V8Debugger::PromiseEventOccurred(v8::debug::PromiseDebugActionType type,
}
std::shared_ptr<AsyncStackTrace> V8Debugger::currentAsyncParent() {
+ // TODO(kozyatinskiy): implement creation chain as parent without hack.
+ if (!m_currentAsyncCreation.empty() && m_currentAsyncCreation.back()) {
+ return m_currentAsyncCreation.back();
+ }
return m_currentAsyncParent.empty() ? nullptr : m_currentAsyncParent.back();
}
std::shared_ptr<AsyncStackTrace> V8Debugger::currentAsyncCreation() {
- return m_currentAsyncCreation.empty() ? nullptr
- : m_currentAsyncCreation.back();
+ return nullptr;
}
void V8Debugger::compileDebuggerScript() {
@@ -856,7 +859,8 @@ void V8Debugger::asyncTaskCreatedForStack(void* task, void* parentTask) {
if (parentTask) m_parentTask[task] = parentTask;
v8::HandleScope scope(m_isolate);
std::shared_ptr<AsyncStackTrace> asyncCreation =
- AsyncStackTrace::capture(this, currentContextGroupId(), String16(), 1);
+ AsyncStackTrace::capture(this, currentContextGroupId(), String16(),
+ V8StackTraceImpl::maxCallStackSizeToCapture);
// Passing one as maxStackSize forces no async chain for the new stack.
if (asyncCreation && !asyncCreation->isEmpty()) {
m_asyncTaskCreationStacks[task] = asyncCreation;
@@ -932,6 +936,12 @@ void V8Debugger::asyncTaskStartedForStack(void* task) {
auto itCreation = m_asyncTaskCreationStacks.find(task);
if (itCreation != m_asyncTaskCreationStacks.end()) {
m_currentAsyncCreation.push_back(itCreation->second.lock());
+ // TODO(kozyatinskiy): implement it without hack.
+ if (m_currentAsyncParent.back()) {
+ m_currentAsyncCreation.back()->setDescription(
+ m_currentAsyncParent.back()->description());
+ m_currentAsyncParent.back().reset();
+ }
} else {
m_currentAsyncCreation.emplace_back();
}
« no previous file with comments | « no previous file | src/inspector/v8-stack-trace-impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698