<!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>[194313] 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/194313">194313</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2015-12-19 05:26:38 -0800 (Sat, 19 Dec 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Cache redirects as separate entries
https://bugs.webkit.org/show_bug.cgi?id=152424
Reviewed by Alex Christensen.
Source/WebCore:
Test: http/tests/cache/disk-cache/disk-cache-redirect.html
* platform/network/ResourceRequestBase.h:
Source/WebKit2:
We are currently caching redirect chains. This has correctness issues and can be inefficient in cases
where multiple URLs redirect to the same destination.
After this patch we write a cache entry for each redirect individually.
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
* NetworkProcess/NetworkLoad.h:
(WebKit::NetworkLoad::currentRequest):
(WebKit::NetworkLoad::clearCurrentRequest):
* NetworkProcess/NetworkLoadClient.h:
Add original request as a parameter for willSendRedirectedRequest.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::~NetworkResourceLoader):
(WebKit::NetworkResourceLoader::canUseCache):
Factor to a function.
(WebKit::NetworkResourceLoader::isSynchronous):
(WebKit::NetworkResourceLoader::start):
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
Factor to a function.
Call dispatchWillSendRequestForCacheEntry for cached redirects.
(WebKit::NetworkResourceLoader::startNetworkLoad):
Make this take request as argument instead of always loading originalRequest().
(WebKit::NetworkResourceLoader::abort):
(WebKit::NetworkResourceLoader::didFinishLoading):
Remove redirect chain code.
Store cache entry for current request instead of the original request.
(WebKit::NetworkResourceLoader::didFailLoading):
(WebKit::NetworkResourceLoader::willSendRedirectedRequest):
Write cache entry for redirect.
(WebKit::NetworkResourceLoader::continueWillSendRequest):
If we are playing back cached redirect continue with another cache lookup.
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
No need to synthesize fake willSendRequest anymore.
(WebKit::NetworkResourceLoader::validateCacheEntry):
(WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
Route via web process willSendRequest so cached redirects looks exactly like network ones.
(WebKit::NetworkResourceLoader::messageSenderConnection):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::makeUseDecision):
Ignore validation headers for cached redirects.
(WebKit::NetworkCache::makeRetrieveDecision):
(WebKit::NetworkCache::makeStoreDecision):
(WebKit::NetworkCache::Cache::retrieve):
(WebKit::NetworkCache::Cache::store):
Rename originalRequest -> request since it is not really the original request anymore in all cases.
(WebKit::NetworkCache::Cache::storeRedirect):
Stored redirects include the network layer generated ResourceRequest instead of body data.
(WebKit::NetworkCache::Cache::update):
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::Entry):
New constructor for making redirect entries.
(WebKit::NetworkCache::Entry::encodeAsStorageRecord):
(WebKit::NetworkCache::Entry::decodeStorageRecord):
Encoding support.
* NetworkProcess/cache/NetworkCacheEntry.h:
(WebKit::NetworkCache::Entry::varyingRequestHeaders):
(WebKit::NetworkCache::Entry::redirectRequest):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::~SpeculativeLoad):
(WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
* NetworkProcess/cache/NetworkCacheStatistics.cpp:
(WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
LayoutTests:
* http/tests/cache/disk-cache/disk-cache-redirect-expected.txt: Added.
* http/tests/cache/disk-cache/disk-cache-redirect.html: Added.
* http/tests/cache/disk-cache/resources/generate-response.cgi:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestshttptestscachediskcacheresourcesgenerateresponsecgi">trunk/LayoutTests/http/tests/cache/disk-cache/resources/generate-response.cgi</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceRequestBaseh">trunk/Source/WebCore/platform/network/ResourceRequestBase.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkLoadcpp">trunk/Source/WebKit2/NetworkProcess/NetworkLoad.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkLoadh">trunk/Source/WebKit2/NetworkProcess/NetworkLoad.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkLoadClienth">trunk/Source/WebKit2/NetworkProcess/NetworkLoadClient.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkResourceLoadercpp">trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkResourceLoaderh">trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h</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="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheEntrycpp">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheEntry.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheEntryh">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheEntry.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheSpeculativeLoadcpp">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheSpeculativeLoadh">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoad.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheStatisticscpp">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestscachediskcachediskcacheredirectexpectedtxt">trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-redirect-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestscachediskcachediskcacheredirecthtml">trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-redirect.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (194312 => 194313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-12-19 09:01:00 UTC (rev 194312)
+++ trunk/LayoutTests/ChangeLog        2015-12-19 13:26:38 UTC (rev 194313)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-12-18 Antti Koivisto <antti@apple.com>
+
+ Cache redirects as separate entries
+ https://bugs.webkit.org/show_bug.cgi?id=152424
+
+ Reviewed by Alex Christensen.
+
+ * http/tests/cache/disk-cache/disk-cache-redirect-expected.txt: Added.
+ * http/tests/cache/disk-cache/disk-cache-redirect.html: Added.
+ * http/tests/cache/disk-cache/resources/generate-response.cgi:
+
</ins><span class="cx"> 2015-12-18 Michael Catanzaro <mcatanzaro@igalia.com>
</span><span class="cx">
</span><span class="cx"> [GTK] Mark fast/regions/overflow/overflow-region-float.html as passing
</span></span></pre></div>
<a id="trunkLayoutTestshttptestscachediskcachediskcacheredirectexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-redirect-expected.txt (0 => 194313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-redirect-expected.txt         (rev 0)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-redirect-expected.txt        2015-12-19 13:26:38 UTC (rev 194313)
</span><span class="lines">@@ -0,0 +1,122 @@
</span><ins>+Test redirect caching
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+running 12 tests
+
+--------Testing loads from disk cache--------
+response headers: {"Status":"301","Location":"unique-cacheable"}
+response source: Disk cache
+
+response headers: {"Status":"302","Location":"unique-cacheable"}
+response source: Network
+
+response headers: {"Status":"303","Location":"unique-cacheable"}
+response source: Network
+
+response headers: {"Status":"307","Location":"unique-cacheable"}
+response source: Network
+
+response headers: {"Status":"301","Location":"unique-cacheable","Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Status":"302","Location":"unique-cacheable","Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Status":"303","Location":"unique-cacheable","Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Status":"307","Location":"unique-cacheable","Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Status":"301","Location":"unique-cacheable","Cache-control":"max-age=100"}
+response source: Disk cache
+
+response headers: {"Status":"302","Location":"unique-cacheable","Cache-control":"max-age=100"}
+response source: Disk cache
+
+response headers: {"Status":"303","Location":"unique-cacheable","Cache-control":"max-age=100"}
+response source: Disk cache
+
+response headers: {"Status":"307","Location":"unique-cacheable","Cache-control":"max-age=100"}
+response source: Disk cache
+
+--------Testing loads through memory cache (XHR behavior)--------
+response headers: {"Status":"301","Location":"unique-cacheable"}
+response source: Memory cache
+
+response headers: {"Status":"302","Location":"unique-cacheable"}
+response source: Network
+
+response headers: {"Status":"303","Location":"unique-cacheable"}
+response source: Network
+
+response headers: {"Status":"307","Location":"unique-cacheable"}
+response source: Network
+
+response headers: {"Status":"301","Location":"unique-cacheable","Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Status":"302","Location":"unique-cacheable","Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Status":"303","Location":"unique-cacheable","Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Status":"307","Location":"unique-cacheable","Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Status":"301","Location":"unique-cacheable","Cache-control":"max-age=100"}
+response source: Memory cache
+
+response headers: {"Status":"302","Location":"unique-cacheable","Cache-control":"max-age=100"}
+response source: Memory cache
+
+response headers: {"Status":"303","Location":"unique-cacheable","Cache-control":"max-age=100"}
+response source: Memory cache
+
+response headers: {"Status":"307","Location":"unique-cacheable","Cache-control":"max-age=100"}
+response source: Memory cache
+
+--------Testing loads through memory cache (subresource behavior)--------
+response headers: {"Status":"301","Location":"unique-cacheable"}
+response source: Memory cache
+
+response headers: {"Status":"302","Location":"unique-cacheable"}
+response source: Network
+
+response headers: {"Status":"303","Location":"unique-cacheable"}
+response source: Network
+
+response headers: {"Status":"307","Location":"unique-cacheable"}
+response source: Network
+
+response headers: {"Status":"301","Location":"unique-cacheable","Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Status":"302","Location":"unique-cacheable","Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Status":"303","Location":"unique-cacheable","Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Status":"307","Location":"unique-cacheable","Cache-control":"max-age=0"}
+response source: Network
+
+response headers: {"Status":"301","Location":"unique-cacheable","Cache-control":"max-age=100"}
+response source: Memory cache
+
+response headers: {"Status":"302","Location":"unique-cacheable","Cache-control":"max-age=100"}
+response source: Memory cache
+
+response headers: {"Status":"303","Location":"unique-cacheable","Cache-control":"max-age=100"}
+response source: Memory cache
+
+response headers: {"Status":"307","Location":"unique-cacheable","Cache-control":"max-age=100"}
+response source: Memory cache
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestscachediskcachediskcacheredirecthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-redirect.html (0 => 194313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-redirect.html         (rev 0)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-redirect.html        2015-12-19 13:26:38 UTC (rev 194313)
</span><span class="lines">@@ -0,0 +1,31 @@
</span><ins>+<script src="/js-test-resources/js-test-pre.js"></script>
+<script src="resources/cache-test.js"></script>
+<body>
+<script>
+
+var testMatrix =
+[
+ [
+ { responseHeaders: {'Status': '301', 'Location': 'unique-cacheable' } },
+ { responseHeaders: {'Status': '302', 'Location': 'unique-cacheable' } },
+ { responseHeaders: {'Status': '303', 'Location': 'unique-cacheable' } },
+ { responseHeaders: {'Status': '307', 'Location': 'unique-cacheable' } },
+ ],
+ [
+ { },
+ { responseHeaders: {'Cache-control': 'max-age=0' } },
+ { responseHeaders: {'Cache-control': 'max-age=100' } },
+ ],
+ ];
+
+description("Test redirect caching");
+
+var tests = generateTests(testMatrix);
+
+debug("running " + tests.length + " tests");
+debug("");
+
+runTests(tests);
+
+</script>
+<script src="/js-test-resources/js-test-post.js"></script>
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestscachediskcacheresourcesgenerateresponsecgi"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/cache/disk-cache/resources/generate-response.cgi (194312 => 194313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/cache/disk-cache/resources/generate-response.cgi        2015-12-19 09:01:00 UTC (rev 194312)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/resources/generate-response.cgi        2015-12-19 13:26:38 UTC (rev 194313)
</span><span class="lines">@@ -8,12 +8,24 @@
</span><span class="cx"> my $expiresInFutureIn304 = $query->param('expires-in-future-in-304') || 0;
</span><span class="cx"> my $delay = $query->param('delay') || 0;
</span><span class="cx"> my $body = $query->param('body') || 0;
</span><ins>+my $status = $query->param('Status') || 0;
</ins><span class="cx">
</span><span class="cx"> if ($body eq "unique") {
</span><span class="cx"> $body = sprintf "%08X\n", rand(0xffffffff)
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> my $hasStatusCode = 0;
</span><ins>+my $hasLocation = 0;
+if ($status == 301 || $status == 302 || $status == 303 || $status == 307) {
+ if ($query->param('Location') eq "unique-cacheable") {
+ my $redirectBody = sprintf "%08X", rand(0xffffffff);
+ print "Status: ". $status . "\n";
+ print "Location: generate-response.cgi?body=" . $redirectBody . "&Cache-control=max-age%3D1000&uniqueId=" . $query->param('uniqueId') . "\n";
+ $hasLocation = 1;
+ $hasStatusCode = 1;
+ }
+}
+
</ins><span class="cx"> my $hasExpiresHeader = 0;
</span><span class="cx"> if ($query->http && $query->http("If-None-Match") eq "match") {
</span><span class="cx"> print "Status: 304\n";
</span><span class="lines">@@ -29,7 +41,7 @@
</span><span class="cx"> if ($1 < 6 && $2 < 6) {
</span><span class="cx"> print "Status: 206\n";
</span><span class="cx"> } else {
</span><del>-        print "Status: 416\n";
</del><ins>+ print "Status: 416\n";
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> $hasStatusCode = 1;
</span><span class="lines">@@ -39,6 +51,7 @@
</span><span class="cx"> next if ($_ eq "uniqueId");
</span><span class="cx"> next if ($_ eq "delay");
</span><span class="cx"> next if ($_ eq "body");
</span><ins>+ next if ($_ eq "Location" and $hasLocation);
</ins><span class="cx"> next if ($_ eq "Status" and $hasStatusCode);
</span><span class="cx"> next if ($_ eq "Expires" and $hasExpiresHeader);
</span><span class="cx"> print $_ . ": " . $query->param($_) . "\n";
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (194312 => 194313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-12-19 09:01:00 UTC (rev 194312)
+++ trunk/Source/WebCore/ChangeLog        2015-12-19 13:26:38 UTC (rev 194313)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-12-18 Antti Koivisto <antti@apple.com>
+
+ Cache redirects as separate entries
+ https://bugs.webkit.org/show_bug.cgi?id=152424
+
+ Reviewed by Alex Christensen.
+
+ Test: http/tests/cache/disk-cache/disk-cache-redirect.html
+
+ * platform/network/ResourceRequestBase.h:
+
</ins><span class="cx"> 2015-12-18 Per Arne Vollan <peavo@outlook.com>
</span><span class="cx">
</span><span class="cx"> [WinCairo] Empty context menu item.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceRequestBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceRequestBase.h (194312 => 194313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceRequestBase.h        2015-12-19 09:01:00 UTC (rev 194312)
+++ trunk/Source/WebCore/platform/network/ResourceRequestBase.h        2015-12-19 13:26:38 UTC (rev 194313)
</span><span class="lines">@@ -54,10 +54,10 @@
</span><span class="cx"> class ResourceRequestBase {
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>- static std::unique_ptr<ResourceRequest> adopt(std::unique_ptr<CrossThreadResourceRequestData>);
</del><ins>+ WEBCORE_EXPORT static std::unique_ptr<ResourceRequest> adopt(std::unique_ptr<CrossThreadResourceRequestData>);
</ins><span class="cx">
</span><span class="cx"> // Gets a copy of the data suitable for passing to another thread.
</span><del>- std::unique_ptr<CrossThreadResourceRequestData> copyData() const;
</del><ins>+ WEBCORE_EXPORT std::unique_ptr<CrossThreadResourceRequestData> copyData() const;
</ins><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT bool isNull() const;
</span><span class="cx"> WEBCORE_EXPORT bool isEmpty() const;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (194312 => 194313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-12-19 09:01:00 UTC (rev 194312)
+++ trunk/Source/WebKit2/ChangeLog        2015-12-19 13:26:38 UTC (rev 194313)
</span><span class="lines">@@ -1,3 +1,105 @@
</span><ins>+2015-12-18 Antti Koivisto <antti@apple.com>
+
+ Cache redirects as separate entries
+ https://bugs.webkit.org/show_bug.cgi?id=152424
+
+ Reviewed by Alex Christensen.
+
+ We are currently caching redirect chains. This has correctness issues and can be inefficient in cases
+ where multiple URLs redirect to the same destination.
+
+ After this patch we write a cache entry for each redirect individually.
+
+ * NetworkProcess/NetworkLoad.cpp:
+ (WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
+ * NetworkProcess/NetworkLoad.h:
+ (WebKit::NetworkLoad::currentRequest):
+ (WebKit::NetworkLoad::clearCurrentRequest):
+ * NetworkProcess/NetworkLoadClient.h:
+
+ Add original request as a parameter for willSendRedirectedRequest.
+
+ * NetworkProcess/NetworkResourceLoader.cpp:
+ (WebKit::NetworkResourceLoader::~NetworkResourceLoader):
+ (WebKit::NetworkResourceLoader::canUseCache):
+
+ Factor to a function.
+
+ (WebKit::NetworkResourceLoader::isSynchronous):
+ (WebKit::NetworkResourceLoader::start):
+ (WebKit::NetworkResourceLoader::retrieveCacheEntry):
+
+ Factor to a function.
+ Call dispatchWillSendRequestForCacheEntry for cached redirects.
+
+ (WebKit::NetworkResourceLoader::startNetworkLoad):
+
+ Make this take request as argument instead of always loading originalRequest().
+
+ (WebKit::NetworkResourceLoader::abort):
+ (WebKit::NetworkResourceLoader::didFinishLoading):
+
+ Remove redirect chain code.
+ Store cache entry for current request instead of the original request.
+
+ (WebKit::NetworkResourceLoader::didFailLoading):
+ (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
+
+ Write cache entry for redirect.
+
+ (WebKit::NetworkResourceLoader::continueWillSendRequest):
+
+ If we are playing back cached redirect continue with another cache lookup.
+
+ (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
+
+ No need to synthesize fake willSendRequest anymore.
+
+ (WebKit::NetworkResourceLoader::validateCacheEntry):
+ (WebKit::NetworkResourceLoader::dispatchWillSendRequestForCacheEntry):
+
+ Route via web process willSendRequest so cached redirects looks exactly like network ones.
+
+ (WebKit::NetworkResourceLoader::messageSenderConnection):
+ * NetworkProcess/NetworkResourceLoader.h:
+ * NetworkProcess/cache/NetworkCache.cpp:
+ (WebKit::NetworkCache::makeUseDecision):
+
+ Ignore validation headers for cached redirects.
+
+ (WebKit::NetworkCache::makeRetrieveDecision):
+ (WebKit::NetworkCache::makeStoreDecision):
+ (WebKit::NetworkCache::Cache::retrieve):
+ (WebKit::NetworkCache::Cache::store):
+
+ Rename originalRequest -> request since it is not really the original request anymore in all cases.
+
+ (WebKit::NetworkCache::Cache::storeRedirect):
+
+ Stored redirects include the network layer generated ResourceRequest instead of body data.
+
+ (WebKit::NetworkCache::Cache::update):
+ * NetworkProcess/cache/NetworkCache.h:
+ * NetworkProcess/cache/NetworkCacheEntry.cpp:
+ (WebKit::NetworkCache::Entry::Entry):
+
+ New constructor for making redirect entries.
+
+ (WebKit::NetworkCache::Entry::encodeAsStorageRecord):
+ (WebKit::NetworkCache::Entry::decodeStorageRecord):
+
+ Encoding support.
+
+ * NetworkProcess/cache/NetworkCacheEntry.h:
+ (WebKit::NetworkCache::Entry::varyingRequestHeaders):
+ (WebKit::NetworkCache::Entry::redirectRequest):
+ * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
+ (WebKit::NetworkCache::SpeculativeLoad::~SpeculativeLoad):
+ (WebKit::NetworkCache::SpeculativeLoad::willSendRedirectedRequest):
+ * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
+ * NetworkProcess/cache/NetworkCacheStatistics.cpp:
+ (WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
+
</ins><span class="cx"> 2015-12-18 Michael Catanzaro <mcatanzaro@igalia.com>
</span><span class="cx">
</span><span class="cx"> Avoid triggering clang's -Wundefined-bool-conversion
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkLoadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkLoad.cpp (194312 => 194313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkLoad.cpp        2015-12-19 09:01:00 UTC (rev 194312)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkLoad.cpp        2015-12-19 13:26:38 UTC (rev 194313)
</span><span class="lines">@@ -149,8 +149,9 @@
</span><span class="cx"> ASSERT(!redirectResponse.isNull());
</span><span class="cx"> ASSERT(RunLoop::isMain());
</span><span class="cx">
</span><ins>+ auto oldRequest = m_currentRequest;
</ins><span class="cx"> m_currentRequest = request;
</span><del>- m_client.willSendRedirectedRequest(request, redirectResponse);
</del><ins>+ m_client.willSendRedirectedRequest(oldRequest, request, redirectResponse);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if USE(NETWORK_SESSION)
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkLoadh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkLoad.h (194312 => 194313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkLoad.h        2015-12-19 09:01:00 UTC (rev 194312)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkLoad.h        2015-12-19 13:26:38 UTC (rev 194313)
</span><span class="lines">@@ -53,6 +53,7 @@
</span><span class="cx"> void setDefersLoading(bool);
</span><span class="cx"> void cancel();
</span><span class="cx">
</span><ins>+ const WebCore::ResourceRequest& currentRequest() const { return m_currentRequest; }
</ins><span class="cx"> void clearCurrentRequest() { m_currentRequest = WebCore::ResourceRequest(); }
</span><span class="cx">
</span><span class="cx"> void continueWillSendRequest(const WebCore::ResourceRequest&);
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkLoadClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkLoadClient.h (194312 => 194313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkLoadClient.h        2015-12-19 09:01:00 UTC (rev 194312)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkLoadClient.h        2015-12-19 13:26:38 UTC (rev 194313)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx">
</span><span class="cx"> virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) = 0;
</span><span class="cx"> virtual void canAuthenticateAgainstProtectionSpaceAsync(const WebCore::ProtectionSpace&) = 0;
</span><del>- virtual void willSendRedirectedRequest(const WebCore::ResourceRequest&, const WebCore::ResourceResponse& redirectResponse) = 0;
</del><ins>+ virtual void willSendRedirectedRequest(const WebCore::ResourceRequest&, const WebCore::ResourceRequest& redirectRequest, const WebCore::ResourceResponse& redirectResponse) = 0;
</ins><span class="cx"> enum class ShouldContinueDidReceiveResponse { No, Yes };
</span><span class="cx"> virtual ShouldContinueDidReceiveResponse didReceiveResponse(const WebCore::ResourceResponse&) = 0;
</span><span class="cx"> virtual void didReceiveBuffer(RefPtr<WebCore::SharedBuffer>&&, int reportedEncodedDataLength) = 0;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp (194312 => 194313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2015-12-19 09:01:00 UTC (rev 194312)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2015-12-19 13:26:38 UTC (rev 194313)
</span><span class="lines">@@ -107,6 +107,19 @@
</span><span class="cx"> ASSERT(!isSynchronous() || !m_synchronousLoadData->delayedReply);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if ENABLE(NETWORK_CACHE)
+bool NetworkResourceLoader::canUseCache(const ResourceRequest& request) const
+{
+ if (!NetworkCache::singleton().isEnabled())
+ return false;
+ if (sessionID().isEphemeral())
+ return false;
+ if (!request.url().protocolIsInHTTPFamily())
+ return false;
+ return true;
+}
+#endif
+
</ins><span class="cx"> bool NetworkResourceLoader::isSynchronous() const
</span><span class="cx"> {
</span><span class="cx"> return !!m_synchronousLoadData;
</span><span class="lines">@@ -120,23 +133,36 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(NETWORK_CACHE)
</span><del>- if (!NetworkCache::singleton().isEnabled() || sessionID().isEphemeral() || !originalRequest().url().protocolIsInHTTPFamily()) {
- startNetworkLoad();
</del><ins>+ if (canUseCache(originalRequest())) {
+ retrieveCacheEntry(originalRequest());
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><ins>+#endif
</ins><span class="cx">
</span><ins>+ startNetworkLoad(originalRequest());
+}
+
+#if ENABLE(NETWORK_CACHE)
+void NetworkResourceLoader::retrieveCacheEntry(const ResourceRequest& request)
+{
+ ASSERT(canUseCache(request));
+
</ins><span class="cx"> RefPtr<NetworkResourceLoader> loader(this);
</span><del>- NetworkCache::singleton().retrieve(originalRequest(), { m_parameters.webPageID, m_parameters.webFrameID }, [loader](std::unique_ptr<NetworkCache::Entry> entry) {
</del><ins>+ NetworkCache::singleton().retrieve(request, { m_parameters.webPageID, m_parameters.webFrameID }, [loader, request](std::unique_ptr<NetworkCache::Entry> entry) {
</ins><span class="cx"> if (loader->hasOneRef()) {
</span><span class="cx"> // The loader has been aborted and is only held alive by this lambda.
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> if (!entry) {
</span><del>- loader->startNetworkLoad();
</del><ins>+ loader->startNetworkLoad(request);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><ins>+ if (entry->redirectRequest()) {
+ loader->dispatchWillSendRequestForCacheEntry(WTF::move(entry));
+ return;
+ }
</ins><span class="cx"> if (loader->m_parameters.needsCertificateInfo && !entry->response().containsCertificateInfo()) {
</span><del>- loader->startNetworkLoad();
</del><ins>+ loader->startNetworkLoad(request);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> if (entry->needsValidation()) {
</span><span class="lines">@@ -145,12 +171,10 @@
</span><span class="cx"> }
</span><span class="cx"> loader->didRetrieveCacheEntry(WTF::move(entry));
</span><span class="cx"> });
</span><del>-#else
- startNetworkLoad();
</del><ins>+}
</ins><span class="cx"> #endif
</span><del>-}
</del><span class="cx">
</span><del>-void NetworkResourceLoader::startNetworkLoad(const Optional<ResourceRequest>& updatedRequest)
</del><ins>+void NetworkResourceLoader::startNetworkLoad(const ResourceRequest& request)
</ins><span class="cx"> {
</span><span class="cx"> consumeSandboxExtensions();
</span><span class="cx">
</span><span class="lines">@@ -158,14 +182,13 @@
</span><span class="cx"> m_bufferedData = SharedBuffer::create();
</span><span class="cx">
</span><span class="cx"> #if ENABLE(NETWORK_CACHE)
</span><del>- if (NetworkCache::singleton().isEnabled())
</del><ins>+ if (canUseCache(request))
</ins><span class="cx"> m_bufferedDataForCache = SharedBuffer::create();
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> NetworkLoadParameters parameters = m_parameters;
</span><span class="cx"> parameters.defersLoading = m_defersLoading;
</span><del>- if (updatedRequest)
- parameters.request = updatedRequest.value();
</del><ins>+ parameters.request = request;
</ins><span class="cx"> m_networkLoad = std::make_unique<NetworkLoad>(*this, parameters);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -212,15 +235,14 @@
</span><span class="cx"> ASSERT(RunLoop::isMain());
</span><span class="cx">
</span><span class="cx"> if (m_networkLoad && !m_didConvertToDownload) {
</span><del>- m_networkLoad->cancel();
-
</del><span class="cx"> #if ENABLE(NETWORK_CACHE)
</span><del>- if (NetworkCache::singleton().isEnabled()) {
</del><ins>+ if (canUseCache(m_networkLoad->currentRequest())) {
</ins><span class="cx"> // We might already have used data from this incomplete load. Ensure older versions don't remain in the cache after cancel.
</span><span class="cx"> if (!m_response.isNull())
</span><del>- NetworkCache::singleton().remove(originalRequest());
</del><ins>+ NetworkCache::singleton().remove(m_networkLoad->currentRequest());
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><ins>+ m_networkLoad->cancel();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> cleanup();
</span><span class="lines">@@ -302,7 +324,7 @@
</span><span class="cx"> void NetworkResourceLoader::didFinishLoading(double finishTime)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(NETWORK_CACHE)
</span><del>- if (NetworkCache::singleton().isEnabled()) {
</del><ins>+ if (canUseCache(m_networkLoad->currentRequest())) {
</ins><span class="cx"> if (m_cacheEntryForValidation) {
</span><span class="cx"> // 304 Not Modified
</span><span class="cx"> ASSERT(m_response.httpStatusCode() == 304);
</span><span class="lines">@@ -310,21 +332,13 @@
</span><span class="cx"> didRetrieveCacheEntry(WTF::move(m_cacheEntryForValidation));
</span><span class="cx"> return;
</span><span class="cx"> }
</span><del>- bool allowStale = originalRequest().cachePolicy() >= ReturnCacheDataElseLoad;
- bool hasCacheableRedirect = m_response.isHTTP() && redirectChainAllowsReuse(m_redirectChainCacheStatus, allowStale ? ReuseExpiredRedirection : DoNotReuseExpiredRedirection);
- if (hasCacheableRedirect && m_redirectChainCacheStatus.status == RedirectChainCacheStatus::CachedRedirection) {
- // Maybe we should cache the actual redirects instead of the end result?
- auto now = std::chrono::system_clock::now();
- auto responseEndOfValidity = now + computeFreshnessLifetimeForHTTPFamily(m_response, now) - computeCurrentAge(m_response, now);
- hasCacheableRedirect = responseEndOfValidity <= m_redirectChainCacheStatus.endOfValidity;
- }
</del><span class="cx">
</span><span class="cx"> bool isPrivateSession = sessionID().isEphemeral();
</span><del>- if (m_bufferedDataForCache && hasCacheableRedirect && !isPrivateSession) {
</del><ins>+ if (m_bufferedDataForCache && m_response.isHTTP() && !isPrivateSession) {
</ins><span class="cx"> // Keep the connection alive.
</span><span class="cx"> RefPtr<NetworkConnectionToWebProcess> connection(&connectionToWebProcess());
</span><span class="cx"> RefPtr<NetworkResourceLoader> loader(this);
</span><del>- NetworkCache::singleton().store(originalRequest(), m_response, WTF::move(m_bufferedDataForCache), [loader, connection](NetworkCache::MappedBody& mappedBody) {
</del><ins>+ NetworkCache::singleton().store(m_networkLoad->currentRequest(), m_response, WTF::move(m_bufferedDataForCache), [loader, connection](NetworkCache::MappedBody& mappedBody) {
</ins><span class="cx"> #if ENABLE(SHAREABLE_RESOURCE)
</span><span class="cx"> if (mappedBody.shareableResourceHandle.isNull())
</span><span class="cx"> return;
</span><span class="lines">@@ -332,9 +346,6 @@
</span><span class="cx"> loader->send(Messages::NetworkProcessConnection::DidCacheResource(loader->originalRequest(), mappedBody.shareableResourceHandle, loader->sessionID()));
</span><span class="cx"> #endif
</span><span class="cx"> });
</span><del>- } else if (!hasCacheableRedirect) {
- // Make sure we don't keep a stale entry in the cache.
- NetworkCache::singleton().remove(originalRequest());
</del><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -371,17 +382,13 @@
</span><span class="cx"> cleanup();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NetworkResourceLoader::willSendRedirectedRequest(const ResourceRequest& request, const ResourceResponse& redirectResponse)
</del><ins>+void NetworkResourceLoader::willSendRedirectedRequest(const ResourceRequest& request, const WebCore::ResourceRequest& redirectRequest, const ResourceResponse& redirectResponse)
</ins><span class="cx"> {
</span><del>-#if ENABLE(NETWORK_CACHE)
- updateRedirectChainStatus(m_redirectChainCacheStatus, redirectResponse);
-#endif
-
</del><span class="cx"> if (isSynchronous()) {
</span><del>- ResourceRequest overridenRequest = request;
</del><ins>+ ResourceRequest overridenRequest = redirectRequest;
</ins><span class="cx"> // FIXME: This needs to be fixed to follow the redirect correctly even for cross-domain requests.
</span><span class="cx"> // This includes at least updating host records, and comparing the current request instead of the original request here.
</span><del>- if (!protocolHostAndPortAreEqual(originalRequest().url(), request.url())) {
</del><ins>+ if (!protocolHostAndPortAreEqual(originalRequest().url(), redirectRequest.url())) {
</ins><span class="cx"> ASSERT(m_synchronousLoadData->error.isNull());
</span><span class="cx"> m_synchronousLoadData->error = SynchronousLoaderClient::platformBadResponseError();
</span><span class="cx"> m_networkLoad->clearCurrentRequest();
</span><span class="lines">@@ -390,11 +397,30 @@
</span><span class="cx"> continueWillSendRequest(overridenRequest);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><del>- sendAbortingOnFailure(Messages::WebResourceLoader::WillSendRequest(request, redirectResponse));
</del><ins>+ sendAbortingOnFailure(Messages::WebResourceLoader::WillSendRequest(redirectRequest, redirectResponse));
+
+#if ENABLE(NETWORK_CACHE)
+ if (canUseCache(request))
+ NetworkCache::singleton().storeRedirect(request, redirectResponse, redirectRequest);
+#else
+ UNUSED_PARAM(request);
+#endif
</ins><span class="cx"> }
</span><del>-
</del><ins>+
</ins><span class="cx"> void NetworkResourceLoader::continueWillSendRequest(const ResourceRequest& newRequest)
</span><span class="cx"> {
</span><ins>+#if ENABLE(NETWORK_CACHE)
+ if (m_isWaitingContinueWillSendRequestForCachedRedirect) {
+ LOG(NetworkCache, "(NetworkProcess) Retrieving cached redirect");
+ if (canUseCache(newRequest))
+ retrieveCacheEntry(newRequest);
+ else
+ startNetworkLoad(newRequest);
+
+ m_isWaitingContinueWillSendRequestForCachedRedirect = false;
+ return;
+ }
+#endif
</ins><span class="cx"> m_networkLoad->continueWillSendRequest(newRequest);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -463,14 +489,6 @@
</span><span class="cx"> m_synchronousLoadData->response = entry->response();
</span><span class="cx"> sendReplyToSynchronousRequest(*m_synchronousLoadData, entry->buffer());
</span><span class="cx"> } else {
</span><del>- if (entry->response().url() != originalRequest().url()) {
- // This is a cached redirect. Synthesize a minimal redirect so we get things like referer header right.
- // FIXME: We should cache the actual redirects.
- ResourceRequest syntheticRedirectRequest(entry->response().url());
- ResourceResponse syntheticRedirectResponse(originalRequest().url(), { }, 0, { });
- sendAbortingOnFailure(Messages::WebResourceLoader::WillSendRequest(syntheticRedirectRequest, syntheticRedirectResponse));
- }
-
</del><span class="cx"> bool needsContinueDidReceiveResponseMessage = originalRequest().requester() == ResourceRequest::Requester::Main;
</span><span class="cx"> sendAbortingOnFailure(Messages::WebResourceLoader::DidReceiveResponse(entry->response(), needsContinueDidReceiveResponseMessage));
</span><span class="cx">
</span><span class="lines">@@ -511,6 +529,15 @@
</span><span class="cx">
</span><span class="cx"> startNetworkLoad(revalidationRequest);
</span><span class="cx"> }
</span><ins>+
+void NetworkResourceLoader::dispatchWillSendRequestForCacheEntry(std::unique_ptr<NetworkCache::Entry> entry)
+{
+ ASSERT(entry->redirectRequest());
+ LOG(NetworkCache, "(NetworkProcess) Executing cached redirect");
+
+ sendAbortingOnFailure(Messages::WebResourceLoader::WillSendRequest(*entry->redirectRequest(), entry->response()));
+ m_isWaitingContinueWillSendRequestForCachedRedirect = true;
+}
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> IPC::Connection* NetworkResourceLoader::messageSenderConnection()
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkResourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h (194312 => 194313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h        2015-12-19 09:01:00 UTC (rev 194312)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h        2015-12-19 13:26:38 UTC (rev 194313)
</span><span class="lines">@@ -61,6 +61,10 @@
</span><span class="cx">
</span><span class="cx"> NetworkLoad* networkLoad() const { return m_networkLoad.get(); }
</span><span class="cx">
</span><ins>+#if ENABLE(NETWORK_CACHE)
+ bool canUseCache(const WebCore::ResourceRequest&) const;
+#endif
+
</ins><span class="cx"> void start();
</span><span class="cx"> void abort();
</span><span class="cx">
</span><span class="lines">@@ -97,7 +101,7 @@
</span><span class="cx"> virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override;
</span><span class="cx"> virtual void canAuthenticateAgainstProtectionSpaceAsync(const WebCore::ProtectionSpace&) override;
</span><span class="cx"> virtual bool isSynchronous() const override;
</span><del>- virtual void willSendRedirectedRequest(const WebCore::ResourceRequest&, const WebCore::ResourceResponse& redirectResponse) override;
</del><ins>+ virtual void willSendRedirectedRequest(const WebCore::ResourceRequest&, const WebCore::ResourceRequest& redirectRequest, const WebCore::ResourceResponse& redirectResponse) override;
</ins><span class="cx"> virtual ShouldContinueDidReceiveResponse didReceiveResponse(const WebCore::ResourceResponse&) override;
</span><span class="cx"> virtual void didReceiveBuffer(RefPtr<WebCore::SharedBuffer>&&, int reportedEncodedDataLength) override;
</span><span class="cx"> virtual void didFinishLoading(double finishTime) override;
</span><span class="lines">@@ -112,11 +116,13 @@
</span><span class="cx"> virtual uint64_t messageSenderDestinationID() override { return m_parameters.identifier; }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(NETWORK_CACHE)
</span><ins>+ void retrieveCacheEntry(const WebCore::ResourceRequest&);
</ins><span class="cx"> void didRetrieveCacheEntry(std::unique_ptr<NetworkCache::Entry>);
</span><span class="cx"> void validateCacheEntry(std::unique_ptr<NetworkCache::Entry>);
</span><ins>+ void dispatchWillSendRequestForCacheEntry(std::unique_ptr<NetworkCache::Entry>);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>- void startNetworkLoad(const Optional<WebCore::ResourceRequest>& updatedRequest = { });
</del><ins>+ void startNetworkLoad(const WebCore::ResourceRequest&);
</ins><span class="cx"> void continueDidReceiveResponse();
</span><span class="cx">
</span><span class="cx"> void cleanup();
</span><span class="lines">@@ -155,8 +161,7 @@
</span><span class="cx"> #if ENABLE(NETWORK_CACHE)
</span><span class="cx"> RefPtr<WebCore::SharedBuffer> m_bufferedDataForCache;
</span><span class="cx"> std::unique_ptr<NetworkCache::Entry> m_cacheEntryForValidation;
</span><del>-
- WebCore::RedirectChainCacheStatus m_redirectChainCacheStatus;
</del><ins>+ bool m_isWaitingContinueWillSendRequestForCachedRedirect { false };
</ins><span class="cx"> #endif
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp (194312 => 194313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp        2015-12-19 09:01:00 UTC (rev 194312)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp        2015-12-19 13:26:38 UTC (rev 194313)
</span><span class="lines">@@ -220,7 +220,7 @@
</span><span class="cx"> {
</span><span class="cx"> // The request is conditional so we force revalidation from the network. We merely check the disk cache
</span><span class="cx"> // so we can update the cache entry.
</span><del>- if (request.isConditional())
</del><ins>+ if (request.isConditional() && !entry.redirectRequest())
</ins><span class="cx"> return UseDecision::Validate;
</span><span class="cx">
</span><span class="cx"> if (!verifyVaryingRequestHeaders(entry.varyingRequestHeaders(), request))
</span><span class="lines">@@ -236,7 +236,7 @@
</span><span class="cx"> if (!entry.response().hasCacheValidatorFields())
</span><span class="cx"> return UseDecision::NoDueToMissingValidatorFields;
</span><span class="cx">
</span><del>- return UseDecision::Validate;
</del><ins>+ return entry.redirectRequest() ? UseDecision::NoDueToExpiredRedirect : UseDecision::Validate;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static RetrieveDecision makeRetrieveDecision(const WebCore::ResourceRequest& request)
</span><span class="lines">@@ -343,35 +343,35 @@
</span><span class="cx"> return StoreDecision::Yes;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void Cache::retrieve(const WebCore::ResourceRequest& originalRequest, const GlobalFrameID& frameID, std::function<void (std::unique_ptr<Entry>)> completionHandler)
</del><ins>+void Cache::retrieve(const WebCore::ResourceRequest& request, const GlobalFrameID& frameID, std::function<void (std::unique_ptr<Entry>)> completionHandler)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(isEnabled());
</span><del>- ASSERT(originalRequest.url().protocolIsInHTTPFamily());
</del><ins>+ ASSERT(request.url().protocolIsInHTTPFamily());
</ins><span class="cx">
</span><del>- LOG(NetworkCache, "(NetworkProcess) retrieving %s priority %d", originalRequest.url().string().ascii().data(), static_cast<int>(originalRequest.priority()));
</del><ins>+ LOG(NetworkCache, "(NetworkProcess) retrieving %s priority %d", request.url().string().ascii().data(), static_cast<int>(request.priority()));
</ins><span class="cx">
</span><span class="cx"> if (m_statistics)
</span><span class="cx"> m_statistics->recordRetrievalRequest(frameID.first);
</span><span class="cx">
</span><del>- Key storageKey = makeCacheKey(originalRequest);
</del><ins>+ Key storageKey = makeCacheKey(request);
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION)
</span><span class="cx"> if (m_speculativeLoadManager)
</span><del>- m_speculativeLoadManager->registerLoad(frameID, originalRequest, storageKey);
</del><ins>+ m_speculativeLoadManager->registerLoad(frameID, request, storageKey);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><del>- auto retrieveDecision = makeRetrieveDecision(originalRequest);
</del><ins>+ auto retrieveDecision = makeRetrieveDecision(request);
</ins><span class="cx"> if (retrieveDecision != RetrieveDecision::Yes) {
</span><span class="cx"> if (m_statistics)
</span><del>- m_statistics->recordNotUsingCacheForRequest(frameID.first, storageKey, originalRequest, retrieveDecision);
</del><ins>+ m_statistics->recordNotUsingCacheForRequest(frameID.first, storageKey, request, retrieveDecision);
</ins><span class="cx">
</span><span class="cx"> completionHandler(nullptr);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(NETWORK_CACHE_SPECULATIVE_REVALIDATION)
</span><del>- if (m_speculativeLoadManager && m_speculativeLoadManager->retrieve(frameID, storageKey, [originalRequest, completionHandler](std::unique_ptr<Entry> entry) {
- if (entry && verifyVaryingRequestHeaders(entry->varyingRequestHeaders(), originalRequest))
</del><ins>+ if (m_speculativeLoadManager && m_speculativeLoadManager->retrieve(frameID, storageKey, [request, completionHandler](std::unique_ptr<Entry> entry) {
+ if (entry && verifyVaryingRequestHeaders(entry->varyingRequestHeaders(), request))
</ins><span class="cx"> completionHandler(WTF::move(entry));
</span><span class="cx"> else
</span><span class="cx"> completionHandler(nullptr);
</span><span class="lines">@@ -380,14 +380,14 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> auto startTime = std::chrono::system_clock::now();
</span><del>- auto priority = static_cast<unsigned>(originalRequest.priority());
</del><ins>+ auto priority = static_cast<unsigned>(request.priority());
</ins><span class="cx">
</span><del>- m_storage->retrieve(storageKey, priority, [this, originalRequest, completionHandler, startTime, storageKey, frameID](std::unique_ptr<Storage::Record> record) {
</del><ins>+ m_storage->retrieve(storageKey, priority, [this, request, completionHandler, startTime, storageKey, frameID](std::unique_ptr<Storage::Record> record) {
</ins><span class="cx"> if (!record) {
</span><span class="cx"> LOG(NetworkCache, "(NetworkProcess) not found in storage");
</span><span class="cx">
</span><span class="cx"> if (m_statistics)
</span><del>- m_statistics->recordRetrievalFailure(frameID.first, storageKey, originalRequest);
</del><ins>+ m_statistics->recordRetrievalFailure(frameID.first, storageKey, request);
</ins><span class="cx">
</span><span class="cx"> completionHandler(nullptr);
</span><span class="cx"> return false;
</span><span class="lines">@@ -397,7 +397,7 @@
</span><span class="cx">
</span><span class="cx"> auto entry = Entry::decodeStorageRecord(*record);
</span><span class="cx">
</span><del>- auto useDecision = entry ? makeUseDecision(*entry, originalRequest) : UseDecision::NoDueToDecodeFailure;
</del><ins>+ auto useDecision = entry ? makeUseDecision(*entry, request) : UseDecision::NoDueToDecodeFailure;
</ins><span class="cx"> switch (useDecision) {
</span><span class="cx"> case UseDecision::Use:
</span><span class="cx"> break;
</span><span class="lines">@@ -410,34 +410,27 @@
</span><span class="cx">
</span><span class="cx"> #if !LOG_DISABLED
</span><span class="cx"> auto elapsedMS = static_cast<int64_t>(std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - startTime).count());
</span><del>- LOG(NetworkCache, "(NetworkProcess) retrieve complete useDecision=%d priority=%d time=%" PRIi64 "ms", static_cast<int>(useDecision), static_cast<int>(originalRequest.priority()), elapsedMS);
</del><ins>+ LOG(NetworkCache, "(NetworkProcess) retrieve complete useDecision=%d priority=%d time=%" PRIi64 "ms", static_cast<int>(useDecision), static_cast<int>(request.priority()), elapsedMS);
</ins><span class="cx"> #endif
</span><span class="cx"> completionHandler(WTF::move(entry));
</span><span class="cx">
</span><span class="cx"> if (m_statistics)
</span><del>- m_statistics->recordRetrievedCachedEntry(frameID.first, storageKey, originalRequest, useDecision);
</del><ins>+ m_statistics->recordRetrievedCachedEntry(frameID.first, storageKey, request, useDecision);
</ins><span class="cx"> return useDecision != UseDecision::NoDueToDecodeFailure;
</span><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><del>-std::unique_ptr<Entry> Cache::store(const WebCore::ResourceRequest& originalRequest, const WebCore::ResourceResponse& response, RefPtr<WebCore::SharedBuffer>&& responseData, std::function<void (MappedBody&)> completionHandler)
</del><ins>+std::unique_ptr<Entry> Cache::store(const WebCore::ResourceRequest& request, const WebCore::ResourceResponse& response, RefPtr<WebCore::SharedBuffer>&& responseData, std::function<void (MappedBody&)> completionHandler)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(isEnabled());
</span><span class="cx"> ASSERT(responseData);
</span><span class="cx">
</span><del>-#if !LOG_DISABLED
-#if ENABLE(CACHE_PARTITIONING)
- CString partition = originalRequest.cachePartition().latin1();
-#else
- CString partition = "No partition";
-#endif
- LOG(NetworkCache, "(NetworkProcess) storing %s, partition %s", originalRequest.url().string().latin1().data(), partition.data());
-#endif // !LOG_DISABLED
</del><ins>+ LOG(NetworkCache, "(NetworkProcess) storing %s, partition %s", request.url().string().latin1().data(), makeCacheKey(request).partition().latin1().data());
</ins><span class="cx">
</span><del>- StoreDecision storeDecision = makeStoreDecision(originalRequest, response);
</del><ins>+ StoreDecision storeDecision = makeStoreDecision(request, response);
</ins><span class="cx"> if (storeDecision != StoreDecision::Yes) {
</span><span class="cx"> LOG(NetworkCache, "(NetworkProcess) didn't store, storeDecision=%d", static_cast<int>(storeDecision));
</span><del>- auto key = makeCacheKey(originalRequest);
</del><ins>+ auto key = makeCacheKey(request);
</ins><span class="cx">
</span><span class="cx"> auto isSuccessfulRevalidation = response.httpStatusCode() == 304;
</span><span class="cx"> if (!isSuccessfulRevalidation) {
</span><span class="lines">@@ -451,7 +444,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- std::unique_ptr<Entry> cacheEntry = std::make_unique<Entry>(makeCacheKey(originalRequest), response, WTF::move(responseData), collectVaryingRequestHeaders(originalRequest, response));
</del><ins>+ std::unique_ptr<Entry> cacheEntry = std::make_unique<Entry>(makeCacheKey(request), response, WTF::move(responseData), collectVaryingRequestHeaders(request, response));
</ins><span class="cx">
</span><span class="cx"> auto record = cacheEntry->encodeAsStorageRecord();
</span><span class="cx">
</span><span class="lines">@@ -471,6 +464,31 @@
</span><span class="cx"> return cacheEntry;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+std::unique_ptr<Entry> Cache::storeRedirect(const WebCore::ResourceRequest& request, const WebCore::ResourceResponse& response, const WebCore::ResourceRequest& redirectRequest)
+{
+ ASSERT(isEnabled());
+
+ LOG(NetworkCache, "(NetworkProcess) storing redirect %s -> %s", request.url().string().latin1().data(), redirectRequest.url().string().latin1().data());
+
+ StoreDecision storeDecision = makeStoreDecision(request, response);
+ if (storeDecision != StoreDecision::Yes) {
+ LOG(NetworkCache, "(NetworkProcess) didn't store redirect, storeDecision=%d", static_cast<int>(storeDecision));
+ auto key = makeCacheKey(request);
+ if (m_statistics)
+ m_statistics->recordNotCachingResponse(key, storeDecision);
+
+ return nullptr;
+ }
+
+ std::unique_ptr<Entry> cacheEntry = std::make_unique<Entry>(makeCacheKey(request), response, redirectRequest, collectVaryingRequestHeaders(request, response));
+
+ auto record = cacheEntry->encodeAsStorageRecord();
+
+ m_storage->store(record, nullptr);
+
+ return cacheEntry;
+}
+
</ins><span class="cx"> std::unique_ptr<Entry> Cache::update(const WebCore::ResourceRequest& originalRequest, const GlobalFrameID& frameID, const Entry& existingEntry, const WebCore::ResourceResponse& validatingResponse)
</span><span class="cx"> {
</span><span class="cx"> LOG(NetworkCache, "(NetworkProcess) updating %s", originalRequest.url().string().latin1().data());
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h (194312 => 194313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h        2015-12-19 09:01:00 UTC (rev 194312)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCache.h        2015-12-19 13:26:38 UTC (rev 194313)
</span><span class="lines">@@ -82,6 +82,7 @@
</span><span class="cx"> NoDueToVaryingHeaderMismatch,
</span><span class="cx"> NoDueToMissingValidatorFields,
</span><span class="cx"> NoDueToDecodeFailure,
</span><ins>+ NoDueToExpiredRedirect,
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> using GlobalFrameID = std::pair<uint64_t /*webPageID*/, uint64_t /*webFrameID*/>;
</span><span class="lines">@@ -104,6 +105,7 @@
</span><span class="cx"> // Completion handler may get called back synchronously on failure.
</span><span class="cx"> void retrieve(const WebCore::ResourceRequest&, const GlobalFrameID&, std::function<void (std::unique_ptr<Entry>)>);
</span><span class="cx"> std::unique_ptr<Entry> store(const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, RefPtr<WebCore::SharedBuffer>&&, std::function<void (MappedBody&)>);
</span><ins>+ std::unique_ptr<Entry> storeRedirect(const WebCore::ResourceRequest&, const WebCore::ResourceResponse&, const WebCore::ResourceRequest& redirectRequest);
</ins><span class="cx"> std::unique_ptr<Entry> update(const WebCore::ResourceRequest&, const GlobalFrameID&, const Entry&, const WebCore::ResourceResponse& validatingResponse);
</span><span class="cx">
</span><span class="cx"> void traverse(std::function<void (const Entry*)>&&);
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheEntrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheEntry.cpp (194312 => 194313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheEntry.cpp        2015-12-19 09:01:00 UTC (rev 194312)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheEntry.cpp        2015-12-19 13:26:38 UTC (rev 194313)
</span><span class="lines">@@ -49,6 +49,18 @@
</span><span class="cx"> ASSERT(m_key.type() == "resource");
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+Entry::Entry(const Key& key, const WebCore::ResourceResponse& response, const WebCore::ResourceRequest& redirectRequest, const Vector<std::pair<String, String>>& varyingRequestHeaders)
+ : m_key(key)
+ , m_timeStamp(std::chrono::system_clock::now())
+ , m_response(response)
+ , m_varyingRequestHeaders(varyingRequestHeaders)
+ , m_redirectRequest(WebCore::ResourceRequest::adopt(redirectRequest.copyData())) // Don't include the underlying platform request object.
+{
+ ASSERT(m_key.type() == "resource");
+ // Redirect body is not needed even if exists.
+ m_redirectRequest->setHTTPBody(nullptr);
+}
+
</ins><span class="cx"> Entry::Entry(const Entry& other)
</span><span class="cx"> : m_key(other.m_key)
</span><span class="cx"> , m_timeStamp(other.m_timeStamp)
</span><span class="lines">@@ -77,6 +89,11 @@
</span><span class="cx"> if (hasVaryingRequestHeaders)
</span><span class="cx"> encoder << m_varyingRequestHeaders;
</span><span class="cx">
</span><ins>+ bool isRedirect = !!m_redirectRequest;
+ encoder << isRedirect;
+ if (isRedirect)
+ m_redirectRequest->encodeWithoutPlatformData(encoder);
+
</ins><span class="cx"> encoder.encodeChecksum();
</span><span class="cx">
</span><span class="cx"> Data header(encoder.buffer(), encoder.bufferSize());
</span><span class="lines">@@ -105,6 +122,16 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ bool isRedirect;
+ if (!decoder.decode(isRedirect))
+ return nullptr;
+
+ if (isRedirect) {
+ entry->m_redirectRequest = std::make_unique<WebCore::ResourceRequest>();
+ if (!entry->m_redirectRequest->decodeWithoutPlatformData(decoder))
+ return nullptr;
+ }
+
</ins><span class="cx"> if (!decoder.verifyChecksum()) {
</span><span class="cx"> LOG(NetworkCache, "(NetworkProcess) checksum verification failure\n");
</span><span class="cx"> return nullptr;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheEntryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheEntry.h (194312 => 194313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheEntry.h        2015-12-19 09:01:00 UTC (rev 194312)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheEntry.h        2015-12-19 13:26:38 UTC (rev 194313)
</span><span class="lines">@@ -30,12 +30,12 @@
</span><span class="cx">
</span><span class="cx"> #include "NetworkCacheStorage.h"
</span><span class="cx"> #include "ShareableResource.h"
</span><ins>+#include <WebCore/ResourceRequest.h>
</ins><span class="cx"> #include <WebCore/ResourceResponse.h>
</span><span class="cx"> #include <wtf/Noncopyable.h>
</span><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><del>-class ResourceRequest;
</del><span class="cx"> class SharedBuffer;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -46,6 +46,7 @@
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="cx"> Entry(const Key&, const WebCore::ResourceResponse&, RefPtr<WebCore::SharedBuffer>&&, const Vector<std::pair<String, String>>& varyingRequestHeaders);
</span><ins>+ Entry(const Key&, const WebCore::ResourceResponse&, const WebCore::ResourceRequest& redirectRequest, const Vector<std::pair<String, String>>& varyingRequestHeaders);
</ins><span class="cx"> explicit Entry(const Storage::Record&);
</span><span class="cx"> Entry(const Entry&);
</span><span class="cx">
</span><span class="lines">@@ -58,6 +59,8 @@
</span><span class="cx"> const Vector<std::pair<String, String>>& varyingRequestHeaders() const { return m_varyingRequestHeaders; }
</span><span class="cx">
</span><span class="cx"> WebCore::SharedBuffer* buffer() const;
</span><ins>+ const WebCore::ResourceRequest* redirectRequest() const { return m_redirectRequest.get(); }
+
</ins><span class="cx"> #if ENABLE(SHAREABLE_RESOURCE)
</span><span class="cx"> ShareableResource::Handle& shareableResourceHandle() const;
</span><span class="cx"> #endif
</span><span class="lines">@@ -80,6 +83,7 @@
</span><span class="cx"> WebCore::ResourceResponse m_response;
</span><span class="cx"> Vector<std::pair<String, String>> m_varyingRequestHeaders;
</span><span class="cx">
</span><ins>+ std::unique_ptr<WebCore::ResourceRequest> m_redirectRequest;
</ins><span class="cx"> mutable RefPtr<WebCore::SharedBuffer> m_buffer;
</span><span class="cx"> #if ENABLE(SHAREABLE_RESOURCE)
</span><span class="cx"> mutable ShareableResource::Handle m_shareableResourceHandle;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheSpeculativeLoadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp (194312 => 194313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp        2015-12-19 09:01:00 UTC (rev 194312)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp        2015-12-19 13:26:38 UTC (rev 194313)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx"> ASSERT(!m_networkLoad);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void SpeculativeLoad::willSendRedirectedRequest(const ResourceRequest& request, const ResourceResponse& redirectResponse)
</del><ins>+void SpeculativeLoad::willSendRedirectedRequest(const ResourceRequest& request, const ResourceRequest& redirectRequest, const ResourceResponse& redirectResponse)
</ins><span class="cx"> {
</span><span class="cx"> updateRedirectChainStatus(m_redirectChainCacheStatus, redirectResponse);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheSpeculativeLoadh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoad.h (194312 => 194313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoad.h        2015-12-19 09:01:00 UTC (rev 194312)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoad.h        2015-12-19 13:26:38 UTC (rev 194313)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx"> virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override { }
</span><span class="cx"> virtual void canAuthenticateAgainstProtectionSpaceAsync(const WebCore::ProtectionSpace&) override { }
</span><span class="cx"> virtual bool isSynchronous() const override { return false; }
</span><del>- virtual void willSendRedirectedRequest(const WebCore::ResourceRequest&, const WebCore::ResourceResponse& redirectResponse) override;
</del><ins>+ virtual void willSendRedirectedRequest(const WebCore::ResourceRequest&, const WebCore::ResourceRequest& redirectRequest, const WebCore::ResourceResponse& redirectResponse) override;
</ins><span class="cx"> virtual ShouldContinueDidReceiveResponse didReceiveResponse(const WebCore::ResourceResponse&) override;
</span><span class="cx"> virtual void didReceiveBuffer(RefPtr<WebCore::SharedBuffer>&&, int reportedEncodedDataLength) override;
</span><span class="cx"> virtual void didFinishLoading(double finishTime) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheStatisticscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.cpp (194312 => 194313)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.cpp        2015-12-19 09:01:00 UTC (rev 194312)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheStatistics.cpp        2015-12-19 13:26:38 UTC (rev 194313)
</span><span class="lines">@@ -280,6 +280,7 @@
</span><span class="cx"> case UseDecision::NoDueToMissingValidatorFields:
</span><span class="cx"> return WebCore::DiagnosticLoggingKeys::missingValidatorFieldsKey();
</span><span class="cx"> case UseDecision::NoDueToDecodeFailure:
</span><ins>+ case UseDecision::NoDueToExpiredRedirect:
</ins><span class="cx"> return WebCore::DiagnosticLoggingKeys::otherKey();
</span><span class="cx"> case UseDecision::Use:
</span><span class="cx"> case UseDecision::Validate:
</span></span></pre>
</div>
</div>
</body>
</html>