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

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

Issue 1278143002: Oilpan: tidy StylePropertySerializer's handling of GCed objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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/StylePropertySerializer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/StylePropertySerializer.cpp
diff --git a/Source/core/css/StylePropertySerializer.cpp b/Source/core/css/StylePropertySerializer.cpp
index e81a5aead2ebfba3714bcdfac3408d5992ff73bc..5eb0a3fea3fcf5d800f74bf91b700f01e7e06130 100644
--- a/Source/core/css/StylePropertySerializer.cpp
+++ b/Source/core/css/StylePropertySerializer.cpp
@@ -40,16 +40,16 @@ static bool isInitialOrInherit(const String& value)
}
StylePropertySerializer::StylePropertySetForSerializer::StylePropertySetForSerializer(const StylePropertySet& properties)
- : m_propertySet(properties)
- , m_allIndex(m_propertySet.findPropertyIndex(CSSPropertyAll))
+ : m_propertySet(&properties)
+ , m_allIndex(m_propertySet->findPropertyIndex(CSSPropertyAll))
, m_needToExpandAll(false)
{
if (!hasAllProperty())
return;
- StylePropertySet::PropertyReference allProperty = m_propertySet.propertyAt(m_allIndex);
- for (unsigned i = 0; i < m_propertySet.propertyCount(); ++i) {
- StylePropertySet::PropertyReference property = m_propertySet.propertyAt(i);
+ StylePropertySet::PropertyReference allProperty = m_propertySet->propertyAt(m_allIndex);
+ for (unsigned i = 0; i < m_propertySet->propertyCount(); ++i) {
+ StylePropertySet::PropertyReference property = m_propertySet->propertyAt(i);
if (CSSProperty::isAffectedByAllProperty(property.id())) {
if (allProperty.isImportant() && !property.isImportant())
continue;
@@ -64,27 +64,32 @@ StylePropertySerializer::StylePropertySetForSerializer::StylePropertySetForSeria
}
}
+DEFINE_TRACE(StylePropertySerializer::StylePropertySetForSerializer)
+{
+ visitor->trace(m_propertySet);
+}
+
unsigned StylePropertySerializer::StylePropertySetForSerializer::propertyCount() const
{
if (!hasExpandedAllProperty())
- return m_propertySet.propertyCount();
+ return m_propertySet->propertyCount();
return lastCSSProperty - firstCSSProperty + 1;
}
StylePropertySerializer::PropertyValueForSerializer StylePropertySerializer::StylePropertySetForSerializer::propertyAt(unsigned index) const
{
if (!hasExpandedAllProperty())
- return StylePropertySerializer::PropertyValueForSerializer(m_propertySet.propertyAt(index));
+ return StylePropertySerializer::PropertyValueForSerializer(m_propertySet->propertyAt(index));
CSSPropertyID propertyID = static_cast<CSSPropertyID>(index + firstCSSProperty);
ASSERT(firstCSSProperty <= propertyID && propertyID <= lastCSSProperty);
if (m_longhandPropertyUsed.get(index)) {
- int index = m_propertySet.findPropertyIndex(propertyID);
+ int index = m_propertySet->findPropertyIndex(propertyID);
ASSERT(index != -1);
- return StylePropertySerializer::PropertyValueForSerializer(m_propertySet.propertyAt(index));
+ return StylePropertySerializer::PropertyValueForSerializer(m_propertySet->propertyAt(index));
}
- StylePropertySet::PropertyReference property = m_propertySet.propertyAt(m_allIndex);
+ StylePropertySet::PropertyReference property = m_propertySet->propertyAt(m_allIndex);
return StylePropertySerializer::PropertyValueForSerializer(propertyID, property.value(), property.isImportant());
}
@@ -97,7 +102,7 @@ bool StylePropertySerializer::StylePropertySetForSerializer::shouldProcessProper
// If all is not expanded, we need to process "all" and properties which
// are not overwritten by "all".
if (!m_needToExpandAll) {
- StylePropertySet::PropertyReference property = m_propertySet.propertyAt(index);
+ StylePropertySet::PropertyReference property = m_propertySet->propertyAt(index);
if (property.id() == CSSPropertyAll || !CSSProperty::isAffectedByAllProperty(property.id()))
return true;
return m_longhandPropertyUsed.get(property.id() - firstCSSProperty);
@@ -124,7 +129,7 @@ bool StylePropertySerializer::StylePropertySetForSerializer::shouldProcessProper
int StylePropertySerializer::StylePropertySetForSerializer::findPropertyIndex(CSSPropertyID propertyID) const
{
if (!hasExpandedAllProperty())
- return m_propertySet.findPropertyIndex(propertyID);
+ return m_propertySet->findPropertyIndex(propertyID);
return propertyID - firstCSSProperty;
}
@@ -140,7 +145,7 @@ const CSSValue* StylePropertySerializer::StylePropertySetForSerializer::getPrope
String StylePropertySerializer::StylePropertySetForSerializer::getPropertyValue(CSSPropertyID propertyID) const
{
if (!hasExpandedAllProperty())
- return m_propertySet.getPropertyValue(propertyID);
+ return m_propertySet->getPropertyValue(propertyID);
const CSSValue* value = getPropertyCSSValue(propertyID);
if (!value)
« no previous file with comments | « Source/core/css/StylePropertySerializer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698