Commit 1f7a4ac1 authored by Andrew Comminos's avatar Andrew Comminos Committed by Commit Bot

Filter blink::Profiler traces by invoker context

Passes the context associated with the profile invoker's ScriptState
into v8::CpuProfilingOptions for filtration, providing isolation of
traces to the invoker's realm.

Bug: 956688
Change-Id: Iafb46d1990841656b216588a67ef63e3198b0a14
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762249Reviewed-by: default avatarPeter Marshall <petermarshall@chromium.org>
Reviewed-by: default avatarNicolás Peña Moreno <npm@chromium.org>
Commit-Queue: Andrew Comminos <acomminos@fb.com>
Cr-Commit-Position: refs/heads/master@{#689137}
parent 9cadb2a3
......@@ -80,11 +80,11 @@ Profiler* ProfilerGroup::CreateProfiler(ScriptState* script_state,
DCHECK(cpu_profiler_);
String profiler_id = NextProfilerId();
v8::CpuProfilingOptions options(v8::kLeafNodeLineNumbers,
init_options.hasMaxBufferSize()
? init_options.maxBufferSize()
v8::CpuProfilingOptions options(
v8::kLeafNodeLineNumbers,
init_options.hasMaxBufferSize() ? init_options.maxBufferSize()
: v8::CpuProfilingOptions::kNoSampleLimit,
static_cast<int>(sample_interval_us));
static_cast<int>(sample_interval_us), script_state->GetContext());
cpu_profiler_->StartProfiling(V8String(isolate_, profiler_id), options);
......
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