Closed
Bug 529701
Opened 15 years ago
Closed 15 years ago
nsCategoryCache could add a category observer twice in some situation.
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
status1.9.2 | --- | beta5-fixed |
People
(Reporter: mak, Assigned: Biesinger)
References
Details
Attachments
(1 file)
1.08 KB,
patch
|
benjamin
:
review+
beltzner
:
approval1.9.2+
|
Details | Diff | Splinter Review |
I'm still trying to completely understand what happens here, but this is what i can see so far. I have a category called "history-observers". i have a component that is registered as an "history-observers" entry through XPCOMUtils. This component also implements nsIObserver. History to notify changes enumerates observers through a categoryCache. I have a test that executes some history stuff, my category observer is correctly enumerated and notified once. then i Cc[my_component].getService(Ci.nsIObserver).notify(null, some_custom_notification, null); at this point i see that nsCategoryCache receives an entry added notification from the category manager, the entry is then added again to the hash, History enumerates entries and notifies my component TWICE. Doing some debugging i've seen that when nsCategoryCache starts it adds all entries that have been loaded so far (they come from compreg.dat at this point), but then when i run the above test it adds the entry again. I'm trying to argue if i'm doing something wrong or there's a problem here.
Reporter | ||
Comment 1•15 years ago
|
||
actually, looks like i see the double addition even without the getService thing, i just execute a method that will cause a notification to be fired, the notification instantiates the component, that is registered again. this is my test http://mozilla.pastebin.com/m50a35910 i call removeAllPages, that will notify onClearHistory to "history-observers", expiration components should be instantiated at this point since it's in the category cache, and it will fire "places-expiration-finished". Running this test i see that the entry is added twice, any history change from now on is notified twice to my component.
Assignee | ||
Updated•15 years ago
|
Assignee: nobody → cbiesinger
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•15 years ago
|
||
Attachment #413325 -
Flags: review?
Assignee | ||
Updated•15 years ago
|
Attachment #413325 -
Flags: review? → review?(benjamin)
Updated•15 years ago
|
Attachment #413325 -
Flags: review?(benjamin) → review+
Comment 3•15 years ago
|
||
I'd like a test as well... I think it can be done with xpcshell
Flags: in-testsuite?
Comment 4•15 years ago
|
||
Urgh... if the category cache is exposed to xpcshell at all.
Assignee | ||
Comment 5•15 years ago
|
||
Nope, it's a C++-only API.
Comment 6•15 years ago
|
||
Comment on attachment 413325 [details] [diff] [review] patch a192=beltzner mostly because I <3 biesi so much.
Attachment #413325 -
Flags: approval1.9.2+
Assignee | ||
Comment 7•15 years ago
|
||
marking checkin-needed in case anybody gets around to do it tonight, otherwise I'll do it tomorrow
Keywords: checkin-needed
Comment 8•15 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/231a65a2d273 http://hg.mozilla.org/releases/mozilla-1.9.2/rev/1114b55a5b52
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
status1.9.2:
--- → final-fixed
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•