mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1373725 - Trigger a rule tree gc at the end of DoProcessPendingRestyles. r=emilio
MozReview-Commit-ID: W2lkQohudA
This commit is contained in:
parent
a123d7939a
commit
690fa8991e
@ -680,6 +680,10 @@ ServoRestyleManager::DoProcessPendingRestyles(TraversalRestyleBehavior
|
|||||||
mRestyleForCSSRuleChanges = false;
|
mRestyleForCSSRuleChanges = false;
|
||||||
mInStyleRefresh = false;
|
mInStyleRefresh = false;
|
||||||
|
|
||||||
|
// Now that everything has settled, see if we have enough free rule nodes in
|
||||||
|
// the tree to warrant sweeping them.
|
||||||
|
styleSet->MaybeGCRuleTree();
|
||||||
|
|
||||||
// Note: We are in the scope of |animationsWithDestroyedFrame|, so
|
// Note: We are in the scope of |animationsWithDestroyedFrame|, so
|
||||||
// |mAnimationsWithDestroyedFrame| is still valid.
|
// |mAnimationsWithDestroyedFrame| is still valid.
|
||||||
MOZ_ASSERT(mAnimationsWithDestroyedFrame);
|
MOZ_ASSERT(mAnimationsWithDestroyedFrame);
|
||||||
|
@ -518,6 +518,10 @@ SERVO_BINDING_FUNC(Servo_TraverseSubtree,
|
|||||||
// Assert that the tree has no pending or unconsumed restyles.
|
// Assert that the tree has no pending or unconsumed restyles.
|
||||||
SERVO_BINDING_FUNC(Servo_AssertTreeIsClean, void, RawGeckoElementBorrowed root)
|
SERVO_BINDING_FUNC(Servo_AssertTreeIsClean, void, RawGeckoElementBorrowed root)
|
||||||
|
|
||||||
|
// Checks whether the rule tree has crossed its threshold for unused rule nodes,
|
||||||
|
// and if so, frees them.
|
||||||
|
SERVO_BINDING_FUNC(Servo_MaybeGCRuleTree, void, RawServoStyleSetBorrowed set)
|
||||||
|
|
||||||
// Returns computed values for the given element without any animations rules.
|
// Returns computed values for the given element without any animations rules.
|
||||||
SERVO_BINDING_FUNC(Servo_StyleSet_GetBaseComputedValuesForElement,
|
SERVO_BINDING_FUNC(Servo_StyleSet_GetBaseComputedValuesForElement,
|
||||||
ServoComputedValuesStrong,
|
ServoComputedValuesStrong,
|
||||||
|
@ -1290,6 +1290,13 @@ ServoStyleSet::UpdateStylist()
|
|||||||
mStylistState = StylistState::NotDirty;
|
mStylistState = StylistState::NotDirty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ServoStyleSet::MaybeGCRuleTree()
|
||||||
|
{
|
||||||
|
MOZ_ASSERT(NS_IsMainThread());
|
||||||
|
Servo_MaybeGCRuleTree(mRawSet.get());
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ServoStyleSet::PrependSheetOfType(SheetType aType,
|
ServoStyleSet::PrependSheetOfType(SheetType aType,
|
||||||
ServoStyleSheet* aSheet)
|
ServoStyleSheet* aSheet)
|
||||||
|
@ -341,6 +341,12 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks whether the rule tree has crossed its threshold for unused nodes,
|
||||||
|
* and if so, frees them.
|
||||||
|
*/
|
||||||
|
void MaybeGCRuleTree();
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
void AssertTreeIsClean();
|
void AssertTreeIsClean();
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user