| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 DCHECK(element.isStyledElement()); | 181 DCHECK(element.isStyledElement()); |
| 182 | 182 |
| 183 PresentationAttributeCacheKey cacheKey; | 183 PresentationAttributeCacheKey cacheKey; |
| 184 makePresentationAttributeCacheKey(element, cacheKey); | 184 makePresentationAttributeCacheKey(element, cacheKey); |
| 185 | 185 |
| 186 unsigned cacheHash = computePresentationAttributeCacheHash(cacheKey); | 186 unsigned cacheHash = computePresentationAttributeCacheHash(cacheKey); |
| 187 | 187 |
| 188 PresentationAttributeCache::ValueType* cacheValue; | 188 PresentationAttributeCache::ValueType* cacheValue; |
| 189 if (cacheHash) { | 189 if (cacheHash) { |
| 190 cacheValue = | 190 cacheValue = |
| 191 presentationAttributeCache().add(cacheHash, nullptr).storedValue; | 191 presentationAttributeCache().insert(cacheHash, nullptr).storedValue; |
| 192 if (cacheValue->value && cacheValue->value->key != cacheKey) | 192 if (cacheValue->value && cacheValue->value->key != cacheKey) |
| 193 cacheHash = 0; | 193 cacheHash = 0; |
| 194 } else { | 194 } else { |
| 195 cacheValue = nullptr; | 195 cacheValue = nullptr; |
| 196 } | 196 } |
| 197 | 197 |
| 198 StylePropertySet* style = nullptr; | 198 StylePropertySet* style = nullptr; |
| 199 if (cacheHash && cacheValue->value) { | 199 if (cacheHash && cacheValue->value) { |
| 200 style = cacheValue->value->value; | 200 style = cacheValue->value->value; |
| 201 cacheCleaner.didHitPresentationAttributeCache(); | 201 cacheCleaner.didHitPresentationAttributeCache(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 224 presentationAttributeCache().clear(); | 224 presentationAttributeCache().clear(); |
| 225 presentationAttributeCache().set(cacheHash, newEntry); | 225 presentationAttributeCache().set(cacheHash, newEntry); |
| 226 } else { | 226 } else { |
| 227 cacheValue->value = newEntry; | 227 cacheValue->value = newEntry; |
| 228 } | 228 } |
| 229 | 229 |
| 230 return style; | 230 return style; |
| 231 } | 231 } |
| 232 | 232 |
| 233 } // namespace blink | 233 } // namespace blink |
| OLD | NEW |