Skip to content

Commit

Permalink
ES Modules: Set referrer for top-level module script in ModuleScriptL…
Browse files Browse the repository at this point in the history
…oader

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 <[email protected]>
Commit-Queue: Hiroki Nakagawa <[email protected]>
Cr-Commit-Position: refs/heads/master@{#567937}
  • Loading branch information
nhiroki authored and chromium-wpt-export-bot committed Jun 18, 2018
1 parent 38ef0a3 commit 561fbb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion workers/modules/dedicated-worker-import-referrer.html
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit 561fbb9

Please sign in to comment.