Bug 1594000 - correct iteration conversion of cookies.enumerator. r=khushil
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Thu, 06 Feb 2020 13:37:35 +0200
changeset 37210 b7cf1a257c23df9eeeb720694215b7bbcc30886c
parent 37209 010e3872fa134f50cde10c951741e8a5e6fed842
child 37211 33e611ec360536dec3aff23b0cd998019ffbef39
push id2552
push userclokep@gmail.com
push dateMon, 10 Feb 2020 21:24:16 +0000
treeherdercomm-beta@f95a6f4408a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhushil
bugs1594000
Bug 1594000 - correct iteration conversion of cookies.enumerator. r=khushil
mail/base/content/sanitize.js
mail/components/preferences/cookies.js
--- a/mail/base/content/sanitize.js
+++ b/mail/base/content/sanitize.js
@@ -92,17 +92,17 @@ Sanitizer.prototype = {
         return true;
       },
     },
 
     cookies: {
       clear() {
         if (this.range) {
           // Iterate through the cookies and delete any created after our cutoff.
-          for (let cookie of Services.cookies.enumerator) {
+          for (let cookie of Services.cookies.cookies) {
             if (cookie.creationTime > this.range[0]) {
               // This cookie was created after our cutoff, clear it
               Services.cookies.remove(
                 cookie.host,
                 cookie.name,
                 cookie.path,
                 false,
                 cookie.originAttributes
--- a/mail/components/preferences/cookies.js
+++ b/mail/components/preferences/cookies.js
@@ -525,23 +525,19 @@ var gCookiesWindow = {
     };
     return c;
   },
 
   _loadCookies() {
     var hostCount = { value: 0 };
     this._hosts = {};
     this._hostOrder = [];
-    for (let cookie of Services.cookies.enumerator) {
-      if (cookie && cookie instanceof Ci.nsICookie) {
-        var strippedHost = this._makeStrippedHost(cookie.host);
-        this._addCookie(strippedHost, cookie, hostCount);
-      } else {
-        break;
-      }
+    for (let cookie of Services.cookies.cookies) {
+      var strippedHost = this._makeStrippedHost(cookie.host);
+      this._addCookie(strippedHost, cookie, hostCount);
     }
     this._view._rowCount = hostCount.value;
   },
 
   formatExpiresString(aExpires) {
     if (aExpires) {
       var date = new Date(1000 * aExpires);
       const dateTimeFormatter = new Services.intl.DateTimeFormat(undefined, {