Changeset 197254 in webkit
- Timestamp:
- Feb 27, 2016 9:49:29 AM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r197244 r197254 1 2016-02-27 Andreas Kling <akling@apple.com> 2 3 [iOS] Discard decoded image data on top-level navigation. 4 <https://webkit.org/b/154776> 5 6 Reviewed by Anders Carlsson. 7 8 Add a mechanism that destroys decoded data for all CachedImages and invoke it 9 when performing a top-level navigation on iOS. 10 11 This substantially reduces the ImageIO contribution to our peak memory footprint. 12 13 It would be even better if we could mark these images volatile during the transition 14 but we currently don't have framework support for such machinations. 15 16 * loader/FrameLoader.cpp: 17 (WebCore::FrameLoader::commitProvisionalLoad): 18 * loader/cache/MemoryCache.cpp: 19 (WebCore::MemoryCache::forEachResource): 20 (WebCore::MemoryCache::destroyDecodedDataForAllImages): 21 * loader/cache/MemoryCache.h: 22 1 23 2016-02-26 Carlos Garcia Campos <cgarcia@igalia.com> 2 24 -
trunk/Source/WebCore/loader/FrameLoader.cpp
r197244 r197254 1767 1767 // outweigh the cost of recompiling in the case of a future backwards navigation. 1768 1768 GCController::singleton().deleteAllLinkedCode(); 1769 1770 // Throw out decoded data for CachedImages when we are switching pages. The majority of it 1771 // will not be used by the next page. 1772 MemoryCache::singleton().destroyDecodedDataForAllImages(); 1769 1773 #endif 1770 1774 } -
trunk/Source/WebCore/loader/cache/MemoryCache.cpp
r196483 r197254 278 278 } 279 279 280 void MemoryCache::forEachResource(const std::function<void(CachedResource&)>& function) 281 { 282 for (auto& lruList : m_allResources) { 283 for (auto& resource : *lruList) 284 function(*resource); 285 } 286 } 287 288 void MemoryCache::destroyDecodedDataForAllImages() 289 { 290 MemoryCache::singleton().forEachResource([](CachedResource& resource) { 291 if (resource.isImage()) 292 resource.destroyDecodedData(); 293 }); 294 } 295 280 296 void MemoryCache::pruneLiveResourcesToSize(unsigned targetSize, bool shouldDestroyDecodedDataForAllLiveResources) 281 297 { -
trunk/Source/WebCore/loader/cache/MemoryCache.h
r187706 r197254 102 102 void revalidationSucceeded(CachedResource& revalidatingResource, const ResourceResponse&); 103 103 void revalidationFailed(CachedResource& revalidatingResource); 104 105 void forEachResource(const std::function<void(CachedResource&)>&); 106 void destroyDecodedDataForAllImages(); 104 107 105 108 // Sets the cache's memory capacities, in bytes. These will hold only approximately,
Note: See TracChangeset
for help on using the changeset viewer.