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

Side by Side Diff: third_party/WebKit/Source/core/css/CSSValue.h

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 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 static const size_t ValueListSeparatorBits = 2; 179 static const size_t ValueListSeparatorBits = 2;
180 enum ValueListSeparator { 180 enum ValueListSeparator {
181 SpaceSeparator, 181 SpaceSeparator,
182 CommaSeparator, 182 CommaSeparator,
183 SlashSeparator 183 SlashSeparator
184 }; 184 };
185 185
186 ClassType getClassType() const { return static_cast<ClassType>(m_classType); } 186 ClassType getClassType() const { return static_cast<ClassType>(m_classType); }
187 187
188 explicit CSSValue(ClassType classType) 188 explicit CSSValue(ClassType classType)
189 : m_primitiveUnitType(0) 189 : m_classType(classType)
190 , m_hasCachedCSSText(false)
191 , m_valueListSeparator(SpaceSeparator)
192 , m_classType(classType)
193 { 190 {
194 } 191 }
195 192
196 // NOTE: This class is non-virtual for memory and performance reasons. 193 // NOTE: This class is non-virtual for memory and performance reasons.
197 // Don't go making it virtual again unless you know exactly what you're doin g! 194 // Don't go making it virtual again unless you know exactly what you're doin g!
198 195
199 private: 196 private:
200 void destroy(); 197 void destroy();
201 198
202 protected:
203 // The bits in this section are only used by specific subclasses but kept he re
204 // to maximize struct packing.
205
206 // CSSPrimitiveValue bits:
207 unsigned m_primitiveUnitType : 7; // CSSPrimitiveValue::UnitType
208 mutable unsigned m_hasCachedCSSText : 1;
209
210 unsigned m_valueListSeparator : ValueListSeparatorBits;
esprehn 2016/08/11 05:42:35 this was done so these bits can pack with m_classT
211
212 private:
213 unsigned m_classType : ClassTypeBits; // ClassType 199 unsigned m_classType : ClassTypeBits; // ClassType
214 }; 200 };
215 201
216 template<typename CSSValueType, size_t inlineCapacity> 202 template<typename CSSValueType, size_t inlineCapacity>
217 inline bool compareCSSValueVector(const HeapVector<Member<CSSValueType>, inlineC apacity>& firstVector, const HeapVector<Member<CSSValueType>, inlineCapacity>& s econdVector) 203 inline bool compareCSSValueVector(const HeapVector<Member<CSSValueType>, inlineC apacity>& firstVector, const HeapVector<Member<CSSValueType>, inlineCapacity>& s econdVector)
218 { 204 {
219 size_t size = firstVector.size(); 205 size_t size = firstVector.size();
220 if (size != secondVector.size()) 206 if (size != secondVector.size())
221 return false; 207 return false;
222 208
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 return false; 245 return false;
260 return first->equals(*second); 246 return first->equals(*second);
261 } 247 }
262 248
263 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \ 249 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \
264 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica te) 250 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica te)
265 251
266 } // namespace blink 252 } // namespace blink
267 253
268 #endif // CSSValue_h 254 #endif // CSSValue_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp ('k') | third_party/WebKit/Source/core/css/CSSValueList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698