Bug 1263252 - Change attributes sequence of cookie.remove calls to take into account changes in Bug 1259169. Reorder cookie constructors for key fields. r=Ratty a=Ratty for comm-aurora CLOSED TREE
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Thu, 14 Apr 2016 19:02:14 +0200
changeset 26978 7d7b4275989563498e225748ac20b77660ed601e
parent 26977 dd86a1b531eeb33a89de9161a3472201de129adf
child 26979 c66fadeb47f65eda25c9c809e771ee3a3986b4f0
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersRatty, Ratty
bugs1263252, 1259169
Bug 1263252 - Change attributes sequence of cookie.remove calls to take into account changes in Bug 1259169. Reorder cookie constructors for key fields. r=Ratty a=Ratty for comm-aurora CLOSED TREE
suite/common/dataman/dataman.js
suite/common/permissions/cookieViewer.js
--- a/suite/common/dataman/dataman.js
+++ b/suite/common/dataman/dataman.js
@@ -888,24 +888,24 @@ var gCookies = {
       let nextCookie = enumerator.getNext();
       if (!nextCookie) break;
       nextCookie = nextCookie.QueryInterface(Components.interfaces.nsICookie2);
       this.cookies.push(this._makeCookieObject(nextCookie));
     }
   },
 
   _makeCookieObject: function cookies__makeCookieObject(aCookie) {
-      return {name: aCookie.name,
+      return {host: aCookie.host,
+              name: aCookie.name,
+              path: aCookie.path,
+              originAttributes: aCookie.originAttributes,
               value: aCookie.value,
               isDomain: aCookie.isDomain,
-              host: aCookie.host,
               rawHost: aCookie.rawHost,
               displayHost: gLocSvc.idn.convertToDisplayIDN(aCookie.rawHost, {}),
-              path: aCookie.path,
-              originAttributes: aCookie.originAttributes,
               isSecure: aCookie.isSecure,
               isSession: aCookie.isSession,
               isHttpOnly: aCookie.isHttpOnly,
               expires: this._getExpiresString(aCookie.expires),
               expiresSortValue: aCookie.expires};
   },
 
   _getObjID: function cookies__getObjID(aIdx) {
@@ -1061,17 +1061,17 @@ var gCookies = {
     this.tree.view.selection.clearSelection();
     // Loop backwards so later indexes in the list don't change.
     for (let i = selections.length - 1; i >= 0; i--) {
       let delCookie = this.displayedCookies[selections[i]];
       this.cookies.splice(this.cookies.indexOf(this.displayedCookies[selections[i]]), 1);
       this.displayedCookies.splice(selections[i], 1);
       this.tree.treeBoxObject.rowCountChanged(selections[i], -1);
       Services.cookies.remove(delCookie.host, delCookie.name, delCookie.path,
-                              delCookie.originAttributes, this.blockOnRemove.checked);
+                              this.blockOnRemove.checked, delCookie.originAttributes);
     }
     if (!this.displayedCookies.length)
       gDomains.removeDomainOrFlag(gDomains.selectedDomain.title, "hasCookies");
     // Select the entry after the first deleted one or the last of all entries.
     if (selections.length && this.displayedCookies.length)
       this.tree.view.selection.toggleSelect(selections[0] < this.displayedCookies.length ?
                                             selections[0] :
                                             this.displayedCookies.length - 1);
--- a/suite/common/permissions/cookieViewer.js
+++ b/suite/common/permissions/cookieViewer.js
@@ -124,45 +124,45 @@ var cookiesTreeView = {
   isContainer : function(index) {return false;},
   cycleHeader : function(aCol) {},
   getRowProperties : function(row) { return ""; },
   getColumnProperties : function(column) { return ""; },
   getCellProperties : function(row, column) { return ""; }
  };
 var cookiesTree;
 
-function Cookie(id, name, value, isDomain, host, rawHost, path,
-                originAttributes, isSecure, expires) {
+function Cookie(id, host, name, path, originAttributes, value,
+                isDomain, rawHost, isSecure, expires) {
   this.id = id;
+  this.host = host;
   this.name = name;
+  this.path = path;
+  this.originAttributes = originAttributes;
   this.value = value;
   this.isDomain = isDomain;
-  this.host = host;
   this.rawHost = rawHost;
-  this.path = path;
-  this.originAttributes = originAttributes;
   this.isSecure = isSecure;
   this.expires = GetExpiresString(expires);
   this.expiresSortValue = expires;
 }
 
 function loadCookies() {
   // load cookies into a table
   var enumerator = cookiemanager.enumerator;
   var count = 0;
   while (enumerator.hasMoreElements()) {
     var nextCookie = enumerator.getNext();
     if (!nextCookie) break;
     nextCookie = nextCookie.QueryInterface(Components.interfaces.nsICookie);
     var host = nextCookie.host;
     allCookies[count] =
-      new Cookie(count++, nextCookie.name, nextCookie.value,
-                 nextCookie.isDomain, host,
+      new Cookie(count++, host, nextCookie.name,
+                 nextCookie.path, nextCookie.originAttributes,
+                 nextCookie.value, nextCookie.isDomain,
                  host.charAt(0)=="." ? host.slice(1) : host,
-                 nextCookie.path, nextCookie.originAttributes,
                  nextCookie.isSecure, nextCookie.expires);
   }
 
   // filter, sort and display the table
   cookiesTree.view = cookiesTreeView;
   filter(document.getElementById("filter").value);
 }
 
@@ -289,18 +289,18 @@ function DeleteAllCookies() {
 }
 
 function FinalizeCookieDeletions() {
   gUpdatingBatch = "cookie-changed";
   for (var c=0; c<deletedCookies.length; c++) {
     cookiemanager.remove(deletedCookies[c].host,
                          deletedCookies[c].name,
                          deletedCookies[c].path,
-                         delCookie.originAttributes,
-                         document.getElementById("checkbox").checked);
+                         document.getElementById("checkbox").checked,
+                         delCookie.originAttributes);
   }
   deletedCookies.length = 0;
   gUpdatingBatch = "";
 }
 
 function HandleCookieKeyPress(e) {
   if (e.keyCode == KeyEvent.DOM_VK_DELETE) {
     DeleteCookie();