Closed Bug 148213 Opened 24 years ago Closed 24 years ago

Add COOKIE_Write() to nsCookieManager::RemoveAll()

Categories

(Core :: Networking: Cookies, defect)

PowerPC
macOS
defect
Not set
major

Tracking

()

VERIFIED FIXED
mozilla1.0.1

People

(Reporter: mikepinkerton, Assigned: morse)

Details

(Keywords: topembed+, Whiteboard: [needs a=, drivers emailed 6/3])

Attachments

(1 file)

As steve and I discussed in email, nsCookieManager::RemoveAll() needs to call COOKIE_Write in order to flush the empty cookie list to disk. We need this for the "clear all cookies" button in chimera. Sure, we could do what seamonkey does and enumerate all the cookies and delete them one by one, but why not use code that's already there? Steve: I can take this bug and get it on the trunk and on the branch if you don't have time.
Blocks: 147975
we need this for chimera, it is topembed. cc'ing beard for an SR
Keywords: topembed+
Target Milestone: --- → mozilla1.0.1
Comment on attachment 85711 [details] [diff] [review] Flushing to disk after removing all cookies tested, this works. thanks steve! beard, can you sr? r=pink
Attachment #85711 - Flags: review+
nominating nsbeta1 per comment 2.
Keywords: nsbeta1
Status: NEW → ASSIGNED
Comment on attachment 85711 [details] [diff] [review] Flushing to disk after removing all cookies sr=beard, this will also have to be checked into CHIMERA_M1_0_BRANCH.
Attachment #85711 - Flags: superreview+
Checked in on trunk.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
requesting branch permission
Whiteboard: [needs a=, drivers emailed 6/3]
Comment on attachment 85711 [details] [diff] [review] Flushing to disk after removing all cookies a=chofmann for 1.0.1
Attachment #85711 - Flags: approval+
this patch is doing more than writing to disk. what's the other code supposed to be doing?
The other code makes sure we write to disk even if the cookie list is empty. As currently coded, there is a null check and no write occurs. Problem is that if you delete all cookies you would wind up with an empty list and nothing gets written, leaving the old (non-empty) cookie file on disk.
this needs the browser triage teams approval before being approved by the adt.
tever - pls verify the fix on the trunk, and check around for possible regressions. thanks!
According to Steve, this can't really be checked since it is not used in the product. Or at least without adding additional test code. I did check with LXR that the fix is checked in and based on comment #3 I think this can be marked verified.
Status: RESOLVED → VERIFIED
adding adt1.0.1+.
Keywords: adt1.0.1adt1.0.1+
Not needed for Mach V, but needed for ProjectX which is using the MOZILLA_1_0_BRANCH per saari.
Keywords: nsbeta1nsbeta1+
Please check this in asap and change the mozilla1.0.1+ keyword to fixed1.0.1
Will check in as soon as drivers gives their reapproval (previous approval has expired).
doh, i'm not cc'd so i missed the adt+. i'm gonna land this on the branch today.
But the driver's approval in this expired a while ago. I re-rerequested drivers approval yesterday.
landed on branch
Keywords: adt1.0.1+fixed1.0.1
Keywords: mozilla1.0.1+
No longer blocks: 147975
adding verified1.0.1
Keywords: verified1.0.1
pinkerton: Was the important part of this patch the fact that the cookies were not written out immediately upon doing the remove-all, or that they never got written out even when the browser was shut down because of the error with not writing if the cookie list is empty? If the latter, then would it be ok to delay all cookie writing until the browser closes? I'm asking because of bug 158216 (needed for Chimera) in which I'm considering never writing out the cookie file until the browser closes.
my $.02 - write the file when the user edits the pref and on browser exit. If you only write on exit any crash loses the changes made in the edit.
it should clear and write immediately, because then if the browser crashes before quitting, all your cookies would be back and you'd never know why.
I'm not sure I undertand Dagley's comment: > write the file when the user edits the pref What pref are you talking about? Are your referring to deletions that the user specifically makes, such as when using the cookie-manager dialog? Yes, I could easily keep the saving in that case but not in the case when new cookies arrive, as the latter is the cause of the performance hit mentioned in bug 158216. If your concern is with browser crashes, I thought we didn't crash any more. ;-) In any case, we don't write out other items (e.g., prefs) whenever they change, so why do we need to single out cookies?
we do write out prefs to disk when you close the prefs window. i think we're all in agreement here: writing cookies as they come in while browsing bad, writing cookies when the user makes explicit changes they expect saved (editing, deleting) good. ;)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: