Bug 1503654 - Correct comparision (from bug 1245184) and parameter order (from bug 1259169) for cookie removal. r=jorgk
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Wed, 31 Oct 2018 15:45:00 +0100
changeset 33632 89c98293e4af398d5e642aaedec9f6f08e2e8a9c
parent 33631 22fb120a634f0281b496b650d21da0d05bded5d4
child 33633 8b4648e6ba485708e26ac3e7a23bb3b62220be13
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersjorgk
bugs1503654, 1245184, 1259169
Bug 1503654 - Correct comparision (from bug 1245184) and parameter order (from bug 1259169) for cookie removal. r=jorgk
mail/base/content/sanitize.js
mail/components/preferences/cookies.js
--- a/mail/base/content/sanitize.js
+++ b/mail/base/content/sanitize.js
@@ -101,17 +101,17 @@ Sanitizer.prototype = {
           // Iterate through the cookies and delete any created after our cutoff.
           var cookiesEnum = Services.cookies.enumerator;
           while (cookiesEnum.hasMoreElements()) {
             var cookie = cookiesEnum.getNext().QueryInterface(Ci.nsICookie2);
 
             if (cookie.creationTime > this.range[0])
               // This cookie was created after our cutoff, clear it
               Services.cookies.remove(cookie.host, cookie.name, cookie.path,
-                                      cookie.originAttributes, false);
+                                      false, cookie.originAttributes);
           }
         }
         else {
           // Remove everything
           Services.cookies.removeAll();
         }
 
         // Clear plugin data.
--- a/mail/components/preferences/cookies.js
+++ b/mail/components/preferences/cookies.js
@@ -54,17 +54,17 @@ var gCookiesWindow = {
 
     this._saveState();
   },
 
   _cookieEquals(aCookieA, aCookieB, aStrippedHost) {
     return aCookieA.rawHost == aStrippedHost &&
            aCookieA.name == aCookieB.name &&
            aCookieA.path == aCookieB.path &&
-           !ChromeUtils.compareOriginAttributes(aCookieA.originAttributes,
+           !ChromeUtils.isOriginAttributesEqual(aCookieA.originAttributes,
                                                 aCookieB.originAttributes);
   },
 
   observe(aCookie, aTopic, aData) {
     if (aTopic != "cookie-changed")
       return;
 
     if (aCookie instanceof Ci.nsICookie) {
@@ -264,17 +264,17 @@ var gCookiesWindow = {
         gCookiesWindow._hosts[item.rawHost] = null;
       } else {
         let parent = this._getItemAtIndex(item.parentIndex);
         for (let i = 0; i < parent.cookies.length; ++i) {
           var cookie = parent.cookies[i];
           if (item.rawHost == cookie.rawHost &&
               item.name == cookie.name &&
               item.path == cookie.path &&
-              !ChromeUtils.compareOriginAttributes(item.originAttributes,
+              !ChromeUtils.isOriginAttributesEqual(item.originAttributes,
                                                    cookie.originAttributes)) {
             parent.cookies.splice(i, removeCount);
           }
         }
       }
     },
 
     _invalidateCache(aIndex) {
@@ -672,17 +672,17 @@ var gCookiesWindow = {
     }
 
     var blockFutureCookies = false;
     if (Services.prefs.prefHasUserValue("network.cookie.blockFutureCookies"))
       blockFutureCookies = Services.prefs
         .getBoolPref("network.cookie.blockFutureCookies");
     for (let item of deleteItems) {
       Services.cookies.remove(item.host, item.name, item.path,
-                              item.originAttributes, blockFutureCookies);
+                              blockFutureCookies, item.originAttributes);
     }
 
     if (nextSelected < 0)
       seln.clearSelection();
     else {
       seln.select(nextSelected);
       this._tree.focus();
     }