Bug 1503654 - Correct comparision (from bug 1245184) and parameter order (from bug 1259169) for cookie removal. r+a=jorgk
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Wed, 31 Oct 2018 15:45:00 +0100
changeset 33463 8338dbce84a93ad65edec1b462b9cd83d7018bf3
parent 33462 bcaa8d88f2815c2a055e576307901ded5e6ae917
child 33464 593d228719d752e37377d322cced522032d3582b
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
bugs1503654, 1245184, 1259169
Bug 1503654 - Correct comparision (from bug 1245184) and parameter order (from bug 1259169) for cookie removal. r+a=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();
     }