Bug 965413 part 12. Use a LoadInfo in SetUpChannelOwner. r=smaug

This commit is contained in:
Boris Zbarsky
2014-07-10 02:56:38 -04:00
parent cca84e31c7
commit 61238deef8
5 changed files with 76 additions and 93 deletions

View File

@@ -10008,21 +10008,9 @@ nsDocShell::DoURILoad(nsIURI * aURI,
}
}
nsCOMPtr<nsIPrincipal> ownerPrincipal;
// If the content being loaded should be sandboxed with respect to origin
// we need to create a new null principal here, and then tell
// nsContentUtils::SetUpChannelOwner to force it to be set as the
// channel owner.
if (mSandboxFlags & SANDBOXED_ORIGIN) {
ownerPrincipal = do_CreateInstance("@mozilla.org/nullprincipal;1");
} else {
// Not sandboxed - we allow the content to assume its natural owner.
ownerPrincipal = do_QueryInterface(aOwner);
}
nsCOMPtr<nsIPrincipal> ownerPrincipal = do_QueryInterface(aOwner);
nsContentUtils::SetUpChannelOwner(ownerPrincipal, channel, aURI, true,
(mSandboxFlags & SANDBOXED_ORIGIN) ||
mSandboxFlags & SANDBOXED_ORIGIN,
isSrcdoc);
nsCOMPtr<nsIScriptChannel> scriptChannel = do_QueryInterface(channel);