Closed Bug 154458 Opened 22 years ago Closed 12 years ago

Generic module macros should do category registration too

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED INCOMPLETE
Future

People

(Reporter: dveditz, Unassigned)

References

Details

(Keywords: helpwanted)

The registration (and unregistration) of categories is the single biggest reason
people have to write custom module registration routines instead of relying
completely on the generic module macros. There should be a form of these macros
which accepts a structure that will generically register/unregister category
entries.

I keep bugging you for this but couldn't find a bug on it, so here it is.
Categories are not frozen.  This bug should not be fixed until we have a frozen
component set interface.
If categories change we'll have to change lots and lots of code. If we convert
people over to generic macros and then change the interface we'll only have to
change the macro -- unless you change the basic idea of three strings in which
case you'd have to re-write all the components anyway.
dan.   Currently the generic module code does not use *anything* that isn't
frozen.  What you are proposing will will break this.  Or maybe you have some
way to register components without using the nsICategoryManager?  Maybe special
contract id meanings?

We can easily document which macros are frozen and still offer a non-frozen
helper macro since we use categories so heavily. For components that use
categories (a lot of them) they aren't going to care if they're broken because
their macro doesn't work or because their hand-coded category code is broken.
Either way as long as they know they're on unsafe ground wouldn't it be nice to
make it easier on folks?

... just noticed xpcom/glue/standalone -- is that what you're worried about
breaking? If so fair enough, push the bug out. I still think you could define
the a constructor/destructor as a macro which wouldn't introduce any bad binary
links except for the people who explicitly chose to use this.

You worked categories into your new registry format, right? Is still part of the
crucial xpcom/components code, so it's clearly important and not going anywhere,
even if not frozen.
When 154047 if fixed, I will fix this.  
Depends on: 154047
I think that this is a great idea, but looking over my things-to-do, this
doesn't have the highest priority.  Today, it really isn't that hard to plug
into the NSRegisterSelfProcPtr and register a category there.  There are plenty
of examples of how to do this too.  But I do agree, it would be nice to extend
nsModuleComponentInfo to support categories.
Keywords: helpwanted
Target Milestone: --- → Future
Assignee: dougt → nobody
QA Contact: scc → xpcom
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.