Darin Fisher & Ben Goodger, 05/12/2004
To provide version-safe XPCOM startup and component registration with a simplified Profile system for Firefox 1.0.
Changes should be as minimal as possible. Firefox 0.9 needs to ship "feature complete" and operational at the end of the first week of June, in order to meet a 1.0 release date of mid-September 2004. If we miss mid-September, there will be irreconcilable marketing and PR consequences that I cannot discuss, and we will not be able to ship until mid November.
Years of experience with this codebase has shown that big patches have a much higher incidence of follow-on problems because the set of problems that they contain and the rate at which they can be identified and resolved is not purely linear. While one might assume x errors per y lines of code, when one checks in a series of smaller patches those errors are considerably easier to identify if they cause problems, and the patches can be easily identified as the cause of problems, larger patches mean that a larger set of problems need to be isolated at the same time within a larger set of code.
Darin and I discussed how profile and XPCOM startup might work with an Extension manager based only on what is logically required.
We discovered three core areas where code is needed:
Other elements, while idealistically desirable (such as a split appshell) are better suited for testing and development on the trunk until the 1.0 branch is on a strong, secure trajectory towards the September final release.
Based on the logical requirements here is a diagram showing how application startup is handled:
Branch 1 - Versions Are NOT Equal
nsnull
for the "ComsDL" property.
(3) This ensures all extension components are
disabled before XPCOM is initialized to prevent any compatibility problems
that might be encountered by those components' app-startup category
handlers.
Branch 2 - Versions ARE Equal
All XPCOM Component/Profile related operations are now complete. Before the profile is completely selected, i.e. in the analog of "profile-do-change" before any of the services have had the chance to obtain locks on files the Extension Manager might need to change, the Extension Manager performs any of its own internal state management and Extension Installation/Uninstallation/Disabling/Enabling finalization.
The app now starts fully.
This document has given fairly in-depth coverage of how the control flows through the startup process with respect to registering components. We have treated the restart operation as something that can be factored into a method that can be called in a cross platform manner. There may be implications with DDE on Windows - if the app needs to be restarted DDE maybe be running for the initial instance which does not have the ability to respond to DDE messages. Thus we need to ensure in any restart process that if DDE has been initialized as a server it is properly shut down.
1 - this file can be in the same format as the New Profile
System uses if there is a convenient shared reader
utility available.
2 - The degree of granularity is a unique version for each
release, and a version for the development period in
between releases. (e.g. 0.8.0+)
3 - "ComsDL" is designed to return an enumeration of additional
components directories to register components in - returning
nsnull here tells the Component Manager to register only
the default location(s).