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

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

Issue 2759703002: Migrate WTF::HashMap::remove() to ::erase() (Closed)
Patch Set: rebase, fix one platform-specific reference Created 3 years, 9 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 Vector<std::unique_ptr<CacheEntry>>* deletionList) { 242 Vector<std::unique_ptr<CacheEntry>>* deletionList) {
243 const size_t cacheEntryBytes = cacheEntry->memoryUsageInBytes(); 243 const size_t cacheEntryBytes = cacheEntry->memoryUsageInBytes();
244 ASSERT(m_heapMemoryUsageInBytes >= cacheEntryBytes); 244 ASSERT(m_heapMemoryUsageInBytes >= cacheEntryBytes);
245 m_heapMemoryUsageInBytes -= cacheEntryBytes; 245 m_heapMemoryUsageInBytes -= cacheEntryBytes;
246 246
247 // Remove entry from identifier map. 247 // Remove entry from identifier map.
248 typename V::iterator iter = identifierMap->find(cacheEntry->generator()); 248 typename V::iterator iter = identifierMap->find(cacheEntry->generator());
249 ASSERT(iter != identifierMap->end()); 249 ASSERT(iter != identifierMap->end());
250 iter->value.erase(cacheEntry->cacheKey()); 250 iter->value.erase(cacheEntry->cacheKey());
251 if (!iter->value.size()) 251 if (!iter->value.size())
252 identifierMap->remove(iter); 252 identifierMap->erase(iter);
253 253
254 // Remove entry from cache map. 254 // Remove entry from cache map.
255 deletionList->push_back(cacheMap->take(cacheEntry->cacheKey())); 255 deletionList->push_back(cacheMap->take(cacheEntry->cacheKey()));
256 256
257 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink.image_decoding"), 257 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink.image_decoding"),
258 "ImageDecodingStoreHeapMemoryUsageBytes", 258 "ImageDecodingStoreHeapMemoryUsageBytes",
259 m_heapMemoryUsageInBytes); 259 m_heapMemoryUsageInBytes);
260 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink.image_decoding"), 260 TRACE_COUNTER1(TRACE_DISABLED_BY_DEFAULT("blink.image_decoding"),
261 "ImageDecodingStoreNumOfDecoders", m_decoderCacheMap.size()); 261 "ImageDecodingStoreNumOfDecoders", m_decoderCacheMap.size());
262 } 262 }
(...skipping 33 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

Powered by Google App Engine
This is Rietveld 408576698