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

Unified Diff: src/inspector/v8-stack-trace-impl.cc

Issue 2822073002: [inspector] AsyncStackTrace should always have non-zero context group id (Closed)
Patch Set: 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/inspector/v8-stack-trace-impl.cc
diff --git a/src/inspector/v8-stack-trace-impl.cc b/src/inspector/v8-stack-trace-impl.cc
index ed82d1264adc18c9f858ef9aca9cd18d0df09624..cff06d74f064e2b4978a6e0ddede00b9a287e79b 100644
--- a/src/inspector/v8-stack-trace-impl.cc
+++ b/src/inspector/v8-stack-trace-impl.cc
@@ -48,7 +48,7 @@ void calculateAsyncChain(V8Debugger* debugger, int contextGroupId,
// Do not accidentally append async call chain from another group. This should
// not happen if we have proper instrumentation, but let's double-check to be
// safe.
- if (contextGroupId && *asyncParent && (*asyncParent)->contextGroupId() &&
+ if (contextGroupId && *asyncParent &&
(*asyncParent)->contextGroupId() != contextGroupId) {
asyncParent->reset();
asyncCreation->reset();
@@ -274,6 +274,10 @@ std::shared_ptr<AsyncStackTrace> AsyncStackTrace::capture(
return asyncParent;
}
+ DCHECK(contextGroupId || asyncParent);
+ if (!contextGroupId && asyncParent) {
+ contextGroupId = asyncParent->m_contextGroupId;
+ }
return std::shared_ptr<AsyncStackTrace>(new AsyncStackTrace(
contextGroupId, description, frames, asyncParent, asyncCreation));
}
@@ -287,7 +291,9 @@ AsyncStackTrace::AsyncStackTrace(
m_description(description),
m_frames(frames),
m_asyncParent(asyncParent),
- m_asyncCreation(asyncCreation) {}
+ m_asyncCreation(asyncCreation) {
+ DCHECK(m_contextGroupId);
+}
std::unique_ptr<protocol::Runtime::StackTrace>
AsyncStackTrace::buildInspectorObject(AsyncStackTrace* asyncCreation,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698