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

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

Issue 1276243002: Oilpan: mark StylePropertySet::PropertyReference as stack allocated. (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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/StylePropertySet.h
diff --git a/Source/core/css/StylePropertySet.h b/Source/core/css/StylePropertySet.h
index 34f1d947ed090bb6ac31f38eff0ef3f2e1a4c010..4799550ee9461c5cd2d0ddaf864bab8704bf6851 100644
--- a/Source/core/css/StylePropertySet.h
+++ b/Source/core/css/StylePropertySet.h
@@ -56,9 +56,10 @@ public:
#endif
class PropertyReference {
+ STACK_ALLOCATED();
public:
PropertyReference(const StylePropertySet& propertySet, unsigned index)
- : m_propertySet(propertySet)
+ : m_propertySet(&propertySet)
, m_index(index)
{
}
@@ -82,7 +83,7 @@ public:
private:
const CSSValue* propertyValue() const;
- const StylePropertySet& m_propertySet;
+ RawPtrWillBeMember<const StylePropertySet> m_propertySet;
unsigned m_index;
};
@@ -250,16 +251,16 @@ inline MutableStylePropertySet* toMutableStylePropertySet(const Member<StyleProp
inline const StylePropertyMetadata& StylePropertySet::PropertyReference::propertyMetadata() const
{
- if (m_propertySet.isMutable())
- return toMutableStylePropertySet(m_propertySet).m_propertyVector.at(m_index).metadata();
- return toImmutableStylePropertySet(m_propertySet).metadataArray()[m_index];
+ if (m_propertySet->isMutable())
+ return toMutableStylePropertySet(*m_propertySet).m_propertyVector.at(m_index).metadata();
+ return toImmutableStylePropertySet(*m_propertySet).metadataArray()[m_index];
}
inline const CSSValue* StylePropertySet::PropertyReference::propertyValue() const
{
- if (m_propertySet.isMutable())
- return toMutableStylePropertySet(m_propertySet).m_propertyVector.at(m_index).value();
- return toImmutableStylePropertySet(m_propertySet).valueArray()[m_index];
+ if (m_propertySet->isMutable())
+ return toMutableStylePropertySet(*m_propertySet).m_propertyVector.at(m_index).value();
+ return toImmutableStylePropertySet(*m_propertySet).valueArray()[m_index];
}
inline unsigned StylePropertySet::propertyCount() const
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698