Closed Bug 46779 Opened 25 years ago Closed 24 years ago

clean up nsIServiceManager

Categories

(Core :: XPCOM, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla1.0

People

(Reporter: warrensomebody, Assigned: dougt)

References

Details

(Keywords: arch, Whiteboard: [nsbeta3-])

- nsIServiceManager - Can't change because of JRE 1.3 - Ray to consider nsIServiceManager2 for methods that include a version parameter - Remove nsServiceManager to a separate. - nsIShutdownListener should move to a separate file or die (dp). - InitXPCOM and ShutdownXPCOM need fixed ordinals, probably in a new file. - NS_NewServiceManager should be removed. - ray to own.
Keywords: arch, nsbeta3
I decided we do not need a version parameter. It was really just an optimization that I am now confident can be done in other ways.
Status: NEW → ASSIGNED
Target Milestone: --- → M18
Whiteboard: [nsbeta3+]
Let me list issues with this API and look for clarification. First, I found a note that we cannot change the API. That seems to contradict much of an API cleanup whatsoever. Things that may be doable anyway: 1. Is there a reason this interface is not declared in an idl file? 2. We need to move nsIShutdownListener to a new file. Shutdown listeners are only used in one place (deallocating string case conversion tables) in the code that I can find, that could probably be solved via a virtual destructor. But it seems like a good function to have when trying to replace static destructors with something which shuts down when the service it depends upon shuts down. Do we need to keep it? 3. Remove NS_NewServiceManager. 4. Make fixed ordinals for a number of XPCOM static calls including InitXPCOM, a method to get the global service manager, etc.
Additional things that I would do if I could change the API: 1. We have two versions of ReleaseService, which appear to be obsolete. 2. Eliminate the overloading so we could use IDL. 3. Try and understand the purpose, if any, for RegisterService.
The idea behind RegisterService was that if you had an existing object (not one implicitly create through the act of getting a service), you could register that object as a service. Yeah, it's not strictly necessary since you could always invent a dummy factory to do the same thing. In general I agree with your proposed changes, but the issue was that the OJI plugin might be using the existing service manager interface. Cc'ing Stanley for his input on this. Stanley: I'm guessing that you're probably only calling GetService without the shutdown listener, right? Ray: Maybe you can rework things here while keeping GetService alive for OJI.
Oops, really cc'ing Stanley this time.
Not holding PR3 for this; marking nsbeta3-.
Whiteboard: [nsbeta3+] → [nsbeta3-]
Assigning rest of xpcom stuff to myself (from Ray).
Assignee: rayw → warren
Status: ASSIGNED → NEW
Target Milestone: M18 → mozilla1.0
QA Contact: leger → kandrot
reasigning warren bugs to default component owners.
Assignee: warren → kandrot
QA Contact: kandrot → scc
Target Milestone: mozilla1.0 → ---
reassign all kandrot xpcom bug.
Assignee: kandrot → dougt
Blocks: 70229
Blocks: 98278
this interface should be idl'ified.
Target Milestone: --- → mozilla1.0
Blocks: 99147
These changes have been made and checked in this evening.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.