Created attachment 296537 [details] [diff] [review] Simple extension that demonstrates the problem 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.
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
http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/xpcom/build/nsXPComInit.cpp&rev=1.163&mark=585#584 is passing the wrong constant to: http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/xpcom/components/nsCategoryManagerUtils.h&mark=44&rev=1.7#43 it should use: http://bonsai.mozilla.org/cvsblame.cgi?&file=/mozilla/xpcom/build/nsXPCOM.h&mark=492&rev=1.24#485
Created attachment 301897 [details] [diff] [review] Fixed for timeless's nit 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.
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
Last Resolved: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9beta5
You need to log in before you can comment on or make changes to this bug.