Bug 1083422 - Add triggering Principal to nsILoadInfo - update consumers (r=bz)

This commit is contained in:
Christoph Kerschbaumer 2014-11-14 08:57:26 -08:00
parent 59e7c4cbd1
commit ba415e054d
3 changed files with 3 additions and 3 deletions

View File

@ -332,7 +332,7 @@ nsScriptSecurityManager::GetChannelResultPrincipal(nsIChannel* aChannel,
}
if (loadInfo->GetForceInheritPrincipal()) {
NS_ADDREF(*aPrincipal = loadInfo->LoadingPrincipal());
NS_ADDREF(*aPrincipal = loadInfo->TriggeringPrincipal());
return NS_OK;
}
}

View File

@ -11590,7 +11590,7 @@ nsDocShell::AddToSessionHistory(nsIURI * aURI, nsIChannel * aChannel,
owner = nsNullPrincipal::CreateWithInheritedAttributes(loadInfo->LoadingPrincipal());
NS_ENSURE_TRUE(owner, NS_ERROR_FAILURE);
} else if (loadInfo->GetForceInheritPrincipal()) {
owner = loadInfo->LoadingPrincipal();
owner = loadInfo->TriggeringPrincipal();
}
}
}

View File

@ -157,7 +157,7 @@ nsresult nsJSThunk::EvaluateScript(nsIChannel *aChannel,
nsCOMPtr<nsILoadInfo> loadInfo;
aChannel->GetLoadInfo(getter_AddRefs(loadInfo));
if (loadInfo && loadInfo->GetForceInheritPrincipal()) {
principal = loadInfo->LoadingPrincipal();
principal = loadInfo->TriggeringPrincipal();
} else {
// No execution without a principal!
NS_ASSERTION(!owner, "Non-principal owner?");