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

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

Issue 1318543010: Change first() and second() in CSSPairValue to return const references (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Review feedback 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/CSSGradientValue.cpp ('k') | Source/core/css/parser/CSSPropertyParser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSValuePair.h
diff --git a/Source/core/css/CSSValuePair.h b/Source/core/css/CSSValuePair.h
index b429c66b4743620b3709d1dd127e99a3e31a049f..dc9053915bc5856695d70d3e50b095d381d6fa44 100644
--- a/Source/core/css/CSSValuePair.h
+++ b/Source/core/css/CSSValuePair.h
@@ -47,8 +47,11 @@ public:
return adoptRefWillBeNoop(new CSSValuePair(CSSPrimitiveValue::create(lengthSize.width(), style.effectiveZoom()), CSSPrimitiveValue::create(lengthSize.height(), style.effectiveZoom()), KeepIdenticalValues));
}
- CSSValue* first() const { return m_first.get(); }
- CSSValue* second() const { return m_second.get(); }
+ // TODO(sashab): Remove these non-const versions.
+ CSSValue& first() { return *m_first; }
+ CSSValue& second() { return *m_second; }
+ const CSSValue& first() const { return *m_first; }
+ const CSSValue& second() const { return *m_second; }
String customCSSText() const
{
@@ -73,7 +76,11 @@ private:
: CSSValue(ValuePairClass)
, m_first(first)
, m_second(second)
- , m_identicalValuesPolicy(identicalValuesPolicy) { }
+ , m_identicalValuesPolicy(identicalValuesPolicy)
+ {
+ ASSERT(m_first);
+ ASSERT(m_second);
+ }
RefPtrWillBeMember<CSSValue> m_first;
RefPtrWillBeMember<CSSValue> m_second;
« no previous file with comments | « Source/core/css/CSSGradientValue.cpp ('k') | Source/core/css/parser/CSSPropertyParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698