Commit f2d4f9d4 authored by Hiroshige Hayashizaki's avatar Hiroshige Hayashizaki Committed by Commit Bot

Show origin for Paint/LayoutWorklet in DevTools context selector

Previously, an opaque origin is passed to
MainThreadDebugger::ContextCreated() for Paint/Layout worklets,
and caused the origins in the context selector shown as "IFrame".

This CL passes DocumentSecurityOrigin() instead, which is the
origin of the Document that creates the worklets, and thus
shows the correct origin.

Bug: 866666, 861564
Change-Id: Ic038b3901ed0e301e4d2d9afdf632f7caf6add77
Reviewed-on: https://chromium-review.googlesource.com/1141290Reviewed-by: default avatarHiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: default avatarIan Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578754}
parent 3ed1c6c1
Tests console execution context selector for paintworklet. Tests console execution context selector for paintworklet.
Console context selector: Console context selector:
* top * top / 127.0.0.1:8000
____PaintWorklet #1 ____PaintWorklet #1 / 127.0.0.1:8000
____PaintWorklet #2 ____PaintWorklet #2 / 127.0.0.1:8000
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
TestRunner.addResult('Console context selector:'); TestRunner.addResult('Console context selector:');
for (var executionContext of selector._items) { for (var executionContext of selector._items) {
var selected = UI.context.flavor(SDK.ExecutionContext) === executionContext; var selected = UI.context.flavor(SDK.ExecutionContext) === executionContext;
var text = '____'.repeat(selector._depthFor(executionContext)) + selector.titleFor(executionContext); var text = '____'.repeat(selector._depthFor(executionContext)) + selector.titleFor(executionContext) + " / " + selector._subtitleFor(executionContext);
var disabled = !selector.isItemSelectable(executionContext); var disabled = !selector.isItemSelectable(executionContext);
TestRunner.addResult(`${selected ? '*' : ' '} ${text} ${disabled ? '[disabled]' : ''}`); TestRunner.addResult(`${selected ? '*' : ' '} ${text} ${disabled ? '[disabled]' : ''}`);
} }
......
...@@ -34,7 +34,7 @@ LayoutWorkletGlobalScope* LayoutWorkletGlobalScope::Create( ...@@ -34,7 +34,7 @@ LayoutWorkletGlobalScope* LayoutWorkletGlobalScope::Create(
global_scope->ScriptController()->InitializeContextIfNeeded(context_name); global_scope->ScriptController()->InitializeContextIfNeeded(context_name);
MainThreadDebugger::Instance()->ContextCreated( MainThreadDebugger::Instance()->ContextCreated(
global_scope->ScriptController()->GetScriptState(), global_scope->ScriptController()->GetScriptState(),
global_scope->GetFrame(), global_scope->GetSecurityOrigin()); global_scope->GetFrame(), global_scope->DocumentSecurityOrigin());
return global_scope; return global_scope;
} }
......
...@@ -101,7 +101,7 @@ PaintWorkletGlobalScope* PaintWorkletGlobalScope::Create( ...@@ -101,7 +101,7 @@ PaintWorkletGlobalScope* PaintWorkletGlobalScope::Create(
global_scope->ScriptController()->InitializeContextIfNeeded(context_name); global_scope->ScriptController()->InitializeContextIfNeeded(context_name);
MainThreadDebugger::Instance()->ContextCreated( MainThreadDebugger::Instance()->ContextCreated(
global_scope->ScriptController()->GetScriptState(), global_scope->ScriptController()->GetScriptState(),
global_scope->GetFrame(), global_scope->GetSecurityOrigin()); global_scope->GetFrame(), global_scope->DocumentSecurityOrigin());
return global_scope; return global_scope;
} }
......
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