Bug 1034920, part 2 - Fix names of NativeLoadData. r=froydnj

This commit is contained in:
Andrew McCreight
2014-07-28 10:15:57 -07:00
parent 015247eee7
commit 9b2a50b4c6
2 changed files with 17 additions and 17 deletions

View File

@@ -131,11 +131,11 @@ nsNativeModuleLoader::LoadModule(FileLocation &aFile)
NativeLoadData data;
if (mLibraries.Get(hashedFile, &data)) {
NS_ASSERTION(data.module, "Corrupt mLibraries hash");
NS_ASSERTION(data.mModule, "Corrupt mLibraries hash");
LOG(PR_LOG_DEBUG,
("nsNativeModuleLoader::LoadModule(\"%s\") - found in cache",
filePath.get()));
return data.module;
return data.mModule;
}
// We haven't loaded this module before
@@ -143,7 +143,7 @@ nsNativeModuleLoader::LoadModule(FileLocation &aFile)
#ifdef HAS_DLL_BLOCKLIST
AutoSetXPCOMLoadOnMainThread guard;
#endif
rv = file->Load(&data.library);
rv = file->Load(&data.mLibrary);
}
if (NS_FAILED(rv)) {
@@ -176,32 +176,32 @@ nsNativeModuleLoader::LoadModule(FileLocation &aFile)
}
#endif
void *module = PR_FindSymbol(data.library, "NSModule");
void *module = PR_FindSymbol(data.mLibrary, "NSModule");
if (!module) {
LogMessage("Native module at path '%s' doesn't export symbol `NSModule`.",
filePath.get());
PR_UnloadLibrary(data.library);
PR_UnloadLibrary(data.mLibrary);
return nullptr;
}
data.module = *(mozilla::Module const *const *) module;
if (mozilla::Module::kVersion != data.module->mVersion) {
data.mModule = *(mozilla::Module const *const *) module;
if (mozilla::Module::kVersion != data.mModule->mVersion) {
LogMessage("Native module at path '%s' is incompatible with this version of Firefox, has version %i, expected %i.",
filePath.get(), data.module->mVersion,
filePath.get(), data.mModule->mVersion,
mozilla::Module::kVersion);
PR_UnloadLibrary(data.library);
PR_UnloadLibrary(data.mLibrary);
return nullptr;
}
mLibraries.Put(hashedFile, data); // infallible
return data.module;
return data.mModule;
}
PLDHashOperator
nsNativeModuleLoader::ReleaserFunc(nsIHashable* aHashedFile,
NativeLoadData& aLoadData, void*)
{
aLoadData.module = nullptr;
aLoadData.mModule = nullptr;
return PL_DHASH_NEXT;
}
@@ -226,7 +226,7 @@ nsNativeModuleLoader::UnloaderFunc(nsIHashable* aHashedFile,
#if 0
// XXXbsmedberg: do this as soon as the static-destructor crash(es)
// are fixed
PRStatus ret = PR_UnloadLibrary(aLoadData.library);
PRStatus ret = PR_UnloadLibrary(aLoadData.mLibrary);
NS_ASSERTION(ret == PR_SUCCESS, "Failed to unload library");
#endif