OLD | NEW |
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 Loading... |
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 std::unique_ptr<protocol::Runtime::StackTrace> stackTrace = | 301 return buildInspectorObjectCommon(m_frames, m_description, |
302 buildInspectorObjectCommon(m_frames, m_description, m_asyncParent.lock(), | 302 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; | |
309 } | 304 } |
310 | 305 |
311 int AsyncStackTrace::contextGroupId() const { return m_contextGroupId; } | 306 int AsyncStackTrace::contextGroupId() const { return m_contextGroupId; } |
312 | 307 |
313 const String16& AsyncStackTrace::description() const { return m_description; } | 308 const String16& AsyncStackTrace::description() const { return m_description; } |
314 | 309 |
315 std::weak_ptr<AsyncStackTrace> AsyncStackTrace::parent() const { | 310 std::weak_ptr<AsyncStackTrace> AsyncStackTrace::parent() const { |
316 return m_asyncParent; | 311 return m_asyncParent; |
317 } | 312 } |
318 | 313 |
319 std::weak_ptr<AsyncStackTrace> AsyncStackTrace::creation() const { | 314 std::weak_ptr<AsyncStackTrace> AsyncStackTrace::creation() const { |
320 return m_asyncCreation; | 315 return m_asyncCreation; |
321 } | 316 } |
322 | 317 |
323 bool AsyncStackTrace::isEmpty() const { return m_frames.empty(); } | 318 bool AsyncStackTrace::isEmpty() const { return m_frames.empty(); } |
324 | 319 |
325 } // namespace v8_inspector | 320 } // namespace v8_inspector |
OLD | NEW |