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

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

Issue 1238943004: CSSValue Immediates: Replace CSSValue usage with const references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_1
Patch Set: Rebase Created 5 years, 5 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') | Source/core/css/StylePropertySet.cpp » ('j') | 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 bc717e84f3f8ebe117aa3f2eed077c2768461b67..16772337db79b9909be528a23f2b1113621b9965 100644
--- a/Source/core/css/StylePropertySet.h
+++ b/Source/core/css/StylePropertySet.h
@@ -70,9 +70,7 @@ public:
bool isInherited() const { return propertyMetadata().m_inherited; }
bool isImplicit() const { return propertyMetadata().m_implicit; }
- const CSSValue value() const { return propertyValue(); }
- // FIXME: We should try to remove this mutable overload.
- CSSValue value() { return propertyValue(); }
+ const CSSValue& value() const { return propertyValue(); }
// FIXME: Remove this.
CSSProperty toCSSProperty() const { return CSSProperty(propertyMetadata(), propertyValue()); }
@@ -80,7 +78,7 @@ public:
const StylePropertyMetadata& propertyMetadata() const;
private:
- const CSSValue propertyValue() const;
+ const CSSValue& propertyValue() const;
const StylePropertySet& m_propertySet;
unsigned m_index;
@@ -118,7 +116,7 @@ public:
void showStyle();
#endif
- bool propertyMatches(CSSPropertyID, const CSSValue) const;
+ bool propertyMatches(CSSPropertyID, const CSSValue&) const;
DECLARE_TRACE();
DEFINE_INLINE_TRACE_AFTER_DISPATCH() { }
@@ -196,7 +194,7 @@ public:
// These expand shorthand properties into multiple properties.
bool setProperty(CSSPropertyID unresolvedProperty, const String& value, bool important = false, StyleSheetContents* contextStyleSheet = 0);
- void setProperty(CSSPropertyID, CSSValue, bool important = false);
+ void setProperty(CSSPropertyID, const CSSValue&, bool important = false);
// These do not. FIXME: This is too messy, we can do better.
bool setProperty(CSSPropertyID, CSSValueID identifier, bool important = false);
@@ -255,7 +253,7 @@ inline const StylePropertyMetadata& StylePropertySet::PropertyReference::propert
return toImmutableStylePropertySet(m_propertySet).metadataArray()[m_index];
}
-inline const CSSValue StylePropertySet::PropertyReference::propertyValue() const
+inline const CSSValue& StylePropertySet::PropertyReference::propertyValue() const
{
if (m_propertySet.isMutable())
return toMutableStylePropertySet(m_propertySet).m_propertyVector.at(m_index).value();
« no previous file with comments | « Source/core/css/StylePropertySerializer.h ('k') | Source/core/css/StylePropertySet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698