Bug 604496. Inherit the document principal for data: media elements. r=cpearce

This commit is contained in:
Boris Zbarsky
2015-01-16 22:47:32 -05:00
parent 6fd30079d3
commit 2da41c90ad
2 changed files with 30 additions and 3 deletions

View File

@@ -1202,12 +1202,21 @@ nsresult HTMLMediaElement::LoadResource()
return FinishDecoderSetup(decoder, resource, nullptr, nullptr);
}
nsSecurityFlags securityFlags = nsILoadInfo::SEC_NORMAL;
if (nsContentUtils::ChannelShouldInheritPrincipal(NodePrincipal(),
mLoadingSrc,
false, // aInheritForAboutBlank
false // aForceInherit
)) {
securityFlags = nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL;
}
nsCOMPtr<nsILoadGroup> loadGroup = GetDocumentLoadGroup();
nsCOMPtr<nsIChannel> channel;
rv = NS_NewChannel(getter_AddRefs(channel),
mLoadingSrc,
static_cast<Element*>(this),
nsILoadInfo::SEC_NORMAL,
securityFlags,
nsIContentPolicy::TYPE_MEDIA,
loadGroup,
nullptr, // aCallbacks