http://mxr.mozilla.org/mozilla-central/source/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js#583 Using nsICookieManager.enumerator means iterating over all cookies, of which there will be thousands. This is slow -- much better to just do cm.getCookiesFromHost(aDomain); and then the guard on 'hasRootDomain' isn't required, either.
So, does GetCookiesFromHost expose the exact same behavior as what we achieve using hasRootDomain? (i.e., we want clearing cookies for mozilla.org also clear all cookies for xyz.mozilla.org, abc.xyz.mozilla.org, etc. as well).
One more question, should we pass a preceding dot with the domain name to GetCookiesFromHost?
It doesn't matter, but let's say no.
Created attachment 432683 [details] [diff] [review] Patch (v1)
Assignee: nobody → ehsan.akhgari
Status: NEW → ASSIGNED
Attachment #432683 - Flags: review?(vladimir)
This _was_ a good first bug, but since it would potentially lead to perf wins, I decided to pick it up myself. :-)
Whiteboard: [good first bug]
Comment on attachment 432683 [details] [diff] [review] Patch (v1) r=dwitte -- I assume that's OK, given that I wrote the API. :)
Attachment #432683 - Flags: review?(vladimir) → review+
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 3.7a4
Version: unspecified → Trunk
You need to log in before you can comment on or make changes to this bug.