mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 792385 - Try to skip nsJSEventListener in CC, r=mccr8
This commit is contained in:
parent
a0648b9ee4
commit
91520a7f56
@ -90,7 +90,22 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsJSEventListener)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRACE_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsJSEventListener)
|
||||
if (tmp->IsBlackForCC()) {
|
||||
return true;
|
||||
}
|
||||
// If we have a target, it is the one which has tmp as onfoo handler.
|
||||
if (tmp->mTarget) {
|
||||
nsXPCOMCycleCollectionParticipant* cp = nullptr;
|
||||
CallQueryInterface(tmp->mTarget, &cp);
|
||||
nsISupports* canonical = nullptr;
|
||||
tmp->mTarget->QueryInterface(NS_GET_IID(nsCycleCollectionISupports),
|
||||
reinterpret_cast<void**>(&canonical));
|
||||
// Usually CanSkip ends up unmarking the event listeners of mTarget,
|
||||
// so tmp may become black.
|
||||
if (cp && canonical && cp->CanSkip(canonical, true)) {
|
||||
return tmp->IsBlackForCC();
|
||||
}
|
||||
}
|
||||
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
|
||||
|
||||
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(nsJSEventListener)
|
||||
|
Loading…
Reference in New Issue
Block a user