Issue #1990 - Part 5 - Common up the skippability implementations that are basically copy/pastes of the DOMEventTargetHelper one. Mozilla Bug Bug 1333540. Skipped the renamed of various functions, but otherwise a direct port.

This commit is contained in:
Brian Smith 2022-08-25 21:59:08 -05:00 committed by roytam1
commit 5fd53649bd
7 changed files with 30 additions and 84 deletions

View file

@ -2087,32 +2087,6 @@ EventSource::UpdateDontKeepAlive()
NS_IMPL_CYCLE_COLLECTION_CLASS(EventSource)
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(EventSource)
bool isBlack = tmp->IsBlack();
if (isBlack || tmp->mKeepingAlive) {
if (tmp->mListenerManager) {
tmp->mListenerManager->MarkForCC();
}
if (!isBlack && tmp->PreservingWrapper()) {
// This marks the wrapper black.
tmp->GetWrapper();
}
return true;
}
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(EventSource)
return tmp->IsBlack();
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(EventSource)
return tmp->IsBlack();
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(EventSource,
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(EventSource,
DOMEventTargetHelper)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
@ -2125,6 +2099,12 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(EventSource,
}
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
bool
EventSource::IsCertainlyAliveForCC() const
{
return mKeepingAlive;
}
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(EventSource)
NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)