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

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

Issue 2884613004: [inspector] added in-deeper-frame continue-to-location strategy
Patch Set: rebased 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 side-by-side diff with in-line comments
Download patch
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 9db6b47caf01c79944bb40412c1c9416a62e2a31..daa03fee875f91f342e3e603cdfab103fffde67e 100644
--- a/src/inspector/v8-stack-trace-impl.cc
+++ b/src/inspector/v8-stack-trace-impl.cc
@@ -264,6 +264,32 @@ bool V8StackTraceImpl::isEqualIgnoringTopFrame(
return current.done() == target.done();
}
+void V8StackTraceImpl::allFrames(std::vector<StackFrame*>* frames) const {
+ StackFrameIterator current(this);
+ while (!current.done()) {
+ frames->push_back(current.frame());
+ current.next();
+ }
+}
+
+bool V8StackTraceImpl::isPrefix(V8StackTraceImpl* currentStack) const {
+ std::vector<StackFrame*> prefix;
+ allFrames(&prefix);
+ std::vector<StackFrame*> current;
+ currentStack->allFrames(&current);
+
+ auto itPrefix = prefix.rbegin();
+ auto itCurrent = current.rbegin();
+ while (itPrefix != prefix.rend() && itCurrent != current.rend()) {
+ if (!(*itPrefix)->isEqual(*itCurrent)) {
+ return false;
+ }
+ ++itPrefix;
+ ++itCurrent;
+ }
+ return itPrefix == prefix.rend();
+}
+
V8StackTraceImpl::StackFrameIterator::StackFrameIterator(
const V8StackTraceImpl* stackTrace)
: m_currentIt(stackTrace->m_frames.begin()),
« no previous file with comments | « src/inspector/v8-stack-trace-impl.h ('k') | test/inspector/debugger/continue-to-location-target-call-frames.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698