If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

xpcom-autoregistration notification never fires

RESOLVED FIXED in mozilla0.9.6

Status

()

Core
XPCOM
RESOLVED FIXED
16 years ago
16 years ago

People

(Reporter: Robert Ginda, Assigned: dougt)

Tracking

Trunk
mozilla0.9.6
x86
All
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: ready to go)

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

16 years ago
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.
(Reporter)

Comment 1

16 years ago
Created attachment 53047 [details] [diff] [review]
proposed patch
(Assignee)

Comment 2

16 years ago
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 ;-)
(Reporter)

Comment 3

16 years ago
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.
(Reporter)

Comment 4

16 years ago
Here comes a new patch, fire at will.
(Reporter)

Comment 5

16 years ago
Created attachment 53184 [details] [diff] [review]
new patch, move appstartnotifier to xpcom/components, and give it a better name
(Reporter)

Comment 6

16 years ago
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.)
(Assignee)

Comment 7

16 years ago
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.  
(Reporter)

Comment 8

16 years ago
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.
(Reporter)

Updated

16 years ago
Attachment #53047 - Attachment is obsolete: true
(Reporter)

Updated

16 years ago
Attachment #53184 - Attachment is obsolete: true
(Reporter)

Comment 9

16 years ago
Created attachment 55773 [details] [diff] [review]
NS_CreateServicesFromCategory, who knew?
(Reporter)

Comment 10

16 years ago
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.
(Assignee)

Comment 11

16 years ago
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+
(Assignee)

Updated

16 years ago
Whiteboard: ready to go
Target Milestone: --- → mozilla0.9.6
(Reporter)

Comment 13

16 years ago
I checked this in a few days ago, forgot to mark as such.
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.