Bug 1541792 - Replace linker magic with manual component registration. r=froydnj

Before bug 938437, we had a rather large and error-prone
nsStaticXULComponents.cpp used to register all modules. That was
replaced with clever use of the linker, which allowed to avoid the mess
that maintaining that file was.

Fast forward to now, where after bug 1524687 and other work that
preceded it, we have a much smaller number of remaining static xpcom
components, registered via this linker hack, and don't expect to add
any new ones. The list should eventually go down to zero.

Within that context, it seems to be the right time to get rid of the
magic, and with it the problems it causes on its own.

Some of those components could probably be trivially be converted to
static registration via .conf files, but I didn't want to deal with the
possible need to increase the number of dummy modules in XPCOMInit.cpp.
They can still be converted as a followup.

Differential Revision: https://phabricator.services.mozilla.com/D26076
This commit is contained in:
Mike Hommey committed 2019-04-05 02:30:56 +00:00
1 parent 8619456370
commit 1b87806fdc
29 files changed
+108 -307

No files matched your search

+7 -9
View File
@@ -31,12 +31,10 @@ static nsresult Initialize() {
static void Shutdown() { nsHTMLTags::ReleaseTable(); }
static mozilla::Module kParserModule = {mozilla::Module::kVersion,
kParserCIDs,
nullptr,
nullptr,
nullptr,
Initialize,
Shutdown};
NSMODULE_DEFN(nsParserModule) = &kParserModule;
extern const mozilla::Module kParserModule = {mozilla::Module::kVersion,
kParserCIDs,
nullptr,
nullptr,
nullptr,
Initialize,
Shutdown};