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

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

Issue 184313004: Move all RefPtr's to CSSValue to oilpan transition types, except for the one in CSSCursorImageValue. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 mutable unsigned m_hasCachedCSSText : 1; 217 mutable unsigned m_hasCachedCSSText : 1;
218 unsigned m_isQuirkValue : 1; 218 unsigned m_isQuirkValue : 1;
219 219
220 unsigned m_valueListSeparator : ValueListSeparatorBits; 220 unsigned m_valueListSeparator : ValueListSeparatorBits;
221 221
222 private: 222 private:
223 unsigned m_classType : ClassTypeBits; // ClassType 223 unsigned m_classType : ClassTypeBits; // ClassType
224 }; 224 };
225 225
226 template<typename CSSValueType, size_t inlineCapacity> 226 template<typename CSSValueType, size_t inlineCapacity>
227 inline bool compareCSSValueVector(const Vector<RefPtr<CSSValueType>, inlineCapac ity>& firstVector, const Vector<RefPtr<CSSValueType>, inlineCapacity>& secondVec tor) 227 inline bool compareCSSValueVector(const WillBeHeapVector<RefPtrWillBeMember<CSSV alueType>, inlineCapacity>& firstVector, const WillBeHeapVector<RefPtrWillBeMemb er<CSSValueType>, inlineCapacity>& secondVector)
228 { 228 {
229 size_t size = firstVector.size(); 229 size_t size = firstVector.size();
230 if (size != secondVector.size()) 230 if (size != secondVector.size())
231 return false; 231 return false;
232 232
233 for (size_t i = 0; i < size; i++) { 233 for (size_t i = 0; i < size; i++) {
234 const RefPtr<CSSValueType>& firstPtr = firstVector[i]; 234 const RefPtrWillBeMember<CSSValueType>& firstPtr = firstVector[i];
235 const RefPtr<CSSValueType>& secondPtr = secondVector[i]; 235 const RefPtrWillBeMember<CSSValueType>& secondPtr = secondVector[i];
zerny-chromium 2014/03/05 03:41:44 Nit: These should in due time (once transition typ
wibling-chromium 2014/03/05 08:02:14 No, off hand the idea was they should be Member<CS
236 if (firstPtr == secondPtr || (firstPtr && secondPtr && firstPtr->equals( *secondPtr))) 236 if (firstPtr == secondPtr || (firstPtr && secondPtr && firstPtr->equals( *secondPtr)))
237 continue; 237 continue;
238 return false; 238 return false;
239 }
240 return true;
241 }
242
243 // FIXME: oilpan: this will be merged with the above compareCSSVector method
244 // once CSSValue is moved to the transition types.
245 template<typename CSSValueType, size_t inlineCapacity>
246 inline bool compareCSSValueVector(const HeapVector<Member<CSSValueType>, inlineC apacity>& firstVector, const HeapVector<Member<CSSValueType>, inlineCapacity>& s econdVector)
247 {
248 size_t size = firstVector.size();
249 if (size != secondVector.size())
250 return false;
251
252 for (size_t i = 0; i < size; i++) {
253 const Member<CSSValueType>& firstPtr = firstVector[i];
254 const Member<CSSValueType>& secondPtr = secondVector[i];
255 if (firstPtr == secondPtr || (firstPtr && secondPtr && firstPtr->equals( *secondPtr)))
256 continue;
257 return false;
258 } 239 }
259 return true; 240 return true;
260 } 241 }
261 242
262 template<typename CSSValueType> 243 template<typename CSSValueType>
263 inline bool compareCSSValuePtr(const RefPtr<CSSValueType>& first, const RefPtr<C SSValueType>& second) 244 inline bool compareCSSValuePtr(const RefPtr<CSSValueType>& first, const RefPtr<C SSValueType>& second)
264 { 245 {
265 return first ? second && first->equals(*second) : !second; 246 return first ? second && first->equals(*second) : !second;
266 } 247 }
267 248
268 template<typename CSSValueType> 249 template<typename CSSValueType>
269 inline bool compareCSSValuePtr(const RawPtr<CSSValueType>& first, const RawPtr<C SSValueType>& second) 250 inline bool compareCSSValuePtr(const RawPtr<CSSValueType>& first, const RawPtr<C SSValueType>& second)
270 { 251 {
271 return first ? second && first->equals(*second) : !second; 252 return first ? second && first->equals(*second) : !second;
272 } 253 }
273 254
274 template<typename CSSValueType> 255 template<typename CSSValueType>
275 inline bool compareCSSValuePtr(const Member<CSSValueType>& first, const Member<C SSValueType>& second) 256 inline bool compareCSSValuePtr(const Member<CSSValueType>& first, const Member<C SSValueType>& second)
276 { 257 {
277 return first ? second && first->equals(*second) : !second; 258 return first ? second && first->equals(*second) : !second;
278 } 259 }
279 260
280 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \ 261 #define DEFINE_CSS_VALUE_TYPE_CASTS(thisType, predicate) \
281 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica te) 262 DEFINE_TYPE_CASTS(thisType, CSSValue, value, value->predicate, value.predica te)
282 263
283 } // namespace WebCore 264 } // namespace WebCore
284 265
285 #endif // CSSValue_h 266 #endif // CSSValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698