Bug 1483604 - Part 3: Pass in a channel object when calling InternalStorageAllowedForPrincipal() from StorageAllowedForWindow() and StorageAllowedForDocument(); r=smaug

This commit is contained in:
Ehsan Akhgari 2018-08-15 18:17:10 -04:00
Родитель 99d839224e
Коммит 60f130b6fc
1 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -8688,8 +8688,12 @@ nsContentUtils::StorageAllowedForWindow(nsPIDOMWindowInner* aWindow)
{
if (nsIDocument* document = aWindow->GetExtantDoc()) {
nsCOMPtr<nsIPrincipal> principal = document->NodePrincipal();
// Note that GetChannel() below may return null, but that's OK, since the
// callee is able to deal with a null channel argument, and if passed null,
// will only fail to notify the UI in case storage gets blocked.
nsIChannel* channel = document->GetChannel();
return InternalStorageAllowedForPrincipal(principal, aWindow, nullptr,
nullptr);
channel);
}
return StorageAccess::eDeny;
@ -8703,8 +8707,12 @@ nsContentUtils::StorageAllowedForDocument(nsIDocument* aDoc)
if (nsPIDOMWindowInner* inner = aDoc->GetInnerWindow()) {
nsCOMPtr<nsIPrincipal> principal = aDoc->NodePrincipal();
// Note that GetChannel() below may return null, but that's OK, since the
// callee is able to deal with a null channel argument, and if passed null,
// will only fail to notify the UI in case storage gets blocked.
nsIChannel* channel = aDoc->GetChannel();
return InternalStorageAllowedForPrincipal(principal, inner, nullptr,
nullptr);
channel);
}
return StorageAccess::eDeny;