mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1087442 - Attach LoadInfo inside each individual ProtocolHandler - loadinfo changes (r=sicking)
This commit is contained in:
parent
9afda1809f
commit
3e32b15198
@ -20,16 +20,23 @@ LoadInfo::LoadInfo(nsIPrincipal* aLoadingPrincipal,
|
||||
nsSecurityFlags aSecurityFlags,
|
||||
nsContentPolicyType aContentPolicyType,
|
||||
nsIURI* aBaseURI)
|
||||
: mLoadingPrincipal(aLoadingPrincipal)
|
||||
: mLoadingPrincipal(aLoadingContext ?
|
||||
aLoadingContext->NodePrincipal() : aLoadingPrincipal)
|
||||
, mTriggeringPrincipal(aTriggeringPrincipal ?
|
||||
aTriggeringPrincipal : aLoadingPrincipal)
|
||||
aTriggeringPrincipal : mLoadingPrincipal.get())
|
||||
, mLoadingContext(do_GetWeakReference(aLoadingContext))
|
||||
, mSecurityFlags(aSecurityFlags)
|
||||
, mContentPolicyType(aContentPolicyType)
|
||||
, mBaseURI(aBaseURI)
|
||||
{
|
||||
MOZ_ASSERT(aLoadingPrincipal);
|
||||
MOZ_ASSERT(mLoadingPrincipal);
|
||||
MOZ_ASSERT(mTriggeringPrincipal);
|
||||
|
||||
// if consumers pass both, aLoadingContext and aLoadingPrincipal
|
||||
// then the loadingPrincipal must be the same as the node's principal
|
||||
MOZ_ASSERT(!aLoadingContext || !aLoadingPrincipal ||
|
||||
aLoadingContext->NodePrincipal() == aLoadingPrincipal);
|
||||
|
||||
// if the load is sandboxed, we can not also inherit the principal
|
||||
if (mSecurityFlags & nsILoadInfo::SEC_SANDBOXED) {
|
||||
mSecurityFlags ^= nsILoadInfo::SEC_FORCE_INHERIT_PRINCIPAL;
|
||||
|
Loading…
Reference in New Issue
Block a user