Closed
Bug 296561
Opened 20 years ago
Closed 19 years ago
Make it possible to access nsIXULRuntime during xpcom-startup event
Categories
(Toolkit Graveyard :: XULRunner, enhancement, P2)
Toolkit Graveyard
XULRunner
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla1.8beta4
People
(Reporter: darin.moz, Assigned: benjamin)
References
Details
(Whiteboard: has patch with reviews)
Attachments
(1 file, 2 obsolete files)
|
84.96 KB,
patch
|
Details | Diff | Splinter Review |
Make it possible to access nsIXULRuntime during xpcom-startup event Right now, one cannot access nsIXULRuntime or nsIXULAppInfo during the xpcom-startup event, which fires before NS_InitXPCOM2 returns. Since these interfaces expose information about the runtime, we probably want to ensure that they are available sooner rather than later. I realize that people could defer to the app-startup event, but a lot of documentation out there mentions xpcom-startup. We could probably solve this bug easily by leveraging the static component loader.
| Assignee | ||
Updated•20 years ago
|
Assignee: nobody → benjamin
| Assignee | ||
Comment 1•20 years ago
|
||
This patch works on windows with dynamic and static builds of ffox/tbird and with dynamic/static/libxul builds of xulrunner. It also fixes the embedding clients built on Windows. It does not fix seamonkey static build, and I will attach a separate patch for the camino static build.
| Assignee | ||
Updated•20 years ago
|
Attachment #186347 -
Flags: first-review?(shaver)
| Assignee | ||
Comment 2•20 years ago
|
||
Comment on attachment 186347 [details] [diff] [review] NS_InitXPCOM3, rev. 1 Dougt, I've burndened darin with a lot of reviews recently, can you take on superreviewing this?
Attachment #186347 -
Flags: second-review?(dougt)
| Reporter | ||
Comment 3•20 years ago
|
||
Please specify whether static components specified via this interface are loaded before or after dynamic components. I recall observing that static components are currently registered after dynamic components making it difficult to override a static component. I think it should be the other way around.
| Assignee | ||
Comment 4•20 years ago
|
||
I would be happy to switch the native and static component loader (nsComponentManagerUtils.cpp#3193 and #3197), but I'm leery about frozen-documenting that before we come up with a better XPCOM override mechanism in general.
| Reporter | ||
Comment 5•20 years ago
|
||
Hrm... I think we should specify the order since it would be a natural question of anyone calling NS_InitXPCOM3. We could also specify that it is not specified. Either way, we need to say something about it.
| Assignee | ||
Comment 6•20 years ago
|
||
I'm happy enough to document that the static components come first, as long as we don't specify the relative ordering of native/JS/python/whatever components.
| Reporter | ||
Comment 7•20 years ago
|
||
That sounds fine to me.
| Assignee | ||
Comment 8•20 years ago
|
||
This changes the autoreg order to static -> dynamic -> others, but only documents static -> everything else as I plan to change the "everything else" situation a little bit in the 1.9 timeframe (nsIComponentLoader -> nsIModuleLoader, but not filed yet). It also makes sure that the static components are registered in the order they appear in the NS_InitXPCOM3 list. This means that static camino and other embedders can reliably override core gecko components.
Attachment #186347 -
Attachment is obsolete: true
Attachment #186396 -
Flags: second-review?(dougt)
Attachment #186396 -
Flags: first-review?(shaver)
Comment 9•20 years ago
|
||
Comment on attachment 186396 [details] [diff] [review] NS_InitXPCOM3, rev. 2 Alot cooler then the _BUILD_STATIC_BIN #define we were using! A few general q's: Why are you removing the ablity to disable the static build? Why are you moving the nsGetModuleProc into nsXPCOM.h. It is already defined in nsModule.h:53. Can you avoid NS_InitXPCOM3 by adding a function that can set the nsStaticModuleInfo data before init is called? Could you fix up the spelling error(s) "initialisation" in nsXPCOM.h, plz.
| Assignee | ||
Comment 10•20 years ago
|
||
> Why are you removing the ablity to disable the static build? Because the static loader is now part of the frozen XPCOM API, and I haven't found any consumers who really need to disable it (minimo uses it, and that's the only real consumer I'm worried about WRT codesize). > Why are you moving the nsGetModuleProc into nsXPCOM.h. It is already defined > in nsModule.h:53. nsModule.h is not a frozen header, at least as far as I can tell, and I need the function prototype declaration for the structure. > Can you avoid NS_InitXPCOM3 by adding a function that can set the > nsStaticModuleInfo data before init is called? I could, but I don't think it's a good idea. I don't want multiple callers to start overriding static component lists or other badness. > Could you fix up the spelling error(s) "initialisation" in nsXPCOM.h, plz. Damn yankees ;-)
Comment 11•20 years ago
|
||
Comment on attachment 186396 [details] [diff] [review] NS_InitXPCOM3, rev. 2 + * Initialises XPCOM with static components. You must call this method + * before proceeding to use xpcom. I have the choice between NS_InitXPCOM2 and 3, right? maybe the comment should make that a bit more clear...
| Assignee | ||
Comment 12•20 years ago
|
||
biesi: suggest wording?
| Assignee | ||
Updated•20 years ago
|
Attachment #186347 -
Flags: second-review?(dougt)
Attachment #186347 -
Flags: first-review?(shaver)
Comment 13•20 years ago
|
||
"One of the NS_InitXPCOM methods must be called before proceeding to use XPCOM."
Comment 14•20 years ago
|
||
Comment on attachment 186396 [details] [diff] [review] NS_InitXPCOM3, rev. 2 I'll try to get to this review this week; it's a big'un.
Comment 15•19 years ago
|
||
Comment on attachment 186396 [details] [diff] [review] NS_InitXPCOM3, rev. 2 r=shaver. It'd be nice if there was a macro outside of nsIGenericFactory.h that let people get the right calling convention on their NSGetModule impl, but it's no big deal.
Attachment #186396 -
Flags: first-review?(shaver) → first-review+
| Assignee | ||
Comment 16•19 years ago
|
||
dougt, ping? An important Firefox extension author wants this badly.
Flags: blocking1.8b4?
Updated•19 years ago
|
Attachment #186396 -
Flags: second-review?(dougt) → second-review+
| Reporter | ||
Comment 17•19 years ago
|
||
Comment on attachment 186396 [details] [diff] [review] NS_InitXPCOM3, rev. 2 >Index: xpcom/build/nsXPCOM.h >+typedef nsresult (PR_CALLBACK *nsGetModuleProc)(nsIComponentManager *aCompMgr, >+ nsIFile* location, >+ nsIModule** return_cobj); Should this use NS_CALLBACK instead? I'm not sure. We don't seem to be very consistent in our use of cdecl vs stdcall.
Attachment #186396 -
Flags: second-review+ → second-review?(dougt)
| Assignee | ||
Comment 18•19 years ago
|
||
NSGetModule is very unfortunately *not* stdcall on windows, it is cdecl.
| Assignee | ||
Comment 19•19 years ago
|
||
Comment on attachment 186396 [details] [diff] [review] NS_InitXPCOM3, rev. 2 I'm going to re-mark dougt's review based on the fact that we can't use NS_CALLBACK because it would change our frozen-by-real-life cdecl NSGetModule signature, and requesting approval. This is unlikely to break the toolkit apps or camino, which have been tested.
Attachment #186396 -
Flags: second-review?(dougt)
Attachment #186396 -
Flags: second-review+
Attachment #186396 -
Flags: approval1.8b4?
| Assignee | ||
Updated•19 years ago
|
Flags: blocking1.8b4? → blocking1.8b4+
Priority: -- → P2
Target Milestone: --- → mozilla1.8beta4
| Assignee | ||
Updated•19 years ago
|
Whiteboard: has patch with reviews
Updated•19 years ago
|
Attachment #186396 -
Flags: approval1.8b4? → approval1.8b4+
| Assignee | ||
Comment 20•19 years ago
|
||
This is the final patch committed, there were some additional changes needed in embedding/browser/gtk and some makefile-fu to get those working properly.
Attachment #186396 -
Attachment is obsolete: true
| Assignee | ||
Updated•19 years ago
|
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Looks like this slowed btek Tp by about 10ms.
Updated•9 years ago
|
Product: Toolkit → Toolkit Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•