Make XPCOM broadcast any LoadLibrary Load() error failures. b=308716 r=bsmedberg

This commit is contained in:
dougt@meer.net
2005-09-15 19:53:01 +00:00
parent 8143797b94
commit 80b2105bff

View File

@@ -87,6 +87,17 @@ nsNativeComponentLoader::nsNativeComponentLoader() :
NS_IMPL_THREADSAFE_ISUPPORTS1(nsNativeComponentLoader,
nsIComponentLoader)
static void BroadcastLoadFailure(nsDll *dll)
{
nsCOMPtr<nsIFile> fs;
dll->GetDllSpec(getter_AddRefs(fs));
nsCOMPtr<nsIObserverService> observerService = do_GetService("@mozilla.org/observer-service;1");
if (observerService)
observerService->NotifyObservers(fs, "xpcom-loader", NS_LITERAL_STRING("Load Failed").get());
}
NS_IMETHODIMP
nsNativeComponentLoader::GetFactory(const nsIID & aCID,
const char *aLocation,
@@ -130,6 +141,8 @@ nsNativeComponentLoader::GetFactory(const nsIID & aCID,
DumpLoadError(dll, "GetFactory", errorMsg);
BroadcastLoadFailure(dll);
return NS_ERROR_FAILURE;
}
}
@@ -390,6 +403,8 @@ nsNativeComponentLoader::SelfRegisterDll(nsDll *dll,
DumpLoadError(dll, "SelfRegisterDll", errorMsg);
BroadcastLoadFailure(dll);
return NS_ERROR_FAILURE;
}