mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-05-26 14:30:27 +00:00
import changes from `dev' branch of rmottola/Arctic-Fox:
- Bug 1255655 - Const-ify k{Unix,Win}Charsets and kLangGroups. r=smontagu. (75e9a5bf6c)
- Bug 1253010 - part 1 - refactor nsX509CertValidity time formatting; r=keeler (976afc4b16)
- Bug 1253010 - part 2 - provide a non-XPCOM way to create new nsIDateTimeFormat instances; r=smontagu (a2ccf520bb)
- Bug 1255239 - Reduce size of HuffmanIncomingTables. r=hurley. (8de07f2979)
- Bug 1224328 - Don't infinite loop when parsing headers with newlines. r=mcmanus (e7a9871294)
- Bug 1245106 - necko compilation warnings r=mcmanus (373b414d71)
- Bug 1253358 - no flags on priority frames r=hurley (0bfe9ccabe)
- Bug 1253358 - Assert no flags on several h2 frame types r=hurley (4315f882d7)
- Bug 1246735 - h2 reset recursive push. r=hurley (067e98a044)
- Bug 1253358 - minor h2 push fixes r=hurley (5a1c86723a)
- Bug 1246761 - Properly handle non-terminal 0-length DATA frames. r=mcmanus (4c1c907fc1)
- Bug 1120715 - Part 1: Add Necko APIs to preserve the Request cache mode on the channel; r=mayhemer (be7b704e09)
- Bug 1244122 P1 Always support SW intercept even when http cache is disabled. r=mayhemer (1929d6ff6b)
- Bug 1120715 - Part 2: Don't use OPEN_TRUNCATE when reopening a fake synthesized cache entry; r=mayhemer,jdm (84c5265a46)
- Bug 1148544 - Figure out UA override once per LoadGroup and cache it, rather than once per channel. r=nwgh (d610f7210f)
- Bug 1253582 - h2 coalescing impacts wss:// r=michal (bc7acebd2e)
- Bug 1064378 - Don't rewrite custom Authorization header set on a channel by cached credential. r=jduell (a427c97d24)
- Bug 1219482: Replace PRLogModuleInfo with LazyLogModule in uriloader subdirectory.r=erahm (2b54ad3276)
- Bug 1113196 - Pass a sane set of parameters to loadinfo for top-level loads in e10s. r=sicking (ea83174b6b)
- enable missing bit of 1487964 that is now valid (f6959fdcbc)
- Bug 1226928 - network and ipc bits for content-signing on remote about:newtab, r=mayhemer (0a183e0136)
- Bug 1257186 - Refactor the way compacting GC passes lists of arenas to background tasks to avoid possible race r=terrence (80e167e4b0)
This commit is contained in:
@@ -10557,11 +10557,39 @@ nsDocShell::DoURILoad(nsIURI* aURI,
|
||||
|
||||
bool isSrcdoc = !aSrcdoc.IsVoid();
|
||||
|
||||
// There are three cases we care about:
|
||||
// * Null mScriptGlobal: shouldn't happen but does (see bug 1240246). In this
|
||||
// case, we create a loadingPrincipal as for a top-level load, but we leave
|
||||
// requestingNode and requestingWindow null.
|
||||
// * Top-level load (GetFrameElementInternal returns null). In this case,
|
||||
// requestingNode is null, but requestingWindow is our mScriptGlobal.
|
||||
// TODO we want to pass null for loadingPrincipal in this case.
|
||||
// * Subframe load: requestingWindow is null, but requestingNode is the frame
|
||||
// element for the load. loadingPrincipal is the NodePrincipal of the frame
|
||||
// element.
|
||||
nsCOMPtr<nsINode> requestingNode;
|
||||
nsCOMPtr<nsPIDOMWindow> requestingWindow;
|
||||
|
||||
nsCOMPtr<nsIPrincipal> loadingPrincipal;
|
||||
if (mScriptGlobal) {
|
||||
requestingNode = mScriptGlobal->GetFrameElementInternal();
|
||||
if (!requestingNode) {
|
||||
requestingNode = mScriptGlobal->GetExtantDoc();
|
||||
if (requestingNode) {
|
||||
// If we have a requesting node, then use that as our loadingPrincipal.
|
||||
loadingPrincipal = requestingNode->NodePrincipal();
|
||||
} else {
|
||||
MOZ_ASSERT(aContentPolicyType == nsIContentPolicy::TYPE_DOCUMENT);
|
||||
requestingWindow = mScriptGlobal;
|
||||
}
|
||||
}
|
||||
|
||||
if (!loadingPrincipal) {
|
||||
if (mItemType != typeChrome) {
|
||||
nsIScriptSecurityManager* ssm = nsContentUtils::GetSecurityManager();
|
||||
ssm->GetDocShellCodebasePrincipal(aURI, this, getter_AddRefs(loadingPrincipal));
|
||||
} else {
|
||||
// This is a top-level chrome load, use a system principal for the
|
||||
// loadingPrincipal.
|
||||
loadingPrincipal = nsContentUtils::GetSystemPrincipal();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10592,27 +10620,24 @@ nsDocShell::DoURILoad(nsIURI* aURI,
|
||||
securityFlags |= nsILoadInfo::SEC_SANDBOXED;
|
||||
}
|
||||
|
||||
#if(0)
|
||||
// XXX: bug 1487964 has this code, but we have no nsILoadInfo set up yet.
|
||||
// Do we need it?
|
||||
RefPtr<LoadInfo> loadInfo =
|
||||
requestingWindow ?
|
||||
new LoadInfo(requestingWindow, loadingPrincipal, triggeringPrincipal,
|
||||
securityFlags) :
|
||||
new LoadInfo(loadingPrincipal, triggeringPrincipal, requestingNode,
|
||||
securityFlags, aContentPolicyType);
|
||||
|
||||
if (aIsFromProcessingFrameAttributes) {
|
||||
loadInfo->SetIsFromProcessingFrameAttributes();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!isSrcdoc) {
|
||||
rv = NS_NewChannelInternal(getter_AddRefs(channel),
|
||||
aURI,
|
||||
requestingNode,
|
||||
requestingNode
|
||||
? requestingNode->NodePrincipal()
|
||||
: triggeringPrincipal.get(),
|
||||
triggeringPrincipal,
|
||||
securityFlags,
|
||||
aContentPolicyType,
|
||||
nullptr, // loadGroup
|
||||
static_cast<nsIInterfaceRequestor*>(this),
|
||||
loadFlags);
|
||||
loadInfo,
|
||||
nullptr, // loadGroup
|
||||
static_cast<nsIInterfaceRequestor*>(this),
|
||||
loadFlags);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
if (rv == NS_ERROR_UNKNOWN_PROTOCOL) {
|
||||
@@ -10647,26 +10672,13 @@ nsDocShell::DoURILoad(nsIURI* aURI,
|
||||
NS_ENSURE_TRUE(vsh, NS_ERROR_FAILURE);
|
||||
|
||||
rv = vsh->NewSrcdocChannel(aURI, aBaseURI, aSrcdoc,
|
||||
requestingNode,
|
||||
requestingNode
|
||||
? requestingNode->NodePrincipal()
|
||||
: triggeringPrincipal.get(),
|
||||
triggeringPrincipal,
|
||||
securityFlags,
|
||||
aContentPolicyType,
|
||||
getter_AddRefs(channel));
|
||||
loadInfo, getter_AddRefs(channel));
|
||||
} else {
|
||||
rv = NS_NewInputStreamChannelInternal(getter_AddRefs(channel),
|
||||
aURI,
|
||||
aSrcdoc,
|
||||
NS_LITERAL_CSTRING("text/html"),
|
||||
requestingNode,
|
||||
requestingNode ?
|
||||
requestingNode->NodePrincipal() :
|
||||
triggeringPrincipal.get(),
|
||||
triggeringPrincipal,
|
||||
securityFlags,
|
||||
aContentPolicyType,
|
||||
loadInfo,
|
||||
true);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsCOMPtr<nsIInputStreamChannel> isc = do_QueryInterface(channel);
|
||||
|
||||
Reference in New Issue
Block a user