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

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

Issue 2807273002: [inspector] store creation stack in current V8StackTraceImpl (Closed)
Patch Set: finally passed tests Created 3 years, 8 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 | « src/inspector/v8-debugger.h ('k') | src/inspector/v8-debugger-agent-impl.cc » ('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 3f0fb900825838c2342631d7bd5ce7d1b34d2ea3..0dcdf644677177e2fa48ae4471503b69b63d87b2 100644
--- a/src/inspector/v8-debugger.cc
+++ b/src/inspector/v8-debugger.cc
@@ -686,6 +686,11 @@ V8StackTraceImpl* V8Debugger::currentAsyncCallChain() {
return m_currentStacks.back().get();
}
+V8StackTraceImpl* V8Debugger::currentAsyncTaskCreationStack() {
+ if (!m_currentCreationStacks.size()) return nullptr;
+ return m_currentCreationStacks.back().get();
+}
+
void V8Debugger::compileDebuggerScript() {
if (!m_debuggerScript.IsEmpty()) {
UNREACHABLE();
@@ -939,7 +944,9 @@ void V8Debugger::asyncTaskStartedForStack(void* task) {
stack = stackIt->second->cloneImpl();
auto itCreation = m_asyncTaskCreationStacks.find(task);
if (stack && itCreation != m_asyncTaskCreationStacks.end()) {
- stack->setCreation(itCreation->second->cloneImpl());
+ m_currentCreationStacks.push_back(itCreation->second->cloneImpl());
+ } else {
+ m_currentCreationStacks.push_back(nullptr);
}
m_currentStacks.push_back(std::move(stack));
}
@@ -948,11 +955,12 @@ void V8Debugger::asyncTaskFinishedForStack(void* task) {
if (!m_maxAsyncCallStackDepth) return;
// We could start instrumenting half way and the stack is empty.
if (!m_currentStacks.size()) return;
-
DCHECK(m_currentTasks.back() == task);
m_currentTasks.pop_back();
+ DCHECK(m_currentStacks.size() == m_currentCreationStacks.size());
m_currentStacks.pop_back();
+ m_currentCreationStacks.pop_back();
if (m_recurringTasks.find(task) == m_recurringTasks.end()) {
asyncTaskCanceledForStack(task);
}
@@ -990,6 +998,7 @@ void V8Debugger::allAsyncTasksCanceled() {
m_asyncTaskStacks.clear();
m_recurringTasks.clear();
m_currentStacks.clear();
+ m_currentCreationStacks.clear();
m_currentTasks.clear();
m_parentTask.clear();
m_asyncTaskCreationStacks.clear();
« no previous file with comments | « src/inspector/v8-debugger.h ('k') | src/inspector/v8-debugger-agent-impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698