Index: Source/core/css/ElementRuleCollector.h |
diff --git a/Source/core/css/ElementRuleCollector.h b/Source/core/css/ElementRuleCollector.h |
index 5c169b6eb907a4c1834a2013e6f483f9e6f22125..cea335216560302f751e6bac43dede954c4d5d67 100644 |
--- a/Source/core/css/ElementRuleCollector.h |
+++ b/Source/core/css/ElementRuleCollector.h |
@@ -47,9 +47,9 @@ const CascadeScope ignoreCascadeScope = 0; |
const CascadeOrder ignoreCascadeOrder = 0; |
class MatchedRule { |
- WTF_MAKE_FAST_ALLOCATED; |
+ ALLOW_ONLY_INLINE_ALLOCATION(); |
public: |
- explicit MatchedRule(const RuleData* ruleData, unsigned specificity, CascadeScope cascadeScope, CascadeOrder cascadeOrder, unsigned styleSheetIndex, const CSSStyleSheet* parentStyleSheet) |
+ MatchedRule(const RuleData* ruleData, unsigned specificity, CascadeScope cascadeScope, CascadeOrder cascadeOrder, unsigned styleSheetIndex, const CSSStyleSheet* parentStyleSheet) |
: m_ruleData(ruleData) |
, m_specificity(specificity) |
, m_cascadeScope(cascadeScope) |
@@ -66,15 +66,37 @@ public: |
uint64_t position() const { return m_position; } |
unsigned specificity() const { return ruleData()->specificity() + m_specificity; } |
const CSSStyleSheet* parentStyleSheet() const { return m_parentStyleSheet; } |
+ void trace(Visitor* visitor) |
+ { |
+ visitor->trace(m_parentStyleSheet); |
+ } |
private: |
+ // FIXME: Oilpan: RuleData is in the oilpan heap and this pointer |
+ // really should be traced. However, RuleData objects are |
+ // allocated inside larger TerminatedArray objects and we cannot |
+ // trace a raw rule data pointer at this point. |
const RuleData* m_ruleData; |
unsigned m_specificity; |
CascadeScope m_cascadeScope; |
uint64_t m_position; |
- const CSSStyleSheet* m_parentStyleSheet; |
+ RawPtrWillBeMember<const CSSStyleSheet> m_parentStyleSheet; |
}; |
+} // namespace WebCore |
+ |
+ |
+namespace WTF { |
+ |
+template <> struct VectorTraits<WebCore::MatchedRule> : VectorTraitsBase<WebCore::MatchedRule> { |
+ static const bool canInitializeWithMemset = true; |
+ static const bool canMoveWithMemcpy = true; |
+}; |
+ |
+} // namespace WTF |
+ |
+namespace WebCore { |
+ |
// FIXME: oilpan: when transition types are gone this class can be replaced with HeapVector. |
class StyleRuleList : public RefCounted<StyleRuleList> { |
public: |
@@ -150,7 +172,7 @@ private: |
bool m_sameOriginOnly; |
bool m_matchingUARules; |
- OwnPtr<Vector<MatchedRule, 32> > m_matchedRules; |
+ OwnPtrWillBeMember<WillBeHeapVector<MatchedRule, 32> > m_matchedRules; |
// Output. |
RefPtrWillBeMember<StaticCSSRuleList> m_cssRuleList; |