We sometimes fail to remove outdated entry from the disk cache after revalidation...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Apr 2016 16:50:29 +0000 (16:50 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Apr 2016 16:50:29 +0000 (16:50 +0000)
commit4f999365ec85ce49ead12431223e3eb4d154bb03
treead141444963abb69b1694d65c77b6ee951908def
parenta5deb5179c88e503d3c9f6255bb299dc23775a28
We sometimes fail to remove outdated entry from the disk cache after revalidation and when the resource is no longer cacheable
https://bugs.webkit.org/show_bug.cgi?id=156048
<rdar://problem/25514480>

Reviewed by Antti Koivisto.

Source/WebKit2:

We would sometimes fail to remove outdated entry from the disk cache
after revalidation and when the resource is no longer cacheable. This
was due to Storage::removeFromPendingWriteOperations() only removing
the first pending write operation with a given key instead of actually
removing all of the operations with this key.

* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::removeFromPendingWriteOperations):
* NetworkProcess/cache/NetworkCacheStorage.h:

LayoutTests:

Add test coverage for the bug.

* http/tests/cache/disk-cache/disk-cache-remove-several-pending-writes-expected.txt: Added.
* http/tests/cache/disk-cache/disk-cache-remove-several-pending-writes.html: Added.
* http/tests/cache/disk-cache/resources/json.php: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/cache/disk-cache/disk-cache-remove-several-pending-writes-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/cache/disk-cache/disk-cache-remove-several-pending-writes.html [new file with mode: 0644]
LayoutTests/http/tests/cache/disk-cache/resources/json.php [new file with mode: 0644]
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp
Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h