Well, actually %SUBJ% statement is not really true, I think I should share some ideas on where we all are. I think the info below is quite important for people who are just going to embed Gecko and for people who are developing Mozilla (probably I'll submit all the items below as bugs too)
1) Old profile management that was available in Mozilla 1.7.x, is not available anymore in 1.8.x and by default Makefiles are run with MOZ_SINGLE_PROFILE=1 defined, leaving us with those pretty ugly profdirserviceprovider_s and profdirserviceprovidersa_s libraries (why ugly? see below). Because most important components including necko, necko etc are all profile-events-driven, profile service is quite a crusial component and no embedding stuff can be made without it. 2) currently profdirserviceprovider is quite a broken stuff and below the reasons why I think so: 2a) It has no interfaces (oh well it has nsISupports but nothing else) and all calls to its Register() or Shutdown() methods are done against C++ class, not interface. What's about reference counting and other really good things offered by XPCOM? By working with C++ class you simply bypass them. That's UGLY thing #1. 2b) profdirserviceprovider depends on functions in NSPR library. Certaonly I have nothing against knowing current thread or working with synchronization mutexes, but on the other hand, it means that the following requirement for embedders is never doable:quote: "Embedders using the standalone glue typically also need to avoid linking against NSPR as well". (see http://developer.mozilla.org/en/docs/XPCOM_Glue). So your embedding application should avoid what can not be avoided. This is (probably) UGLY thing #2. (either it is a mislieading recommendation or poorly designed profdirserviceprovider). 2c) profdirserviceprovider has no clear way for its shutdown. Although it has public Shutdown() method, it's not clear when to call it. If I do not call it at all, mainthread clamins that there are remained references to when XPCOM (with its glue) is shutted down and profdirserviceprovider as you might guess remains in memory (causing leaks, of course). If I call it immediately before NS_TermEmbedding(), it will trigger assertion "nsNSSComponent relies on profile manager to wait for synchronous shutdown of all network activity" if network was used. So it looks like current profdirserviceprovider does not issue PROFILE_CHANGE_NET_TEARDOWN_TOPIC when needed. Needless to say that much more nad things happen if Shutdown() called much before NS_TermEmbedding(). That's UGLY thing #3. 2d) in Register() method, profdirserviceprovider registers itself in NS_DIRECTORY_SERVICE (see directoryService->RegisterProvider), but does not unregister itself during Shutdown() and it causes leaks too. Leaks are always UGLY things. 3) Nothing is said that FireFox 1.5 distro (at least under Windows) can't be reused by any embedding application, but that's it because there are no components available as standalone dlls, almost all are linked statically into firefox.exe. Nothing bad, but should be noted somehow on the web. BTW people asked about it on this group but no replies. Nevertheless, I should emphasize that although there are more or less ugly glitches, I do believe Mozilla and Gecko in particular are the GREATEST things and I'm wishing them to get even better. (to be continued) :) -dmitry. _______________________________________________ dev-embedding mailing list [email protected] https://lists.mozilla.org/listinfo/dev-embedding
