Bug 1638910 - Clear JSActorService EventListener references in Unlink, r=kmag

Differential Revision: https://phabricator.services.mozilla.com/D76018
This commit is contained in:
Nika Layzell 2020-05-26 22:19:31 +00:00
Родитель f26bcad85c
Коммит 73f14abd78
2 изменённых файлов: 24 добавлений и 2 удалений

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

@ -140,6 +140,10 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(
InProcessBrowserChildMessageManager, DOMEventTargetHelper)
if (XRE_IsParentProcess()) {
JSActorService::UnregisterChromeEventTarget(tmp);
}
NS_IMPL_CYCLE_COLLECTION_UNLINK(mMessageManager)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mDocShell)
tmp->nsMessageManagerScriptExecutor::Unlink();

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

@ -54,8 +54,26 @@ nsWindowRoot::~nsWindowRoot() {
}
}
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsWindowRoot, mWindow, mListenerManager,
mParent)
NS_IMPL_CYCLE_COLLECTION_CLASS(nsWindowRoot)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsWindowRoot)
if (XRE_IsContentProcess()) {
JSActorService::UnregisterChromeEventTarget(tmp);
}
NS_IMPL_CYCLE_COLLECTION_UNLINK(mWindow)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mListenerManager)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mParent)
NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsWindowRoot)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mWindow)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mListenerManager)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(nsWindowRoot)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsWindowRoot)
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY