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

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

Issue 195953003: Oilpan: Move CSSStyleDeclaration and subclasses to the heap using transistion types. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review feedback 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/PropertySetCSSStyleDeclaration.h ('k') | Source/core/css/StylePropertySet.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/PropertySetCSSStyleDeclaration.cpp
diff --git a/Source/core/css/PropertySetCSSStyleDeclaration.cpp b/Source/core/css/PropertySetCSSStyleDeclaration.cpp
index b948d36a1e1d7d1034c8288042b958d6e5cf9044..502217985240bdc93104276ccccc8f5cf0499d2d 100644
--- a/Source/core/css/PropertySetCSSStyleDeclaration.cpp
+++ b/Source/core/css/PropertySetCSSStyleDeclaration.cpp
@@ -125,6 +125,7 @@ bool StyleAttributeMutationScope::s_shouldDeliver = false;
} // namespace
+#if !ENABLE(OILPAN)
void PropertySetCSSStyleDeclaration::ref()
{
m_propertySet->ref();
@@ -134,6 +135,13 @@ void PropertySetCSSStyleDeclaration::deref()
{
m_propertySet->deref();
}
+#endif
+
+void PropertySetCSSStyleDeclaration::trace(Visitor* visitor)
+{
+ visitor->trace(m_propertySet);
+ AbstractPropertySetCSSStyleDeclaration::trace(visitor);
+}
unsigned AbstractPropertySetCSSStyleDeclaration::length() const
{
@@ -282,7 +290,7 @@ CSSValue* AbstractPropertySetCSSStyleDeclaration::cloneAndCacheForCSSOM(CSSValue
// The map is here to maintain the object identity of the CSSValues over multiple invocations.
// FIXME: It is likely that the identity is not important for web compatibility and this code should be removed.
if (!m_cssomCSSValueClones)
- m_cssomCSSValueClones = adoptPtrWillBeNoop(new WillBeHeapHashMap<CSSValue*, RefPtrWillBeMember<CSSValue> >);
+ m_cssomCSSValueClones = adoptPtrWillBeNoop(new WillBeHeapHashMap<RawPtrWillBeMember<CSSValue>, RefPtrWillBeMember<CSSValue> >);
RefPtrWillBeMember<CSSValue>& clonedValue = m_cssomCSSValueClones->add(internalValue, RefPtrWillBeMember<CSSValue>()).storedValue->value;
if (!clonedValue)
@@ -306,19 +314,33 @@ bool AbstractPropertySetCSSStyleDeclaration::cssPropertyMatches(CSSPropertyID pr
return propertySet().propertyMatches(propertyID, propertyValue);
}
+void AbstractPropertySetCSSStyleDeclaration::trace(Visitor* visitor)
+{
+#if ENABLE(OILPAN)
+ visitor->trace(m_cssomCSSValueClones);
+#endif
+}
+
StyleRuleCSSStyleDeclaration::StyleRuleCSSStyleDeclaration(MutableStylePropertySet& propertySetArg, CSSRule* parentRule)
: PropertySetCSSStyleDeclaration(propertySetArg)
+#if !ENABLE(OILPAN)
, m_refCount(1)
+#endif
, m_parentRule(parentRule)
{
+#if !ENABLE(OILPAN)
m_propertySet->ref();
+#endif
}
StyleRuleCSSStyleDeclaration::~StyleRuleCSSStyleDeclaration()
{
+#if !ENABLE(OILPAN)
m_propertySet->deref();
+#endif
}
+#if !ENABLE(OILPAN)
void StyleRuleCSSStyleDeclaration::ref()
{
++m_refCount;
@@ -330,6 +352,7 @@ void StyleRuleCSSStyleDeclaration::deref()
if (!--m_refCount)
delete this;
}
+#endif
void StyleRuleCSSStyleDeclaration::willMutate()
{
@@ -354,9 +377,19 @@ CSSStyleSheet* StyleRuleCSSStyleDeclaration::parentStyleSheet() const
void StyleRuleCSSStyleDeclaration::reattach(MutableStylePropertySet& propertySet)
{
+#if !ENABLE(OILPAN)
m_propertySet->deref();
+#endif
m_propertySet = &propertySet;
+#if !ENABLE(OILPAN)
m_propertySet->ref();
+#endif
+}
+
+void StyleRuleCSSStyleDeclaration::trace(Visitor* visitor)
+{
+ visitor->trace(m_parentRule);
+ PropertySetCSSStyleDeclaration::trace(visitor);
}
MutableStylePropertySet& InlineCSSStyleDeclaration::propertySet() const
@@ -385,6 +418,7 @@ CSSStyleSheet* InlineCSSStyleDeclaration::parentStyleSheet() const
return m_parentElement ? &m_parentElement->document().elementSheet() : 0;
}
+#if !ENABLE(OILPAN)
void InlineCSSStyleDeclaration::ref()
{
m_parentElement->ref();
@@ -394,5 +428,11 @@ void InlineCSSStyleDeclaration::deref()
{
m_parentElement->deref();
}
+#endif
+
+void InlineCSSStyleDeclaration::trace(Visitor* visitor)
+{
+ AbstractPropertySetCSSStyleDeclaration::trace(visitor);
+}
} // namespace WebCore
« no previous file with comments | « Source/core/css/PropertySetCSSStyleDeclaration.h ('k') | Source/core/css/StylePropertySet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698