Changeset 211673 in webkit
- Timestamp:
- Feb 4, 2017, 1:40:33 PM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r211671 r211673 1 2017-02-04 Yoav Weiss <yoav@yoav.ws> 2 3 Fix memory issues related to preload eviction. 4 https://bugs.webkit.org/show_bug.cgi?id=167838 5 6 Reviewed by Andreas Kling. 7 8 This avoids removing resources from m_preloads during the iteration 9 by creating a second HashSetList containing the remaining link preloads. 10 11 No new tests but this will fix crashes on the leak bots. 12 13 * loader/cache/CachedResourceLoader.cpp: 14 (WebCore::CachedResourceLoader::clearPreloads): 15 1 16 2017-02-04 Zalan Bujtas <zalan@apple.com> 2 17 -
trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp
r211665 r211673 1255 1255 return; 1256 1256 1257 std::unique_ptr<ListHashSet<CachedResource*>> remainingLinkPreloads; 1257 1258 for (auto* resource : *m_preloads) { 1258 if (mode == ClearPreloadsMode::ClearSpeculativePreloads && resource->isLinkPreload()) 1259 ASSERT(resource); 1260 if (mode == ClearPreloadsMode::ClearSpeculativePreloads && resource->isLinkPreload()) { 1261 if (!remainingLinkPreloads) 1262 remainingLinkPreloads = std::make_unique<ListHashSet<CachedResource*>>(); 1263 remainingLinkPreloads->add(resource); 1259 1264 continue; 1265 } 1260 1266 resource->decreasePreloadCount(); 1261 1267 bool deleted = resource->deleteIfPossible(); 1262 1268 if (!deleted && resource->preloadResult() == CachedResource::PreloadNotReferenced) 1263 1269 MemoryCache::singleton().remove(*resource); 1264 m_preloads->remove(resource); 1265 } 1266 if (!m_preloads->size()) 1267 m_preloads = nullptr; 1270 } 1271 m_preloads = WTFMove(remainingLinkPreloads); 1268 1272 } 1269 1273
Note:
See TracChangeset
for help on using the changeset viewer.