Bug 1187146 - Replace nsBaseHashtable::Enumerate() calls in js/xpconnect/ with iterators. r=mrbkap.

--HG--
extra : rebase_source : 28dc3c5614ee36e6e6955b9cc380e85ccc618a0d
This commit is contained in:
Nicholas Nethercote 2015-11-22 18:52:40 -08:00
parent be3147c152
commit 4dd2a30a0f
2 changed files with 4 additions and 9 deletions

View File

@ -964,13 +964,6 @@ mozJSComponentLoader::ObjectForLocation(ComponentLoaderInfo& aInfo,
return NS_OK;
}
/* static */ PLDHashOperator
mozJSComponentLoader::ClearModules(const nsACString& key, ModuleEntry*& entry, void* cx)
{
entry->Clear();
return PL_DHASH_REMOVE;
}
void
mozJSComponentLoader::UnloadModules()
{
@ -1000,7 +993,10 @@ mozJSComponentLoader::UnloadModules()
mInProgressImports.Clear();
mImports.Clear();
mModules.Enumerate(ClearModules, nullptr);
for (auto iter = mModules.Iter(); !iter.Done(); iter.Next()) {
iter.Data()->Clear();
iter.Remove();
}
}
NS_IMETHODIMP

View File

@ -148,7 +148,6 @@ class mozJSComponentLoader : public mozilla::ModuleLoader,
mozilla::MallocSizeOf aMallocSizeOf, void* arg);
// Modules are intentionally leaked, but still cleared.
static PLDHashOperator ClearModules(const nsACString& key, ModuleEntry*& entry, void* cx);
nsDataHashtable<nsCStringHashKey, ModuleEntry*> mModules;
nsClassHashtable<nsCStringHashKey, ModuleEntry> mImports;