Changeset 241565 in webkit
- Timestamp:
- Feb 14, 2019 2:55:24 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r241564 r241565 1 2019-02-14 Youenn Fablet <youenn@apple.com> 2 3 ASSERTION FAILED: m_caches.isEmpty() || !m_pendingInitializationCallbacks.isEmpty() in WebKit::CacheStorage::Caches::clearMemoryRepresentation() 4 https://bugs.webkit.org/show_bug.cgi?id=188393 5 <rdar://problem/43025665> 6 7 Reviewed by Alex Christensen. 8 9 In case Caches::dispose is called, clearMemoryRepresentation might be called if there is no active cache. 10 We also ensure to not clear the memory representation if there is any remaining removed cache. 11 Update the clearMemoryRepresentation assertion to take that into account. 12 13 In case a Caches is cleared twice, the clearMemoryRepresentation assertion will assert while it should not. 14 In that case m_storage is null the second time. Update the assertion accordingly. 15 16 * NetworkProcess/cache/CacheStorageEngineCaches.cpp: 17 (WebKit::CacheStorage::Caches::hasActiveCache const): 18 (WebKit::CacheStorage::Caches::dispose): 19 (WebKit::CacheStorage::Caches::clearMemoryRepresentation): 20 * NetworkProcess/cache/CacheStorageEngineCaches.h: 21 1 22 2019-02-14 Brian Burg <bburg@apple.com> 2 23 -
trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.cpp
r240437 r241565 344 344 } 345 345 346 bool Caches::hasActiveCache() const 347 { 348 if (m_removedCaches.size()) 349 return true; 350 return m_caches.findMatching([](const auto& item) { return item.isActive(); }) != notFound; 351 } 352 346 353 void Caches::dispose(Cache& cache) 347 354 { … … 357 364 cache.clearMemoryRepresentation(); 358 365 359 if ( m_caches.findMatching([](const auto& item) { return item.isActive(); }) == notFound)366 if (!hasActiveCache()) 360 367 clearMemoryRepresentation(); 361 368 } … … 595 602 { 596 603 if (!m_isInitialized) { 597 ASSERT( m_caches.isEmpty() || !m_pendingInitializationCallbacks.isEmpty());604 ASSERT(!m_storage || !hasActiveCache() || !m_pendingInitializationCallbacks.isEmpty()); 598 605 // m_storage might not be null in case Caches is being initialized. This is fine as nullify it below is a memory optimization. 599 606 m_caches.clear(); -
trunk/Source/WebKit/NetworkProcess/cache/CacheStorageEngineCaches.h
r240099 r241565 97 97 void notifyCachesOfRequestSpaceEnd(); 98 98 99 bool hasActiveCache() const; 100 99 101 bool m_isInitialized { false }; 100 102 bool m_isRequestingSpace { false };
Note: See TracChangeset
for help on using the changeset viewer.