Closed Bug 549536 Opened 15 years ago Closed 15 years ago

nsPrivateBrowsingService.js should use nsICookieManager2.getCookiesFromHost

Categories

(Firefox :: Private Browsing, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 3.7a4

People

(Reporter: dwitte, Assigned: ehsan.akhgari)

Details

(Keywords: perf)

Attachments

(1 file)

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.
Keywords: perf
Whiteboard: goodfirstbug
Whiteboard: goodfirstbug → [good first bug]
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).
Yes. :)
One more question, should we pass a preceding dot with the domain name to GetCookiesFromHost?
It doesn't matter, but let's say no.
Attached patch Patch (v1)Splinter Review
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
Closed: 15 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.

Attachment

General

Created:
Updated:
Size: