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

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

Issue 2868423004: Revert of [inspector] use creation stack trace as parent for async call chains (Closed)
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/inspector/v8-stack-trace-impl.h" 5 #include "src/inspector/v8-stack-trace-impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "src/inspector/v8-debugger.h" 9 #include "src/inspector/v8-debugger.h"
10 #include "src/inspector/wasm-translation.h" 10 #include "src/inspector/wasm-translation.h"
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 m_description(description), 291 m_description(description),
292 m_frames(std::move(frames)), 292 m_frames(std::move(frames)),
293 m_asyncParent(asyncParent), 293 m_asyncParent(asyncParent),
294 m_asyncCreation(asyncCreation) { 294 m_asyncCreation(asyncCreation) {
295 DCHECK(m_contextGroupId); 295 DCHECK(m_contextGroupId);
296 } 296 }
297 297
298 std::unique_ptr<protocol::Runtime::StackTrace> 298 std::unique_ptr<protocol::Runtime::StackTrace>
299 AsyncStackTrace::buildInspectorObject(AsyncStackTrace* asyncCreation, 299 AsyncStackTrace::buildInspectorObject(AsyncStackTrace* asyncCreation,
300 int maxAsyncDepth) const { 300 int maxAsyncDepth) const {
301 return buildInspectorObjectCommon(m_frames, m_description, 301 std::unique_ptr<protocol::Runtime::StackTrace> stackTrace =
302 m_asyncParent.lock(), 302 buildInspectorObjectCommon(m_frames, m_description, m_asyncParent.lock(),
303 m_asyncCreation.lock(), maxAsyncDepth); 303 m_asyncCreation.lock(), maxAsyncDepth);
304 if (asyncCreation && !asyncCreation->isEmpty()) {
305 stackTrace->setPromiseCreationFrame(
306 asyncCreation->m_frames[0]->buildInspectorObject());
307 }
308 return stackTrace;
304 } 309 }
305 310
306 int AsyncStackTrace::contextGroupId() const { return m_contextGroupId; } 311 int AsyncStackTrace::contextGroupId() const { return m_contextGroupId; }
307 312
308 const String16& AsyncStackTrace::description() const { return m_description; } 313 const String16& AsyncStackTrace::description() const { return m_description; }
309 314
310 std::weak_ptr<AsyncStackTrace> AsyncStackTrace::parent() const { 315 std::weak_ptr<AsyncStackTrace> AsyncStackTrace::parent() const {
311 return m_asyncParent; 316 return m_asyncParent;
312 } 317 }
313 318
314 std::weak_ptr<AsyncStackTrace> AsyncStackTrace::creation() const { 319 std::weak_ptr<AsyncStackTrace> AsyncStackTrace::creation() const {
315 return m_asyncCreation; 320 return m_asyncCreation;
316 } 321 }
317 322
318 bool AsyncStackTrace::isEmpty() const { return m_frames.empty(); } 323 bool AsyncStackTrace::isEmpty() const { return m_frames.empty(); }
319 324
320 } // namespace v8_inspector 325 } // namespace v8_inspector
OLDNEW
« no previous file with comments | « src/inspector/v8-stack-trace-impl.h ('k') | test/inspector/debugger/async-for-await-of-promise-stack.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698