<!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>[192062] trunk/Source/WebKit2</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/192062">192062</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-11-05 11:25:29 -0800 (Thu, 05 Nov 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WK2] Clean up / Modernize NetworkResourceLoader
https://bugs.webkit.org/show_bug.cgi?id=150922

Reviewed by Andreas Kling.

Clean up / Modernize NetworkResourceLoader.

* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::filesInBlob):
* NetworkProcess/FileAPI/NetworkBlobRegistry.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
(WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::SynchronousLoadData::SynchronousLoadData):
(WebKit::sendReplyToSynchronousRequest):
(WebKit::NetworkResourceLoader::NetworkResourceLoader):
(WebKit::NetworkResourceLoader::startNetworkLoad):
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::willSendRedirectedRequest):
(WebKit::NetworkResourceLoader::bufferingTimerFired):
(WebKit::NetworkResourceLoader::sendBufferMaybeAborting):
(WebKit::NetworkResourceLoader::validateCacheEntry):
(WebKit::NetworkResourceLoader::messageSenderConnection):
(WebKit::NetworkResourceLoader::invalidateSandboxExtensions):
(WebKit::NetworkResourceLoader::~NetworkResourceLoader): Deleted.
(WebKit::NetworkResourceLoader::didReceiveBuffer): Deleted.
(WebKit::NetworkResourceLoader::didRetrieveCacheEntry): Deleted.
(WebKit::NetworkResourceLoader::consumeSandboxExtensions): Deleted.
(WebKit::NetworkResourceLoader::sendAbortingOnFailure): Deleted.
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/mac/NetworkDiskCacheMonitor.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessFileAPINetworkBlobRegistrycpp">trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessFileAPINetworkBlobRegistryh">trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcesscpp">trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcessh">trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.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="#trunkSourceWebKit2NetworkProcessmacNetworkDiskCacheMonitorh">trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (192061 => 192062)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-11-05 19:22:42 UTC (rev 192061)
+++ trunk/Source/WebKit2/ChangeLog        2015-11-05 19:25:29 UTC (rev 192062)
</span><span class="lines">@@ -1,5 +1,41 @@
</span><span class="cx"> 2015-11-05  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        [WK2] Clean up / Modernize NetworkResourceLoader
+        https://bugs.webkit.org/show_bug.cgi?id=150922
+
+        Reviewed by Andreas Kling.
+
+        Clean up / Modernize NetworkResourceLoader.
+
+        * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
+        (WebKit::NetworkBlobRegistry::filesInBlob):
+        * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
+        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+        (WebKit::NetworkConnectionToWebProcess::scheduleResourceLoad):
+        (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
+        * NetworkProcess/NetworkConnectionToWebProcess.h:
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        (WebKit::NetworkResourceLoader::SynchronousLoadData::SynchronousLoadData):
+        (WebKit::sendReplyToSynchronousRequest):
+        (WebKit::NetworkResourceLoader::NetworkResourceLoader):
+        (WebKit::NetworkResourceLoader::startNetworkLoad):
+        (WebKit::NetworkResourceLoader::didFinishLoading):
+        (WebKit::NetworkResourceLoader::willSendRedirectedRequest):
+        (WebKit::NetworkResourceLoader::bufferingTimerFired):
+        (WebKit::NetworkResourceLoader::sendBufferMaybeAborting):
+        (WebKit::NetworkResourceLoader::validateCacheEntry):
+        (WebKit::NetworkResourceLoader::messageSenderConnection):
+        (WebKit::NetworkResourceLoader::invalidateSandboxExtensions):
+        (WebKit::NetworkResourceLoader::~NetworkResourceLoader): Deleted.
+        (WebKit::NetworkResourceLoader::didReceiveBuffer): Deleted.
+        (WebKit::NetworkResourceLoader::didRetrieveCacheEntry): Deleted.
+        (WebKit::NetworkResourceLoader::consumeSandboxExtensions): Deleted.
+        (WebKit::NetworkResourceLoader::sendAbortingOnFailure): Deleted.
+        * NetworkProcess/NetworkResourceLoader.h:
+        * NetworkProcess/mac/NetworkDiskCacheMonitor.h:
+
+2015-11-05  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Regression(r192038): Safari cannot load any pages
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=150937
</span><span class="cx">         &lt;rdar://problem/23413859&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessFileAPINetworkBlobRegistrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp (192061 => 192062)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp        2015-11-05 19:22:42 UTC (rev 192061)
+++ trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.cpp        2015-11-05 19:25:29 UTC (rev 192062)
</span><span class="lines">@@ -131,9 +131,9 @@
</span><span class="cx">     m_blobsForConnection.remove(connection);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Vector&lt;RefPtr&lt;BlobDataFileReference&gt;&gt; NetworkBlobRegistry::filesInBlob(NetworkConnectionToWebProcess* connection, const WebCore::URL&amp; url)
</del><ins>+Vector&lt;RefPtr&lt;BlobDataFileReference&gt;&gt; NetworkBlobRegistry::filesInBlob(NetworkConnectionToWebProcess&amp; connection, const WebCore::URL&amp; url)
</ins><span class="cx"> {
</span><del>-    if (!m_blobsForConnection.contains(connection) || !m_blobsForConnection.find(connection)-&gt;value.contains(url))
</del><ins>+    if (!m_blobsForConnection.contains(&amp;connection) || !m_blobsForConnection.find(&amp;connection)-&gt;value.contains(url))
</ins><span class="cx">         return Vector&lt;RefPtr&lt;BlobDataFileReference&gt;&gt;();
</span><span class="cx"> 
</span><span class="cx">     ASSERT(blobRegistry().isBlobRegistryImpl());
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessFileAPINetworkBlobRegistryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h (192061 => 192062)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h        2015-11-05 19:22:42 UTC (rev 192061)
+++ trunk/Source/WebKit2/NetworkProcess/FileAPI/NetworkBlobRegistry.h        2015-11-05 19:25:29 UTC (rev 192062)
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx"> 
</span><span class="cx">     void connectionToWebProcessDidClose(NetworkConnectionToWebProcess*);
</span><span class="cx"> 
</span><del>-    Vector&lt;RefPtr&lt;WebCore::BlobDataFileReference&gt;&gt; filesInBlob(NetworkConnectionToWebProcess*, const WebCore::URL&amp;);
</del><ins>+    Vector&lt;RefPtr&lt;WebCore::BlobDataFileReference&gt;&gt; filesInBlob(NetworkConnectionToWebProcess&amp;, const WebCore::URL&amp;);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     ~NetworkBlobRegistry();
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp (192061 => 192062)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp        2015-11-05 19:22:42 UTC (rev 192061)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp        2015-11-05 19:25:29 UTC (rev 192062)
</span><span class="lines">@@ -118,14 +118,14 @@
</span><span class="cx"> 
</span><span class="cx"> void NetworkConnectionToWebProcess::scheduleResourceLoad(const NetworkResourceLoadParameters&amp; loadParameters)
</span><span class="cx"> {
</span><del>-    auto loader = NetworkResourceLoader::create(loadParameters, this);
</del><ins>+    auto loader = NetworkResourceLoader::create(loadParameters, *this);
</ins><span class="cx">     m_networkResourceLoaders.add(loadParameters.identifier, loader.ptr());
</span><span class="cx">     loader-&gt;start();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkConnectionToWebProcess::performSynchronousLoad(const NetworkResourceLoadParameters&amp; loadParameters, PassRefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt; reply)
</del><ins>+void NetworkConnectionToWebProcess::performSynchronousLoad(const NetworkResourceLoadParameters&amp; loadParameters, RefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt;&amp;&amp; reply)
</ins><span class="cx"> {
</span><del>-    auto loader = NetworkResourceLoader::create(loadParameters, this, reply);
</del><ins>+    auto loader = NetworkResourceLoader::create(loadParameters, *this, WTF::move(reply));
</ins><span class="cx">     m_networkResourceLoaders.add(loadParameters.identifier, loader.ptr());
</span><span class="cx">     loader-&gt;start();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h (192061 => 192062)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h        2015-11-05 19:22:42 UTC (rev 192061)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.h        2015-11-05 19:25:29 UTC (rev 192062)
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx">     void didReceiveSyncNetworkConnectionToWebProcessMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;, std::unique_ptr&lt;IPC::MessageEncoder&gt;&amp;);
</span><span class="cx">     
</span><span class="cx">     void scheduleResourceLoad(const NetworkResourceLoadParameters&amp;);
</span><del>-    void performSynchronousLoad(const NetworkResourceLoadParameters&amp;, PassRefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt;);
</del><ins>+    void performSynchronousLoad(const NetworkResourceLoadParameters&amp;, RefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt;&amp;&amp;);
</ins><span class="cx">     void loadPing(const NetworkResourceLoadParameters&amp;);
</span><span class="cx">     void prefetchDNS(const String&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp (192061 => 192062)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2015-11-05 19:22:42 UTC (rev 192061)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2015-11-05 19:25:29 UTC (rev 192062)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012-2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2015 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -34,11 +34,7 @@
</span><span class="cx"> #include &quot;NetworkCache.h&quot;
</span><span class="cx"> #include &quot;NetworkConnectionToWebProcess.h&quot;
</span><span class="cx"> #include &quot;NetworkLoad.h&quot;
</span><del>-#include &quot;NetworkProcess.h&quot;
</del><span class="cx"> #include &quot;NetworkProcessConnectionMessages.h&quot;
</span><del>-#include &quot;NetworkResourceLoadParameters.h&quot;
-#include &quot;ShareableResource.h&quot;
-#include &quot;SharedMemory.h&quot;
</del><span class="cx"> #include &quot;WebCoreArgumentCoders.h&quot;
</span><span class="cx"> #include &quot;WebResourceLoaderMessages.h&quot;
</span><span class="cx"> #include &lt;WebCore/BlobDataFileReference.h&gt;
</span><span class="lines">@@ -48,25 +44,25 @@
</span><span class="cx"> #include &lt;WebCore/SharedBuffer.h&gt;
</span><span class="cx"> #include &lt;WebCore/SynchronousLoaderClient.h&gt;
</span><span class="cx"> #include &lt;wtf/CurrentTime.h&gt;
</span><del>-#include &lt;wtf/MainThread.h&gt;
</del><ins>+#include &lt;wtf/RunLoop.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> struct NetworkResourceLoader::SynchronousLoadData {
</span><del>-    SynchronousLoadData(PassRefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt; reply)
-        : delayedReply(reply)
</del><ins>+    SynchronousLoadData(RefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt;&amp;&amp; reply)
+        : delayedReply(WTF::move(reply))
</ins><span class="cx">     {
</span><span class="cx">         ASSERT(delayedReply);
</span><span class="cx">     }
</span><del>-    WebCore::ResourceRequest currentRequest;
</del><ins>+    ResourceRequest currentRequest;
</ins><span class="cx">     RefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt; delayedReply;
</span><del>-    WebCore::ResourceResponse response;
-    WebCore::ResourceError error;
</del><ins>+    ResourceResponse response;
+    ResourceError error;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><del>-static void sendReplyToSynchronousRequest(NetworkResourceLoader::SynchronousLoadData&amp; data, const WebCore::SharedBuffer* buffer)
</del><ins>+static void sendReplyToSynchronousRequest(NetworkResourceLoader::SynchronousLoadData&amp; data, const SharedBuffer* buffer)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(data.delayedReply);
</span><span class="cx">     ASSERT(!data.response.isNull() || !data.error.isNull());
</span><span class="lines">@@ -79,13 +75,9 @@
</span><span class="cx">     data.delayedReply = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-NetworkResourceLoader::NetworkResourceLoader(const NetworkResourceLoadParameters&amp; parameters, NetworkConnectionToWebProcess* connection, PassRefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt; synchronousReply)
</del><ins>+NetworkResourceLoader::NetworkResourceLoader(const NetworkResourceLoadParameters&amp; parameters, NetworkConnectionToWebProcess&amp; connection, RefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt;&amp;&amp; synchronousReply)
</ins><span class="cx">     : m_parameters(parameters)
</span><span class="cx">     , m_connection(connection)
</span><del>-    , m_bytesReceived(0)
-    , m_bufferedDataEncodedDataLength(0)
-    , m_didConvertHandleToDownload(false)
-    , m_didConsumeSandboxExtensions(false)
</del><span class="cx">     , m_defersLoading(parameters.defersLoading)
</span><span class="cx">     , m_bufferingTimer(*this, &amp;NetworkResourceLoader::bufferingTimerFired)
</span><span class="cx"> {
</span><span class="lines">@@ -95,7 +87,7 @@
</span><span class="cx">     ASSERT((m_parameters.webPageID &amp;&amp; m_parameters.webFrameID) || m_parameters.clientCredentialPolicy == DoNotAskClientForAnyCredentials);
</span><span class="cx"> 
</span><span class="cx">     if (originalRequest().httpBody()) {
</span><del>-        for (const FormDataElement&amp; element : originalRequest().httpBody()-&gt;elements()) {
</del><ins>+        for (const auto&amp; element : originalRequest().httpBody()-&gt;elements()) {
</ins><span class="cx">             if (element.m_type == FormDataElement::Type::EncodedBlob)
</span><span class="cx">                 m_fileReferences.appendVector(NetworkBlobRegistry::singleton().filesInBlob(connection, element.m_url));
</span><span class="cx">         }
</span><span class="lines">@@ -107,7 +99,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (synchronousReply)
</span><del>-        m_synchronousLoadData = std::make_unique&lt;SynchronousLoadData&gt;(synchronousReply);
</del><ins>+        m_synchronousLoadData = std::make_unique&lt;SynchronousLoadData&gt;(WTF::move(synchronousReply));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> NetworkResourceLoader::~NetworkResourceLoader()
</span><span class="lines">@@ -165,11 +157,11 @@
</span><span class="cx">     consumeSandboxExtensions();
</span><span class="cx"> 
</span><span class="cx">     if (isSynchronous() || m_parameters.maximumBufferingTime &gt; 0_ms)
</span><del>-        m_bufferedData = WebCore::SharedBuffer::create();
</del><ins>+        m_bufferedData = SharedBuffer::create();
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETWORK_CACHE)
</span><span class="cx">     if (NetworkCache::singleton().isEnabled())
</span><del>-        m_bufferedDataForCache = WebCore::SharedBuffer::create();
</del><ins>+        m_bufferedDataForCache = SharedBuffer::create();
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     NetworkLoadParameters parameters = m_parameters;
</span><span class="lines">@@ -275,9 +267,8 @@
</span><span class="cx"> #if ENABLE(NETWORK_CACHE)
</span><span class="cx">     shouldContinueDidReceiveResponse = shouldContinueDidReceiveResponse || m_cacheEntryForValidation;
</span><span class="cx"> #endif
</span><del>-    if (!shouldContinueDidReceiveResponse)
-        return ShouldContinueDidReceiveResponse::No;
-    return ShouldContinueDidReceiveResponse::Yes;
</del><ins>+
+    return shouldContinueDidReceiveResponse ? ShouldContinueDidReceiveResponse::Yes : ShouldContinueDidReceiveResponse::No;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::didReceiveBuffer(RefPtr&lt;SharedBuffer&gt;&amp;&amp; buffer, int reportedEncodedDataLength)
</span><span class="lines">@@ -319,18 +310,18 @@
</span><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx">         bool allowStale = originalRequest().cachePolicy() &gt;= ReturnCacheDataElseLoad;
</span><del>-        bool hasCacheableRedirect = m_response.isHTTP() &amp;&amp; WebCore::redirectChainAllowsReuse(m_redirectChainCacheStatus, allowStale ? WebCore::ReuseExpiredRedirection : WebCore::DoNotReuseExpiredRedirection);
</del><ins>+        bool hasCacheableRedirect = m_response.isHTTP() &amp;&amp; redirectChainAllowsReuse(m_redirectChainCacheStatus, allowStale ? ReuseExpiredRedirection : DoNotReuseExpiredRedirection);
</ins><span class="cx">         if (hasCacheableRedirect &amp;&amp; m_redirectChainCacheStatus.status == RedirectChainCacheStatus::CachedRedirection) {
</span><span class="cx">             // Maybe we should cache the actual redirects instead of the end result?
</span><span class="cx">             auto now = std::chrono::system_clock::now();
</span><del>-            auto responseEndOfValidity = now + WebCore::computeFreshnessLifetimeForHTTPFamily(m_response, now) - WebCore::computeCurrentAge(m_response, now);
</del><ins>+            auto responseEndOfValidity = now + computeFreshnessLifetimeForHTTPFamily(m_response, now) - computeCurrentAge(m_response, now);
</ins><span class="cx">             hasCacheableRedirect = responseEndOfValidity &lt;= m_redirectChainCacheStatus.endOfValidity;
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        bool isPrivate = sessionID().isEphemeral();
-        if (m_bufferedDataForCache &amp;&amp; hasCacheableRedirect &amp;&amp; !isPrivate) {
</del><ins>+        bool isPrivateSession = sessionID().isEphemeral();
+        if (m_bufferedDataForCache &amp;&amp; hasCacheableRedirect &amp;&amp; !isPrivateSession) {
</ins><span class="cx">             // Keep the connection alive.
</span><del>-            RefPtr&lt;NetworkConnectionToWebProcess&gt; connection(connectionToWebProcess());
</del><ins>+            RefPtr&lt;NetworkConnectionToWebProcess&gt; connection(&amp;connectionToWebProcess());
</ins><span class="cx">             RefPtr&lt;NetworkResourceLoader&gt; loader(this);
</span><span class="cx">             NetworkCache::singleton().store(originalRequest(), m_response, WTF::move(m_bufferedDataForCache), [loader, connection](NetworkCache::MappedBody&amp; mappedBody) {
</span><span class="cx"> #if ENABLE(SHAREABLE_RESOURCE)
</span><span class="lines">@@ -350,7 +341,7 @@
</span><span class="cx">     if (isSynchronous())
</span><span class="cx">         sendReplyToSynchronousRequest(*m_synchronousLoadData, m_bufferedData.get());
</span><span class="cx">     else {
</span><del>-        if (m_bufferedData &amp;&amp; m_bufferedData-&gt;size()) {
</del><ins>+        if (m_bufferedData &amp;&amp; !m_bufferedData-&gt;isEmpty()) {
</ins><span class="cx">             // FIXME: Pass a real value or remove the encoded data size feature.
</span><span class="cx">             bool shouldContinue = sendBufferMaybeAborting(*m_bufferedData, -1);
</span><span class="cx">             if (!shouldContinue)
</span><span class="lines">@@ -382,7 +373,7 @@
</span><span class="cx"> void NetworkResourceLoader::willSendRedirectedRequest(const ResourceRequest&amp; request, const ResourceResponse&amp; redirectResponse)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(NETWORK_CACHE)
</span><del>-    WebCore::updateRedirectChainStatus(m_redirectChainCacheStatus, redirectResponse);
</del><ins>+    updateRedirectChainStatus(m_redirectChainCacheStatus, redirectResponse);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     if (isSynchronous()) {
</span><span class="lines">@@ -434,25 +425,25 @@
</span><span class="cx">     ASSERT(m_bufferedData);
</span><span class="cx">     ASSERT(m_networkLoad);
</span><span class="cx"> 
</span><del>-    if (!m_bufferedData-&gt;size())
</del><ins>+    if (m_bufferedData-&gt;isEmpty())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     IPC::SharedBufferDataReference dataReference(m_bufferedData.get());
</span><span class="cx">     size_t encodedLength = m_bufferedDataEncodedDataLength;
</span><span class="cx"> 
</span><del>-    m_bufferedData = WebCore::SharedBuffer::create();
</del><ins>+    m_bufferedData = SharedBuffer::create();
</ins><span class="cx">     m_bufferedDataEncodedDataLength = 0;
</span><span class="cx"> 
</span><span class="cx">     sendAbortingOnFailure(Messages::WebResourceLoader::DidReceiveData(dataReference, encodedLength));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool NetworkResourceLoader::sendBufferMaybeAborting(const WebCore::SharedBuffer&amp; buffer, size_t encodedDataLength)
</del><ins>+bool NetworkResourceLoader::sendBufferMaybeAborting(SharedBuffer&amp; buffer, size_t encodedDataLength)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!isSynchronous());
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     ShareableResource::Handle shareableResourceHandle;
</span><del>-    NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer(shareableResourceHandle, const_cast&lt;WebCore::SharedBuffer&amp;&gt;(buffer));
</del><ins>+    NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer(shareableResourceHandle, buffer);
</ins><span class="cx">     if (!shareableResourceHandle.isNull()) {
</span><span class="cx">         send(Messages::WebResourceLoader::DidReceiveResource(shareableResourceHandle, currentTime()));
</span><span class="cx">         abort();
</span><span class="lines">@@ -460,7 +451,7 @@
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    IPC::SharedBufferDataReference dataReference(&amp;const_cast&lt;WebCore::SharedBuffer&amp;&gt;(buffer));
</del><ins>+    IPC::SharedBufferDataReference dataReference(&amp;buffer);
</ins><span class="cx">     return sendAbortingOnFailure(Messages::WebResourceLoader::DidReceiveData(dataReference, encodedDataLength));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -507,12 +498,12 @@
</span><span class="cx">     // and we should not overwrite the existing conditional headers.
</span><span class="cx">     ResourceRequest revalidationRequest = originalRequest();
</span><span class="cx">     if (!revalidationRequest.isConditional()) {
</span><del>-        String eTag = entry-&gt;response().httpHeaderField(WebCore::HTTPHeaderName::ETag);
-        String lastModified = entry-&gt;response().httpHeaderField(WebCore::HTTPHeaderName::LastModified);
</del><ins>+        String eTag = entry-&gt;response().httpHeaderField(HTTPHeaderName::ETag);
+        String lastModified = entry-&gt;response().httpHeaderField(HTTPHeaderName::LastModified);
</ins><span class="cx">         if (!eTag.isEmpty())
</span><del>-            revalidationRequest.setHTTPHeaderField(WebCore::HTTPHeaderName::IfNoneMatch, eTag);
</del><ins>+            revalidationRequest.setHTTPHeaderField(HTTPHeaderName::IfNoneMatch, eTag);
</ins><span class="cx">         if (!lastModified.isEmpty())
</span><del>-            revalidationRequest.setHTTPHeaderField(WebCore::HTTPHeaderName::IfModifiedSince, lastModified);
</del><ins>+            revalidationRequest.setHTTPHeaderField(HTTPHeaderName::IfModifiedSince, lastModified);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_cacheEntryForValidation = WTF::move(entry);
</span><span class="lines">@@ -523,7 +514,7 @@
</span><span class="cx"> 
</span><span class="cx"> IPC::Connection* NetworkResourceLoader::messageSenderConnection()
</span><span class="cx"> {
</span><del>-    return connectionToWebProcess()-&gt;connection();
</del><ins>+    return connectionToWebProcess().connection();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::consumeSandboxExtensions()
</span><span class="lines">@@ -551,11 +542,11 @@
</span><span class="cx">             extension-&gt;revoke();
</span><span class="cx">         for (auto&amp; fileReference : m_fileReferences)
</span><span class="cx">             fileReference-&gt;revokeFileAccess();
</span><ins>+
+        m_didConsumeSandboxExtensions = false;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_fileReferences.clear();
</span><del>-
-    m_didConsumeSandboxExtensions = false;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename T&gt;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkResourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h (192061 => 192062)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h        2015-11-05 19:22:42 UTC (rev 192061)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h        2015-11-05 19:25:29 UTC (rev 192062)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012-2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2015 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -29,14 +29,10 @@
</span><span class="cx"> #if ENABLE(NETWORK_PROCESS)
</span><span class="cx"> 
</span><span class="cx"> #include &quot;MessageSender.h&quot;
</span><del>-#include &quot;NetworkCache.h&quot;
</del><span class="cx"> #include &quot;NetworkConnectionToWebProcessMessages.h&quot;
</span><span class="cx"> #include &quot;NetworkLoadClient.h&quot;
</span><span class="cx"> #include &quot;NetworkResourceLoadParameters.h&quot;
</span><span class="cx"> #include &quot;ShareableResource.h&quot;
</span><del>-#include &lt;WebCore/CacheValidation.h&gt;
-#include &lt;WebCore/ResourceLoaderOptions.h&gt;
-#include &lt;WebCore/SessionID.h&gt;
</del><span class="cx"> #include &lt;WebCore/Timer.h&gt;
</span><span class="cx"> #include &lt;wtf/Optional.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -48,25 +44,20 @@
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> class NetworkConnectionToWebProcess;
</span><del>-class NetworkResourceLoadParameters;
</del><span class="cx"> class NetworkLoad;
</span><span class="cx"> class SandboxExtension;
</span><span class="cx"> 
</span><del>-class NetworkResourceLoader
-    : public RefCounted&lt;NetworkResourceLoader&gt;
-    , public NetworkLoadClient
-    , public IPC::MessageSender {
</del><ins>+namespace NetworkCache {
+class Entry;
+}
+
+class NetworkResourceLoader final : public RefCounted&lt;NetworkResourceLoader&gt;, public NetworkLoadClient, public IPC::MessageSender {
</ins><span class="cx"> public:
</span><del>-    static Ref&lt;NetworkResourceLoader&gt; create(const NetworkResourceLoadParameters&amp; parameters, NetworkConnectionToWebProcess* connection)
</del><ins>+    static Ref&lt;NetworkResourceLoader&gt; create(const NetworkResourceLoadParameters&amp; parameters, NetworkConnectionToWebProcess&amp; connection, RefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt;&amp;&amp; reply = nullptr)
</ins><span class="cx">     {
</span><del>-        return adoptRef(*new NetworkResourceLoader(parameters, connection, nullptr));
</del><ins>+        return adoptRef(*new NetworkResourceLoader(parameters, connection, WTF::move(reply)));
</ins><span class="cx">     }
</span><del>-    
-    static Ref&lt;NetworkResourceLoader&gt; create(const NetworkResourceLoadParameters&amp; parameters, NetworkConnectionToWebProcess* connection, PassRefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt; reply)
-    {
-        return adoptRef(*new NetworkResourceLoader(parameters, connection, reply));
-    }    
-    ~NetworkResourceLoader();
</del><ins>+    virtual ~NetworkResourceLoader();
</ins><span class="cx"> 
</span><span class="cx">     const WebCore::ResourceRequest&amp; originalRequest() const { return m_parameters.request; }
</span><span class="cx"> 
</span><span class="lines">@@ -100,7 +91,7 @@
</span><span class="cx">     WebCore::SharedBuffer* bufferedData() { return m_bufferedData.get(); }
</span><span class="cx">     const WebCore::ResourceResponse&amp; response() const { return m_response; }
</span><span class="cx"> 
</span><del>-    NetworkConnectionToWebProcess* connectionToWebProcess() const { return m_connection.get(); }
</del><ins>+    NetworkConnectionToWebProcess&amp; connectionToWebProcess() { return m_connection; }
</ins><span class="cx">     WebCore::SessionID sessionID() const { return m_parameters.sessionID; }
</span><span class="cx">     ResourceLoadIdentifier identifier() const { return m_parameters.identifier; }
</span><span class="cx"> 
</span><span class="lines">@@ -117,7 +108,7 @@
</span><span class="cx">     virtual void didFailLoading(const WebCore::ResourceError&amp;) override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    NetworkResourceLoader(const NetworkResourceLoadParameters&amp;, NetworkConnectionToWebProcess*, PassRefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt;);
</del><ins>+    NetworkResourceLoader(const NetworkResourceLoadParameters&amp;, NetworkConnectionToWebProcess&amp;, RefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt;&amp;&amp;);
</ins><span class="cx"> 
</span><span class="cx">     // IPC::MessageSender
</span><span class="cx">     virtual IPC::Connection* messageSenderConnection() override;
</span><span class="lines">@@ -137,7 +128,7 @@
</span><span class="cx"> 
</span><span class="cx">     void startBufferingTimerIfNeeded();
</span><span class="cx">     void bufferingTimerFired();
</span><del>-    bool sendBufferMaybeAborting(const WebCore::SharedBuffer&amp;, size_t encodedDataLength);
</del><ins>+    bool sendBufferMaybeAborting(WebCore::SharedBuffer&amp;, size_t encodedDataLength);
</ins><span class="cx"> 
</span><span class="cx">     void consumeSandboxExtensions();
</span><span class="cx">     void invalidateSandboxExtensions();
</span><span class="lines">@@ -146,22 +137,22 @@
</span><span class="cx"> 
</span><span class="cx">     const NetworkResourceLoadParameters m_parameters;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;NetworkConnectionToWebProcess&gt; m_connection;
</del><ins>+    Ref&lt;NetworkConnectionToWebProcess&gt; m_connection;
</ins><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;NetworkLoad&gt; m_networkLoad;
</span><span class="cx"> 
</span><span class="cx">     WebCore::ResourceResponse m_response;
</span><span class="cx"> 
</span><del>-    size_t m_bytesReceived;
-    size_t m_bufferedDataEncodedDataLength;
</del><ins>+    size_t m_bytesReceived { 0 };
+    size_t m_bufferedDataEncodedDataLength { 0 };
</ins><span class="cx">     RefPtr&lt;WebCore::SharedBuffer&gt; m_bufferedData;
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;SynchronousLoadData&gt; m_synchronousLoadData;
</span><span class="cx">     Vector&lt;RefPtr&lt;WebCore::BlobDataFileReference&gt;&gt; m_fileReferences;
</span><span class="cx"> 
</span><del>-    bool m_didConvertHandleToDownload;
-    bool m_didConsumeSandboxExtensions;
-    bool m_defersLoading;
</del><ins>+    bool m_didConvertHandleToDownload { false };
+    bool m_didConsumeSandboxExtensions { false };
+    bool m_defersLoading { false };
</ins><span class="cx"> 
</span><span class="cx">     WebCore::Timer m_bufferingTimer;
</span><span class="cx"> #if ENABLE(NETWORK_CACHE)
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessmacNetworkDiskCacheMonitorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.h (192061 => 192062)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.h        2015-11-05 19:22:42 UTC (rev 192061)
+++ trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.h        2015-11-05 19:25:29 UTC (rev 192062)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx">     virtual IPC::Connection* messageSenderConnection() override;
</span><span class="cx">     virtual uint64_t messageSenderDestinationID() override;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;NetworkConnectionToWebProcess&gt; m_connectionToWebProcess;
</del><ins>+    Ref&lt;NetworkConnectionToWebProcess&gt; m_connectionToWebProcess;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>