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

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

Issue 2346193002: Split CSSPrimitiveValue into CSSPrimitiveValue and CSSIdentifierValue (Closed)
Patch Set: Rebase please work Created 4 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 14 matching lines...) Expand all
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 11 matching lines...) Expand all
56 57
57 // Cached individual values. 58 // Cached individual values.
58 CSSColorValue* transparentColor() { return m_colorTransparent; } 59 CSSColorValue* transparentColor() { return m_colorTransparent; }
59 CSSColorValue* whiteColor() { return m_colorWhite; } 60 CSSColorValue* whiteColor() { return m_colorWhite; }
60 CSSColorValue* blackColor() { return m_colorBlack; } 61 CSSColorValue* blackColor() { return m_colorBlack; }
61 CSSInheritedValue* inheritedValue() { return m_inheritedValue; } 62 CSSInheritedValue* inheritedValue() { return m_inheritedValue; }
62 CSSInitialValue* implicitInitialValue() { return m_implicitInitialValue; } 63 CSSInitialValue* implicitInitialValue() { return m_implicitInitialValue; }
63 CSSInitialValue* explicitInitialValue() { return m_explicitInitialValue; } 64 CSSInitialValue* explicitInitialValue() { return m_explicitInitialValue; }
64 CSSUnsetValue* unsetValue() { return m_unsetValue; } 65 CSSUnsetValue* unsetValue() { return m_unsetValue; }
65 66
66 // CSSPrimitiveValue vector caches. 67 // Vector caches.
67 CSSPrimitiveValue* identifierCacheValue(CSSValueID ident) { return m_identif ierValueCache[ident]; } 68 CSSIdentifierValue* identifierCacheValue(CSSValueID ident) { return m_identi fierValueCache[ident]; }
68 CSSPrimitiveValue* setIdentifierCacheValue(CSSValueID ident, CSSPrimitiveVal ue* cssValue) { return m_identifierValueCache[ident] = cssValue; } 69 CSSIdentifierValue* setIdentifierCacheValue(CSSValueID ident, CSSIdentifierV alue* cssValue) { return m_identifierValueCache[ident] = cssValue; }
69 CSSPrimitiveValue* pixelCacheValue(int intValue) { return m_pixelValueCache[ intValue]; } 70 CSSPrimitiveValue* pixelCacheValue(int intValue) { return m_pixelValueCache[ intValue]; }
70 CSSPrimitiveValue* setPixelCacheValue(int intValue, CSSPrimitiveValue* cssVa lue) { return m_pixelValueCache[intValue] = cssValue; } 71 CSSPrimitiveValue* setPixelCacheValue(int intValue, CSSPrimitiveValue* cssVa lue) { return m_pixelValueCache[intValue] = cssValue; }
71 CSSPrimitiveValue* percentCacheValue(int intValue) { return m_percentValueCa che[intValue]; } 72 CSSPrimitiveValue* percentCacheValue(int intValue) { return m_percentValueCa che[intValue]; }
72 CSSPrimitiveValue* setPercentCacheValue(int intValue, CSSPrimitiveValue* css Value) { return m_percentValueCache[intValue] = cssValue; } 73 CSSPrimitiveValue* setPercentCacheValue(int intValue, CSSPrimitiveValue* css Value) { return m_percentValueCache[intValue] = cssValue; }
73 CSSPrimitiveValue* numberCacheValue(int intValue) { return m_numberValueCach e[intValue]; } 74 CSSPrimitiveValue* numberCacheValue(int intValue) { return m_numberValueCach e[intValue]; }
74 CSSPrimitiveValue* setNumberCacheValue(int intValue, CSSPrimitiveValue* cssV alue) { return m_numberValueCache[intValue] = cssValue; } 75 CSSPrimitiveValue* setNumberCacheValue(int intValue, CSSPrimitiveValue* cssV alue) { return m_numberValueCache[intValue] = cssValue; }
75 76
76 // Hash map caches. 77 // Hash map caches.
77 ColorValueCache::AddResult getColorCacheEntry(RGBA32 rgbValue) 78 ColorValueCache::AddResult getColorCacheEntry(RGBA32 rgbValue)
78 { 79 {
(...skipping 21 matching lines...) Expand all
100 101
101 // Cached individual values. 102 // Cached individual values.
102 Member<CSSInheritedValue> m_inheritedValue; 103 Member<CSSInheritedValue> m_inheritedValue;
103 Member<CSSInitialValue> m_implicitInitialValue; 104 Member<CSSInitialValue> m_implicitInitialValue;
104 Member<CSSInitialValue> m_explicitInitialValue; 105 Member<CSSInitialValue> m_explicitInitialValue;
105 Member<CSSUnsetValue> m_unsetValue; 106 Member<CSSUnsetValue> m_unsetValue;
106 Member<CSSColorValue> m_colorTransparent; 107 Member<CSSColorValue> m_colorTransparent;
107 Member<CSSColorValue> m_colorWhite; 108 Member<CSSColorValue> m_colorWhite;
108 Member<CSSColorValue> m_colorBlack; 109 Member<CSSColorValue> m_colorBlack;
109 110
110 // CSSPrimitiveValue vector caches. 111 // Vector caches.
111 HeapVector<Member<CSSPrimitiveValue>, numCSSValueKeywords> m_identifierValue Cache; 112 HeapVector<Member<CSSIdentifierValue>, numCSSValueKeywords> m_identifierValu eCache;
112 HeapVector<Member<CSSPrimitiveValue>, maximumCacheableIntegerValue + 1> m_pi xelValueCache; 113 HeapVector<Member<CSSPrimitiveValue>, maximumCacheableIntegerValue + 1> m_pi xelValueCache;
113 HeapVector<Member<CSSPrimitiveValue>, maximumCacheableIntegerValue + 1> m_pe rcentValueCache; 114 HeapVector<Member<CSSPrimitiveValue>, maximumCacheableIntegerValue + 1> m_pe rcentValueCache;
114 HeapVector<Member<CSSPrimitiveValue>, maximumCacheableIntegerValue + 1> m_nu mberValueCache; 115 HeapVector<Member<CSSPrimitiveValue>, maximumCacheableIntegerValue + 1> m_nu mberValueCache;
115 116
116 // Hash map caches. 117 // Hash map caches.
117 ColorValueCache m_colorValueCache; 118 ColorValueCache m_colorValueCache;
118 FontFaceValueCache m_fontFaceValueCache; 119 FontFaceValueCache m_fontFaceValueCache;
119 FontFamilyValueCache m_fontFamilyValueCache; 120 FontFamilyValueCache m_fontFamilyValueCache;
120 121
121 friend CORE_EXPORT CSSValuePool& cssValuePool(); 122 friend CORE_EXPORT CSSValuePool& cssValuePool();
122 }; 123 };
123 124
124 CORE_EXPORT CSSValuePool& cssValuePool(); 125 CORE_EXPORT CSSValuePool& cssValuePool();
125 126
126 } // namespace blink 127 } // namespace blink
127 128
128 #endif 129 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSValue.cpp ('k') | third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698