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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp

Issue 2232093002: Removed parent data storage common to multiple CSSValues (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unsigned from enum class Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2012 Apple Inc. All rights reserv ed.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 201
202 static AtomicString* keywordStrings = new AtomicString[numCSSValueKeywords]; // Leaked intentionally. 202 static AtomicString* keywordStrings = new AtomicString[numCSSValueKeywords]; // Leaked intentionally.
203 AtomicString& keywordString = keywordStrings[valueID]; 203 AtomicString& keywordString = keywordStrings[valueID];
204 if (keywordString.isNull()) 204 if (keywordString.isNull())
205 keywordString = getValueName(valueID); 205 keywordString = getValueName(valueID);
206 return keywordString; 206 return keywordString;
207 } 207 }
208 208
209 CSSPrimitiveValue::CSSPrimitiveValue(CSSValueID valueID) 209 CSSPrimitiveValue::CSSPrimitiveValue(CSSValueID valueID)
210 : CSSValue(PrimitiveClass) 210 : CSSValue(PrimitiveClass)
211 , m_primitiveUnitType(0)
212 , m_hasCachedCSSText(false)
211 { 213 {
212 init(UnitType::ValueID); 214 init(UnitType::ValueID);
213 // TODO(sashab): Add a DCHECK_NE(valueID, CSSValueInvalid). 215 // TODO(sashab): Add a DCHECK_NE(valueID, CSSValueInvalid).
214 m_value.valueID = valueID; 216 m_value.valueID = valueID;
215 } 217 }
216 218
217 CSSPrimitiveValue::CSSPrimitiveValue(double num, UnitType type) 219 CSSPrimitiveValue::CSSPrimitiveValue(double num, UnitType type)
218 : CSSValue(PrimitiveClass) 220 : CSSValue(PrimitiveClass)
221 , m_primitiveUnitType(0)
222 , m_hasCachedCSSText(false)
219 { 223 {
220 init(type); 224 init(type);
221 ASSERT(std::isfinite(num)); 225 ASSERT(std::isfinite(num));
222 m_value.num = num; 226 m_value.num = num;
223 } 227 }
224 228
225 CSSPrimitiveValue::CSSPrimitiveValue(const Length& length, float zoom) 229 CSSPrimitiveValue::CSSPrimitiveValue(const Length& length, float zoom)
226 : CSSValue(PrimitiveClass) 230 : CSSValue(PrimitiveClass)
231 , m_primitiveUnitType(0)
232 , m_hasCachedCSSText(false)
227 { 233 {
228 switch (length.type()) { 234 switch (length.type()) {
229 case Auto: 235 case Auto:
230 init(UnitType::ValueID); 236 init(UnitType::ValueID);
231 m_value.valueID = CSSValueAuto; 237 m_value.valueID = CSSValueAuto;
232 break; 238 break;
233 case MinContent: 239 case MinContent:
234 init(UnitType::ValueID); 240 init(UnitType::ValueID);
235 m_value.valueID = CSSValueMinContent; 241 m_value.valueID = CSSValueMinContent;
236 break; 242 break;
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 case UnitType::Calc: 789 case UnitType::Calc:
784 visitor->trace(m_value.calc); 790 visitor->trace(m_value.calc);
785 break; 791 break;
786 default: 792 default:
787 break; 793 break;
788 } 794 }
789 CSSValue::traceAfterDispatch(visitor); 795 CSSValue::traceAfterDispatch(visitor);
790 } 796 }
791 797
792 } // namespace blink 798 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698