<!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>[173468] 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/173468">173468</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2014-09-10 09:35:00 -0700 (Wed, 10 Sep 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>NetworkResourceLoader cleanups
https://bugs.webkit.org/show_bug.cgi?id=136701

Reviewed by Darin Adler.

After smashing NetworkResourceLoader together with the clients it can be made nicer.

* NetworkProcess/NetworkResourceLoadScheduler.cpp:
(WebKit::NetworkResourceLoadScheduler::scheduleLoader):
(WebKit::NetworkResourceLoadScheduler::removeLoader):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::SynchronousLoadData::SynchronousLoadData):

    The original request is now part of the loader.

(WebKit::sendReplyToSynchronousRequest):
(WebKit::NetworkResourceLoader::NetworkResourceLoader):

    Instead of copying everything out from NetworkResourceLoadParameters just include the whole thing as a const field.
    SanboxExtension construction moves to NetworkResourceLoadParameters::decode()
    Stuff that is related to starting the load moves to start().

(WebKit::NetworkResourceLoader::~NetworkResourceLoader):
(WebKit::NetworkResourceLoader::start):
(WebKit::NetworkResourceLoader::setDefersLoading):

    Eliminate m_deferredRequest since we now always remember the original request.

(WebKit::NetworkResourceLoader::cleanup):
(WebKit::NetworkResourceLoader::didConvertHandleToDownload):
(WebKit::NetworkResourceLoader::abort):
(WebKit::NetworkResourceLoader::didReceiveResponseAsync):
(WebKit::NetworkResourceLoader::didFail):
(WebKit::NetworkResourceLoader::willSendRequestAsync):
(WebKit::NetworkResourceLoader::continueWillSendRequest):

    Eliminate unnecessary m_suggestedRequestForWillSendRequest.

(WebKit::NetworkResourceLoader::wasBlocked):
(WebKit::NetworkResourceLoader::cannotShowURL):
(WebKit::NetworkResourceLoader::shouldUseCredentialStorage):
(WebKit::NetworkResourceLoader::didReceiveAuthenticationChallenge):
(WebKit::NetworkResourceLoader::receivedCancellation):
(WebKit::NetworkResourceLoader::startBufferingTimerIfNeeded):
(WebKit::NetworkResourceLoader::consumeSandboxExtensions):
(WebKit::NetworkResourceLoader::invalidateSandboxExtensions):
(WebKit::NetworkResourceLoader::sendAbortingOnFailure):
* NetworkProcess/NetworkResourceLoader.h:
(WebKit::NetworkResourceLoader::originalRequest):
(WebKit::NetworkResourceLoader::currentRequest):
(WebKit::NetworkResourceLoader::sessionID):
(WebKit::NetworkResourceLoader::defersLoading):
(WebKit::NetworkResourceLoader::isLoadingMainResource):
(WebKit::NetworkResourceLoader::request): Deleted.
(WebKit::NetworkResourceLoader::sendAbortingOnFailure): Deleted.

    Made private and moved to cpp.

* NetworkProcess/mac/NetworkDiskCacheMonitor.mm:
(WebKit::NetworkDiskCacheMonitor::NetworkDiskCacheMonitor):

    Use original request instead of the current one. This might fix a bug where we didn't use file backing over redirects.

* Shared/Network/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::decode):

    Decode to SanboxExtensions to the actual type rather than a handle.

