Bug 1534681 Use ReferrerInfo class in document r=ckerschb,baku,Gijs

Also, in many place, we use document uri as referrer. It is not right
for the case srdoc iframe. We should use the last non-srdoc parent
document's uri

Differential Revision: https://phabricator.services.mozilla.com/D30191
This commit is contained in:
Thomas Nguyen
2019-06-06 07:23:37 +00:00
parent 1b5939ce7f
commit 5a46d126ce
38 changed files with 575 additions and 318 deletions

View File

@@ -1500,7 +1500,7 @@ ScriptLoadRequest* ScriptLoader::CreateLoadRequest(
nsIPrincipal* aTriggeringPrincipal, CORSMode aCORSMode,
const SRIMetadata& aIntegrity,
mozilla::net::ReferrerPolicy aReferrerPolicy) {
nsIURI* referrer = mDocument->GetDocumentURI();
nsIURI* referrer = mDocument->GetDocumentURIAsReferrer();
ScriptFetchOptions* fetchOptions = new ScriptFetchOptions(
aCORSMode, aReferrerPolicy, aElement, aTriggeringPrincipal);