From 67e59b9a848b13c2880fbbf4cbc6d7cae976c6a9 Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Sat, 7 Jan 2012 20:57:03 +0200 Subject: [PATCH] Bug 716006 - Don't traverse NodeInfoManager so much, r=jst, mccr8 --HG-- extra : rebase_source : 34085e6ad2c49a691b18c6fb092db7ae71e2a0f3 --- content/base/src/nsNodeInfoManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/content/base/src/nsNodeInfoManager.cpp b/content/base/src/nsNodeInfoManager.cpp index 8a7a21154baa..20ee96f0ba37 100644 --- a/content/base/src/nsNodeInfoManager.cpp +++ b/content/base/src/nsNodeInfoManager.cpp @@ -54,6 +54,7 @@ #include "nsLayoutStatics.h" #include "nsBindingManager.h" #include "nsHashKeys.h" +#include "nsCCUncollectableMarker.h" #ifdef MOZ_LOGGING // so we can get logging even in release builds @@ -161,6 +162,11 @@ NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsNodeInfoManager, AddRef) NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsNodeInfoManager, Release) NS_IMPL_CYCLE_COLLECTION_UNLINK_NATIVE_0(nsNodeInfoManager) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_BEGIN(nsNodeInfoManager) + if (tmp->mDocument && + nsCCUncollectableMarker::InGeneration(cb, + tmp->mDocument->GetMarkedCCGeneration())) { + return NS_SUCCESS_INTERRUPTED_TRAVERSE; + } if (tmp->mNonDocumentNodeInfos) { NS_IMPL_CYCLE_COLLECTION_TRAVERSE_RAWPTR(mDocument) }