Backed out changeset 5db9fcefa874 (
bug 1322856)
--- a/toolkit/components/extensions/.eslintrc.js
+++ b/toolkit/components/extensions/.eslintrc.js
@@ -14,20 +14,16 @@ module.exports = { // eslint-disable-lin
"TextEncoder": false,
// Specific to WebExtensions:
"Extension": true,
"ExtensionManagement": true,
"extensions": true,
"getContainerForCookieStoreId": true,
"getCookieStoreIdForContainer": true,
"global": true,
- "isContainerCookieStoreId": true,
- "isDefaultCookieStoreId": true,
- "isPrivateCookieStoreId": true,
- "isValidCookieStoreId": true,
"NetUtil": true,
"openOptionsPage": true,
"require": false,
"runSafe": true,
"runSafeSync": true,
"runSafeSyncWithoutClone": true,
"Services": true,
"TabManager": true,
--- a/toolkit/components/extensions/ext-cookies.js
+++ b/toolkit/components/extensions/ext-cookies.js
@@ -40,32 +40,32 @@ global.isContainerCookieStoreId = functi
return storeId !== null && storeId.startsWith(CONTAINER_STORE);
};
global.getCookieStoreIdForContainer = function(containerId) {
return CONTAINER_STORE + containerId;
};
global.getContainerForCookieStoreId = function(storeId) {
- if (!isContainerCookieStoreId(storeId)) {
+ if (!global.isContainerCookieStoreId(storeId)) {
return null;
}
let containerId = storeId.substring(CONTAINER_STORE.length);
if (ContextualIdentityService.getIdentityFromId(containerId)) {
return parseInt(containerId, 10);
}
return null;
};
global.isValidCookieStoreId = function(storeId) {
- return isDefaultCookieStoreId(storeId) ||
- isPrivateCookieStoreId(storeId) ||
- isContainerCookieStoreId(storeId);
+ return global.isDefaultCookieStoreId(storeId) ||
+ global.isPrivateCookieStoreId(storeId) ||
+ global.isContainerCookieStoreId(storeId);
};
function convert({cookie, isPrivate}) {
let result = {
name: cookie.name,
value: cookie.value,
domain: cookie.host,
hostOnly: !cookie.isDomain,
@@ -196,27 +196,27 @@ function* query(detailsIn, props, contex
if ("domain" in details) {
details.domain = details.domain.toLowerCase().replace(/^\./, "");
}
let userContextId = 0;
let isPrivate = context.incognito;
if (details.storeId) {
- if (!isValidCookieStoreId(details.storeId)) {
+ if (!global.isValidCookieStoreId(details.storeId)) {
return;
}
- if (isDefaultCookieStoreId(details.storeId)) {
+ if (global.isDefaultCookieStoreId(details.storeId)) {
isPrivate = false;
- } else if (isPrivateCookieStoreId(details.storeId)) {
+ } else if (global.isPrivateCookieStoreId(details.storeId)) {
isPrivate = true;
- } else if (isContainerCookieStoreId(details.storeId)) {
+ } else if (global.isContainerCookieStoreId(details.storeId)) {
isPrivate = false;
- userContextId = getContainerForCookieStoreId(details.storeId);
+ userContextId = global.getContainerForCookieStoreId(details.storeId);
if (!userContextId) {
return;
}
}
}
let storeId = DEFAULT_STORE;
if (isPrivate) {
@@ -367,22 +367,22 @@ extensions.registerSchemaAPI("cookies",
let name = details.name !== null ? details.name : "";
let value = details.value !== null ? details.value : "";
let secure = details.secure !== null ? details.secure : false;
let httpOnly = details.httpOnly !== null ? details.httpOnly : false;
let isSession = details.expirationDate === null;
let expiry = isSession ? Number.MAX_SAFE_INTEGER : details.expirationDate;
let isPrivate = context.incognito;
let userContextId = 0;
- if (isDefaultCookieStoreId(details.storeId)) {
+ if (global.isDefaultCookieStoreId(details.storeId)) {
isPrivate = false;
- } else if (isPrivateCookieStoreId(details.storeId)) {
+ } else if (global.isPrivateCookieStoreId(details.storeId)) {
isPrivate = true;
- } else if (isContainerCookieStoreId(details.storeId)) {
- let containerId = getContainerForCookieStoreId(details.storeId);
+ } else if (global.isContainerCookieStoreId(details.storeId)) {
+ let containerId = global.getContainerForCookieStoreId(details.storeId);
if (containerId === null) {
return Promise.reject({message: `Illegal storeId: ${details.storeId}`});
}
isPrivate = false;
userContextId = containerId;
} else if (details.storeId !== null) {
return Promise.reject({message: "Unknown storeId"});
}