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

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

Issue 2158723002: Make CSSValuePair store const CSSValues (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_make_cssparsersinglevalue_return_const
Patch Set: Review feedback Created 4 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 | « third_party/WebKit/Source/core/css/CSSGradientValue.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/CSSValuePair.h
diff --git a/third_party/WebKit/Source/core/css/CSSValuePair.h b/third_party/WebKit/Source/core/css/CSSValuePair.h
index 9afe52d5359110a43898597e8c04b3e44e7b088c..4069f090f5fb33b253e242e4cb5683cf18f15ebd 100644
--- a/third_party/WebKit/Source/core/css/CSSValuePair.h
+++ b/third_party/WebKit/Source/core/css/CSSValuePair.h
@@ -34,7 +34,7 @@ class CORE_EXPORT CSSValuePair : public CSSValue {
public:
enum IdenticalValuesPolicy { DropIdenticalValues, KeepIdenticalValues };
- static CSSValuePair* create(CSSValue* first, CSSValue* second,
+ static CSSValuePair* create(const CSSValue* first, const CSSValue* second,
IdenticalValuesPolicy identicalValuesPolicy)
{
return new CSSValuePair(first, second, identicalValuesPolicy);
@@ -45,9 +45,6 @@ public:
return new CSSValuePair(CSSPrimitiveValue::create(lengthSize.width(), style.effectiveZoom()), CSSPrimitiveValue::create(lengthSize.height(), style.effectiveZoom()), KeepIdenticalValues);
}
- // 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; }
@@ -70,7 +67,7 @@ public:
DECLARE_TRACE_AFTER_DISPATCH();
private:
- CSSValuePair(CSSValue* first, CSSValue* second, IdenticalValuesPolicy identicalValuesPolicy)
+ CSSValuePair(const CSSValue* first, const CSSValue* second, IdenticalValuesPolicy identicalValuesPolicy)
: CSSValue(ValuePairClass)
, m_first(first)
, m_second(second)
@@ -80,8 +77,8 @@ private:
ASSERT(m_second);
}
- Member<CSSValue> m_first;
- Member<CSSValue> m_second;
+ Member<const CSSValue> m_first;
+ Member<const CSSValue> m_second;
IdenticalValuesPolicy m_identicalValuesPolicy;
};
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSGradientValue.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698