Hi,

I noticed some restrictions to Observer registration that I do not
understand. Maybe I made some mistakes, may be not. In the latter case
I would be happy to get some explanations about why this is so. (I am
using XULRunner)

One can register Observers for various topics using the method
AddCategoryEntry of the CategoryManager. Among them are

xpcom-startup
xpcom-shutdown
app-startup
quit-application.

(1) One can register Observers for the topic xpcom-startup in the
component factories method registerSelf. The Observers are notified.
It does not matter, whether the respective components are implemented
in C++ or JavaScript.

(2) One can register Observers for the topic app-startup in the
component factories method registerSelf. The Observers are only
notified, if the respective components are implemented in C++. They
are not notified, if the components are implemented in JavaScript.

(3) One can register Observers for the topics xpcom-shutdown and quit-
application during notification for the topic xpcom-startup.
Notification does occur.

(4) One can try to register Observers for the topics xpcom-shutdown
and quit-application during notification for the topic app-startup.
This does not work, notification does not occur. (rv of
AddCategoryEntry signals an error here.)

(5) One can try to register Observers for the topics xpcom-shutdown
and quit-application in the component factories method registerSelf.
One does not get an error (rv is 0), but notification does not occur
nonetheless.

In the documentation I browsed, I didn't find any explanation for this
behaviour. I didn't find any rule either about where to register
Observers for which topic. The same questions apply to all the other
topics one can register Observers for.

Any explanation would be very welcome. Thanks in advance,

- Andreas.

_______________________________________________
dev-tech-xpcom mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-xpcom

Reply via email to