Closed Bug 411916 Opened 17 years ago Closed 17 years ago

xpcom-startup fires before component registration

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9beta5

People

(Reporter: matthew.gertner, Assigned: matthew.gertner)

Details

Attachments

(2 files)

I'm registering a component that should do stuff on xpcom-startup, so I add an entry to the category manager in the component's registration method. But it looks like this method is being called after xpcom-startup. I believe that xpcom-startup was fired after component registration in Firefox 2.
Summary: xpcom-startup before component registration → xpcom-startup fires before component registration
Note that http://mxr.mozilla.org/seamonkey/source/netwerk/test/TestServ.js doesn't seem to get the notification either if you copy it to Firefox's component directory. If you change the topic to app-startup, however, it does get the notification.
Flags: blocking1.9?
Keywords: regression
Matthew you want to take this?
"Want" is a very strong word. :-) I'll take a look and see what I can come up with.
Assignee: nobody → matthew
I got this one totally wrong. The problem, apparently, is that app-startup expects the "service," prefix whereas xpcom-startup does not (it assumes the component is a service). I couldn't find any official documentation for the "service," prefix, but if anyone knows where it is located I can update it accordingly since this doesn't appear to be common knowledge. I get the impression that "service," is only used for app-startup. I guess I misdiagnosed this since I didn't realize that I had to delete compreg.dat and reregister the components when testing. I've tested both my extension and JS component for network with 1.8, the nightly from when I filed the bug and the latest trunk, and all work as expected when the correct contract ID (i.e. sans prefix) is supplied. It might be worth considering getting rid of xpcom-startup at some point since no one seems to think it should be used and it is kind of confusing for it to have different behavior from the same usage of app-startup. Just so this isn't a total loss, I'm attaching a fix to the issue timeless reported in https://bugzilla.mozilla.org/show_bug.cgi?id=411916#c4.
Attachment #301897 - Flags: review?(dtownsend)
Attachment #301897 - Flags: review?(dtownsend) → review?(benjamin)
Comment on attachment 301897 [details] [diff] [review] Fixed for timeless's nit It's the same value, right?
Attachment #301897 - Flags: review?(benjamin) → review+
(In reply to comment #6) > (From update of attachment 301897 [details] [diff] [review]) > It's the same value, right? Yeah.
Flags: blocking1.9? → blocking1.9+
Flags: blocking1.9+ → blocking1.9-
Comment on attachment 301897 [details] [diff] [review] Fixed for timeless's nit This shouldn't entail any risk since the constants (old and new) have the same value.
Attachment #301897 - Flags: approval1.9?
Comment on attachment 301897 [details] [diff] [review] Fixed for timeless's nit a1.9=beltzner
Attachment #301897 - Flags: approval1.9? → approval1.9+
Checking in xpcom/build/nsXPComInit.cpp; /cvsroot/mozilla/xpcom/build/nsXPComInit.cpp,v <-- nsXPComInit.cpp new revision: 1.261; previous revision: 1.260 done
Status: NEW → RESOLVED
Closed: 17 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9beta5
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: