| 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 14 matching lines...) Expand all Loading... |
| 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/CSSFontFamilyValue.h" |
| 35 #include "core/css/CSSIdentifierValue.h" |
| 35 #include "core/css/CSSInheritedValue.h" | 36 #include "core/css/CSSInheritedValue.h" |
| 36 #include "core/css/CSSInitialValue.h" | 37 #include "core/css/CSSInitialValue.h" |
| 37 #include "core/css/CSSPrimitiveValue.h" | 38 #include "core/css/CSSPrimitiveValue.h" |
| 38 #include "core/css/CSSUnsetValue.h" | 39 #include "core/css/CSSUnsetValue.h" |
| 39 #include "core/css/CSSValueList.h" | 40 #include "core/css/CSSValueList.h" |
| 40 #include "wtf/HashMap.h" | 41 #include "wtf/HashMap.h" |
| 41 #include "wtf/RefPtr.h" | 42 #include "wtf/RefPtr.h" |
| 42 #include "wtf/text/AtomicStringHash.h" | 43 #include "wtf/text/AtomicStringHash.h" |
| 43 | 44 |
| 44 namespace blink { | 45 namespace blink { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 59 | 60 |
| 60 // Cached individual values. | 61 // Cached individual values. |
| 61 CSSColorValue* transparentColor() { return m_colorTransparent; } | 62 CSSColorValue* transparentColor() { return m_colorTransparent; } |
| 62 CSSColorValue* whiteColor() { return m_colorWhite; } | 63 CSSColorValue* whiteColor() { return m_colorWhite; } |
| 63 CSSColorValue* blackColor() { return m_colorBlack; } | 64 CSSColorValue* blackColor() { return m_colorBlack; } |
| 64 CSSInheritedValue* inheritedValue() { return m_inheritedValue; } | 65 CSSInheritedValue* inheritedValue() { return m_inheritedValue; } |
| 65 CSSInitialValue* implicitInitialValue() { return m_implicitInitialValue; } | 66 CSSInitialValue* implicitInitialValue() { return m_implicitInitialValue; } |
| 66 CSSInitialValue* explicitInitialValue() { return m_explicitInitialValue; } | 67 CSSInitialValue* explicitInitialValue() { return m_explicitInitialValue; } |
| 67 CSSUnsetValue* unsetValue() { return m_unsetValue; } | 68 CSSUnsetValue* unsetValue() { return m_unsetValue; } |
| 68 | 69 |
| 69 // CSSPrimitiveValue vector caches. | 70 // Vector caches. |
| 70 CSSPrimitiveValue* identifierCacheValue(CSSValueID ident) { | 71 CSSIdentifierValue* identifierCacheValue(CSSValueID ident) { |
| 71 return m_identifierValueCache[ident]; | 72 return m_identifierValueCache[ident]; |
| 72 } | 73 } |
| 73 CSSPrimitiveValue* setIdentifierCacheValue(CSSValueID ident, | 74 CSSIdentifierValue* setIdentifierCacheValue(CSSValueID ident, |
| 74 CSSPrimitiveValue* cssValue) { | 75 CSSIdentifierValue* cssValue) { |
| 75 return m_identifierValueCache[ident] = cssValue; | 76 return m_identifierValueCache[ident] = cssValue; |
| 76 } | 77 } |
| 77 CSSPrimitiveValue* pixelCacheValue(int intValue) { | 78 CSSPrimitiveValue* pixelCacheValue(int intValue) { |
| 78 return m_pixelValueCache[intValue]; | 79 return m_pixelValueCache[intValue]; |
| 79 } | 80 } |
| 80 CSSPrimitiveValue* setPixelCacheValue(int intValue, | 81 CSSPrimitiveValue* setPixelCacheValue(int intValue, |
| 81 CSSPrimitiveValue* cssValue) { | 82 CSSPrimitiveValue* cssValue) { |
| 82 return m_pixelValueCache[intValue] = cssValue; | 83 return m_pixelValueCache[intValue] = cssValue; |
| 83 } | 84 } |
| 84 CSSPrimitiveValue* percentCacheValue(int intValue) { | 85 CSSPrimitiveValue* percentCacheValue(int intValue) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 123 |
| 123 // Cached individual values. | 124 // Cached individual values. |
| 124 Member<CSSInheritedValue> m_inheritedValue; | 125 Member<CSSInheritedValue> m_inheritedValue; |
| 125 Member<CSSInitialValue> m_implicitInitialValue; | 126 Member<CSSInitialValue> m_implicitInitialValue; |
| 126 Member<CSSInitialValue> m_explicitInitialValue; | 127 Member<CSSInitialValue> m_explicitInitialValue; |
| 127 Member<CSSUnsetValue> m_unsetValue; | 128 Member<CSSUnsetValue> m_unsetValue; |
| 128 Member<CSSColorValue> m_colorTransparent; | 129 Member<CSSColorValue> m_colorTransparent; |
| 129 Member<CSSColorValue> m_colorWhite; | 130 Member<CSSColorValue> m_colorWhite; |
| 130 Member<CSSColorValue> m_colorBlack; | 131 Member<CSSColorValue> m_colorBlack; |
| 131 | 132 |
| 132 // CSSPrimitiveValue vector caches. | 133 // Vector caches. |
| 133 HeapVector<Member<CSSPrimitiveValue>, numCSSValueKeywords> | 134 HeapVector<Member<CSSIdentifierValue>, numCSSValueKeywords> |
| 134 m_identifierValueCache; | 135 m_identifierValueCache; |
| 135 HeapVector<Member<CSSPrimitiveValue>, maximumCacheableIntegerValue + 1> | 136 HeapVector<Member<CSSPrimitiveValue>, maximumCacheableIntegerValue + 1> |
| 136 m_pixelValueCache; | 137 m_pixelValueCache; |
| 137 HeapVector<Member<CSSPrimitiveValue>, maximumCacheableIntegerValue + 1> | 138 HeapVector<Member<CSSPrimitiveValue>, maximumCacheableIntegerValue + 1> |
| 138 m_percentValueCache; | 139 m_percentValueCache; |
| 139 HeapVector<Member<CSSPrimitiveValue>, maximumCacheableIntegerValue + 1> | 140 HeapVector<Member<CSSPrimitiveValue>, maximumCacheableIntegerValue + 1> |
| 140 m_numberValueCache; | 141 m_numberValueCache; |
| 141 | 142 |
| 142 // Hash map caches. | 143 // Hash map caches. |
| 143 ColorValueCache m_colorValueCache; | 144 ColorValueCache m_colorValueCache; |
| 144 FontFaceValueCache m_fontFaceValueCache; | 145 FontFaceValueCache m_fontFaceValueCache; |
| 145 FontFamilyValueCache m_fontFamilyValueCache; | 146 FontFamilyValueCache m_fontFamilyValueCache; |
| 146 | 147 |
| 147 friend CORE_EXPORT CSSValuePool& cssValuePool(); | 148 friend CORE_EXPORT CSSValuePool& cssValuePool(); |
| 148 }; | 149 }; |
| 149 | 150 |
| 150 CORE_EXPORT CSSValuePool& cssValuePool(); | 151 CORE_EXPORT CSSValuePool& cssValuePool(); |
| 151 | 152 |
| 152 } // namespace blink | 153 } // namespace blink |
| 153 | 154 |
| 154 #endif | 155 #endif |
| OLD | NEW |