<!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>[198450] 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/198450">198450</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-03-18 16:23:09 -0700 (Fri, 18 Mar 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Speculative revalidation requests do not have their HTTP user-agent set
https://bugs.webkit.org/show_bug.cgi?id=155620
<rdar://problem/24657567>
Reviewed by Brady Eidson.
Source/WebCore:
Export a couple of symbols so they can be used from WebKit2.
Test: http/tests/cache/disk-cache/speculative-validation/validation-request.html
* platform/network/ResourceRequestBase.h:
Source/WebKit2:
Speculative revalidation requests do not have their HTTP user-agent set
which could lead to different content getting returned by the server.
To address the problem, we save the original request's 'user-agent' in
the disk cache and re-use it later on for speculative validation
requests.
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
(WebKit::NetworkCache::constructRevalidationRequest):
(WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
(WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
(WebKit::NetworkCache::SubresourceInfo::encode):
(WebKit::NetworkCache::SubresourceInfo::decode):
(WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
(WebKit::NetworkCache::SubresourceInfo::operator=):
(WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
(WebKit::NetworkCache::SubresourcesEntry::updateSubresourceLoads):
(WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord): Deleted.
* NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
(WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
LayoutTests:
Add layout test coverage.
* http/tests/cache/disk-cache/speculative-validation/resources/request-headers-script.php: Added.
* http/tests/cache/disk-cache/speculative-validation/resources/validation-request-frame.php: Added.
* http/tests/cache/disk-cache/speculative-validation/validation-request-expected.txt: Added.
* http/tests/cache/disk-cache/speculative-validation/validation-request.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</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="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheSpeculativeLoadManagercpp">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheSubresourcesEntrycpp">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscacheNetworkCacheSubresourcesEntryh">trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSubresourcesEntry.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/http/tests/cache/disk-cache/speculative-validation/</li>
<li>trunk/LayoutTests/http/tests/cache/disk-cache/speculative-validation/resources/</li>
<li><a href="#trunkLayoutTestshttptestscachediskcachespeculativevalidationresourcesrequestheadersscriptphp">trunk/LayoutTests/http/tests/cache/disk-cache/speculative-validation/resources/request-headers-script.php</a></li>
<li><a href="#trunkLayoutTestshttptestscachediskcachespeculativevalidationresourcesvalidationrequestframephp">trunk/LayoutTests/http/tests/cache/disk-cache/speculative-validation/resources/validation-request-frame.php</a></li>
<li><a href="#trunkLayoutTestshttptestscachediskcachespeculativevalidationvalidationrequestexpectedtxt">trunk/LayoutTests/http/tests/cache/disk-cache/speculative-validation/validation-request-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestscachediskcachespeculativevalidationvalidationrequesthtml">trunk/LayoutTests/http/tests/cache/disk-cache/speculative-validation/validation-request.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (198449 => 198450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-03-18 23:22:52 UTC (rev 198449)
+++ trunk/LayoutTests/ChangeLog        2016-03-18 23:23:09 UTC (rev 198450)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2016-03-18 Chris Dumez <cdumez@apple.com>
+
+ Speculative revalidation requests do not have their HTTP user-agent set
+ https://bugs.webkit.org/show_bug.cgi?id=155620
+ <rdar://problem/24657567>
+
+ Reviewed by Brady Eidson.
+
+ Add layout test coverage.
+
+ * http/tests/cache/disk-cache/speculative-validation/resources/request-headers-script.php: Added.
+ * http/tests/cache/disk-cache/speculative-validation/resources/validation-request-frame.php: Added.
+ * http/tests/cache/disk-cache/speculative-validation/validation-request-expected.txt: Added.
+ * http/tests/cache/disk-cache/speculative-validation/validation-request.html: Added.
+
</ins><span class="cx"> 2016-03-18 Mark Lam <mark.lam@apple.com>
</span><span class="cx">
</span><span class="cx"> ES6 spec requires that RegExpPrototype not be a RegExp object.
</span></span></pre></div>
<a id="trunkLayoutTestshttptestscachediskcachespeculativevalidationresourcesrequestheadersscriptphp"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/cache/disk-cache/speculative-validation/resources/request-headers-script.php (0 => 198450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/cache/disk-cache/speculative-validation/resources/request-headers-script.php         (rev 0)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/speculative-validation/resources/request-headers-script.php        2016-03-18 23:23:09 UTC (rev 198450)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+<?php
+header('Content-Type: text/javascript');
+header('Cache-Control: max-age=0');
+header('Etag: 123456789');
+
+?>
+allRequestHeaders = [];
+<?php
+foreach (getallheaders() as $name => $value) {
+ echo "allRequestHeaders['" . $name . "'] = '" . $value . "';";
+}
+?>
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestscachediskcachespeculativevalidationresourcesvalidationrequestframephp"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/cache/disk-cache/speculative-validation/resources/validation-request-frame.php (0 => 198450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/cache/disk-cache/speculative-validation/resources/validation-request-frame.php         (rev 0)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/speculative-validation/resources/validation-request-frame.php        2016-03-18 23:23:09 UTC (rev 198450)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+<?php
+header('Content-Type: text/html');
+header('Cache-Control: max-age=0');
+header('Etag: 123456789');
+
+?>
+<!DOCTYPE html>
+<body>
+<script src="request-headers-script.php"></script>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestscachediskcachespeculativevalidationvalidationrequestexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/cache/disk-cache/speculative-validation/validation-request-expected.txt (0 => 198450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/cache/disk-cache/speculative-validation/validation-request-expected.txt         (rev 0)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/speculative-validation/validation-request-expected.txt        2016-03-18 23:23:09 UTC (rev 198450)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+Validates HTTP headers of speculative validation requests.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS validationRequestHeader('If-None-Match') is "123456789"
+PASS validationRequestHeader('User-Agent') is initialUserAgent
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestscachediskcachespeculativevalidationvalidationrequesthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/cache/disk-cache/speculative-validation/validation-request.html (0 => 198450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/cache/disk-cache/speculative-validation/validation-request.html         (rev 0)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/speculative-validation/validation-request.html        2016-03-18 23:23:09 UTC (rev 198450)
</span><span class="lines">@@ -0,0 +1,41 @@
</span><ins>+<script src="/js-test-resources/js-test-pre.js"></script>
+<script>
+description("Validates HTTP headers of speculative validation requests.");
+jsTestIsAsync = true;
+
+state = "warmup";
+
+function validationRequestHeader(headerName)
+{
+ return frames[0].allRequestHeaders[headerName];
+
+}
+
+function frameLoaded()
+{
+ if (state == "warmup") {
+ initialUserAgent = validationRequestHeader('User-Agent');
+ // Navigate frame to 'about:blank' to flush to subresource loads metadata to disk.
+ state = "flushingMetadata";
+ document.getElementById("testFrame").src = "about:blank";
+ return;
+ }
+ if (state == "flushingMetadata") {
+ // Navigate frame to its original location again. This time it should speculatively
+ // validate subresources as we have subresource loads metadata in the disk cache.
+ state = "speculativeRevalidation";
+ document.getElementById("testFrame").src = "resources/validation-request-frame.php";
+ return;
+ }
+ if (state == "speculativeRevalidation") {
+ // Validate the HTTP headers of the speculative validation request.
+ shouldBeEqualToString("validationRequestHeader('If-None-Match')", "123456789");
+ shouldBe("validationRequestHeader('User-Agent')", "initialUserAgent");
+ finishJSTest();
+ return;
+ }
+}
+
+</script>
+<iframe id="testFrame" src="resources/validation-request-frame.php" onload="frameLoaded()"></iframe>
+<script src="/js-test-resources/js-test-post.js"></script>
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (198449 => 198450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-03-18 23:22:52 UTC (rev 198449)
+++ trunk/Source/WebCore/ChangeLog        2016-03-18 23:23:09 UTC (rev 198450)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-03-18 Chris Dumez <cdumez@apple.com>
+
+ Speculative revalidation requests do not have their HTTP user-agent set
+ https://bugs.webkit.org/show_bug.cgi?id=155620
+ <rdar://problem/24657567>
+
+ Reviewed by Brady Eidson.
+
+ Export a couple of symbols so they can be used from WebKit2.
+
+ Test: http/tests/cache/disk-cache/speculative-validation/validation-request.html
+
+ * platform/network/ResourceRequestBase.h:
+
</ins><span class="cx"> 2016-03-18 Zhuo Li <zachli@apple.com>
</span><span class="cx">
</span><span class="cx"> Need to forward declare NSScrollerImpSPI::scrollerLayoutDirection.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceRequestBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceRequestBase.h (198449 => 198450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceRequestBase.h        2016-03-18 23:22:52 UTC (rev 198449)
+++ trunk/Source/WebCore/platform/network/ResourceRequestBase.h        2016-03-18 23:23:09 UTC (rev 198450)
</span><span class="lines">@@ -107,8 +107,8 @@
</span><span class="cx"> void setHTTPOrigin(const String&);
</span><span class="cx"> WEBCORE_EXPORT void clearHTTPOrigin();
</span><span class="cx">
</span><del>- String httpUserAgent() const;
- void setHTTPUserAgent(const String&);
</del><ins>+ WEBCORE_EXPORT String httpUserAgent() const;
+ WEBCORE_EXPORT void setHTTPUserAgent(const String&);
</ins><span class="cx"> void clearHTTPUserAgent();
</span><span class="cx">
</span><span class="cx"> String httpAccept() const;
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (198449 => 198450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-03-18 23:22:52 UTC (rev 198449)
+++ trunk/Source/WebKit2/ChangeLog        2016-03-18 23:23:09 UTC (rev 198450)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2016-03-18 Chris Dumez <cdumez@apple.com>
+
+ Speculative revalidation requests do not have their HTTP user-agent set
+ https://bugs.webkit.org/show_bug.cgi?id=155620
+ <rdar://problem/24657567>
+
+ Reviewed by Brady Eidson.
+
+ Speculative revalidation requests do not have their HTTP user-agent set
+ which could lead to different content getting returned by the server.
+
+ To address the problem, we save the original request's 'user-agent' in
+ the disk cache and re-use it later on for speculative validation
+ requests.
+
+ * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
+ (WebKit::NetworkCache::constructRevalidationRequest):
+ (WebKit::NetworkCache::SpeculativeLoadManager::revalidateEntry):
+ (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
+ * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
+ (WebKit::NetworkCache::SubresourceInfo::encode):
+ (WebKit::NetworkCache::SubresourceInfo::decode):
+ (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
+ (WebKit::NetworkCache::SubresourceInfo::operator=):
+ (WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
+ (WebKit::NetworkCache::SubresourcesEntry::updateSubresourceLoads):
+ (WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord): Deleted.
+ * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
+ (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
+
</ins><span class="cx"> 2016-03-18 Enrica Casucci <enrica@apple.com>
</span><span class="cx">
</span><span class="cx"> Add id attribute to _WKActivatedElementInfo.
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheSpeculativeLoadManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp (198449 => 198450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp        2016-03-18 23:22:52 UTC (rev 198449)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp        2016-03-18 23:23:09 UTC (rev 198450)
</span><span class="lines">@@ -84,10 +84,11 @@
</span><span class="cx"> return Key(resourceKey.partition(), subresourcesType(), resourceKey.range(), resourceKey.identifier());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static inline ResourceRequest constructRevalidationRequest(const Entry& entry, const URL& firstPartyForCookies)
</del><ins>+static inline ResourceRequest constructRevalidationRequest(const Entry& entry, const SubresourceInfo& subResourceInfo)
</ins><span class="cx"> {
</span><span class="cx"> ResourceRequest revalidationRequest(entry.key().identifier());
</span><del>- revalidationRequest.setFirstPartyForCookies(firstPartyForCookies);
</del><ins>+ revalidationRequest.setHTTPUserAgent(subResourceInfo.httpUserAgent);
+ revalidationRequest.setFirstPartyForCookies(subResourceInfo.firstPartyForCookies);
</ins><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><span class="cx"> if (entry.key().hasPartition())
</span><span class="cx"> revalidationRequest.setCachePartition(entry.key().partition());
</span><span class="lines">@@ -380,7 +381,7 @@
</span><span class="cx"> if (!key.range().isEmpty())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- ResourceRequest revalidationRequest = constructRevalidationRequest(*entry, subresourceInfo.firstPartyForCookies);
</del><ins>+ ResourceRequest revalidationRequest = constructRevalidationRequest(*entry, subresourceInfo);
</ins><span class="cx">
</span><span class="cx"> LOG(NetworkCacheSpeculativePreloading, "(NetworkProcess) Speculatively revalidating '%s':", key.identifier().utf8().data());
</span><span class="cx"> auto revalidator = std::make_unique<SpeculativeLoad>(frameID, revalidationRequest, WTFMove(entry), [this, key, frameID](std::unique_ptr<Entry> revalidatedEntry) {
</span><span class="lines">@@ -405,8 +406,7 @@
</span><span class="cx"> void SpeculativeLoadManager::preloadEntry(const Key& key, const SubresourceInfo& subResourceInfo, const GlobalFrameID& frameID)
</span><span class="cx"> {
</span><span class="cx"> m_pendingPreloads.add(key, nullptr);
</span><del>- URLCapture firstPartyForCookies(subResourceInfo.firstPartyForCookies);
- retrieveEntryFromStorage(key, [this, key, firstPartyForCookies, frameID](std::unique_ptr<Entry> entry) {
</del><ins>+ retrieveEntryFromStorage(key, [this, key, subResourceInfo, frameID](std::unique_ptr<Entry> entry) {
</ins><span class="cx"> m_pendingPreloads.remove(key);
</span><span class="cx">
</span><span class="cx"> if (satisfyPendingRequests(key, entry.get())) {
</span><span class="lines">@@ -419,7 +419,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> if (entry->needsValidation())
</span><del>- revalidateEntry(WTFMove(entry), firstPartyForCookies.url(), frameID);
</del><ins>+ revalidateEntry(WTFMove(entry), subResourceInfo, frameID);
</ins><span class="cx"> else
</span><span class="cx"> addPreloadedEntry(WTFMove(entry), frameID, WasRevalidated::No);
</span><span class="cx"> });
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheSubresourcesEntrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp (198449 => 198450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp        2016-03-18 23:22:52 UTC (rev 198449)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp        2016-03-18 23:23:09 UTC (rev 198450)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> {
</span><span class="cx"> encoder << firstPartyForCookies;
</span><span class="cx"> encoder << isTransient;
</span><ins>+ encoder << httpUserAgent;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool SubresourceInfo::decode(Decoder& decoder, SubresourceInfo& info)
</span><span class="lines">@@ -48,9 +49,26 @@
</span><span class="cx"> return false;
</span><span class="cx"> if (!decoder.decode(info.isTransient))
</span><span class="cx"> return false;
</span><ins>+ if (!decoder.decode(info.httpUserAgent))
+ return false;
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+SubresourceInfo::SubresourceInfo(const SubresourceInfo& subresourceInfo)
+ : firstPartyForCookies(subresourceInfo.firstPartyForCookies.isolatedCopy())
+ , httpUserAgent(subresourceInfo.httpUserAgent.isolatedCopy())
+ , isTransient(subresourceInfo.isTransient)
+{
+}
+
+SubresourceInfo& SubresourceInfo::operator=(const SubresourceInfo& other)
+{
+ firstPartyForCookies = other.firstPartyForCookies.isolatedCopy();
+ httpUserAgent = other.httpUserAgent.isolatedCopy();
+ isTransient = other.isTransient;
+ return *this;
+}
+
</ins><span class="cx"> Storage::Record SubresourcesEntry::encodeAsStorageRecord() const
</span><span class="cx"> {
</span><span class="cx"> Encoder encoder;
</span><span class="lines">@@ -90,7 +108,7 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_key.type() == "subresources");
</span><span class="cx"> for (auto& subresourceLoad : subresourceLoads)
</span><del>- m_subresources.add(subresourceLoad->key, SubresourceInfo(subresourceLoad->request.firstPartyForCookies()));
</del><ins>+ m_subresources.add(subresourceLoad->key, SubresourceInfo(subresourceLoad->request));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void SubresourcesEntry::updateSubresourceLoads(const Vector<std::unique_ptr<SubresourceLoad>>& subresourceLoads)
</span><span class="lines">@@ -100,7 +118,7 @@
</span><span class="cx"> // Mark keys that are common with last load as non-Transient.
</span><span class="cx"> for (auto& subresourceLoad : subresourceLoads) {
</span><span class="cx"> bool isTransient = !oldSubresources.contains(subresourceLoad->key);
</span><del>- m_subresources.add(subresourceLoad->key, SubresourceInfo(subresourceLoad->request.firstPartyForCookies(), isTransient));
</del><ins>+ m_subresources.add(subresourceLoad->key, SubresourceInfo(subresourceLoad->request, isTransient));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscacheNetworkCacheSubresourcesEntryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSubresourcesEntry.h (198449 => 198450)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSubresourcesEntry.h        2016-03-18 23:22:52 UTC (rev 198449)
+++ trunk/Source/WebKit2/NetworkProcess/cache/NetworkCacheSubresourcesEntry.h        2016-03-18 23:23:09 UTC (rev 198450)
</span><span class="lines">@@ -43,12 +43,19 @@
</span><span class="cx"> static bool decode(Decoder&, SubresourceInfo&);
</span><span class="cx">
</span><span class="cx"> SubresourceInfo() = default;
</span><del>- SubresourceInfo(const WebCore::URL& firstPartyForCookies, bool isTransient = false)
- : firstPartyForCookies(firstPartyForCookies)
</del><ins>+ SubresourceInfo(const WebCore::ResourceRequest& request, bool isTransient = false)
+ : firstPartyForCookies(request.firstPartyForCookies())
+ , httpUserAgent(request.httpUserAgent())
</ins><span class="cx"> , isTransient(isTransient)
</span><span class="cx"> { }
</span><span class="cx">
</span><ins>+ SubresourceInfo(const SubresourceInfo&);
+ SubresourceInfo(SubresourceInfo&&) = default;
+ SubresourceInfo& operator=(const SubresourceInfo&);
+ SubresourceInfo& operator=(SubresourceInfo&&) = default;
+
</ins><span class="cx"> WebCore::URL firstPartyForCookies;
</span><ins>+ String httpUserAgent;
</ins><span class="cx"> bool isTransient { false };
</span><span class="cx"> };
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>