Closed Bug 104168 Opened 23 years ago Closed 23 years ago

xpcom-autoregistration notification never fires

Categories

(Core :: XPCOM, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla0.9.6

People

(Reporter: rginda, Assigned: dougt)

Details

(Whiteboard: ready to go)

Attachments

(1 file, 2 obsolete files)

I need to register the js debugger as an observer of the xpcom-autoregistration
topic so that I can start keeping track of scripts right away.  The problem is
twofold.  First, the component manager only enters the notification code if it
fails to create the notifier service (doh!), and second, the notification list
comes from a table built at runtime.  We havn't provided any hooks proir to this
point in the app, so there is no way for a component to add itself to the list.

The upcoming patch fixes what I assume was a NS_FAILED vs NS_SUCCEDED mixup, and
uses the nsAppStartNotifier (which is poorly named, it's actually a generic
"enumerate some category containing nsIObservers, and tell them something"
component) to take care of the notifications.  This allows clients to register
as an "xpcom-autoregistration" observer via the category manager.

This does introduce an asymmetrical relationship between the
"xpcom-autoregistration" topic, which respects categories, and "xpcom-shutdown
" which still uses a notify list built at runtime... but don't let that bother you.
Attached patch proposed patch (obsolete) — Splinter Review
hey, your lucky it fires at all! :-) :-)

I do not like the patch.  It creates a depend on embedding.  I will take a look
at this more tomorrow.  been up since 4am and I missed a meal or two.  damn
coworker bought 200 bucks worth of candy ;-)
Actually, the point of this bug is that it *doesn't* fire at all, but I'll let
it slip because you're tired ;)

I was afraid someone would complain about the new REQUIRES, so I am prepared to
offer a solution.  How's about we rename nsAppStartNotifier to
nsCategoryNotifier, and move it to xpcom/components.  No one has a new depend,
and the component gets the name it deserves.
Here comes a new patch, fire at will.
Alternatley, we could add a notifyCategory to the category manager, and avoid
the new component and interface.  That is if the interface isn't frozen (I don't
see any comment about it.)
robert, the component manager is going to get an overhaul in the next week or
two.  I would like to roll this into the new interfaces.  I will keep you posted.  
Can I get a status check on this one?

The debugger code would make use of this patch has just been checked in, and
this is now the only bug blocking the ability to debug javascript components
that have changed since the last run.
Attachment #53047 - Attachment is obsolete: true
Attachment #53184 - Attachment is obsolete: true
thanks to dougt for pointing this out.  The latest patch is *much* simpler, and
does the same thing.

I'll file a seperate bug to remove nsAppStartupNotifier.
Comment on attachment 55773 [details] [diff] [review]
NS_CreateServicesFromCategory, who knew?

looks fine. We should eventually rename this utility function.
Attachment #55773 - Flags: review+
Comment on attachment 55773 [details] [diff] [review]
NS_CreateServicesFromCategory, who knew?

Yeah, the NS_CreateServicesFromCategory name is slightly off, isn't it?

/be
Attachment #55773 - Flags: superreview+
Whiteboard: ready to go
Target Milestone: --- → mozilla0.9.6
I checked this in a few days ago, forgot to mark as such.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: