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

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

Issue 1310603004: WIP: Reduce sizeof(CSSValue) by 8 byte Base URL: svn://svn.chromium.org/blink/trunk
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/CSSPrimitiveValue.h ('k') | Source/core/css/CSSValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSPrimitiveValue.cpp
diff --git a/Source/core/css/CSSPrimitiveValue.cpp b/Source/core/css/CSSPrimitiveValue.cpp
index 477da87b9ae30526333df3d53120fc81f742c2fa..099824a526f6de1038fb2ca0ba81d23068849da7 100644
--- a/Source/core/css/CSSPrimitiveValue.cpp
+++ b/Source/core/css/CSSPrimitiveValue.cpp
@@ -331,48 +331,48 @@ CSSPrimitiveValue::CSSPrimitiveValue(const Length& length, float zoom)
void CSSPrimitiveValue::init(UnitType type)
{
- m_primitiveUnitType = static_cast<unsigned>(type);
+ setPrimitiveUnitType(static_cast<unsigned>(type));
}
void CSSPrimitiveValue::init(const LengthSize& lengthSize, const ComputedStyle& style)
{
init(UnitType::Pair);
- m_hasCachedCSSText = false;
+ setHasCachedCSSText(false);
m_value.pair = Pair::create(create(lengthSize.width(), style.effectiveZoom()), create(lengthSize.height(), style.effectiveZoom()), Pair::KeepIdenticalValues).leakRef();
}
void CSSPrimitiveValue::init(PassRefPtrWillBeRawPtr<Rect> r)
{
init(UnitType::Rect);
- m_hasCachedCSSText = false;
+ setHasCachedCSSText(false);
m_value.rect = r.leakRef();
}
void CSSPrimitiveValue::init(PassRefPtrWillBeRawPtr<Quad> quad)
{
init(UnitType::Quad);
- m_hasCachedCSSText = false;
+ setHasCachedCSSText(false);
m_value.quad = quad.leakRef();
}
void CSSPrimitiveValue::init(PassRefPtrWillBeRawPtr<Pair> p)
{
init(UnitType::Pair);
- m_hasCachedCSSText = false;
+ setHasCachedCSSText(false);
m_value.pair = p.leakRef();
}
void CSSPrimitiveValue::init(PassRefPtrWillBeRawPtr<CSSCalcValue> c)
{
init(UnitType::Calc);
- m_hasCachedCSSText = false;
+ setHasCachedCSSText(false);
m_value.calc = c.leakRef();
}
void CSSPrimitiveValue::init(PassRefPtrWillBeRawPtr<CSSBasicShape> shape)
{
init(UnitType::Shape);
- m_hasCachedCSSText = false;
+ setHasCachedCSSText(false);
m_value.shape = shape.leakRef();
}
@@ -461,9 +461,9 @@ void CSSPrimitiveValue::cleanup()
case UnitType::ValueID:
break;
}
- if (m_hasCachedCSSText) {
+ if (hasCachedCSSText()) {
cssTextCache().remove(this);
- m_hasCachedCSSText = false;
+ setHasCachedCSSText(false);
}
}
@@ -921,7 +921,7 @@ const char* CSSPrimitiveValue::unitTypeToString(UnitType type)
String CSSPrimitiveValue::customCSSText() const
{
- if (m_hasCachedCSSText) {
+ if (hasCachedCSSText()) {
ASSERT(cssTextCache().contains(this));
return cssTextCache().get(this);
}
@@ -1018,7 +1018,7 @@ String CSSPrimitiveValue::customCSSText() const
ASSERT(!cssTextCache().contains(this));
cssTextCache().set(this, text);
- m_hasCachedCSSText = true;
+ const_cast<CSSPrimitiveValue*>(this)->setHasCachedCSSText(true);
return text;
}
« no previous file with comments | « Source/core/css/CSSPrimitiveValue.h ('k') | Source/core/css/CSSValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698