Bug 671564 - Initialize NS_XPCOM_LIBRARY_FILE from NS_GRE_DIR. r=bsmedberg

This commit is contained in:
Mike Hommey 2011-07-21 09:57:07 +02:00
parent f2e4962345
commit cb537f7367

View File

@ -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()) {