OLD | NEW |
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 13 matching lines...) Expand all Loading... |
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/CSSColorValue.h" | 32 #include "core/css/CSSColorValue.h" |
33 #include "core/css/CSSCustomIdentValue.h" | 33 #include "core/css/CSSCustomIdentValue.h" |
| 34 #include "core/css/CSSFontFamilyValue.h" |
34 #include "core/css/CSSInheritedValue.h" | 35 #include "core/css/CSSInheritedValue.h" |
35 #include "core/css/CSSInitialValue.h" | 36 #include "core/css/CSSInitialValue.h" |
36 #include "core/css/CSSPrimitiveValue.h" | 37 #include "core/css/CSSPrimitiveValue.h" |
37 #include "core/css/CSSUnsetValue.h" | 38 #include "core/css/CSSUnsetValue.h" |
38 #include "core/css/CSSValueList.h" | 39 #include "core/css/CSSValueList.h" |
39 #include "wtf/HashMap.h" | 40 #include "wtf/HashMap.h" |
40 #include "wtf/RefPtr.h" | 41 #include "wtf/RefPtr.h" |
41 #include "wtf/text/AtomicStringHash.h" | 42 #include "wtf/text/AtomicStringHash.h" |
42 | 43 |
43 namespace blink { | 44 namespace blink { |
44 | 45 |
45 class CORE_EXPORT CSSValuePool : public NoBaseWillBeGarbageCollectedFinalized<C
SSValuePool> { | 46 class CORE_EXPORT CSSValuePool : public NoBaseWillBeGarbageCollectedFinalized<C
SSValuePool> { |
46 USING_FAST_MALLOC_WILL_BE_REMOVED(CSSValuePool); | 47 USING_FAST_MALLOC_WILL_BE_REMOVED(CSSValuePool); |
47 public: | 48 public: |
48 PassRefPtrWillBeRawPtr<CSSValueList> createFontFaceValue(const AtomicString&
); | 49 PassRefPtrWillBeRawPtr<CSSValueList> createFontFaceValue(const AtomicString&
); |
49 PassRefPtrWillBeRawPtr<CSSCustomIdentValue> createFontFamilyValue(const Stri
ng&); | 50 PassRefPtrWillBeRawPtr<CSSFontFamilyValue> createFontFamilyValue(const Strin
g&); |
50 PassRefPtrWillBeRawPtr<CSSInheritedValue> createInheritedValue() { return m_
inheritedValue; } | 51 PassRefPtrWillBeRawPtr<CSSInheritedValue> createInheritedValue() { return m_
inheritedValue; } |
51 PassRefPtrWillBeRawPtr<CSSInitialValue> createImplicitInitialValue() { retur
n m_implicitInitialValue; } | 52 PassRefPtrWillBeRawPtr<CSSInitialValue> createImplicitInitialValue() { retur
n m_implicitInitialValue; } |
52 PassRefPtrWillBeRawPtr<CSSInitialValue> createExplicitInitialValue() { retur
n m_explicitInitialValue; } | 53 PassRefPtrWillBeRawPtr<CSSInitialValue> createExplicitInitialValue() { retur
n m_explicitInitialValue; } |
53 PassRefPtrWillBeRawPtr<CSSUnsetValue> createUnsetValue() { return m_unsetVal
ue; } | 54 PassRefPtrWillBeRawPtr<CSSUnsetValue> createUnsetValue() { return m_unsetVal
ue; } |
54 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createIdentifierValue(CSSValueID i
dentifier); | 55 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createIdentifierValue(CSSValueID i
dentifier); |
55 PassRefPtrWillBeRawPtr<CSSCustomIdentValue> createIdentifierValue(CSSPropert
yID identifier); | 56 PassRefPtrWillBeRawPtr<CSSCustomIdentValue> createIdentifierValue(CSSPropert
yID identifier); |
56 PassRefPtrWillBeRawPtr<CSSColorValue> createColorValue(RGBA32 rgbValue); | 57 PassRefPtrWillBeRawPtr<CSSColorValue> createColorValue(RGBA32 rgbValue); |
57 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(double value, CSSPrimi
tiveValue::UnitType); | 58 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(double value, CSSPrimi
tiveValue::UnitType); |
58 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(const Length& value, c
onst ComputedStyle&); | 59 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(const Length& value, c
onst ComputedStyle&); |
59 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(const Length& value, f
loat zoom) { return CSSPrimitiveValue::create(value, zoom); } | 60 PassRefPtrWillBeRawPtr<CSSPrimitiveValue> createValue(const Length& value, f
loat zoom) { return CSSPrimitiveValue::create(value, zoom); } |
(...skipping 19 matching lines...) Expand all Loading... |
79 | 80 |
80 static const int maximumCacheableIntegerValue = 255; | 81 static const int maximumCacheableIntegerValue = 255; |
81 | 82 |
82 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, maximumCacheableInte
gerValue + 1> m_pixelValueCache; | 83 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, maximumCacheableInte
gerValue + 1> m_pixelValueCache; |
83 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, maximumCacheableInte
gerValue + 1> m_percentValueCache; | 84 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, maximumCacheableInte
gerValue + 1> m_percentValueCache; |
84 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, maximumCacheableInte
gerValue + 1> m_numberValueCache; | 85 WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, maximumCacheableInte
gerValue + 1> m_numberValueCache; |
85 | 86 |
86 using FontFaceValueCache = WillBeHeapHashMap<AtomicString, RefPtrWillBeMembe
r<CSSValueList>>; | 87 using FontFaceValueCache = WillBeHeapHashMap<AtomicString, RefPtrWillBeMembe
r<CSSValueList>>; |
87 FontFaceValueCache m_fontFaceValueCache; | 88 FontFaceValueCache m_fontFaceValueCache; |
88 | 89 |
89 using FontFamilyValueCache = WillBeHeapHashMap<String, RefPtrWillBeMember<CS
SCustomIdentValue>>; | 90 using FontFamilyValueCache = WillBeHeapHashMap<String, RefPtrWillBeMember<CS
SFontFamilyValue>>; |
90 FontFamilyValueCache m_fontFamilyValueCache; | 91 FontFamilyValueCache m_fontFamilyValueCache; |
91 | 92 |
92 friend CORE_EXPORT CSSValuePool& cssValuePool(); | 93 friend CORE_EXPORT CSSValuePool& cssValuePool(); |
93 }; | 94 }; |
94 | 95 |
95 CORE_EXPORT CSSValuePool& cssValuePool(); | 96 CORE_EXPORT CSSValuePool& cssValuePool(); |
96 | 97 |
97 } // namespace blink | 98 } // namespace blink |
98 | 99 |
99 #endif | 100 #endif |
OLD | NEW |