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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 const int maximumFontFaceCacheSize = 128; | 124 const int maximumFontFaceCacheSize = 128; |
125 if (m_fontFaceValueCache.size() > maximumFontFaceCacheSize) | 125 if (m_fontFaceValueCache.size() > maximumFontFaceCacheSize) |
126 m_fontFaceValueCache.clear(); | 126 m_fontFaceValueCache.clear(); |
127 | 127 |
128 RefPtr<CSSValueList>& value = m_fontFaceValueCache.add(string, 0).iterator->
value; | 128 RefPtr<CSSValueList>& value = m_fontFaceValueCache.add(string, 0).iterator->
value; |
129 if (!value) | 129 if (!value) |
130 value = CSSParser::parseFontFaceValue(string); | 130 value = CSSParser::parseFontFaceValue(string); |
131 return value; | 131 return value; |
132 } | 132 } |
133 | 133 |
134 void CSSValuePool::drain() | |
135 { | |
136 m_colorValueCache.clear(); | |
137 m_fontFaceValueCache.clear(); | |
138 m_fontFamilyValueCache.clear(); | |
139 | |
140 for (int i = 0; i < numCSSValueKeywords; ++i) | |
141 m_identifierValueCache[i] = 0; | |
142 | |
143 for (int i = 0; i < maximumCacheableIntegerValue; ++i) { | |
144 m_pixelValueCache[i] = 0; | |
145 m_percentValueCache[i] = 0; | |
146 m_numberValueCache[i] = 0; | |
147 } | |
148 } | 134 } |
149 | |
150 } | |
OLD | NEW |