Bug 1186787 (part 2) - Replace nsBaseHashtable::EnumerateRead() calls in chrome/ with iterators. r=froydnj.

This commit is contained in:
Nicholas Nethercote 2015-11-17 17:58:36 -08:00
Родитель d549d76410
Коммит b5ecc65a1e
1 изменённых файлов: 9 добавлений и 21 удалений

Просмотреть файл

@ -396,26 +396,6 @@ SerializeURI(nsIURI* aURI,
aURI->GetOriginCharset(aSerializedURI.charset);
}
static PLDHashOperator
EnumerateOverride(nsIURI* aURIKey,
nsIURI* aURI,
void* aArg)
{
nsTArray<OverrideMapping>* overrides =
static_cast<nsTArray<OverrideMapping>*>(aArg);
SerializedURI chromeURI, overrideURI;
SerializeURI(aURIKey, chromeURI);
SerializeURI(aURI, overrideURI);
OverrideMapping override = {
chromeURI, overrideURI
};
overrides->AppendElement(override);
return (PLDHashOperator)PL_DHASH_NEXT;
}
void
nsChromeRegistryChrome::SendRegisteredChrome(
mozilla::dom::PContentParent* aParent)
@ -447,7 +427,15 @@ nsChromeRegistryChrome::SendRegisteredChrome(
rph->CollectSubstitutions(resources);
}
mOverrideTable.EnumerateRead(&EnumerateOverride, &overrides);
for (auto iter = mOverrideTable.Iter(); !iter.Done(); iter.Next()) {
SerializedURI chromeURI, overrideURI;
SerializeURI(iter.Key(), chromeURI);
SerializeURI(iter.UserData(), overrideURI);
OverrideMapping override = { chromeURI, overrideURI };
overrides.AppendElement(override);
}
if (aParent) {
bool success = aParent->SendRegisterChrome(packages, resources, overrides,