зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1483604 - Part 3: Pass in a channel object when calling InternalStorageAllowedForPrincipal() from StorageAllowedForWindow() and StorageAllowedForDocument(); r=smaug
This commit is contained in:
Родитель
99d839224e
Коммит
60f130b6fc
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче