Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(422)

Unified Diff: Source/core/css/ElementRuleCollector.h

Issue 196513007: Oilpan: Reapply: Remove all the RefPtrs and most of the raw pointers to style (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix assertion for global persistents Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/CSSTestHelper.h ('k') | Source/core/css/ElementRuleCollector.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « Source/core/css/CSSTestHelper.h ('k') | Source/core/css/ElementRuleCollector.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698