From 561fbb9d097472b33de81436f19ea28d00b1dc14 Mon Sep 17 00:00:00 2001 From: Hiroki Nakagawa Date: Sun, 17 Jun 2018 23:34:27 -0700 Subject: [PATCH] ES Modules: Set referrer for top-level module script in ModuleScriptLoader Before this CL, referrer for top-level module script is set in BaseFetchContext::AddAdditionalRequestHeaders() using ExecutionContext::GetOutgoingReferrer(). This works for documents, but doesn't for workers because this execution context is corresponding to "module map settings object", not "fetch client settings object". To fix this, this CL sets the referrer for top-level module script using "fetch client settings object" in ModuleScriptLoader as the spec defines. Change-Id: I0878b13febdae4ee2dc56c998e7f2c100e9c1ba7 Bug: 842553 Reviewed-on: https://chromium-review.googlesource.com/1102236 Reviewed-by: Kouhei Ueno Commit-Queue: Hiroki Nakagawa Cr-Commit-Position: refs/heads/master@{#567937} --- workers/modules/dedicated-worker-import-referrer.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workers/modules/dedicated-worker-import-referrer.html b/workers/modules/dedicated-worker-import-referrer.html index 01322bb1ed0edf..bed66d81ff6553 100644 --- a/workers/modules/dedicated-worker-import-referrer.html +++ b/workers/modules/dedicated-worker-import-referrer.html @@ -104,7 +104,7 @@ import_referrer_test( { scriptURL: 'referrer-checker.py', windowReferrerPolicy: 'same-origin', - expectedReferrer: createURLString('resources/referrer-window.html') }, + expectedReferrer: createURLString('resources/new-worker-window.html') }, 'Same-origin top-level module script loading with "same-origin" referrer ' + 'policy');