xpcom-startup fires before component registration

RESOLVED FIXED in mozilla1.9beta5

Status

()

Core
XPCOM
RESOLVED FIXED
11 years ago
11 years ago

People

(Reporter: Matthew Gertner, Assigned: Matthew Gertner)

Tracking

Trunk
mozilla1.9beta5
Points:
---
Bug Flags:
blocking1.9 -

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Assignee)

Description

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

Updated

11 years ago
Summary: xpcom-startup before component registration → xpcom-startup fires before component registration
(Assignee)

Comment 1

11 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

11 years ago
Flags: blocking1.9?
Keywords: regression

Comment 2

11 years ago
Matthew you want to take this?
(Assignee)

Comment 3

11 years ago
"Want" is a very strong word. :-) I'll take a look and see what I can come up with.
Assignee: nobody → matthew
(Assignee)

Comment 5

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

Updated

11 years ago
Attachment #301897 - Flags: review?(dtownsend) → review?(benjamin)

Comment 6

11 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

11 years ago
(In reply to comment #6)
> (From update of attachment 301897 [details] [diff] [review])
> It's the same value, right?

Yeah.

Updated

11 years ago
Flags: blocking1.9? → blocking1.9+

Updated

11 years ago
Flags: blocking1.9+ → blocking1.9-
(Assignee)

Comment 8

11 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 on attachment 301897 [details] [diff] [review]
Fixed for timeless's nit

a1.9=beltzner
Attachment #301897 - Flags: approval1.9? → approval1.9+
(Assignee)

Updated

11 years ago
Keywords: regression → checkin-needed
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
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.