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

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

Issue 1306823004: Split out String, URI and CustomIdent from CSSPrimitiveValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@split_out_attr_values
Patch Set: Rebase Created 5 years, 2 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 * 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 11 matching lines...) Expand all
22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 22 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23 * THE POSSIBILITY OF SUCH DAMAGE. 23 * THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef CSSValuePool_h 26 #ifndef CSSValuePool_h
27 #define CSSValuePool_h 27 #define CSSValuePool_h
28 28
29 #include "core/CSSPropertyNames.h" 29 #include "core/CSSPropertyNames.h"
30 #include "core/CSSValueKeywords.h" 30 #include "core/CSSValueKeywords.h"
31 #include "core/CoreExport.h" 31 #include "core/CoreExport.h"
32 #include "core/css/CSSCustomIdentValue.h"
32 #include "core/css/CSSInheritedValue.h" 33 #include "core/css/CSSInheritedValue.h"
33 #include "core/css/CSSInitialValue.h" 34 #include "core/css/CSSInitialValue.h"
34 #include "core/css/CSSPrimitiveValue.h" 35 #include "core/css/CSSPrimitiveValue.h"
35 #include "core/css/CSSUnsetValue.h" 36 #include "core/css/CSSUnsetValue.h"
36 #include "core/css/CSSValueList.h" 37 #include "core/css/CSSValueList.h"
37 #include "wtf/HashMap.h" 38 #include "wtf/HashMap.h"
38 #include "wtf/RefPtr.h" 39 #include "wtf/RefPtr.h"
39 #include "wtf/text/AtomicStringHash.h" 40 #include "wtf/text/AtomicStringHash.h"
40 41
41 namespace blink { 42 namespace blink {
42 43
43 class CORE_EXPORT CSSValuePool : public NoBaseWillBeGarbageCollectedFinalized<C SSValuePool> { 44 class CORE_EXPORT CSSValuePool : public NoBaseWillBeGarbageCollectedFinalized<C SSValuePool> {
44 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(CSSValuePool); 45 WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED(CSSValuePool);
45 public: 46 public:
46 PassRefPtrWillBeRawPtr<CSSValueList> createFontFaceValue(const AtomicString& ); 47 PassRefPtrWillBeRawPtr<CSSValueList> createFontFaceValue(const AtomicString& );
47 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createFontFamilyValue(const String &); 48 PassRefPtrWillBeRawPtr<CSSCustomIdentValue> createFontFamilyValue(const Stri ng&);
48 PassRefPtrWillBeRawPtr<CSSInheritedValue> createInheritedValue() { return m_ inheritedValue; } 49 PassRefPtrWillBeRawPtr<CSSInheritedValue> createInheritedValue() { return m_ inheritedValue; }
49 PassRefPtrWillBeRawPtr<CSSInitialValue> createImplicitInitialValue() { retur n m_implicitInitialValue; } 50 PassRefPtrWillBeRawPtr<CSSInitialValue> createImplicitInitialValue() { retur n m_implicitInitialValue; }
50 PassRefPtrWillBeRawPtr<CSSInitialValue> createExplicitInitialValue() { retur n m_explicitInitialValue; } 51 PassRefPtrWillBeRawPtr<CSSInitialValue> createExplicitInitialValue() { retur n m_explicitInitialValue; }
51 PassRefPtrWillBeRawPtr<CSSUnsetValue> createUnsetValue() { return m_unsetVal ue; } 52 PassRefPtrWillBeRawPtr<CSSUnsetValue> createUnsetValue() { return m_unsetVal ue; }
52 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createIdentifierValue(CSSValueID i dentifier); 53 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createIdentifierValue(CSSValueID i dentifier);
53 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createIdentifierValue(CSSPropertyI D identifier); 54 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createIdentifierValue(CSSPropertyI D identifier);
54 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createColorValue(unsigned rgbValue ); 55 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createColorValue(unsigned rgbValue );
55 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(double value, CSSPrimi tiveValue::UnitType); 56 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(double value, CSSPrimi tiveValue::UnitType);
56 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(const String& value, C SSPrimitiveValue::UnitType type) { return CSSPrimitiveValue::create(value, type) ; }
57 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(const Length& value, c onst ComputedStyle&); 57 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(const Length& value, c onst ComputedStyle&);
58 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(const Length& value, f loat zoom) { return CSSPrimitiveValue::create(value, zoom); } 58 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(const Length& value, f loat zoom) { return CSSPrimitiveValue::create(value, zoom); }
59 template<typename T> static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create Value(T value) { return CSSPrimitiveValue::create(value); } 59 template<typename T> static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> create Value(T value) { return CSSPrimitiveValue::create(value); }
60 60
61 DECLARE_TRACE(); 61 DECLARE_TRACE();
62 62
63 private: 63 private:
64 CSSValuePool(); 64 CSSValuePool();
65 65
66 RefPtrWillBeMember<CSSInheritedValue> m_inheritedValue; 66 RefPtrWillBeMember<CSSInheritedValue> m_inheritedValue;
(...skipping 11 matching lines...) Expand all
78 78
79 static const int maximumCacheableIntegerValue = 255; 79 static const int maximumCacheableIntegerValue = 255;
80 80
81 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, maximumCacheableInte gerValue + 1> m_pixelValueCache; 81 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, maximumCacheableInte gerValue + 1> m_pixelValueCache;
82 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, maximumCacheableInte gerValue + 1> m_percentValueCache; 82 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, maximumCacheableInte gerValue + 1> m_percentValueCache;
83 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, maximumCacheableInte gerValue + 1> m_numberValueCache; 83 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, maximumCacheableInte gerValue + 1> m_numberValueCache;
84 84
85 using FontFaceValueCache = WillBeHeapHashMap<AtomicString, RefPtrWillBeMembe r<CSSValueList>>; 85 using FontFaceValueCache = WillBeHeapHashMap<AtomicString, RefPtrWillBeMembe r<CSSValueList>>;
86 FontFaceValueCache m_fontFaceValueCache; 86 FontFaceValueCache m_fontFaceValueCache;
87 87
88 using FontFamilyValueCache = WillBeHeapHashMap<String, RefPtrWillBeMember<CS SPrimitiveValue>>; 88 using FontFamilyValueCache = WillBeHeapHashMap<String, RefPtrWillBeMember<CS SCustomIdentValue>>;
89 FontFamilyValueCache m_fontFamilyValueCache; 89 FontFamilyValueCache m_fontFamilyValueCache;
90 90
91 friend CORE_EXPORT CSSValuePool& cssValuePool(); 91 friend CORE_EXPORT CSSValuePool& cssValuePool();
92 }; 92 };
93 93
94 CORE_EXPORT CSSValuePool& cssValuePool(); 94 CORE_EXPORT CSSValuePool& cssValuePool();
95 95
96 } 96 }
97 97
98 #endif 98 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSValue.cpp ('k') | third_party/WebKit/Source/core/css/CSSValuePool.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698