Closed
Bug 64501
Opened 24 years ago
Closed 24 years ago
Apps using NS_InitEmbedding cannot specify location of app registry
Categories
(Core Graveyard :: Embedding: APIs, defect, P1)
Core Graveyard
Embedding: APIs
Tracking
(Not tracked)
VERIFIED
FIXED
mozilla0.8
People
(Reporter: ccarlen, Assigned: ccarlen)
Details
Attachments
(5 files)
40.49 KB,
patch
|
Details | Diff | Splinter Review | |
1.98 KB,
patch
|
Details | Diff | Splinter Review | |
1.27 KB,
patch
|
Details | Diff | Splinter Review | |
1.48 KB,
patch
|
Details | Diff | Splinter Review | |
1.46 KB,
patch
|
Details | Diff | Splinter Review |
Currently the application registry location is provided by the directory service provider in XPCOM. In order for an app not to use the same location as mozilla, it can pass a different product name to NS_InitXPCOM2. NS_InitEmbedding, though, calls NS_InitXPCOM which does not use the product name param.
Assignee | ||
Comment 1•24 years ago
|
||
Assignee | ||
Comment 2•24 years ago
|
||
The patch here solves this by having the location of the app registry be provided by the application file location provider. It also makes nsAppFileLocationProvider.cpp get built by XPCOM. Before, it was built as a separate static lib and linked into everything. An embedding app can provide their own application file location provider by passing it to NS_InitEmbedding. Having the default implementation built by XPCOM itself makes things easier because things don't need to link with the appfilelocprovider static lib and then register the provider with directory service.
Status: NEW → ASSIGNED
Assignee | ||
Updated•24 years ago
|
Priority: -- → P1
Target Milestone: --- → mozilla0.8
Comment 4•24 years ago
|
||
+ NS_WITH_SERVICE(nsIProperties, directoryService, NS_DIRECTORY_SERVICE_CONTRACTID, &rv); + if (NS_SUCCEEDED(rv)) { + rv = directoryService->Get(NS_XPCOM_CURRENT_PROCESS_DIR, NS_GET_IID(nsIFile), getter_AddRefs(mMozBinDirectory)); + + if (NS_FAILED(rv)) { + rv = directoryService->Get(NS_OS_CURRENT_PROCESS_DIR,NS_GET_IID(nsIFile), getter_AddRefs(mMozBinDirectory)); + } + } + if (NS_FAILED(rv)) + return rv; Obligatory nit-picking: if the NS_SUCCEEDED condition is false, there's no need to test NS_FAILED, so move that last if inside the then block immediately above it. I defer to cls and sfraser for the build stuff, which looks good enough for my rubber stamp. What worries me about this change is that it breaks XPCOM API and ABI compatibility. Is anyone (a Java VM plugin, perchance?) using NS_InitXPCOM2 in the wild? Cc'ing buddies. /be
Assignee | ||
Comment 5•24 years ago
|
||
> Is anyone (a Java VM plugin, perchance?) using NS_InitXPCOM2 in the wild?
NS_InitXPCOM2 was introduced fairly recently so as not to change NS_InitXPCOM. I
took that to mean NS_InitXPCOM was frozen but hopefully NS_InitXPCOM2 isn't.
Doug - any thoughts? I think you went through this.
Comment 6•24 years ago
|
||
ed please look at this bug. I think that it effects you the most. I am of the opinion that nothing has been frozen yet. I do not believe that I have seen anything from mozilla.org or the xpcom owners stating that any interface has been frozen. Heck, we are only now doing api reviews. The history is that DP requested that I not change the init method of xpcom, but I did this renaming reluctantly. scc, as the owner of xpcom, what is the state of this function. We have a requirement to change the call signature for embedding purposes. Should we just deprecate NS_InitXPCOM* and create NS_XPCOM_Init()? I would be happy with that.
Hi Doug, Thanks for remembering me! Yes, this is huge for us, since in our embedding scenario, the current working directory is that of Java.exe. We currently do this: NativeEventThread.cpp: NS_InitEmbedding(pathFile, nsnull); I'd like to just keep it simple, like that. As long as I can pass an nsIFile representing the mozilla bin dir to NS_InitEmbedding, I'm happy. Ed
Comment 8•24 years ago
|
||
[dougt: don't scare me with NS_XPCOM_Frobnosticate naming style (shades of Ada) instead of NS_FrobnosticateXPCOM!] ed: has Sun already shipped any plugin that depends on NS_InitXPCOM2? /be
Assignee | ||
Comment 9•24 years ago
|
||
Ed, what I'm proposing doesn't change the signature of NS_InitEmbedding() at all. You can continue to use it as is.
Comment 10•24 years ago
|
||
Brendan, I just ran a find command on the java plugin source and the only occurrences of XPCOM were in comments...like this: // Changed by Mark : XPCOM headers have changed ... // UGH, XPCOM has changed again ... // DAMN IT! If XPCOM changes again, I'm going to quit this project. ... Actually I'm kidding. But seriously, it's only in comments. It looks like we don't call any functions with XPCOM in the name.
Comment 11•24 years ago
|
||
Ok, then if the build stuff works and passes r= muster from cls and sfraser, sr=brendan@mozilla.org. Can you get an r= from someone on all the touched files? /be
Assignee | ||
Comment 12•24 years ago
|
||
Doug, you already reviewed this a while back. Can you record that here?
Comment 13•24 years ago
|
||
ccarlen. Got the cash. here is the r=dougt.
Assignee | ||
Comment 14•24 years ago
|
||
cls and sfraser - Can you look at the build changes? As far as the build goes, it just moves the files nsAppFileLocationProvider.h/.cpp and nsAppDirectoryServiceDefs.h into xpcom/io. Only nsAppDirectoryServiceDefs.h gets exported. Once this is done, modules/appfilelocprovider does not need to be built, nothing needs to link with that static lib, and modules/appfilelocprovider can be removed.
Comment 15•24 years ago
|
||
Just for future reference, please don't add new subdirectories to mozilla/modules -- we're trying to get rid of that. /be
Assignee | ||
Comment 16•24 years ago
|
||
Assignee | ||
Comment 17•24 years ago
|
||
I've done full clobber builds of both mozilla and commercial with this on Win and Linux and dep build on Mac (which always clobbers all of dist anyway). Found another 2 makefiles i commercial tree which needed tweaking. Those are on bugscape bug 3666.
Comment 18•24 years ago
|
||
the build changes look fine. sr=sfraser on those.
Assignee | ||
Comment 19•24 years ago
|
||
cls, can you look at the build changes? This is ready to go except for your review of that.
Comment 20•24 years ago
|
||
Sorry about the delay. r=cls on the makefile changes.
Assignee | ||
Comment 21•24 years ago
|
||
Thanks. Now, about moving the 3 files: I need to move nsAppFileLocationProvider.h/.cpp and nsAppDirectoryServiceDefs.h from mozilla/modules/appfilelocprovider to mozilla/xpcom/io while preserving their history. I'd like to move them to the new location, leaving them in the old location and, make the check in. Then after a good build cycle, go remove mozilla/modules/appfilelocprovider. That seems safest. What's the CVS magic to do this? Can I do it from here?
Comment 22•24 years ago
|
||
cc: scc on move of files into xpcom/io. /be
Comment 23•24 years ago
|
||
i can help you with this. provided you are *certain* about this move and scc gives consent, i'll go ahead and do the move.
Comment 24•24 years ago
|
||
actually, dougt is the xpcom/io module owner, according to owners.html...
Assignee | ||
Comment 25•24 years ago
|
||
The bug has r=dougt. It was discussion with him which led to this solution.
Comment 26•24 years ago
|
||
You need to remove the appreg library from the gtkmozembed library too since I link it into there statically.
Comment 27•24 years ago
|
||
the specified three files have been moved to xpcom/io
Assignee | ||
Comment 28•24 years ago
|
||
Christopher (Blizzard) - which is the makefile for the gtkmozembed library? Wouldn't this have been built when doing a clobber and then build_all on Linux?
Comment 29•24 years ago
|
||
Obviously, I didn't check out this patch as well I as should have. Is it really a good idea for xpcom to have a dependency upon chrome?
Assignee | ||
Comment 30•24 years ago
|
||
No, and I just discovered that because that. There was a routine not in the diffs which needs to find the locale. There should be another way to do that. In the meanwhile, it should be surrounded by XP_COM_STANDALONE and the default locale returned in that case.
Assignee | ||
Comment 31•24 years ago
|
||
The dependency introduced by this file move is filed as bug 65907. I've got a way to get rid of it - will put patch on new bug.
Comment 32•24 years ago
|
||
In current CVS 1/19 this broke the xpcom standalone build. It references nsIChromeRegistry.h which is not part of the standalone download.
Assignee | ||
Comment 33•24 years ago
|
||
Assignee | ||
Comment 34•24 years ago
|
||
The above patch (22978) surrounds the refs to chrome with XP_COM_STANDALONE conditionals. A better patch will be put on bug 65907 which removes dependency on chrome in all cases.
Assignee | ||
Comment 35•24 years ago
|
||
Can somebody review the patch to add XPCOM_STANDALONE #ifdefs? If this will fix the standalone build, I'd like to get it in soon while working on getting rid of the use of chrome here at all.
Comment 36•24 years ago
|
||
Comment 37•24 years ago
|
||
The unix builds no longer use XPCOM_STANDALONE. Users have to pull the extra dependencies (usually just headers) so that we have the same functionality between the standalone & non-standalone versions. This patch adds the chrome & necko dirs to the xpcom module. The ifdef patch looks right but I don't have a windows box to test on at the moment.
Comment 38•24 years ago
|
||
The windows standalone patch in not correct. The chrome CID also needs to be ifdef'd out since it comes from the chrome h file. With the additional ifdef it compiles. I don't know if it works.
Comment 39•24 years ago
|
||
Conrad, anyone: how about an updated patch that does work for XPCOM standalone? /be
Assignee | ||
Comment 40•24 years ago
|
||
Assignee | ||
Comment 41•24 years ago
|
||
Hopefully this patch compiles in a real STANDALONE world. I have another patch which removes all refs to chrome from here - whether STANDALONE or not. Once that is a bit more tested, I'll post that.
Assignee | ||
Comment 42•24 years ago
|
||
Better patch which completely gets rid of dependency is on bug 65907.
Comment 43•24 years ago
|
||
Conrad, I suggest you checkin your patch to fix XPCOM_STANDALONE right away - with or without additional review (sr=jband). AFAIC the tree is busted. I just wrote a similar patch on my own before finding this bug so that I could get on with my work. I don't think others should have to do the same. Thanks. John.
Assignee | ||
Comment 44•24 years ago
|
||
Done. Thanks for sr=.
Assignee | ||
Comment 45•24 years ago
|
||
Marking as fixed. Since this bug had no visible symptoms, can be verified by looking at: http://lxr.mozilla.org/seamonkey/source/embedding/browser/powerplant/source/CBrowserApp.cp#191 This embedding app creates and supplies it own file location provider which gives it its own file locations - including that of the registry.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 46•23 years ago
|
||
Correction: Changing QA contact for the Embed API bugs to David Epstein.
QA Contact: mdunn → depstein
Comment 47•23 years ago
|
||
per Conrad's 1/24/01 comment, verifying. Checked code change in CBrowserApp.cp, where the file location provider object is passed in NS_InitEmbedding(): CAppFileLocationProvider *fileLocProvider = new CAppFileLocationProvider(kProgramName); ThrowIfNil_(fileLocProvider); rv = NS_InitEmbedding(appDir, fileLocProvider); mfcEmbed uses winEmbedFileLocProvider object in NS_InitEmbedding().
Status: RESOLVED → VERIFIED
Updated•5 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•