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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/ImageDecodingStore.cpp

Issue 2654033007: Migrate WTF::HashSet::add() to ::insert() [part 2 of N] (Closed)
Patch Set: 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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 const size_t cacheEntryBytes = cacheEntry->memoryUsageInBytes(); 217 const size_t cacheEntryBytes = cacheEntry->memoryUsageInBytes();
218 m_heapMemoryUsageInBytes += cacheEntryBytes; 218 m_heapMemoryUsageInBytes += cacheEntryBytes;
219 219
220 // m_orderedCacheList is used to support LRU operations to reorder cache 220 // m_orderedCacheList is used to support LRU operations to reorder cache
221 // entries quickly. 221 // entries quickly.
222 m_orderedCacheList.append(cacheEntry.get()); 222 m_orderedCacheList.append(cacheEntry.get());
223 223
224 typename U::KeyType key = cacheEntry->cacheKey(); 224 typename U::KeyType key = cacheEntry->cacheKey();
225 typename V::AddResult result = 225 typename V::AddResult result =
226 identifierMap->add(cacheEntry->generator(), typename V::MappedType()); 226 identifierMap->add(cacheEntry->generator(), typename V::MappedType());
227 result.storedValue->value.add(key); 227 result.storedValue->value.insert(key);
228 cacheMap->add(key, std::move(cacheEntry)); 228 cacheMap->add(key, std::move(cacheEntry));
229 229
230 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink.image_decoding"), 230 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink.image_decoding"),
231 "ImageDecodingStoreHeapMemoryUsageBytes", 231 "ImageDecodingStoreHeapMemoryUsageBytes",
232 m_heapMemoryUsageInBytes); 232 m_heapMemoryUsageInBytes);
233 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink.image_decoding"), 233 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink.image_decoding"),
234 "ImageDecodingStoreNumOfDecoders", m_decoderCacheMap.size()); 234 "ImageDecodingStoreNumOfDecoders", m_decoderCacheMap.size());
235 } 235 }
236 236
237 template <class T, class U, class V> 237 template <class T, class U, class V>
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 } 296 }
297 } 297 }
298 298
299 void ImageDecodingStore::removeFromCacheListInternal( 299 void ImageDecodingStore::removeFromCacheListInternal(
300 const Vector<std::unique_ptr<CacheEntry>>& deletionList) { 300 const Vector<std::unique_ptr<CacheEntry>>& deletionList) {
301 for (size_t i = 0; i < deletionList.size(); ++i) 301 for (size_t i = 0; i < deletionList.size(); ++i)
302 m_orderedCacheList.remove(deletionList[i].get()); 302 m_orderedCacheList.remove(deletionList[i].get());
303 } 303 }
304 304
305 } // namespace blink 305 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/inspector/CodeGeneratorInstrumentation.py ('k') | third_party/WebKit/Source/wtf/DequeTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698