Bug 269799 - Clearing cookies using either Clear Private Data or the Clear All button in the privacy prefpane doesn't update the Cookies Manager until it's reopened. r=mconnor.
authormozilla.mano@sent.com
Tue, 02 Oct 2007 20:35:27 -0700
changeset 6577 e0a9035a419cd258d09c305dce1317f80df2eb07
parent 6576 03888e33258256e917ed8e2e28aae25b3cc91814
child 6578 cf65f1235cff9231c6450b1f71a2c4d10543892e
push idunknown
push userunknown
push dateunknown
reviewersmconnor
bugs269799
milestone1.9a9pre
Bug 269799 - Clearing cookies using either Clear Private Data or the Clear All button in the privacy prefpane doesn't update the Cookies Manager until it's reopened. r=mconnor.
browser/modules/Sanitizer.jsm
--- a/browser/modules/Sanitizer.jsm
+++ b/browser/modules/Sanitizer.jsm
@@ -150,26 +150,17 @@ Sanitizer.prototype = {
       }
     },
     
     cookies: {
       clear: function ()
       {
         var cookieMgr = Components.classes["@mozilla.org/cookiemanager;1"]
                                   .getService(Components.interfaces.nsICookieManager);
-        var e = cookieMgr.enumerator;
-        var cookies = [];
-        var cookie;
-        while (e.hasMoreElements()) {
-          cookie = e.getNext().QueryInterface(Components.interfaces.nsICookie);
-          cookies.push(cookie);
-        }
-
-        for (var i = 0; i < cookies.length; ++i)
-          cookieMgr.remove(cookies[i].host, cookies[i].name, cookies[i].path, false);
+        cookieMgr.removeAll();
       },
       
       get canClear()
       {
         var cookieMgr = Components.classes["@mozilla.org/cookiemanager;1"]
                                   .getService(Components.interfaces.nsICookieManager);
         return cookieMgr.enumerator.hasMoreElements();
       }