Closed
Bug 411916
Opened 17 years ago
Closed 17 years ago
xpcom-startup fires before component registration
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla1.9beta5
People
(Reporter: matthew.gertner, Assigned: matthew.gertner)
Details
Attachments
(2 files)
9.33 KB,
patch
|
Details | Diff | Splinter Review | |
1.23 KB,
patch
|
benjamin
:
review+
beltzner
:
approval1.9+
|
Details | Diff | Splinter Review |
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.
Assignee | ||
Updated•17 years ago
|
Summary: xpcom-startup before component registration → xpcom-startup fires before component registration
Assignee | ||
Comment 1•17 years ago
|
||
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.
Updated•17 years ago
|
Flags: blocking1.9?
Keywords: regression
Comment 2•17 years ago
|
||
Matthew you want to take this?
Assignee | ||
Comment 3•17 years ago
|
||
"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
Assignee | ||
Comment 5•17 years ago
|
||
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)
Assignee | ||
Updated•17 years ago
|
Attachment #301897 -
Flags: review?(dtownsend) → review?(benjamin)
Comment 6•17 years ago
|
||
Comment on attachment 301897 [details] [diff] [review]
Fixed for timeless's nit
It's the same value, right?
Attachment #301897 -
Flags: review?(benjamin) → review+
Assignee | ||
Comment 7•17 years ago
|
||
(In reply to comment #6)
> (From update of attachment 301897 [details] [diff] [review])
> It's the same value, right?
Yeah.
Updated•17 years ago
|
Flags: blocking1.9? → blocking1.9+
Updated•17 years ago
|
Flags: blocking1.9+ → blocking1.9-
Assignee | ||
Comment 8•17 years ago
|
||
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 9•17 years ago
|
||
Comment on attachment 301897 [details] [diff] [review]
Fixed for timeless's nit
a1.9=beltzner
Attachment #301897 -
Flags: approval1.9? → approval1.9+
Assignee | ||
Updated•17 years ago
|
Keywords: regression → checkin-needed
Comment 10•17 years ago
|
||
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.
Description
•