Bug 1172784 (part 2) - Remove PL_DHashTableEnumerate use from nsContentUtils. r=mccr8.

--HG--
extra : rebase_source : cc59f7012458d80ed3c70e15c975ac0669471945
This commit is contained in:
Nicholas Nethercote 2015-06-10 13:07:40 -07:00
Родитель c3c054cb1e
Коммит 369266e582
1 изменённых файлов: 9 добавлений и 16 удалений

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

@ -3985,29 +3985,22 @@ nsContentUtils::MaybeFireNodeRemoved(nsINode* aChild, nsINode* aParent,
}
}
PLDHashOperator
ListenerEnumerator(PLDHashTable* aTable, PLDHashEntryHdr* aEntry,
uint32_t aNumber, void* aArg)
void
nsContentUtils::UnmarkGrayJSListenersInCCGenerationDocuments()
{
EventListenerManagerMapEntry* entry =
static_cast<EventListenerManagerMapEntry*>(aEntry);
if (entry) {
if (!sEventListenerManagersHash) {
return;
}
PLDHashTable::Iterator iter(sEventListenerManagersHash);
while (iter.HasMoreEntries()) {
auto entry = static_cast<EventListenerManagerMapEntry*>(iter.NextEntry());
nsINode* n = static_cast<nsINode*>(entry->mListenerManager->GetTarget());
if (n && n->IsInDoc() &&
nsCCUncollectableMarker::InGeneration(n->OwnerDoc()->GetMarkedCCGeneration())) {
entry->mListenerManager->MarkForCC();
}
}
return PL_DHASH_NEXT;
}
void
nsContentUtils::UnmarkGrayJSListenersInCCGenerationDocuments()
{
if (sEventListenerManagersHash) {
PL_DHashTableEnumerate(sEventListenerManagersHash, ListenerEnumerator,
nullptr);
}
}
/* static */