From 1a91e5645a8f3d5d3d71e9531090f03850f5bede Mon Sep 17 00:00:00 2001 From: Iulian Moraru Date: Mon, 14 Aug 2023 16:55:24 +0300 Subject: [PATCH] Backed out changeset 308fde20a1b1 (bug 1843046) for causing geckoview-junit failures related to notifications. CLOSED TREE --- dom/notification/Notification.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/dom/notification/Notification.cpp b/dom/notification/Notification.cpp index 59972707e336..4c233a1bf172 100644 --- a/dom/notification/Notification.cpp +++ b/dom/notification/Notification.cpp @@ -477,9 +477,6 @@ NotificationPermissionRequest::Run() { bool blocked = false; if (isSystem) { mPermission = NotificationPermission::Granted; - } else if (mPrincipal->GetPrivateBrowsingId() != 0) { - mPermission = NotificationPermission::Denied; - blocked = true; } else { // File are automatically granted permission. @@ -1455,12 +1452,7 @@ already_AddRefed Notification::RequestPermission( aRv.Throw(NS_ERROR_UNEXPECTED); return nullptr; } - nsCOMPtr principal = sop->GetPrincipal(); - if (!principal) { - aRv.Throw(NS_ERROR_UNEXPECTED); - return nullptr; - } RefPtr promise = Promise::Create(window->AsGlobal(), aRv); if (aRv.Failed()) { @@ -1514,14 +1506,6 @@ NotificationPermission Notification::GetPermissionInternal( } nsCOMPtr principal = sop->GetPrincipal(); - if (!principal) { - aRv.Throw(NS_ERROR_UNEXPECTED); - return NotificationPermission::Denied; - } - - if (principal->GetPrivateBrowsingId() != 0) { - return NotificationPermission::Denied; - } // Disallow showing notification if our origin is not the same origin as the // toplevel one, see https://github.com/whatwg/notifications/issues/177. if (!StaticPrefs::dom_webnotifications_allowcrossoriginiframe()) { -- 2.11.4.GIT