Commit 647fadd5 authored by Simon Zünd's avatar Simon Zünd Committed by Commit Bot

[stack trace] Make check in FrameArrayBuilder configurable

This CL allows the check for same security context to be disabled
when deciding what frames to include in a stack trace. This flag
will be needed to collect detailed stack traces in the same manner
as simple ones.

R=jgruber@chromium.org

Bug: v8:8742
Change-Id: I99651ad11e11546d7bdba88367a0849e7b308dcb
Reviewed-on: https://chromium-review.googlesource.com/c/1454719
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59395}
parent 84d6864a
......@@ -533,9 +533,16 @@ namespace {
class FrameArrayBuilder {
public:
enum FrameFilterMode { ALL, CURRENT_SECURITY_CONTEXT };
FrameArrayBuilder(Isolate* isolate, FrameSkipMode mode, int limit,
Handle<Object> caller)
: isolate_(isolate), mode_(mode), limit_(limit), caller_(caller) {
Handle<Object> caller,
FrameFilterMode filter_mode = CURRENT_SECURITY_CONTEXT)
: isolate_(isolate),
mode_(mode),
limit_(limit),
caller_(caller),
check_security_context_(filter_mode == CURRENT_SECURITY_CONTEXT) {
switch (mode_) {
case SKIP_FIRST:
skip_next_frame_ = true;
......@@ -715,6 +722,7 @@ class FrameArrayBuilder {
}
bool IsInSameSecurityContext(Handle<JSFunction> function) {
if (!check_security_context_) return true;
return isolate_->context()->HasSameSecurityTokenAs(function->context());
}
......@@ -732,6 +740,7 @@ class FrameArrayBuilder {
const Handle<Object> caller_;
bool skip_next_frame_ = true;
bool encountered_strict_function_ = false;
const bool check_security_context_;
Handle<FrameArray> elements_;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment