Permalink
Browse files

Bug 671564 - Initialize NS_XPCOM_LIBRARY_FILE from NS_GRE_DIR. r=bsme…

…dberg
  • Loading branch information...
1 parent 0f5f5d6 commit 984699c5460ffe8cbc02dec3f0318a296eb6899a @glandium glandium committed Jul 21, 2011
Showing with 11 additions and 12 deletions.
  1. +11 −12 xpcom/build/nsXPComInit.cpp
@@ -422,34 +422,33 @@ NS_InitXPCOM2(nsIServiceManager* *result,
if (NS_FAILED(rv))
return rv;
- nsCOMPtr<nsIFile> xpcomLib;
-
PRBool value;
+
if (binDirectory)
{
rv = binDirectory->IsDirectory(&value);
if (NS_SUCCEEDED(rv) && value) {
nsDirectoryService::gService->Set(NS_XPCOM_INIT_CURRENT_PROCESS_DIR, binDirectory);
- binDirectory->Clone(getter_AddRefs(xpcomLib));
}
}
- else {
- nsDirectoryService::gService->Get(NS_XPCOM_CURRENT_PROCESS_DIR,
- NS_GET_IID(nsIFile),
- getter_AddRefs(xpcomLib));
+
+ if (appFileLocationProvider) {
+ rv = nsDirectoryService::gService->RegisterProvider(appFileLocationProvider);
+ if (NS_FAILED(rv)) return rv;
}
+ nsCOMPtr<nsIFile> xpcomLib;
+
+ nsDirectoryService::gService->Get(NS_GRE_DIR,
+ NS_GET_IID(nsIFile),
+ getter_AddRefs(xpcomLib));
+
if (xpcomLib) {
xpcomLib->AppendNative(nsDependentCString(XPCOM_DLL));
nsDirectoryService::gService->Set(NS_XPCOM_LIBRARY_FILE, xpcomLib);
}
- if (appFileLocationProvider) {
- rv = nsDirectoryService::gService->RegisterProvider(appFileLocationProvider);
- if (NS_FAILED(rv)) return rv;
- }
-
NS_TIME_FUNCTION_MARK("Next: Omnijar init");
if (!mozilla::Omnijar::IsInitialized()) {

0 comments on commit 984699c

Please sign in to comment.