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

Side by Side Diff: third_party/WebKit/Source/core/dom/PresentationAttributeStyle.cpp

Issue 2671933002: Migrate WTF::HashMap::add() to ::insert() (Closed)
Patch Set: rebase, add TODOs Created 3 years, 10 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) 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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/NthIndexCache.cpp ('k') | third_party/WebKit/Source/core/dom/SelectorQuery.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698