<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[188640] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/188640">188640</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-08-19 09:50:50 -0700 (Wed, 19 Aug 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>WebKit may keep outdated entry in the disk cache after a reload
https://bugs.webkit.org/show_bug.cgi?id=148137
&lt;rdar://problem/22299547&gt;

Reviewed by Antti Koivisto.

Source/WebKit2:

WebKit would keep outdated entry in the disk cache after a reload
in the following scenario:
1. We have an entry in the cache
2. The user reloads
3. We get a fresh resource from the network but this one is not cacheable

In this case, we now remove the stale entry from the cache to make sure
it is not served to following requests (e.g. history navigations).

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didFinishLoading):
Remove the entry from the cache if its redirection is no longer
cacheable.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::store):
If we make the decision not to store the response, then remove the
entry in the cache for this resource if it exists.

(WebKit::NetworkCache::Cache::remove):
* NetworkProcess/cache/NetworkCache.h:
Add new remove() overload taking a ResourceRequest argument so the
call site does not have the compute the key.

* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::Storage::removeFromPendingWriteOperations):
(WebKit::NetworkCache::Storage::remove):
* NetworkProcess/cache/NetworkCacheStorage.h:
When we're asked to remove an entry with a given key, also remove
it from the pending write operations. This pre-existing bug would
prevent the new layout test from passing.

LayoutTests:

Add layout test to make sure that stale disk cached entries are removed
when it becomes uncacheable.

