Make XPCOM broadcast any LoadLibrary Load() error failures. b=308716 r=bsmedberg
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user