Backed out changeset 5db9fcefa874 (bug 1322856)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Fri, 16 Dec 2016 23:50:59 +0100
changeset 450684 dcb0721c0c50771d89daeefdddf23329d6e35e50
parent 450683 90b91d69b5760c4bb454ae6d6ad4e04ae3782f20
child 450685 a199014fd2b5fe100e10b9b4557558f6341c16cb
push id38944
push userbmo:leftysolara@gmail.com
push dateSun, 18 Dec 2016 16:01:15 +0000
bugs1322856
milestone53.0a1
backs out5db9fcefa874c25c01983bc09b733d43f8db278f
Backed out changeset 5db9fcefa874 (bug 1322856)
toolkit/components/extensions/.eslintrc.js
toolkit/components/extensions/ext-cookies.js
--- 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"});
         }