* http/tests/cache/disk-cache/resource-becomes-uncacheable-expected.txt: Added.
* http/tests/cache/disk-cache/resource-becomes-uncacheable.html: Added.
* http/tests/cache/disk-cache/resources/generate-response-optionally-cacheable.cgi: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkResourceLoadercpp">trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCachecpp">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheh">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheStoragecpp">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheStorageh">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestscachediskcacheresourcebecomesuncacheableexpectedtxt">trunk/LayoutTests/http/tests/cache/disk-cache/resource-becomes-uncacheable-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestscachediskcacheresourcebecomesuncacheablehtml">trunk/LayoutTests/http/tests/cache/disk-cache/resource-becomes-uncacheable.html</a></li>
<li><a href="#trunkLayoutTestshttptestscachediskcacheresourcesgenerateresponseoptionallycacheablecgi">trunk/LayoutTests/http/tests/cache/disk-cache/resources/generate-response-optionally-cacheable.cgi</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (188639 => 188640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-08-19 16:14:04 UTC (rev 188639)
+++ trunk/LayoutTests/ChangeLog        2015-08-19 16:50:50 UTC (rev 188640)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-08-19  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        WebKit may keep outdated entry in the disk cache after a reload
+        https://bugs.webkit.org/show_bug.cgi?id=148137
+        &lt;rdar://problem/22299547&gt;
+
+        Reviewed by Antti Koivisto.
+
+        Add layout test to make sure that stale disk cached entries are removed
+        when it becomes uncacheable.
+
+        * http/tests/cache/disk-cache/resource-becomes-uncacheable-expected.txt: Added.
+        * http/tests/cache/disk-cache/resource-becomes-uncacheable.html: Added.
+        * http/tests/cache/disk-cache/resources/generate-response-optionally-cacheable.cgi: Added.
+
</ins><span class="cx"> 2015-08-19  Brian Burg  &lt;bburg@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: split TestStub.js into multiple files and modernize it
</span></span></pre></div>
<a id="trunkLayoutTestshttptestscachediskcacheresourcebecomesuncacheableexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/cache/disk-cache/resource-becomes-uncacheable-expected.txt (0 => 188640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/cache/disk-cache/resource-becomes-uncacheable-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/resource-becomes-uncacheable-expected.txt        2015-08-19 16:50:50 UTC (rev 188640)
</span><span class="lines">@@ -0,0 +1,21 @@
</span><ins>+Tests that resources are removed from the cache if they become uncacheable
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Resource should be in the cache now.
+Load resource again using default cache policy.
+PASS internals.xhrResponseSource(xhr) is &quot;Disk cache&quot;
+
+Now load again the same resource, ignoring the cached data.
+This time the resource will not be cacheable
+PASS internals.xhrResponseSource(xhr) is &quot;Network&quot;
+
+Stale resource should have been removed from the cache.
+
+Now try to load the resource from the cache.
+PASS internals.xhrResponseSource(xhr) is &quot;Network&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestscachediskcacheresourcebecomesuncacheablehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/cache/disk-cache/resource-becomes-uncacheable.html (0 => 188640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/cache/disk-cache/resource-becomes-uncacheable.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/resource-becomes-uncacheable.html        2015-08-19 16:50:50 UTC (rev 188640)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+&lt;script src=&quot;/js-test-resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/cache-test.js&quot;&gt;&lt;/script&gt;
+&lt;body&gt;
+&lt;script&gt;
+window.jsTestIsAsync = true;
+
+description(&quot;Tests that resources are removed from the cache if they become uncacheable&quot;);
+
+var uniqueTestId = Math.floor((Math.random() * 1000000000000));
+
+function loadResource(cacheable, onload)
+{
+    internals.clearMemoryCache();
+
+    xhr = new XMLHttpRequest();
+    xhr.onload = onload;
+    xhr.open(&quot;GET&quot;, &quot;resources/generate-response-optionally-cacheable.cgi?uniqueId=&quot; + uniqueTestId, true);
+
+    xhr.setRequestHeader(&quot;X-Cacheable&quot;, cacheable ? &quot;true&quot; : &quot;false&quot;);
+    xhr.send(null);
+}
+
+loadResource(true, function() {
+    // Wait a bit so things settle down in the disk cache.
+    setTimeout(function () {
+        debug(&quot;Resource should be in the cache now.&quot;);
+        debug(&quot;Load resource again using default cache policy.&quot;)
+        loadResource(true, function() {
+            shouldBeEqualToString(&quot;internals.xhrResponseSource(xhr)&quot;, &quot;Disk cache&quot;);
+
+            debug(&quot;&quot;);
+            debug(&quot;Now load again the same resource, ignoring the cached data.&quot;);
+            internals.setOverrideCachePolicy(&quot;ReloadIgnoringCacheData&quot;);
+
+            debug(&quot;This time the resource will not be cacheable&quot;);
+            loadResource(false, function() {
+                shouldBeEqualToString(&quot;internals.xhrResponseSource(xhr)&quot;, &quot;Network&quot;);
+
+                setTimeout(function() {
+                debug(&quot;&quot;);
+                debug(&quot;Stale resource should have been removed from the cache.&quot;);
+
+                debug(&quot;&quot;);
+                debug(&quot;Now try to load the resource from the cache.&quot;);
+                internals.setOverrideCachePolicy(&quot;UseProtocolCachePolicy&quot;);
+                loadResource(false, function() {
+                     shouldBeEqualToString(&quot;internals.xhrResponseSource(xhr)&quot;, &quot;Network&quot;);
+                     finishJSTest();
+                });
+                }, 100);
+            });
+        });
+    }, 100);
+});
+
+&lt;/script&gt;
+&lt;script src=&quot;/js-test-resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestscachediskcacheresourcesgenerateresponseoptionallycacheablecgi"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/cache/disk-cache/resources/generate-response-optionally-cacheable.cgi (0 => 188640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/cache/disk-cache/resources/generate-response-optionally-cacheable.cgi                                (rev 0)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/resources/generate-response-optionally-cacheable.cgi        2015-08-19 16:50:50 UTC (rev 188640)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+#!/usr/bin/perl -w
+
+use CGI;
+use HTTP::Date;
+
+my $query = new CGI;
+
+print &quot;Status: 200\n&quot;;
+if ($query-&gt;http &amp;&amp; $query-&gt;http(&quot;X-Cacheable&quot;) eq &quot;true&quot;) {
+    print &quot;Expires: &quot; . HTTP::Date::time2str(time() + 100) . &quot;\n&quot;;
+} else {
+    print &quot;Cache-Control: no-store\n&quot;;
+}
+
+print &quot;\n&quot;;
</ins><span class="cx">Property changes on: trunk/LayoutTests/http/tests/cache/disk-cache/resources/generate-response-optionally-cacheable.cgi
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (188639 => 188640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-08-19 16:14:04 UTC (rev 188639)
+++ trunk/Source/WebKit2/ChangeLog        2015-08-19 16:50:50 UTC (rev 188640)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2015-08-19  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        WebKit may keep outdated entry in the disk cache after a reload
+        https://bugs.webkit.org/show_bug.cgi?id=148137
+        &lt;rdar://problem/22299547&gt;
+
+        Reviewed by Antti Koivisto.
+
+        WebKit would keep outdated entry in the disk cache after a reload
+        in the following scenario:
+        1. We have an entry in the cache
+        2. The user reloads
+        3. We get a fresh resource from the network but this one is not cacheable
+
+        In this case, we now remove the stale entry from the cache to make sure
+        it is not served to following requests (e.g. history navigations).
+
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        (WebKit::NetworkResourceLoader::didFinishLoading):
+        Remove the entry from the cache if its redirection is no longer
+        cacheable.
+
+        * NetworkProcess/cache/NetworkCache.cpp:
+        (WebKit::NetworkCache::Cache::store):
+        If we make the decision not to store the response, then remove the
+        entry in the cache for this resource if it exists.
+
+        (WebKit::NetworkCache::Cache::remove):
+        * NetworkProcess/cache/NetworkCache.h:
+        Add new remove() overload taking a ResourceRequest argument so the
+        call site does not have the compute the key.
+
+        * NetworkProcess/cache/NetworkCacheStorage.cpp:
+        (WebKit::NetworkCache::Storage::removeFromPendingWriteOperations):
+        (WebKit::NetworkCache::Storage::remove):
+        * NetworkProcess/cache/NetworkCacheStorage.h:
+        When we're asked to remove an entry with a given key, also remove
+        it from the pending write operations. This pre-existing bug would
+        prevent the new layout test from passing.
+
</ins><span class="cx"> 2015-08-18  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GLib] GMainLoopSource should receive the std::function&lt;&gt; objects through rvalue references
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp (188639 => 188640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2015-08-19 16:14:04 UTC (rev 188639)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2015-08-19 16:50:50 UTC (rev 188640)
</span><span class="lines">@@ -348,6 +348,9 @@
</span><span class="cx">                 loader-&gt;send(Messages::NetworkProcessConnection::DidCacheResource(loader-&gt;originalRequest(), mappedBody.shareableResourceHandle, loader-&gt;sessionID()));
</span><span class="cx"> #endif
</span><span class="cx">             });
</span><ins>+        } else if (!hasCacheableRedirect) {
+            // Make sure we don't keep a stale entry in the cache.
+            NetworkCache::singleton().remove(originalRequest());
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp (188639 => 188640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp        2015-08-19 16:14:04 UTC (rev 188639)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp        2015-08-19 16:50:50 UTC (rev 188640)
</span><span class="lines">@@ -405,10 +405,14 @@
</span><span class="cx">     StoreDecision storeDecision = makeStoreDecision(originalRequest, response);
</span><span class="cx">     if (storeDecision != StoreDecision::Yes) {
</span><span class="cx">         LOG(NetworkCache, &quot;(NetworkProcess) didn't store, storeDecision=%d&quot;, storeDecision);
</span><del>-        if (m_statistics) {
-            auto key = makeCacheKey(originalRequest);
</del><ins>+        auto key = makeCacheKey(originalRequest);
+
+        // Make sure we don't keep a stale entry in the cache.
+        remove(key);
+
+        if (m_statistics)
</ins><span class="cx">             m_statistics-&gt;recordNotCachingResponse(key, storeDecision);
</span><del>-        }
</del><ins>+
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -454,6 +458,11 @@
</span><span class="cx">     m_storage-&gt;remove(key);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Cache::remove(const WebCore::ResourceRequest&amp; request)
+{
+    remove(makeCacheKey(request));
+}
+
</ins><span class="cx"> void Cache::traverse(std::function&lt;void (const Entry*)&gt;&amp;&amp; traverseHandler)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isEnabled());
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h (188639 => 188640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h        2015-08-19 16:14:04 UTC (rev 188639)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h        2015-08-19 16:50:50 UTC (rev 188640)
</span><span class="lines">@@ -99,6 +99,7 @@
</span><span class="cx"> 
</span><span class="cx">     void traverse(std::function&lt;void (const Entry*)&gt;&amp;&amp;);
</span><span class="cx">     void remove(const Key&amp;);
</span><ins>+    void remove(const WebCore::ResourceRequest&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void clear();
</span><span class="cx">     void clear(std::chrono::system_clock::time_point modifiedSince, std::function&lt;void ()&gt;&amp;&amp; completionHandler);
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheStoragecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp (188639 => 188640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp        2015-08-19 16:14:04 UTC (rev 188639)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp        2015-08-19 16:50:50 UTC (rev 188640)
</span><span class="lines">@@ -494,14 +494,31 @@
</span><span class="cx">     return { headerData };
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool Storage::removeFromPendingWriteOperations(const Key&amp; key)
+{
+    auto end = m_pendingWriteOperations.end();
+    for (auto it = m_pendingWriteOperations.begin(); it != end; ++it) {
+        if ((*it)-&gt;record.key == key) {
+            m_pendingWriteOperations.remove(it);
+            return true;
+        }
+    }
+    return false;
+}
+
</ins><span class="cx"> void Storage::remove(const Key&amp; key)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(RunLoop::isMain());
</span><span class="cx"> 
</span><ins>+    if (!mayContain(key))
+        return;
+
</ins><span class="cx">     // We can't remove the key from the Bloom filter (but some false positives are expected anyway).
</span><span class="cx">     // For simplicity we also don't reduce m_approximateSize on removals.
</span><span class="cx">     // The next synchronization will update everything.
</span><span class="cx"> 
</span><ins>+    removeFromPendingWriteOperations(key);
+
</ins><span class="cx">     serialBackgroundIOQueue().dispatch([this, key] {
</span><span class="cx">         WebCore::deleteFile(recordPathForKey(key));
</span><span class="cx">         m_blobStorage.remove(bodyPathForKey(key));
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheStorageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h (188639 => 188640)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h        2015-08-19 16:14:04 UTC (rev 188639)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.h        2015-08-19 16:50:50 UTC (rev 188640)
</span><span class="lines">@@ -122,6 +122,7 @@
</span><span class="cx">     void readRecord(ReadOperation&amp;, const Data&amp;);
</span><span class="cx"> 
</span><span class="cx">     void updateFileModificationTime(const String&amp; path);
</span><ins>+    bool removeFromPendingWriteOperations(const Key&amp;);
</ins><span class="cx"> 
</span><span class="cx">     WorkQueue&amp; ioQueue() { return m_ioQueue.get(); }
</span><span class="cx">     WorkQueue&amp; backgroundIOQueue() { return m_backgroundIOQueue.get(); }
</span></span></pre>
</div>
</div>

</body>
</html>