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

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

Issue 138643003: Simpler return value of HashTable::add/HashMap:add and others (Closed)
Patch Set: Daily master update (now with base url?) Created 6 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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 m_discardableMemoryUsageInBytes += cacheEntryBytes; 360 m_discardableMemoryUsageInBytes += cacheEntryBytes;
361 else 361 else
362 m_heapMemoryUsageInBytes += cacheEntryBytes; 362 m_heapMemoryUsageInBytes += cacheEntryBytes;
363 363
364 // m_orderedCacheList is used to support LRU operations to reorder cache 364 // m_orderedCacheList is used to support LRU operations to reorder cache
365 // entries quickly. 365 // entries quickly.
366 m_orderedCacheList.append(cacheEntry.get()); 366 m_orderedCacheList.append(cacheEntry.get());
367 367
368 typename U::KeyType key = cacheEntry->cacheKey(); 368 typename U::KeyType key = cacheEntry->cacheKey();
369 typename V::AddResult result = identifierMap->add(cacheEntry->generator(), t ypename V::MappedType()); 369 typename V::AddResult result = identifierMap->add(cacheEntry->generator(), t ypename V::MappedType());
370 result.iterator->value.add(key); 370 result.storedValue->value.add(key);
371 cacheMap->add(key, cacheEntry); 371 cacheMap->add(key, cacheEntry);
372 372
373 TRACE_COUNTER1("webkit", "ImageDecodingStoreDiscardableMemoryUsageBytes", m_ discardableMemoryUsageInBytes); 373 TRACE_COUNTER1("webkit", "ImageDecodingStoreDiscardableMemoryUsageBytes", m_ discardableMemoryUsageInBytes);
374 TRACE_COUNTER1("webkit", "ImageDecodingStoreHeapMemoryUsageBytes", m_heapMem oryUsageInBytes); 374 TRACE_COUNTER1("webkit", "ImageDecodingStoreHeapMemoryUsageBytes", m_heapMem oryUsageInBytes);
375 TRACE_COUNTER1("webkit", "ImageDecodingStoreNumOfImages", m_imageCacheMap.si ze()); 375 TRACE_COUNTER1("webkit", "ImageDecodingStoreNumOfImages", m_imageCacheMap.si ze());
376 TRACE_COUNTER1("webkit", "ImageDecodingStoreNumOfDecoders", m_decoderCacheMa p.size()); 376 TRACE_COUNTER1("webkit", "ImageDecodingStoreNumOfDecoders", m_decoderCacheMa p.size());
377 } 377 }
378 378
379 template<class T, class U, class V> 379 template<class T, class U, class V>
380 void ImageDecodingStore::removeFromCacheInternal(const T* cacheEntry, U* cacheMa p, V* identifierMap, Vector<OwnPtr<CacheEntry> >* deletionList) 380 void ImageDecodingStore::removeFromCacheInternal(const T* cacheEntry, U* cacheMa p, V* identifierMap, Vector<OwnPtr<CacheEntry> >* deletionList)
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 } 436 }
437 } 437 }
438 438
439 void ImageDecodingStore::removeFromCacheListInternal(const Vector<OwnPtr<CacheEn try> >& deletionList) 439 void ImageDecodingStore::removeFromCacheListInternal(const Vector<OwnPtr<CacheEn try> >& deletionList)
440 { 440 {
441 for (size_t i = 0; i < deletionList.size(); ++i) 441 for (size_t i = 0; i < deletionList.size(); ++i)
442 m_orderedCacheList.remove(deletionList[i].get()); 442 m_orderedCacheList.remove(deletionList[i].get());
443 } 443 }
444 444
445 } // namespace WebCore 445 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/platform/fonts/win/UniscribeHelper.cpp ('k') | Source/platform/network/ResourceRequest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698