Closed Bug 156922 Opened 22 years ago Closed 22 years ago

Cookie/Image Manager dialog not being updated

Categories

(Core :: Networking: Cookies, defect, P2)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED
mozilla1.1beta

People

(Reporter: morse, Assigned: morse)

References

Details

Attachments

(1 file, 4 obsolete files)

Now that cookie manager dialog has been changed from modal to non-modal, the 
display needs to be updated dynamically whenever the cookie list changes (e.g., 
when new cookies are accepted).  This applies to its sister dialogs as well, 
such as password manager, image manager, and probably form manager.

Could have sworn there was a bug on this already but I can't find it.  So I'm 
opening this one.
Priority: -- → P2
Target Milestone: --- → mozilla1.1beta
Opening separate bug reports on Password Manager and Form Manager.  This bug is 
just for Cookie/Image manager

See bug 157038 for Password Manager.
Status: NEW → ASSIGNED
Summary: non-modal dialogs not being updated → Cookie/Image Manager dialog not being updated
And see bug 157039 for Form Manager.
*** Bug 125680 has been marked as a duplicate of this bug. ***
Comment on attachment 91053 [details] [diff] [review]
patch for cookie and image manager dialogs

>+close = Close

Is there an extra leading space before Close here?  I can see that the strings
above it needed an extra leading space since they were in a sentence.
Attached patch remove space preceding " Close" (obsolete) — Splinter Review
Attachment #91053 - Attachment is obsolete: true
Preceding patch had a severe performance penalty.

Specifically, each time a cookie was removed from the cookie manager front end 
(dialog), the cookie was removed from the tree being displayed and a call was 
made to the back end to remove the cookie from the cookie list.  The back end in 
turn sent a notify back to the front end to remove the cookie from the tree 
being displayed.

The notify is required if a change not originating from the front-end itself is 
made to the cookie list.  But if the change originated from the front end, the 
notify is redundant.  Worse yet, it was responsible for a big performance hit.  
Specifically, I took a list of 200 cookies and did a remove-all from the front 
end.  This would normally take a couple of seconds to complete.  Instead it was 
taking several minutes.

I'll attach a revised patch shortly that does not send the notify for front-end 
originated changes.
Attached patch Significant performance gain (obsolete) — Splinter Review
Attachment #91172 - Attachment is obsolete: true
Comment on attachment 91396 [details] [diff] [review]
Significant performance gain

>Index: extensions/cookie/nsCookies.cpp
>===================================================================
>RCS file: /cvsroot/mozilla/extensions/cookie/nsCookies.cpp,v
>retrieving revision 1.62
>diff -u -r1.62 nsCookies.cpp
>--- extensions/cookie/nsCookies.cpp	11 Jul 2002 21:58:43 -0000	1.62
>+++ extensions/cookie/nsCookies.cpp	15 Jul 2002 20:27:12 -0000
>@@ -1704,6 +1709,15 @@
>   cookie_changed = PR_FALSE;
>   strm.flush();
>   strm.close();
>+
>+  /* Notify cookie manager dialog to update its display */
>+  if (notify) {
>+    nsCOMPtr<nsIObserverService> os(do_GetService("@mozilla.org/observer-service;1"));
>+    if (os) {
>+      os->NotifyObservers(nsnull, "cookieChanged", NS_ConvertASCIItoUCS2("cookies").get());

os->NotifyObservers(nsnull, "cookieChanged",
NS_LITERAL_STRING("cookies").get());

NS_LITERAL_STRING is slightly more efficient when the compiler supports
unsigned 16-bit wchar_t.

Same applies to the other NotifyObservers call.

sr=jag with that change.
Attachment #91396 - Flags: superreview+
Attachment #91396 - Attachment is obsolete: true
Comment on attachment 91587 [details] [diff] [review]
NS_ConvertASCIItoUCS2 changed to NS_LITERAL_STRING

r=jag (brought forward)
Attachment #91587 - Flags: review+
Comment on attachment 91587 [details] [diff] [review]
NS_ConvertASCIItoUCS2 changed to NS_LITERAL_STRING

oops, I meant sr=jag (brought forward)
Attachment #91587 - Flags: review+ → superreview+
[Patch looks good to me.] Do you want other perf gains in cookie/wallet code?
Attachment #91587 - Attachment is obsolete: true
Comment on attachment 91698 [details] [diff] [review]
last patch had some stuff in it for another bug by accident

sr=jag (brought forward)
Attachment #91698 - Flags: superreview+
*** Bug 131602 has been marked as a duplicate of this bug. ***
Comment on attachment 91698 [details] [diff] [review]
last patch had some stuff in it for another bug by accident

r=sgehani
Attachment #91698 - Flags: review+
Keywords: nsbeta1
Checked in on trunk.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
*** Bug 152297 has been marked as a duplicate of this bug. ***
verified - cookie display updated dynamically now - 09/16/08 trunk - winNT4,
linux rh6, mac osX
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: