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

@@ -6203,8 +6203,8 @@ void HTMLMediaElement::SetRequestHeaders(nsIHttpChannel* aChannel) {
MOZ_ASSERT(NS_SUCCEEDED(rv));
// Set the Referer header
nsCOMPtr<nsIReferrerInfo> referrerInfo = new ReferrerInfo(
OwnerDoc()->GetDocumentURI(), OwnerDoc()->GetReferrerPolicy());
nsCOMPtr<nsIReferrerInfo> referrerInfo = new ReferrerInfo();
referrerInfo->InitWithDocument(OwnerDoc());
rv = aChannel->SetReferrerInfoWithoutClone(referrerInfo);
MOZ_ASSERT(NS_SUCCEEDED(rv));
}