зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1291652 - Part 1: Return origin attributes from nsILoadInfo in NS_GetOriginAttributes. r=sicking
--HG-- extra : rebase_source : 4a52e6c80fec2ab11709e9e351232bb3bb1082cb
This commit is contained in:
Родитель
425509d685
Коммит
f31ae627b1
|
@ -1251,25 +1251,12 @@ bool
|
|||
NS_GetOriginAttributes(nsIChannel *aChannel,
|
||||
mozilla::NeckoOriginAttributes &aAttributes)
|
||||
{
|
||||
nsCOMPtr<nsILoadContext> loadContext;
|
||||
nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo();
|
||||
NS_QueryNotificationCallbacks(aChannel, loadContext);
|
||||
|
||||
if (!loadContext && !loadInfo) {
|
||||
if (!loadInfo) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Bug 1270678 - By default, we would acquire the originAttributes from
|
||||
// the loadContext. But in some cases, say, loading the favicon, that the
|
||||
// loadContext is not available. We would use the loadInfo to get
|
||||
// originAttributes instead.
|
||||
if (loadContext) {
|
||||
DocShellOriginAttributes doa;
|
||||
loadContext->GetOriginAttributes(doa);
|
||||
aAttributes.InheritFromDocShellToNecko(doa);
|
||||
} else {
|
||||
loadInfo->GetOriginAttributes(&aAttributes);
|
||||
}
|
||||
loadInfo->GetOriginAttributes(&aAttributes);
|
||||
aAttributes.SyncAttributesWithPrivateBrowsing(NS_UsePrivateBrowsing(aChannel));
|
||||
return true;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче