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

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

Issue 195953003: Oilpan: Move CSSStyleDeclaration and subclasses to the heap using transistion types. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
Index: Source/core/css/PropertySetCSSStyleDeclaration.h
diff --git a/Source/core/css/PropertySetCSSStyleDeclaration.h b/Source/core/css/PropertySetCSSStyleDeclaration.h
index ad87376dc9b826cfd0059776146be98acb43361b..bd026cf36be6a7acc1aad0443d599049b3f340a4 100644
--- a/Source/core/css/PropertySetCSSStyleDeclaration.h
+++ b/Source/core/css/PropertySetCSSStyleDeclaration.h
@@ -46,6 +46,8 @@ public:
virtual void clearParentElement() { ASSERT_NOT_REACHED(); }
StyleSheetContents* contextStyleSheet() const;
+ virtual void trace(Visitor*) OVERRIDE;
+
private:
virtual CSSRule* parentRule() const OVERRIDE { return 0; }
virtual unsigned length() const OVERRIDE FINAL;
@@ -74,37 +76,45 @@ protected:
virtual void didMutate(MutationType) { }
virtual MutableStylePropertySet& propertySet() const = 0;
- OwnPtrWillBePersistent<WillBeHeapHashMap<CSSValue*, RefPtrWillBeMember<CSSValue> > > m_cssomCSSValueClones;
+ OwnPtrWillBeMember<WillBeHeapHashMap<CSSValue*, RefPtrWillBeMember<CSSValue> > > m_cssomCSSValueClones;
haraken 2014/03/20 11:22:38 Shouldn't this be OwnPtrWillBeMember<WillBeHeapHas
wibling-chromium 2014/03/20 11:59:33 Yes, that would be better. Done.
};
class PropertySetCSSStyleDeclaration : public AbstractPropertySetCSSStyleDeclaration {
public:
PropertySetCSSStyleDeclaration(MutableStylePropertySet& propertySet) : m_propertySet(&propertySet) { }
+#if !ENABLE(OILPAN)
virtual void ref() OVERRIDE;
virtual void deref() OVERRIDE;
+#endif
+
+ virtual void trace(Visitor*) OVERRIDE;
protected:
virtual MutableStylePropertySet& propertySet() const OVERRIDE FINAL { ASSERT(m_propertySet); return *m_propertySet; }
- MutableStylePropertySet* m_propertySet; // Cannot be null
+ RawPtrWillBeMember<MutableStylePropertySet> m_propertySet; // Cannot be null
};
class StyleRuleCSSStyleDeclaration FINAL : public PropertySetCSSStyleDeclaration
{
public:
- static PassRefPtr<StyleRuleCSSStyleDeclaration> create(MutableStylePropertySet& propertySet, CSSRule* parentRule)
+ static PassRefPtrWillBeRawPtr<StyleRuleCSSStyleDeclaration> create(MutableStylePropertySet& propertySet, CSSRule* parentRule)
{
- return adoptRef(new StyleRuleCSSStyleDeclaration(propertySet, parentRule));
+ return adoptRefWillBeNoop(new StyleRuleCSSStyleDeclaration(propertySet, parentRule));
}
- void clearParentRule() { m_parentRule = 0; }
+#if !ENABLE(OILPAN)
+ void clearParentRule() { m_parentRule = nullptr; }
virtual void ref() OVERRIDE;
virtual void deref() OVERRIDE;
+#endif
void reattach(MutableStylePropertySet&);
+ virtual void trace(Visitor*);
haraken 2014/03/20 11:22:38 Add OVERRIDE.
wibling-chromium 2014/03/20 11:59:33 Done.
+
private:
StyleRuleCSSStyleDeclaration(MutableStylePropertySet&, CSSRule*);
virtual ~StyleRuleCSSStyleDeclaration();
@@ -116,8 +126,10 @@ private:
virtual void willMutate() OVERRIDE;
virtual void didMutate(MutationType) OVERRIDE;
+#if !ENABLE(OILPAN)
unsigned m_refCount;
- CSSRule* m_parentRule;
+#endif
+ RawPtrWillBeMember<CSSRule> m_parentRule;
};
class InlineCSSStyleDeclaration FINAL : public AbstractPropertySetCSSStyleDeclaration
@@ -128,10 +140,14 @@ public:
{
}
+ virtual void trace(Visitor*) OVERRIDE;
+
private:
virtual MutableStylePropertySet& propertySet() const OVERRIDE;
+#if !ENABLE(OILPAN)
virtual void ref() OVERRIDE;
virtual void deref() OVERRIDE;
+#endif
virtual CSSStyleSheet* parentStyleSheet() const OVERRIDE;
virtual Element* parentElement() const OVERRIDE { return m_parentElement; }
virtual void clearParentElement() OVERRIDE { m_parentElement = 0; }

Powered by Google App Engine
This is Rietveld 408576698