Chromium Code Reviews

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

Issue 137863007: Revert of Move most of the [Pass]RefPtr's of CSSPrimitiveValue to our transition types. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSShadowValue.cpp ('k') | Source/core/css/CSSValuePool.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 26 matching lines...)
37 37
38 namespace WebCore { 38 namespace WebCore {
39 39
40 class CSSValueList; 40 class CSSValueList;
41 41
42 class CSSValuePool : public NoBaseWillBeGarbageCollected<CSSValuePool> { 42 class CSSValuePool : public NoBaseWillBeGarbageCollected<CSSValuePool> {
43 DECLARE_GC_INFO; 43 DECLARE_GC_INFO;
44 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; 44 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
45 public: 45 public:
46 PassRefPtrWillBeRawPtr<CSSValueList> createFontFaceValue(const AtomicString& ); 46 PassRefPtrWillBeRawPtr<CSSValueList> createFontFaceValue(const AtomicString& );
47 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createFontFamilyValue(const String &); 47 PassRefPtr<CSSPrimitiveValue> createFontFamilyValue(const String&);
48 PassRefPtrWillBeRawPtr<CSSInheritedValue> createInheritedValue() { return m_ inheritedValue; } 48 PassRefPtrWillBeRawPtr<CSSInheritedValue> createInheritedValue() { return m_ inheritedValue; }
49 PassRefPtrWillBeRawPtr<CSSInitialValue> createImplicitInitialValue() { retur n m_implicitInitialValue; } 49 PassRefPtrWillBeRawPtr<CSSInitialValue> createImplicitInitialValue() { retur n m_implicitInitialValue; }
50 PassRefPtrWillBeRawPtr<CSSInitialValue> createExplicitInitialValue() { retur n m_explicitInitialValue; } 50 PassRefPtrWillBeRawPtr<CSSInitialValue> createExplicitInitialValue() { retur n m_explicitInitialValue; }
51 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createIdentifierValue(CSSValueID i dentifier); 51 PassRefPtr<CSSPrimitiveValue> createIdentifierValue(CSSValueID identifier);
52 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createIdentifierValue(CSSPropertyI D identifier); 52 PassRefPtr<CSSPrimitiveValue> createIdentifierValue(CSSPropertyID identifier );
53 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createColorValue(unsigned rgbValue ); 53 PassRefPtr<CSSPrimitiveValue> createColorValue(unsigned rgbValue);
54 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(double value, CSSPrimi tiveValue::UnitTypes); 54 PassRefPtr<CSSPrimitiveValue> createValue(double value, CSSPrimitiveValue::U nitTypes);
55 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(const String& value, C SSPrimitiveValue::UnitTypes type) { return CSSPrimitiveValue::create(value, type ); } 55 PassRefPtr<CSSPrimitiveValue> createValue(const String& value, CSSPrimitiveV alue::UnitTypes type) { return CSSPrimitiveValue::create(value, type); }
56 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(const Length& value, c onst RenderStyle&); 56 PassRefPtr<CSSPrimitiveValue> createValue(const Length& value, const RenderS tyle&);
57 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(const Length& value, f loat zoom) { return CSSPrimitiveValue::create(value, zoom); } 57 PassRefPtr<CSSPrimitiveValue> createValue(const Length& value, float zoom) { return CSSPrimitiveValue::create(value, zoom); }
58 template<typename T> static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create Value(T value) { return CSSPrimitiveValue::create(value); } 58 template<typename T> static PassRefPtr<CSSPrimitiveValue> createValue(T valu e) { return CSSPrimitiveValue::create(value); }
59 59
60 void trace(Visitor*); 60 void trace(Visitor*);
61 61
62 private: 62 private:
63 CSSValuePool(); 63 CSSValuePool();
64 64
65 RefPtrWillBeMember<CSSInheritedValue> m_inheritedValue; 65 RefPtrWillBeMember<CSSInheritedValue> m_inheritedValue;
66 RefPtrWillBeMember<CSSInitialValue> m_implicitInitialValue; 66 RefPtrWillBeMember<CSSInitialValue> m_implicitInitialValue;
67 RefPtrWillBeMember<CSSInitialValue> m_explicitInitialValue; 67 RefPtrWillBeMember<CSSInitialValue> m_explicitInitialValue;
68 68
69 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, numCSSValueKeywords> m_identifierValueCache; 69 RefPtr<CSSPrimitiveValue> m_identifierValueCache[numCSSValueKeywords];
70 70
71 typedef WillBeHeapHashMap<unsigned, RefPtrWillBeMember<CSSPrimitiveValue> > ColorValueCache; 71 typedef HashMap<unsigned, RefPtr<CSSPrimitiveValue> > ColorValueCache;
72 ColorValueCache m_colorValueCache; 72 ColorValueCache m_colorValueCache;
73 RefPtrWillBeMember<CSSPrimitiveValue> m_colorTransparent; 73 RefPtr<CSSPrimitiveValue> m_colorTransparent;
74 RefPtrWillBeMember<CSSPrimitiveValue> m_colorWhite; 74 RefPtr<CSSPrimitiveValue> m_colorWhite;
75 RefPtrWillBeMember<CSSPrimitiveValue> m_colorBlack; 75 RefPtr<CSSPrimitiveValue> m_colorBlack;
76 76
77 static const int maximumCacheableIntegerValue = 255; 77 static const int maximumCacheableIntegerValue = 255;
78 78
79 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, maximumCacheableInte gerValue + 1> m_pixelValueCache; 79 RefPtr<CSSPrimitiveValue> m_pixelValueCache[maximumCacheableIntegerValue + 1 ];
80 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, maximumCacheableInte gerValue + 1> m_percentValueCache; 80 RefPtr<CSSPrimitiveValue> m_percentValueCache[maximumCacheableIntegerValue + 1];
81 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, maximumCacheableInte gerValue + 1> m_numberValueCache; 81 RefPtr<CSSPrimitiveValue> m_numberValueCache[maximumCacheableIntegerValue + 1];
82 82
83 typedef WillBeHeapHashMap<AtomicString, RefPtrWillBeMember<CSSValueList> > F ontFaceValueCache; 83 typedef WillBeHeapHashMap<AtomicString, RefPtrWillBeMember<CSSValueList> > F ontFaceValueCache;
84 FontFaceValueCache m_fontFaceValueCache; 84 FontFaceValueCache m_fontFaceValueCache;
85 85
86 typedef WillBeHeapHashMap<String, RefPtrWillBeMember<CSSPrimitiveValue> > Fo ntFamilyValueCache; 86 typedef HashMap<String, RefPtr<CSSPrimitiveValue> > FontFamilyValueCache;
87 FontFamilyValueCache m_fontFamilyValueCache; 87 FontFamilyValueCache m_fontFamilyValueCache;
88 88
89 friend CSSValuePool& cssValuePool(); 89 friend CSSValuePool& cssValuePool();
90 }; 90 };
91 91
92 CSSValuePool& cssValuePool(); 92 CSSValuePool& cssValuePool();
93 93
94 } 94 }
95 95
96 #endif 96 #endif
OLDNEW
« no previous file with comments | « Source/core/css/CSSShadowValue.cpp ('k') | Source/core/css/CSSValuePool.cpp » ('j') | no next file with comments »

Powered by Google App Engine