* Shared/Network/NetworkResourceLoadParameters.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkResourceLoadSchedulercpp">trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoadScheduler.cpp</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="#trunkSourceWebKit2NetworkProcessmacNetworkDiskCacheMonitormm">trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.mm</a></li>
<li><a href="#trunkSourceWebKit2SharedNetworkNetworkResourceLoadParameterscpp">trunk/Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedNetworkNetworkResourceLoadParametersh">trunk/Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (173467 => 173468)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-09-10 16:22:26 UTC (rev 173467)
+++ trunk/Source/WebKit2/ChangeLog        2014-09-10 16:35:00 UTC (rev 173468)
</span><span class="lines">@@ -1,3 +1,75 @@
</span><ins>+2014-09-10  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        NetworkResourceLoader cleanups
+        https://bugs.webkit.org/show_bug.cgi?id=136701
+
+        Reviewed by Darin Adler.
+
+        After smashing NetworkResourceLoader together with the clients it can be made nicer.
+
+        * NetworkProcess/NetworkResourceLoadScheduler.cpp:
+        (WebKit::NetworkResourceLoadScheduler::scheduleLoader):
+        (WebKit::NetworkResourceLoadScheduler::removeLoader):
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        (WebKit::NetworkResourceLoader::SynchronousLoadData::SynchronousLoadData):
+
+            The original request is now part of the loader.
+
+        (WebKit::sendReplyToSynchronousRequest):
+        (WebKit::NetworkResourceLoader::NetworkResourceLoader):
+
+            Instead of copying everything out from NetworkResourceLoadParameters just include the whole thing as a const field.
+            SanboxExtension construction moves to NetworkResourceLoadParameters::decode()
+            Stuff that is related to starting the load moves to start().
+
+        (WebKit::NetworkResourceLoader::~NetworkResourceLoader):
+        (WebKit::NetworkResourceLoader::start):
+        (WebKit::NetworkResourceLoader::setDefersLoading):
+
+            Eliminate m_deferredRequest since we now always remember the original request.
+
+        (WebKit::NetworkResourceLoader::cleanup):
+        (WebKit::NetworkResourceLoader::didConvertHandleToDownload):
+        (WebKit::NetworkResourceLoader::abort):
+        (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
+        (WebKit::NetworkResourceLoader::didFail):
+        (WebKit::NetworkResourceLoader::willSendRequestAsync):
+        (WebKit::NetworkResourceLoader::continueWillSendRequest):
+
+            Eliminate unnecessary m_suggestedRequestForWillSendRequest.
+
+        (WebKit::NetworkResourceLoader::wasBlocked):
+        (WebKit::NetworkResourceLoader::cannotShowURL):
+        (WebKit::NetworkResourceLoader::shouldUseCredentialStorage):
+        (WebKit::NetworkResourceLoader::didReceiveAuthenticationChallenge):
+        (WebKit::NetworkResourceLoader::receivedCancellation):
+        (WebKit::NetworkResourceLoader::startBufferingTimerIfNeeded):
+        (WebKit::NetworkResourceLoader::consumeSandboxExtensions):
+        (WebKit::NetworkResourceLoader::invalidateSandboxExtensions):
+        (WebKit::NetworkResourceLoader::sendAbortingOnFailure):
+        * NetworkProcess/NetworkResourceLoader.h:
+        (WebKit::NetworkResourceLoader::originalRequest):
+        (WebKit::NetworkResourceLoader::currentRequest):
+        (WebKit::NetworkResourceLoader::sessionID):
+        (WebKit::NetworkResourceLoader::defersLoading):
+        (WebKit::NetworkResourceLoader::isLoadingMainResource):
+        (WebKit::NetworkResourceLoader::request): Deleted.
+        (WebKit::NetworkResourceLoader::sendAbortingOnFailure): Deleted.
+
+            Made private and moved to cpp.
+
+        * NetworkProcess/mac/NetworkDiskCacheMonitor.mm:
+        (WebKit::NetworkDiskCacheMonitor::NetworkDiskCacheMonitor):
+
+            Use original request instead of the current one. This might fix a bug where we didn't use file backing over redirects.
+
+        * Shared/Network/NetworkResourceLoadParameters.cpp:
+        (WebKit::NetworkResourceLoadParameters::decode):
+
+            Decode to SanboxExtensions to the actual type rather than a handle.
+
+        * Shared/Network/NetworkResourceLoadParameters.h:
+
</ins><span class="cx"> 2014-09-10  Michael Catanzaro  &lt;mcatanzaro@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] allow overwriting destination of download
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkResourceLoadSchedulercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoadScheduler.cpp (173467 => 173468)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoadScheduler.cpp        2014-09-10 16:22:26 UTC (rev 173467)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoadScheduler.cpp        2014-09-10 16:35:00 UTC (rev 173468)
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(RunLoop::isMain());
</span><span class="cx"> 
</span><del>-    LOG(NetworkScheduling, &quot;(NetworkProcess) NetworkResourceLoadScheduler::scheduleLoader resource '%s'&quot;, loader-&gt;request().url().string().utf8().data());
</del><ins>+    LOG(NetworkScheduling, &quot;(NetworkProcess) NetworkResourceLoadScheduler::scheduleLoader resource '%s'&quot;, loader-&gt;originalRequest().url().string().utf8().data());
</ins><span class="cx"> 
</span><span class="cx">     // This request might be from WebProcess we've lost our connection to.
</span><span class="cx">     // If so we should just skip it.
</span><span class="lines">@@ -44,7 +44,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(RunLoop::isMain());
</span><span class="cx"> 
</span><del>-    LOG(NetworkScheduling, &quot;(NetworkProcess) NetworkResourceLoadScheduler::removeLoader resource '%s'&quot;, loader-&gt;request().url().string().utf8().data());
</del><ins>+    LOG(NetworkScheduling, &quot;(NetworkProcess) NetworkResourceLoadScheduler::removeLoader resource '%s'&quot;, loader-&gt;originalRequest().url().string().utf8().data());
</ins><span class="cx"> 
</span><span class="cx">     m_activeLoaders.remove(loader);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp (173467 => 173468)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2014-09-10 16:22:26 UTC (rev 173467)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2014-09-10 16:35:00 UTC (rev 173468)
</span><span class="lines">@@ -57,92 +57,66 @@
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> struct NetworkResourceLoader::SynchronousLoadData {
</span><del>-        SynchronousLoadData(WebCore::ResourceRequest&amp; request, PassRefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt; reply)
-        : m_originalRequest(request)
-        , m_delayedReply(reply)
</del><ins>+    SynchronousLoadData(PassRefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt; reply)
+        : delayedReply(reply)
</ins><span class="cx">     {
</span><del>-        ASSERT(m_delayedReply);
</del><ins>+        ASSERT(delayedReply);
</ins><span class="cx">     }
</span><del>-    WebCore::ResourceRequest m_originalRequest;
-    WebCore::ResourceRequest m_currentRequest;
-    RefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt; m_delayedReply;
-    WebCore::ResourceResponse m_response;
-    WebCore::ResourceError m_error;
</del><ins>+    WebCore::ResourceRequest currentRequest;
+    RefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt; delayedReply;
+    WebCore::ResourceResponse response;
+    WebCore::ResourceError error;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> static void sendReplyToSynchronousRequest(NetworkResourceLoader::SynchronousLoadData&amp; data, WebCore::SharedBuffer* buffer)
</span><span class="cx"> {
</span><del>-    ASSERT(data.m_delayedReply);
-    ASSERT(!data.m_response.isNull() || !data.m_error.isNull());
</del><ins>+    ASSERT(data.delayedReply);
+    ASSERT(!data.response.isNull() || !data.error.isNull());
</ins><span class="cx"> 
</span><span class="cx">     Vector&lt;char&gt; responseBuffer;
</span><span class="cx">     if (buffer &amp;&amp; buffer-&gt;size())
</span><span class="cx">         responseBuffer.append(buffer-&gt;data(), buffer-&gt;size());
</span><span class="cx"> 
</span><del>-    data.m_delayedReply-&gt;send(data.m_error, data.m_response, responseBuffer);
-    data.m_delayedReply = nullptr;
</del><ins>+    data.delayedReply-&gt;send(data.error, data.response, responseBuffer);
+    data.delayedReply = nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> NetworkResourceLoader::NetworkResourceLoader(const NetworkResourceLoadParameters&amp; parameters, NetworkConnectionToWebProcess* connection, PassRefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt; synchronousReply)
</span><del>-    : m_bytesReceived(0)
-    , m_handleConvertedToDownload(false)
-    , m_identifier(parameters.identifier)
-    , m_webPageID(parameters.webPageID)
-    , m_webFrameID(parameters.webFrameID)
-    , m_sessionID(parameters.sessionID)
-    , m_request(parameters.request)
-    , m_contentSniffingPolicy(parameters.contentSniffingPolicy)
-    , m_allowStoredCredentials(parameters.allowStoredCredentials)
-    , m_clientCredentialPolicy(parameters.clientCredentialPolicy)
-    , m_shouldClearReferrerOnHTTPSToHTTPRedirect(parameters.shouldClearReferrerOnHTTPSToHTTPRedirect)
-    , m_isLoadingMainResource(parameters.isMainResource)
-    , m_defersLoading(parameters.defersLoading)
-    , m_needsCertificateInfo(parameters.needsCertificateInfo)
-    , m_maximumBufferingTime(parameters.maximumBufferingTime)
-    , m_bufferingTimer(this, &amp;NetworkResourceLoader::bufferingTimerFired)
-    , m_sandboxExtensionsAreConsumed(false)
</del><ins>+    : m_parameters(parameters)
</ins><span class="cx">     , m_connection(connection)
</span><ins>+    , m_bytesReceived(0)
</ins><span class="cx">     , m_bufferedDataEncodedDataLength(0)
</span><ins>+    , m_didConvertHandleToDownload(false)
+    , m_didConsumeSandboxExtensions(false)
+    , m_defersLoading(parameters.defersLoading)
+    , m_bufferingTimer(this, &amp;NetworkResourceLoader::bufferingTimerFired)
</ins><span class="cx"> {
</span><del>-    // Either this loader has both a webPageID and webFrameID, or it is not allowed to ask the client for authentication credentials.
</del><ins>+    ASSERT(RunLoop::isMain());
</ins><span class="cx">     // FIXME: This is necessary because of the existence of EmptyFrameLoaderClient in WebCore.
</span><span class="cx">     //        Once bug 116233 is resolved, this ASSERT can just be &quot;m_webPageID &amp;&amp; m_webFrameID&quot;
</span><del>-    ASSERT((m_webPageID &amp;&amp; m_webFrameID) || m_clientCredentialPolicy == DoNotAskClientForAnyCredentials);
</del><ins>+    ASSERT((m_parameters.webPageID &amp;&amp; m_parameters.webFrameID) || m_parameters.clientCredentialPolicy == DoNotAskClientForAnyCredentials);
</ins><span class="cx"> 
</span><del>-    for (size_t i = 0, count = parameters.requestBodySandboxExtensions.size(); i &lt; count; ++i) {
-        if (RefPtr&lt;SandboxExtension&gt; extension = SandboxExtension::create(parameters.requestBodySandboxExtensions[i]))
-            m_requestBodySandboxExtensions.append(extension);
-    }
-
-    if (m_request.httpBody()) {
-        for (const FormDataElement&amp; element : m_request.httpBody()-&gt;elements()) {
</del><ins>+    if (originalRequest().httpBody()) {
+        for (const FormDataElement&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::shared().filesInBlob(connection, element.m_url));
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (m_request.url().protocolIs(&quot;blob&quot;)) {
-        ASSERT(!SandboxExtension::create(parameters.resourceSandboxExtension));
-        m_fileReferences.appendVector(NetworkBlobRegistry::shared().filesInBlob(connection, m_request.url()));
-    } else
</del><ins>+    if (originalRequest().url().protocolIs(&quot;blob&quot;)) {
+        ASSERT(!m_parameters.resourceSandboxExtension);
+        m_fileReferences.appendVector(NetworkBlobRegistry::shared().filesInBlob(connection, originalRequest().url()));
+    }
</ins><span class="cx"> 
</span><del>-    if (RefPtr&lt;SandboxExtension&gt; resourceSandboxExtension = SandboxExtension::create(parameters.resourceSandboxExtension))
-        m_resourceSandboxExtensions.append(resourceSandboxExtension);
-
-    ASSERT(RunLoop::isMain());
-    
-    if (synchronousReply || m_maximumBufferingTime &gt; 0_ms)
-        m_bufferedData = WebCore::SharedBuffer::create();
-
</del><span class="cx">     if (synchronousReply)
</span><del>-        m_synchronousLoadData = std::make_unique&lt;SynchronousLoadData&gt;(m_request, synchronousReply);
</del><ins>+        m_synchronousLoadData = std::make_unique&lt;SynchronousLoadData&gt;(synchronousReply);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> NetworkResourceLoader::~NetworkResourceLoader()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(RunLoop::isMain());
</span><span class="cx">     ASSERT(!m_handle);
</span><del>-    ASSERT(!isSynchronous() || !m_synchronousLoadData-&gt;m_delayedReply);
</del><ins>+    ASSERT(!isSynchronous() || !m_synchronousLoadData-&gt;delayedReply);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool NetworkResourceLoader::isSynchronous() const
</span><span class="lines">@@ -154,33 +128,36 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(RunLoop::isMain());
</span><span class="cx"> 
</span><del>-    if (m_defersLoading) {
-        m_deferredRequest = m_request;
</del><ins>+    if (m_defersLoading)
</ins><span class="cx">         return;
</span><del>-    }
</del><span class="cx"> 
</span><span class="cx">     // Explicit ref() balanced by a deref() in NetworkResourceLoader::cleanup()
</span><span class="cx">     ref();
</span><span class="cx"> 
</span><del>-    // FIXME (NetworkProcess): Set platform specific settings.
-    m_networkingContext = RemoteNetworkingContext::create(m_sessionID, m_shouldClearReferrerOnHTTPSToHTTPRedirect);
</del><ins>+    m_networkingContext = RemoteNetworkingContext::create(sessionID(), m_parameters.shouldClearReferrerOnHTTPSToHTTPRedirect);
</ins><span class="cx"> 
</span><span class="cx">     consumeSandboxExtensions();
</span><span class="cx"> 
</span><del>-    // FIXME (NetworkProcess): Pass an actual value for defersLoading
-    m_handle = ResourceHandle::create(m_networkingContext.get(), m_request, this, false /* defersLoading */, m_contentSniffingPolicy == SniffContent);
</del><ins>+    m_currentRequest = originalRequest();
+
+    if (isSynchronous() || m_parameters.maximumBufferingTime &gt; 0_ms)
+        m_bufferedData = WebCore::SharedBuffer::create();
+
+    bool shouldSniff = m_parameters.contentSniffingPolicy == SniffContent;
+    m_handle = ResourceHandle::create(m_networkingContext.get(), m_currentRequest, this, false /* defersLoading */, shouldSniff);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::setDefersLoading(bool defers)
</span><span class="cx"> {
</span><ins>+    if (m_defersLoading == defers)
+        return;
</ins><span class="cx">     m_defersLoading = defers;
</span><del>-    if (m_handle)
</del><ins>+    if (m_handle) {
</ins><span class="cx">         m_handle-&gt;setDefersLoading(defers);
</span><del>-    if (!defers &amp;&amp; !m_deferredRequest.isNull()) {
-        m_request = m_deferredRequest;
-        m_deferredRequest = ResourceRequest();
-        start();
</del><ins>+        return;
</ins><span class="cx">     }
</span><ins>+    if (!m_defersLoading)
+        start();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::cleanup()
</span><span class="lines">@@ -191,7 +168,6 @@
</span><span class="cx"> 
</span><span class="cx">     invalidateSandboxExtensions();
</span><span class="cx"> 
</span><del>-    // Tell the scheduler about this finished loader soon so it can start more network requests.
</del><span class="cx">     NetworkProcess::shared().networkResourceLoadScheduler().removeLoader(this);
</span><span class="cx"> 
</span><span class="cx">     if (m_handle) {
</span><span class="lines">@@ -205,14 +181,14 @@
</span><span class="cx"> void NetworkResourceLoader::didConvertHandleToDownload()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_handle);
</span><del>-    m_handleConvertedToDownload = true;
</del><ins>+    m_didConvertHandleToDownload = true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::abort()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(RunLoop::isMain());
</span><span class="cx"> 
</span><del>-    if (m_handle &amp;&amp; !m_handleConvertedToDownload)
</del><ins>+    if (m_handle &amp;&amp; !m_didConvertHandleToDownload)
</ins><span class="cx">         m_handle-&gt;cancel();
</span><span class="cx"> 
</span><span class="cx">     cleanup();
</span><span class="lines">@@ -222,22 +198,23 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT_UNUSED(handle, handle == m_handle);
</span><span class="cx"> 
</span><del>-    if (m_needsCertificateInfo)
</del><ins>+    if (m_parameters.needsCertificateInfo)
</ins><span class="cx">         response.includeCertificateInfo();
</span><span class="cx"> 
</span><span class="cx">     if (isSynchronous())
</span><del>-        m_synchronousLoadData-&gt;m_response = response;
</del><ins>+        m_synchronousLoadData-&gt;response = response;
</ins><span class="cx">     else
</span><del>-        sendAbortingOnFailure(Messages::WebResourceLoader::DidReceiveResponse(response, isLoadingMainResource()));
</del><ins>+        sendAbortingOnFailure(Messages::WebResourceLoader::DidReceiveResponse(response, m_parameters.isMainResource));
</ins><span class="cx"> 
</span><span class="cx">     // m_handle will be null if the request got aborted above.
</span><span class="cx">     if (!m_handle)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (!m_isLoadingMainResource) {
-        // For main resources, the web process is responsible for sending back a NetworkResourceLoader::ContinueDidReceiveResponse message.
-        m_handle-&gt;continueDidReceiveResponse();
-    }
</del><ins>+    // For main resources, the web process is responsible for sending back a NetworkResourceLoader::ContinueDidReceiveResponse message.
+    if (m_parameters.isMainResource)
+        return;
+
+    m_handle-&gt;continueDidReceiveResponse();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::didReceiveData(ResourceHandle*, const char* /* data */, unsigned /* length */, int /* encodedDataLength */)
</span><span class="lines">@@ -284,7 +261,7 @@
</span><span class="cx">     ASSERT_UNUSED(handle, handle == m_handle);
</span><span class="cx"> 
</span><span class="cx">     if (isSynchronous()) {
</span><del>-        m_synchronousLoadData-&gt;m_error = error;
</del><ins>+        m_synchronousLoadData-&gt;error = error;
</ins><span class="cx">         sendReplyToSynchronousRequest(*m_synchronousLoadData, nullptr);
</span><span class="cx">     } else
</span><span class="cx">         send(Messages::WebResourceLoader::DidFailResourceLoad(error));
</span><span class="lines">@@ -300,19 +277,17 @@
</span><span class="cx">     ASSERT(!redirectResponse.isNull());
</span><span class="cx">     ASSERT(RunLoop::isMain());
</span><span class="cx"> 
</span><del>-    m_suggestedRequestForWillSendRequest = request;
</del><ins>+    m_currentRequest = request;
</ins><span class="cx"> 
</span><span class="cx">     if (isSynchronous()) {
</span><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(m_synchronousLoadData-&gt;m_originalRequest.url(), request.url()))
-            m_synchronousLoadData-&gt;m_currentRequest = request;
-        else {
-            ASSERT(m_synchronousLoadData-&gt;m_error.isNull());
-            m_synchronousLoadData-&gt;m_error = SynchronousLoaderClient::platformBadResponseError();
-            m_synchronousLoadData-&gt;m_currentRequest = ResourceRequest();
</del><ins>+        if (!protocolHostAndPortAreEqual(originalRequest().url(), request.url())) {
+            ASSERT(m_synchronousLoadData-&gt;error.isNull());
+            m_synchronousLoadData-&gt;error = SynchronousLoaderClient::platformBadResponseError();
+            m_currentRequest = ResourceRequest();
</ins><span class="cx">         }
</span><del>-        continueWillSendRequest(m_synchronousLoadData-&gt;m_currentRequest);
</del><ins>+        continueWillSendRequest(m_currentRequest);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     sendAbortingOnFailure(Messages::WebResourceLoader::WillSendRequest(request, redirectResponse));
</span><span class="lines">@@ -321,20 +296,17 @@
</span><span class="cx"> void NetworkResourceLoader::continueWillSendRequest(const ResourceRequest&amp; newRequest)
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>-    m_suggestedRequestForWillSendRequest.updateFromDelegatePreservingOldProperties(newRequest.nsURLRequest(DoNotUpdateHTTPBody));
</del><ins>+    m_currentRequest.updateFromDelegatePreservingOldProperties(newRequest.nsURLRequest(DoNotUpdateHTTPBody));
</ins><span class="cx"> #elif USE(SOUP)
</span><span class="cx">     // FIXME: Implement ResourceRequest::updateFromDelegatePreservingOldProperties. See https://bugs.webkit.org/show_bug.cgi?id=126127.
</span><del>-    m_suggestedRequestForWillSendRequest.updateFromDelegatePreservingOldProperties(newRequest);
</del><ins>+    m_currentRequest.updateFromDelegatePreservingOldProperties(newRequest);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    m_request = m_suggestedRequestForWillSendRequest;
-    m_suggestedRequestForWillSendRequest = ResourceRequest();
</del><ins>+    m_handle-&gt;continueWillSendRequest(m_currentRequest);
</ins><span class="cx"> 
</span><del>-    m_handle-&gt;continueWillSendRequest(m_request);
-
-    if (m_request.isNull()) {
</del><ins>+    if (m_currentRequest.isNull()) {
</ins><span class="cx">         m_handle-&gt;cancel();
</span><del>-        didFail(m_handle.get(), cancelledError(m_request));
</del><ins>+        didFail(m_handle.get(), cancelledError(m_currentRequest));
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -360,14 +332,14 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT_UNUSED(handle, handle == m_handle);
</span><span class="cx"> 
</span><del>-    didFail(handle, WebKit::blockedError(request()));
</del><ins>+    didFail(handle, WebKit::blockedError(m_currentRequest));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::cannotShowURL(ResourceHandle* handle)
</span><span class="cx"> {
</span><span class="cx">     ASSERT_UNUSED(handle, handle == m_handle);
</span><span class="cx"> 
</span><del>-    didFail(handle, WebKit::cannotShowURLError(request()));
</del><ins>+    didFail(handle, WebKit::cannotShowURLError(m_currentRequest));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool NetworkResourceLoader::shouldUseCredentialStorage(ResourceHandle* handle)
</span><span class="lines">@@ -379,7 +351,7 @@
</span><span class="cx"> 
</span><span class="cx">     // We still need this sync version, because ResourceHandle itself uses it internally, even when the delegate uses an async one.
</span><span class="cx"> 
</span><del>-    return m_allowStoredCredentials == AllowStoredCredentials;
</del><ins>+    return m_parameters.allowStoredCredentials == AllowStoredCredentials;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::didReceiveAuthenticationChallenge(ResourceHandle* handle, const AuthenticationChallenge&amp; challenge)
</span><span class="lines">@@ -389,12 +361,12 @@
</span><span class="cx">     // FIXME (http://webkit.org/b/115291): Since we go straight to the UI process for authentication we don't get WebCore's
</span><span class="cx">     // cross-origin check before asking the client for credentials.
</span><span class="cx">     // Therefore we are too permissive in the case where the ClientCredentialPolicy is DoNotAskClientForCrossOriginCredentials.
</span><del>-    if (m_clientCredentialPolicy == DoNotAskClientForAnyCredentials) {
</del><ins>+    if (m_parameters.clientCredentialPolicy == DoNotAskClientForAnyCredentials) {
</ins><span class="cx">         challenge.authenticationClient()-&gt;receivedRequestToContinueWithoutCredential(challenge);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    NetworkProcess::shared().authenticationManager().didReceiveAuthenticationChallenge(m_webPageID, m_webFrameID, challenge);
</del><ins>+    NetworkProcess::shared().authenticationManager().didReceiveAuthenticationChallenge(m_parameters.webPageID, m_parameters.webFrameID, challenge);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::didCancelAuthenticationChallenge(ResourceHandle* handle, const AuthenticationChallenge&amp;)
</span><span class="lines">@@ -410,7 +382,7 @@
</span><span class="cx">     ASSERT_UNUSED(handle, handle == m_handle);
</span><span class="cx"> 
</span><span class="cx">     m_handle-&gt;cancel();
</span><del>-    didFail(m_handle.get(), cancelledError(m_request));
</del><ins>+    didFail(m_handle.get(), cancelledError(m_currentRequest));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::startBufferingTimerIfNeeded()
</span><span class="lines">@@ -419,7 +391,7 @@
</span><span class="cx">         return;
</span><span class="cx">     if (m_bufferingTimer.isActive())
</span><span class="cx">         return;
</span><del>-    m_bufferingTimer.startOneShot(m_maximumBufferingTime);
</del><ins>+    m_bufferingTimer.startOneShot(m_parameters.maximumBufferingTime);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::bufferingTimerFired(Timer&lt;NetworkResourceLoader&gt;&amp;)
</span><span class="lines">@@ -461,36 +433,43 @@
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::consumeSandboxExtensions()
</span><span class="cx"> {
</span><del>-    for (RefPtr&lt;SandboxExtension&gt;&amp; extension : m_requestBodySandboxExtensions)
</del><ins>+    for (auto&amp; extension : m_parameters.requestBodySandboxExtensions)
</ins><span class="cx">         extension-&gt;consume();
</span><span class="cx"> 
</span><del>-    for (RefPtr&lt;SandboxExtension&gt;&amp; extension : m_resourceSandboxExtensions)
</del><ins>+    if (auto&amp; extension = m_parameters.resourceSandboxExtension)
</ins><span class="cx">         extension-&gt;consume();
</span><span class="cx"> 
</span><del>-    for (RefPtr&lt;BlobDataFileReference&gt;&amp; fileReference : m_fileReferences)
</del><ins>+    for (auto&amp; fileReference : m_fileReferences)
</ins><span class="cx">         fileReference-&gt;prepareForFileAccess();
</span><span class="cx"> 
</span><del>-    m_sandboxExtensionsAreConsumed = true;
</del><ins>+    m_didConsumeSandboxExtensions = true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::invalidateSandboxExtensions()
</span><span class="cx"> {
</span><del>-    if (m_sandboxExtensionsAreConsumed) {
-        for (RefPtr&lt;SandboxExtension&gt;&amp; extension : m_requestBodySandboxExtensions)
</del><ins>+    if (m_didConsumeSandboxExtensions) {
+        for (auto&amp; extension : m_parameters.requestBodySandboxExtensions)
</ins><span class="cx">             extension-&gt;revoke();
</span><del>-        for (RefPtr&lt;SandboxExtension&gt;&amp; extension : m_resourceSandboxExtensions)
</del><ins>+        if (auto&amp; extension = m_parameters.resourceSandboxExtension)
</ins><span class="cx">             extension-&gt;revoke();
</span><del>-        for (RefPtr&lt;BlobDataFileReference&gt;&amp; fileReference : m_fileReferences)
</del><ins>+        for (auto&amp; fileReference : m_fileReferences)
</ins><span class="cx">             fileReference-&gt;revokeFileAccess();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_requestBodySandboxExtensions.clear();
-    m_resourceSandboxExtensions.clear();
</del><span class="cx">     m_fileReferences.clear();
</span><span class="cx"> 
</span><del>-    m_sandboxExtensionsAreConsumed = false;
</del><ins>+    m_didConsumeSandboxExtensions = false;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template&lt;typename T&gt;
+bool NetworkResourceLoader::sendAbortingOnFailure(T&amp;&amp; message, unsigned messageSendFlags)
+{
+    bool result = messageSenderConnection()-&gt;send(std::forward&lt;T&gt;(message), messageSenderDestinationID(), messageSendFlags);
+    if (!result)
+        abort();
+    return result;
+}
+
</ins><span class="cx"> #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
</span><span class="cx"> void NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync(ResourceHandle* handle, const ProtectionSpace&amp; protectionSpace)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkResourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h (173467 => 173468)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h        2014-09-10 16:22:26 UTC (rev 173467)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h        2014-09-10 16:35:00 UTC (rev 173468)
</span><span class="lines">@@ -71,10 +71,10 @@
</span><span class="cx">     }    
</span><span class="cx">     ~NetworkResourceLoader();
</span><span class="cx"> 
</span><del>-    NetworkConnectionToWebProcess* connectionToWebProcess() const { return m_connection.get(); }
</del><ins>+    const WebCore::ResourceRequest&amp; originalRequest() const { return m_parameters.request; }
</ins><span class="cx"> 
</span><del>-    WebCore::ResourceRequest&amp; request() { return m_request; }
-    WebCore::SessionID sessionID() const { return m_sessionID; }
</del><ins>+    // Changes with redirects.
+    WebCore::ResourceRequest&amp; currentRequest() { return m_currentRequest; }
</ins><span class="cx"> 
</span><span class="cx">     WebCore::ResourceHandle* handle() const { return m_handle.get(); }
</span><span class="cx">     void didConvertHandleToDownload();
</span><span class="lines">@@ -83,9 +83,36 @@
</span><span class="cx">     void abort();
</span><span class="cx"> 
</span><span class="cx">     void setDefersLoading(bool);
</span><del>-    bool defersLoading() const { return m_defersLoading; }
</del><span class="cx"> 
</span><del>-    // ResourceHandleClient methods
</del><ins>+#if PLATFORM(COCOA)
+    static size_t fileBackedResourceMinimumSize();
+#endif
+    // Message handlers.
+    void didReceiveNetworkResourceLoaderMessage(IPC::Connection*, IPC::MessageDecoder&amp;);
+
+#if PLATFORM(IOS) || (PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090)
+    static void tryGetShareableHandleFromCFURLCachedResponse(ShareableResource::Handle&amp;, CFCachedURLResponseRef);
+    static void tryGetShareableHandleFromSharedBuffer(ShareableResource::Handle&amp;, WebCore::SharedBuffer*);
+#endif
+
+#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
+    void continueCanAuthenticateAgainstProtectionSpace(bool);
+#endif
+    void continueWillSendRequest(const WebCore::ResourceRequest&amp; newRequest);
+
+    NetworkConnectionToWebProcess* connectionToWebProcess() const { return m_connection.get(); }
+    WebCore::SessionID sessionID() const { return m_parameters.sessionID; }
+
+    struct SynchronousLoadData;
+
+private:
+    NetworkResourceLoader(const NetworkResourceLoadParameters&amp;, NetworkConnectionToWebProcess*, PassRefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt;);
+
+    // IPC::MessageSender
+    virtual IPC::Connection* messageSenderConnection() override;
+    virtual uint64_t messageSenderDestinationID() override { return m_parameters.identifier; }
+
+    // ResourceHandleClient
</ins><span class="cx">     virtual void willSendRequestAsync(WebCore::ResourceHandle*, const WebCore::ResourceRequest&amp;, const WebCore::ResourceResponse&amp; redirectResponse) override;
</span><span class="cx">     virtual void didSendData(WebCore::ResourceHandle*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override;
</span><span class="cx">     virtual void didReceiveResponseAsync(WebCore::ResourceHandle*, const WebCore::ResourceResponse&amp;) override;
</span><span class="lines">@@ -100,19 +127,14 @@
</span><span class="cx">     virtual void didCancelAuthenticationChallenge(WebCore::ResourceHandle*, const WebCore::AuthenticationChallenge&amp;) override;
</span><span class="cx">     virtual void receivedCancellation(WebCore::ResourceHandle*, const WebCore::AuthenticationChallenge&amp;) override;
</span><span class="cx">     virtual bool usesAsyncCallbacks() override { return true; }
</span><del>-
</del><span class="cx"> #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
</span><span class="cx">     virtual void canAuthenticateAgainstProtectionSpaceAsync(WebCore::ResourceHandle*, const WebCore::ProtectionSpace&amp;) override;
</span><span class="cx"> #endif
</span><del>-
</del><span class="cx"> #if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
</span><span class="cx">     virtual bool supportsDataArray() override;
</span><span class="cx">     virtual void didReceiveDataArray(WebCore::ResourceHandle*, CFArrayRef) override;
</span><span class="cx"> #endif
</span><del>-
</del><span class="cx"> #if PLATFORM(COCOA)
</span><del>-    static size_t fileBackedResourceMinimumSize();
-
</del><span class="cx"> #if USE(CFNETWORK)
</span><span class="cx">     virtual void willCacheResponseAsync(WebCore::ResourceHandle*, CFCachedURLResponseRef) override;
</span><span class="cx"> #else
</span><span class="lines">@@ -120,42 +142,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    // Message handlers.
-    void didReceiveNetworkResourceLoaderMessage(IPC::Connection*, IPC::MessageDecoder&amp;);
-
-#if PLATFORM(IOS) || (PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090)
-    static void tryGetShareableHandleFromCFURLCachedResponse(ShareableResource::Handle&amp;, CFCachedURLResponseRef);
-    static void tryGetShareableHandleFromSharedBuffer(ShareableResource::Handle&amp;, WebCore::SharedBuffer*);
-#endif
-
-    bool isSynchronous() const;
-    bool isLoadingMainResource() const { return m_isLoadingMainResource; }
-
-    template&lt;typename T&gt;
-    bool sendAbortingOnFailure(T&amp;&amp; message, unsigned messageSendFlags = 0)
-    {
-        bool result = messageSenderConnection()-&gt;send(std::forward&lt;T&gt;(message), messageSenderDestinationID(), messageSendFlags);
-        if (!result)
-            abort();
-        return result;
-    }
-
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    void continueCanAuthenticateAgainstProtectionSpace(bool);
-#endif
-    void continueWillSendRequest(const WebCore::ResourceRequest&amp; newRequest);
-
-    WebCore::SharedBuffer* bufferedData() const { return m_bufferedData.get(); }
-
-    struct SynchronousLoadData;
-
-private:
-    NetworkResourceLoader(const NetworkResourceLoadParameters&amp;, NetworkConnectionToWebProcess*, PassRefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt;);
-
-    // IPC::MessageSender
-    virtual IPC::Connection* messageSenderConnection() override;
-    virtual uint64_t messageSenderDestinationID() override { return m_identifier; }
-
</del><span class="cx">     void continueDidReceiveResponse();
</span><span class="cx"> 
</span><span class="cx">     void cleanup();
</span><span class="lines">@@ -166,47 +152,34 @@
</span><span class="cx">     void bufferingTimerFired(WebCore::Timer&lt;NetworkResourceLoader&gt;&amp;);
</span><span class="cx">     void sendBuffer(WebCore::SharedBuffer*, int encodedDataLength);
</span><span class="cx"> 
</span><ins>+    bool isSynchronous() const;
+
</ins><span class="cx">     void consumeSandboxExtensions();
</span><span class="cx">     void invalidateSandboxExtensions();
</span><span class="cx"> 
</span><ins>+    template&lt;typename T&gt; bool sendAbortingOnFailure(T&amp;&amp; message, unsigned messageSendFlags = 0);
+
+    const NetworkResourceLoadParameters m_parameters;
+
+    RefPtr&lt;NetworkConnectionToWebProcess&gt; m_connection;
+
</ins><span class="cx">     RefPtr&lt;RemoteNetworkingContext&gt; m_networkingContext;
</span><span class="cx">     RefPtr&lt;WebCore::ResourceHandle&gt; m_handle;
</span><span class="cx"> 
</span><del>-    // Keep the suggested request around while asynchronously asking to update it, because some parts of the request don't survive IPC.
-    WebCore::ResourceRequest m_suggestedRequestForWillSendRequest;
</del><ins>+    WebCore::ResourceRequest m_currentRequest;
</ins><span class="cx"> 
</span><del>-    uint64_t m_bytesReceived;
</del><ins>+    size_t m_bytesReceived;
+    size_t m_bufferedDataEncodedDataLength;
+    RefPtr&lt;WebCore::SharedBuffer&gt; m_bufferedData;
</ins><span class="cx"> 
</span><del>-    bool m_handleConvertedToDownload;
-
</del><span class="cx">     std::unique_ptr&lt;SynchronousLoadData&gt; m_synchronousLoadData;
</span><ins>+    Vector&lt;RefPtr&lt;WebCore::BlobDataFileReference&gt;&gt; m_fileReferences;
</ins><span class="cx"> 
</span><del>-    ResourceLoadIdentifier m_identifier;
-    uint64_t m_webPageID;
-    uint64_t m_webFrameID;
-    WebCore::SessionID m_sessionID;
-    WebCore::ResourceRequest m_request;
-    WebCore::ResourceRequest m_deferredRequest;
-    WebCore::ContentSniffingPolicy m_contentSniffingPolicy;
-    WebCore::StoredCredentials m_allowStoredCredentials;
-    WebCore::ClientCredentialPolicy m_clientCredentialPolicy;
-    bool m_shouldClearReferrerOnHTTPSToHTTPRedirect;
-    bool m_isLoadingMainResource;
</del><ins>+    bool m_didConvertHandleToDownload;
+    bool m_didConsumeSandboxExtensions;
</ins><span class="cx">     bool m_defersLoading;
</span><del>-    bool m_needsCertificateInfo;
-    const std::chrono::milliseconds m_maximumBufferingTime;
</del><span class="cx"> 
</span><span class="cx">     WebCore::Timer&lt;NetworkResourceLoader&gt; m_bufferingTimer;
</span><del>-
-    Vector&lt;RefPtr&lt;SandboxExtension&gt;&gt; m_requestBodySandboxExtensions;
-    Vector&lt;RefPtr&lt;SandboxExtension&gt;&gt; m_resourceSandboxExtensions;
-    Vector&lt;RefPtr&lt;WebCore::BlobDataFileReference&gt;&gt; m_fileReferences;
-    bool m_sandboxExtensionsAreConsumed;
-
-    RefPtr&lt;NetworkConnectionToWebProcess&gt; m_connection;
-    
-    RefPtr&lt;WebCore::SharedBuffer&gt; m_bufferedData;
-    size_t m_bufferedDataEncodedDataLength;
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessmacNetworkDiskCacheMonitormm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.mm (173467 => 173468)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.mm        2014-09-10 16:22:26 UTC (rev 173467)
+++ trunk/Source/WebKit2/NetworkProcess/mac/NetworkDiskCacheMonitor.mm        2014-09-10 16:35:00 UTC (rev 173468)
</span><span class="lines">@@ -54,7 +54,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> NetworkDiskCacheMonitor::NetworkDiskCacheMonitor(CFCachedURLResponseRef cachedResponse, NetworkResourceLoader* loader)
</span><del>-    : DiskCacheMonitor(loader-&gt;request(), loader-&gt;sessionID(), cachedResponse)
</del><ins>+    : DiskCacheMonitor(loader-&gt;originalRequest(), loader-&gt;sessionID(), cachedResponse)
</ins><span class="cx">     , m_connectionToWebProcess(loader-&gt;connectionToWebProcess())
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedNetworkNetworkResourceLoadParameterscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.cpp (173467 => 173468)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.cpp        2014-09-10 16:22:26 UTC (rev 173467)
+++ trunk/Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.cpp        2014-09-10 16:35:00 UTC (rev 173468)
</span><span class="lines">@@ -127,13 +127,20 @@
</span><span class="cx">             return false;
</span><span class="cx">         result.request.setHTTPBody(formData.release());
</span><span class="cx"> 
</span><del>-        if (!decoder.decode(result.requestBodySandboxExtensions))
</del><ins>+        SandboxExtension::HandleArray requestBodySandboxExtensionHandles;
+        if (!decoder.decode(requestBodySandboxExtensionHandles))
</ins><span class="cx">             return false;
</span><ins>+        for (size_t i = 0; i &lt; requestBodySandboxExtensionHandles.size(); ++i) {
+            if (RefPtr&lt;SandboxExtension&gt; extension = SandboxExtension::create(requestBodySandboxExtensionHandles[i]))
+                result.requestBodySandboxExtensions.append(extension.release());
+        }
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (result.request.url().isLocalFile()) {
</span><del>-        if (!decoder.decode(result.resourceSandboxExtension))
</del><ins>+        SandboxExtension::Handle resourceSandboxExtensionHandle;
+        if (!decoder.decode(resourceSandboxExtensionHandle))
</ins><span class="cx">             return false;
</span><ins>+        result.resourceSandboxExtension = SandboxExtension::create(resourceSandboxExtensionHandle);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!decoder.decodeEnum(result.contentSniffingPolicy))
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedNetworkNetworkResourceLoadParametersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.h (173467 => 173468)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.h        2014-09-10 16:22:26 UTC (rev 173467)
+++ trunk/Source/WebKit2/Shared/Network/NetworkResourceLoadParameters.h        2014-09-10 16:35:00 UTC (rev 173468)
</span><span class="lines">@@ -55,8 +55,8 @@
</span><span class="cx">     uint64_t webFrameID;
</span><span class="cx">     WebCore::SessionID sessionID;
</span><span class="cx">     WebCore::ResourceRequest request;
</span><del>-    SandboxExtension::HandleArray requestBodySandboxExtensions; // Created automatically for the sender.
-    SandboxExtension::Handle resourceSandboxExtension; // Created automatically for the sender.
</del><ins>+    Vector&lt;RefPtr&lt;SandboxExtension&gt;&gt; requestBodySandboxExtensions; // Created automatically for the sender.
+    RefPtr&lt;SandboxExtension&gt; resourceSandboxExtension; // Created automatically for the sender.
</ins><span class="cx">     WebCore::ContentSniffingPolicy contentSniffingPolicy;
</span><span class="cx">     WebCore::StoredCredentials allowStoredCredentials;
</span><span class="cx">     WebCore::ClientCredentialPolicy clientCredentialPolicy;
</span></span></pre>
</div>
</div>

</body>
</html>