Closed Bug 199108 Opened 22 years ago Closed 22 years ago

Changes to cookie prefs need restart to take effect

Categories

(Core :: Networking: Cookies, defect)

x86
Windows 98
defect
Not set
major

Tracking

()

RESOLVED FIXED

People

(Reporter: ch.ey, Assigned: dwitte)

Details

Attachments

(1 file, 1 obsolete file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-DE; rv:1.4a) Gecko/2003032416 Build Identifier: Mozilla/5.0 (Windows; U; Windows 98; de-DE; rv:1.4a) Gecko/2003032416 After making changes to cookie behaviour (Enable cookies, disable cookies, ask before storing a.s.o) in ui I need to leave the browser and start it again to take the changes effect. E.g. changing from "Enable all cookies" to "Disable cookies" and leaving prefs via ok changes nothing: cookies will be set further on. Reproducible: Always Steps to Reproduce:
Also occurs in current CVS build.
OS: Windows 98 → All
->me, confirming AddObserver is failing in nsCookiePrefObserver's ctor, because the latter isn't an xpcom object and weakref can't QI to it. two options: a) merge nsCookiePrefObserver into the cookieservice (which involves some messy hackery, since we need to pass |this| into nsCookies.cpp for now). this would've been all taken care of nicely when we merge them all together, but that's not happening for 1.4a, so this is a stopgap measure. b) make it an xpcom interface so weakrefs work. i've taken the former approach, fix is done. i'll run it by darin then post for r/sr.
Assignee: darin → dwitte
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: All → Windows 98
darin: sorry for the size of the patch :/ it's mostly code movement, the only interesting bit is the ctor of nsCookieService, where some |if| conditions changed. the rest is just code movement and |this| hackery.
Attached patch better patchSplinter Review
ok, this one follows darin's suggestion and is much cleaner. all we had to do was call NS_ADDREF and NS_RELEASE properly, to avoid crashes when the observer service tries to deal with weak refs.
Attachment #118482 - Attachment is obsolete: true
Comment on attachment 118498 [details] [diff] [review] better patch yup, looks good. sr=darin
Attachment #118498 - Flags: superreview+
Attachment #118498 - Flags: review?(alecf)
Comment on attachment 118498 [details] [diff] [review] better patch If I understand correctly, nsCookiePrefObserver::Init was already declared in the header, but there was not yet any implementation? Since you are not adding a header entry for that new function. You are removing checks for mPrefBranch. I have no knowledge whether it is safe to remove those checks, and you are not explaining it in your comments. If you are confident this is ok, r=kaie
Attachment #118498 - Flags: review?(alecf) → review+
Oh, now I see, it's safe to no longer check mPrefBranch, since the Init function won't succeed if mPrefBranch could not get created. So the patch makes sense.
thanks kaie! to address your two concerns: 1) yeah, the prototypes were there already; I forgot to clean them up at some earlier stage, so I removed the cruft there. 2) sorry for not commenting about the checks... they're not necessary, since nsCookiePrefObserver::Init will fail if it can't get mPrefBranch, so there's not much point in checking it later on in life. and we still want to read the prefs if ->AddObserver failed, so I moved that outside the |if|. great, thanks again, ready for checkin!
fixed-on-trunk
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: