Bug 1696111 - Make LoadInfo know if the request is triggered from a media element and if it's an initial request. r=necko-reviewers,alwu,dragana

Differential Revision: https://phabricator.services.mozilla.com/D106890
This commit is contained in:
Eden Chuang
2021-03-30 00:52:31 +00:00
parent 2e4e65ad4d
commit fde79b287b
8 changed files with 87 additions and 6 deletions

View File

@@ -1717,12 +1717,14 @@ class HTMLMediaElement::ChannelLoader final {
return;
}
nsCOMPtr<nsILoadInfo> loadInfo = channel->LoadInfo();
if (setAttrs) {
nsCOMPtr<nsILoadInfo> loadInfo = channel->LoadInfo();
// The function simply returns NS_OK, so we ignore the return value.
Unused << loadInfo->SetOriginAttributes(
triggeringPrincipal->OriginAttributesRef());
}
loadInfo->SetIsMediaRequest(true);
loadInfo->SetIsMediaInitialRequest(true);
nsCOMPtr<nsIClassOfService> cos(do_QueryInterface(channel));
if (cos) {