Bug 1732473 - Remove redundant privateBrowsingAllowed check r=zombie

The query method already validates whether access to private cookies is
allowed. It cannot yield private cookies if not allowed, so checking it
again in the loop of getAll is redundant..

Differential Revision: https://phabricator.services.mozilla.com/D127644
This commit is contained in:
Rob Wu 2021-11-30 16:25:16 +00:00
Родитель 9cc497b2b4
Коммит b364bab638
1 изменённых файлов: 0 добавлений и 6 удалений

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

@ -565,12 +565,6 @@ this.cookies = class extends ExtensionAPI {
let allowed = ["url", "name"];
for (let { cookie, storeId } of query(details, allowed, context)) {
if (
isPrivateCookieStoreId(details.storeId) &&
!context.privateBrowsingAllowed
) {
return Promise.reject({ message: "Unknown storeId" });
}
Services.cookies.remove(
cookie.host,
cookie.name,