[DevTools] V8StackTrace: Add the ability to limit the max async depth...
... when building inspector objects. This is useful in Chromium, when recording the initiator information for navigations. See https://chromium-review.googlesource.com/c/chromium/src/+/1674885 Change-Id: Ib9ddcaf05586ca1f48a31921a20ab11a703ec7b0 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1677381 Reviewed-by: Yang Guo <yangguo@chromium.org> Reviewed-by: Alexei Filippov <alph@chromium.org> Commit-Queue: Johannes Henkel <johannes@chromium.org> Cr-Commit-Position: refs/heads/master@{#62389}
This commit is contained in:
parent
e3793ef554
commit
00e389d238
@ -109,6 +109,8 @@ class V8_EXPORT V8StackTrace {
|
||||
virtual ~V8StackTrace() = default;
|
||||
virtual std::unique_ptr<protocol::Runtime::API::StackTrace>
|
||||
buildInspectorObject() const = 0;
|
||||
virtual std::unique_ptr<protocol::Runtime::API::StackTrace>
|
||||
buildInspectorObject(int maxAsyncDepth) const = 0;
|
||||
virtual std::unique_ptr<StringBuffer> toString() const = 0;
|
||||
|
||||
// Safe to pass between threads, drops async chain.
|
||||
|
@ -285,6 +285,12 @@ V8StackTraceImpl::buildInspectorObject() const {
|
||||
return buildInspectorObjectImpl(nullptr);
|
||||
}
|
||||
|
||||
std::unique_ptr<protocol::Runtime::API::StackTrace>
|
||||
V8StackTraceImpl::buildInspectorObject(int maxAsyncDepth) const {
|
||||
return buildInspectorObjectImpl(nullptr,
|
||||
std::min(maxAsyncDepth, m_maxAsyncDepth));
|
||||
}
|
||||
|
||||
std::unique_ptr<StringBuffer> V8StackTraceImpl::toString() const {
|
||||
String16Builder stackTrace;
|
||||
for (size_t i = 0; i < m_frames.size(); ++i) {
|
||||
|
@ -78,6 +78,8 @@ class V8StackTraceImpl : public V8StackTrace {
|
||||
StringView topFunctionName() const override;
|
||||
std::unique_ptr<protocol::Runtime::API::StackTrace> buildInspectorObject()
|
||||
const override;
|
||||
std::unique_ptr<protocol::Runtime::API::StackTrace> buildInspectorObject(
|
||||
int maxAsyncDepth) const override;
|
||||
std::unique_ptr<StringBuffer> toString() const override;
|
||||
|
||||
bool isEqualIgnoringTopFrame(V8StackTraceImpl* stackTrace) const;
|
||||
|
Loading…
Reference in New Issue
Block a user