Bug 725446 - BBP for ContentList, f=mccr8,r=jst

This commit is contained in:
Olli Pettay 2012-02-10 22:47:29 +02:00
parent 0fe1640d6b
commit a67dd476a5
4 changed files with 25 additions and 3 deletions

View File

@ -90,6 +90,27 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsBaseContentList)
NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsBaseContentList)
if (nsCCUncollectableMarker::sGeneration && tmp->IsBlack()) {
for (PRUint32 i = 0; i < tmp->mElements.Length(); ++i) {
nsIContent* c = tmp->mElements[i];
if (c->IsPurple()) {
c->RemovePurple();
}
nsGenericElement::MarkNodeChildren(c);
}
return true;
}
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(nsBaseContentList)
return nsCCUncollectableMarker::sGeneration && tmp->IsBlack();
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(nsBaseContentList)
return nsCCUncollectableMarker::sGeneration && tmp->IsBlack();
NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
#define NS_CONTENT_LIST_INTERFACES(_class) \
NS_INTERFACE_TABLE_ENTRY(_class, nsINodeList) \
NS_INTERFACE_TABLE_ENTRY(_class, nsIDOMNodeList)

View File

@ -103,7 +103,7 @@ public:
return mElements.Length();
}
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsBaseContentList)
NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsBaseContentList)
void AppendElement(nsIContent *aContent)
{

View File

@ -4415,8 +4415,8 @@ nsGenericElement::MarkUserDataHandler(void* aObject, nsIAtom* aKey,
xpc_UnmarkGrayObject(wjs);
}
static void
MarkNodeChildren(nsINode* aNode)
void
nsGenericElement::MarkNodeChildren(nsINode* aNode)
{
JSObject* o = GetJSObjectChild(aNode);
xpc_UnmarkGrayObject(o);

View File

@ -626,6 +626,7 @@ public:
static bool CanSkip(nsINode* aNode);
static bool CanSkipInCC(nsINode* aNode);
static bool CanSkipThis(nsINode* aNode);
static void MarkNodeChildren(nsINode* aNode);
static void InitCCCallbacks();
static void MarkUserData(void* aObject, nsIAtom* aKey, void* aChild,
void *aData);