Changeset 225253 in webkit
- Timestamp:
- Nov 28, 2017 6:23:38 PM (6 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r225251 r225253 1 2017-11-28 Youenn Fablet <youenn@apple.com> 2 3 NetworkCache::Storage should protect itself when removing operations from its maps 4 https://bugs.webkit.org/show_bug.cgi?id=180118 5 6 Reviewed by Antti Koivisto. 7 8 The operations can contain ref to the Storage object and removing them from the map may destroy the Storage object 9 10 * NetworkProcess/cache/NetworkCacheStorage.cpp: 11 (WebKit::NetworkCache::Storage::remove): 12 (WebKit::NetworkCache::Storage::finishReadOperation): 13 (WebKit::NetworkCache::Storage::finishWriteOperation): 14 (WebKit::NetworkCache::Storage::traverse): 15 1 16 2017-11-28 Youenn Fablet <youenn@apple.com> 2 17 -
trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheStorage.cpp
r224371 r225253 562 562 return; 563 563 564 auto protectedThis = makeRef(*this); 565 564 566 // We can't remove the key from the Bloom filter (but some false positives are expected anyway). 565 567 // For simplicity we also don't reduce m_approximateSize on removals. … … 568 570 removeFromPendingWriteOperations(key); 569 571 570 serialBackgroundIOQueue().dispatch([this, protectedThis = makeRef(*this), key] () mutable {572 serialBackgroundIOQueue().dispatch([this, protectedThis = WTFMove(protectedThis), key] () mutable { 571 573 deleteFiles(key); 572 574 RunLoop::main().dispatch([protectedThis = WTFMove(protectedThis)] { }); … … 666 668 else if (!readOperation.isCanceled) 667 669 remove(readOperation.key); 670 671 auto protectedThis = makeRef(*this); 668 672 669 673 ASSERT(m_activeReadOperations.contains(&readOperation)); … … 794 798 if (--writeOperation.activeCount) 795 799 return; 800 801 auto protectedThis = makeRef(*this); 796 802 797 803 m_activeWriteOperations.remove(&writeOperation); … … 916 922 RunLoop::main().dispatch([this, &traverseOperation] { 917 923 traverseOperation.handler(nullptr, { }); 924 925 auto protectedThis = makeRef(*this); 926 918 927 m_activeTraverseOperations.remove(&traverseOperation); 919 928 });
Note: See TracChangeset
for help on using the changeset viewer.