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

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

Issue 992903002: Oilpan: implement StyleRuleList without an extra wrapper. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 5 years, 6 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 | « no previous file | 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 676c66a63772c2fddb94bc28673a186b3a0e5684..3fbc161d91576c57694001d1d6bc17cb9ee028dd 100644
--- a/Source/core/css/ElementRuleCollector.h
+++ b/Source/core/css/ElementRuleCollector.h
@@ -83,20 +83,20 @@ WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::MatchedRule);
namespace blink {
-// FIXME: oilpan: when transition types are gone this class can be replaced with HeapVector.
-class StyleRuleList final : public RefCountedWillBeGarbageCollected<StyleRuleList> {
+#if ENABLE(OILPAN)
+using StyleRuleList = HeapVector<Member<StyleRule>>;
+#else
+class StyleRuleList final : public RefCounted<StyleRuleList> {
public:
- static PassRefPtrWillBeRawPtr<StyleRuleList> create() { return adoptRefWillBeNoop(new StyleRuleList()); }
+ static PassRefPtr<StyleRuleList> create() { return adoptRef(new StyleRuleList()); }
- DEFINE_INLINE_TRACE()
- {
-#if ENABLE(OILPAN)
- visitor->trace(m_list);
-#endif
- }
+ void append(StyleRule* rule) { m_list.append(rule); }
+ StyleRule* at(size_t index) const { return m_list[index]; }
+ size_t size() const { return m_list.size(); }
- WillBeHeapVector<RawPtrWillBeMember<StyleRule>> m_list;
+ Vector<StyleRule*> m_list;
};
+#endif
// ElementRuleCollector is designed to be used as a stack object.
// Create one, ask what rules the ElementResolveContext matches
« no previous file with comments | « no previous file | Source/core/css/ElementRuleCollector.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698