<!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>[192038] 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/192038">192038</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-11-04 14:39:15 -0800 (Wed, 04 Nov 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WK2] Extract networking code out of NetworkResourceLoader class to improve reusability
https://bugs.webkit.org/show_bug.cgi?id=150898

Reviewed by Alex Christensen.

Extract networking code out of NetworkResourceLoader class to improve
reusability (will be used for speculative revalidation) and simplify
the NetworkResourceLoader.

* CMakeLists.txt:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
* NetworkProcess/NetworkLoad.cpp: Added.
* NetworkProcess/NetworkLoad.h: Added.
* NetworkProcess/NetworkLoadClient.h: Added.
* NetworkProcess/NetworkLoadParameters.cpp: Added.
* NetworkProcess/NetworkLoadParameters.h: Added.
* NetworkProcess/NetworkResourceLoader.cpp:
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/mac/NetworkLoadMac.mm: Added.
* NetworkProcess/mac/NetworkResourceLoaderMac.mm:
(WebKit::NetworkResourceLoader::willCacheResponseAsync):
* WebKit2.xcodeproj/project.pbxproj:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2CMakeListstxt">trunk/Source/WebKit2/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcesscpp">trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.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="#trunkSourceWebKit2NetworkProcessmacNetworkResourceLoaderMacmm">trunk/Source/WebKit2/NetworkProcess/mac/NetworkResourceLoaderMac.mm</a></li>
<li><a href="#trunkSourceWebKit2PlatformMaccmake">trunk/Source/WebKit2/PlatformMac.cmake</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkLoadcpp">trunk/Source/WebKit2/NetworkProcess/NetworkLoad.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkLoadh">trunk/Source/WebKit2/NetworkProcess/NetworkLoad.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkLoadClienth">trunk/Source/WebKit2/NetworkProcess/NetworkLoadClient.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkLoadParameterscpp">trunk/Source/WebKit2/NetworkProcess/NetworkLoadParameters.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkLoadParametersh">trunk/Source/WebKit2/NetworkProcess/NetworkLoadParameters.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessmacNetworkLoadMacmm">trunk/Source/WebKit2/NetworkProcess/mac/NetworkLoadMac.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2CMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/CMakeLists.txt (192037 => 192038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/CMakeLists.txt        2015-11-04 22:34:01 UTC (rev 192037)
+++ trunk/Source/WebKit2/CMakeLists.txt        2015-11-04 22:39:15 UTC (rev 192038)
</span><span class="lines">@@ -162,6 +162,8 @@
</span><span class="cx"> 
</span><span class="cx"> set(NetworkProcess_COMMON_SOURCES
</span><span class="cx">     NetworkProcess/NetworkConnectionToWebProcess.cpp
</span><ins>+    NetworkProcess/NetworkLoad.cpp
+    NetworkProcess/NetworkLoadParameters.cpp
</ins><span class="cx">     NetworkProcess/NetworkProcess.cpp
</span><span class="cx">     NetworkProcess/NetworkProcessPlatformStrategies.cpp
</span><span class="cx">     NetworkProcess/NetworkResourceLoader.cpp
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (192037 => 192038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-11-04 22:34:01 UTC (rev 192037)
+++ trunk/Source/WebKit2/ChangeLog        2015-11-04 22:39:15 UTC (rev 192038)
</span><span class="lines">@@ -1,3 +1,29 @@
</span><ins>+2015-11-04  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        [WK2] Extract networking code out of NetworkResourceLoader class to improve reusability
+        https://bugs.webkit.org/show_bug.cgi?id=150898
+
+        Reviewed by Alex Christensen.
+
+        Extract networking code out of NetworkResourceLoader class to improve
+        reusability (will be used for speculative revalidation) and simplify
+        the NetworkResourceLoader.
+
+        * CMakeLists.txt:
+        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+        (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
+        * NetworkProcess/NetworkLoad.cpp: Added.
+        * NetworkProcess/NetworkLoad.h: Added.
+        * NetworkProcess/NetworkLoadClient.h: Added.
+        * NetworkProcess/NetworkLoadParameters.cpp: Added.
+        * NetworkProcess/NetworkLoadParameters.h: Added.
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        * NetworkProcess/NetworkResourceLoader.h:
+        * NetworkProcess/mac/NetworkLoadMac.mm: Added.
+        * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
+        (WebKit::NetworkResourceLoader::willCacheResponseAsync):
+        * WebKit2.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2015-11-04  Beth Dakin  &lt;bdakin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Link preview doesn't work on XHTML pages with Content-Type header as 
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkConnectionToWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp (192037 => 192038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp        2015-11-04 22:34:01 UTC (rev 192037)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkConnectionToWebProcess.cpp        2015-11-04 22:39:15 UTC (rev 192038)
</span><span class="lines">@@ -30,6 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;NetworkBlobRegistry.h&quot;
</span><span class="cx"> #include &quot;NetworkConnectionToWebProcessMessages.h&quot;
</span><ins>+#include &quot;NetworkLoad.h&quot;
</ins><span class="cx"> #include &quot;NetworkProcess.h&quot;
</span><span class="cx"> #include &quot;NetworkResourceLoadParameters.h&quot;
</span><span class="cx"> #include &quot;NetworkResourceLoader.h&quot;
</span><span class="lines">@@ -202,10 +203,10 @@
</span><span class="cx">     // FIXME: Do something here.
</span><span class="cx">     notImplemented();
</span><span class="cx"> #else
</span><del>-    networkProcess.downloadManager().convertHandleToDownload(downloadID, loader-&gt;handle(), request, response);
</del><ins>+    networkProcess.downloadManager().convertHandleToDownload(downloadID, loader-&gt;networkLoad()-&gt;handle(), request, response);
</ins><span class="cx"> 
</span><span class="cx">     // Unblock the URL connection operation queue.
</span><del>-    loader-&gt;handle()-&gt;continueDidReceiveResponse();
</del><ins>+    loader-&gt;networkLoad()-&gt;handle()-&gt;continueDidReceiveResponse();
</ins><span class="cx">     
</span><span class="cx">     loader-&gt;didConvertHandleToDownload();
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkLoadcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/NetworkProcess/NetworkLoad.cpp (0 => 192038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkLoad.cpp                                (rev 0)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkLoad.cpp        2015-11-04 22:39:15 UTC (rev 192038)
</span><span class="lines">@@ -0,0 +1,355 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+
+#if ENABLE(NETWORK_PROCESS)
+#include &quot;NetworkLoad.h&quot;
+
+#include &quot;AuthenticationManager.h&quot;
+#include &quot;NetworkProcess.h&quot;
+#include &quot;SessionTracker.h&quot;
+#include &quot;WebErrors.h&quot;
+#include &lt;WebCore/NotImplemented.h&gt;
+#include &lt;WebCore/SessionID.h&gt;
+#include &lt;wtf/MainThread.h&gt;
+
+#if !USE(NETWORK_SESSION)
+#include &lt;WebCore/ResourceHandle.h&gt;
+#endif
+
+namespace WebKit {
+
+using namespace WebCore;
+
+NetworkLoad::NetworkLoad(NetworkLoadClient&amp; client, const NetworkLoadParameters&amp; parameters)
+    : m_client(client)
+    , m_parameters(parameters)
+    , m_networkingContext(RemoteNetworkingContext::create(parameters.sessionID, parameters.shouldClearReferrerOnHTTPSToHTTPRedirect))
+    , m_currentRequest(parameters.request)
+{
+#if USE(NETWORK_SESSION)
+    m_task = SessionTracker::networkSession(parameters.sessionID)-&gt;createDataTaskWithRequest(parameters.request, *this);
+    m_task-&gt;resume();
+#else
+    m_handle = ResourceHandle::create(m_networkingContext.get(), parameters.request, this, parameters.defersLoading, parameters.contentSniffingPolicy == SniffContent);
+#endif
+}
+
+NetworkLoad::~NetworkLoad()
+{
+    ASSERT(RunLoop::isMain());
+#if USE(NETWORK_SESSION)
+    m_task-&gt;clearClient();
+#else
+    if (m_handle)
+        m_handle-&gt;clearClient();
+#endif
+}
+
+void NetworkLoad::setDefersLoading(bool defers)
+{
+#if USE(NETWORK_SESSION)
+    // FIXME: Do something here.
+    notImplemented();
+#else
+    if (m_handle)
+        m_handle-&gt;setDefersLoading(defers);
+#endif
+}
+
+void NetworkLoad::cancel()
+{
+#if USE(NETWORK_SESSION)
+    m_task-&gt;cancel();
+#else
+    if (m_handle)
+        m_handle-&gt;cancel();
+#endif
+}
+
+void NetworkLoad::continueWillSendRequest(const WebCore::ResourceRequest&amp; newRequest)
+{
+#if PLATFORM(COCOA)
+    m_currentRequest.updateFromDelegatePreservingOldProperties(newRequest.nsURLRequest(DoNotUpdateHTTPBody));
+#elif USE(SOUP)
+    // FIXME: Implement ResourceRequest::updateFromDelegatePreservingOldProperties. See https://bugs.webkit.org/show_bug.cgi?id=126127.
+    m_currentRequest.updateFromDelegatePreservingOldProperties(newRequest);
+#endif
+
+    if (m_currentRequest.isNull()) {
+#if USE(NETWORK_SESSION)
+        // FIXME: Do something here.
+        notImplemented();
+#else
+        m_handle-&gt;cancel();
+        didFail(m_handle.get(), cancelledError(m_currentRequest));
+#endif
+        return;
+    }
+
+#if USE(NETWORK_SESSION)
+    // FIXME: Do something here.
+    notImplemented();
+#else
+    m_handle-&gt;continueWillSendRequest(m_currentRequest);
+#endif
+}
+
+void NetworkLoad::continueDidReceiveResponse()
+{
+#if USE(NETWORK_SESSION)
+    // FIXME: Do something here.
+    notImplemented();
+#else
+    m_handle-&gt;continueDidReceiveResponse();
+#endif
+}
+
+NetworkLoadClient::ShouldContinueDidReceiveResponse NetworkLoad::sharedDidReceiveResponse(const ResourceResponse&amp; receivedResponse)
+{
+    ResourceResponse response = receivedResponse;
+    response.setSource(ResourceResponse::Source::Network);
+    if (m_parameters.needsCertificateInfo)
+        response.includeCertificateInfo();
+
+    return m_client.didReceiveResponse(response);
+}
+
+void NetworkLoad::sharedWillSendRedirectedRequest(const ResourceRequest&amp; request, const ResourceResponse&amp; redirectResponse)
+{
+    // We only expect to get the willSendRequest callback from ResourceHandle as the result of a redirect.
+    ASSERT(!redirectResponse.isNull());
+    ASSERT(RunLoop::isMain());
+
+    m_currentRequest = request;
+    m_client.willSendRedirectedRequest(request, redirectResponse);
+}
+
+#if USE(NETWORK_SESSION)
+
+void NetworkLoad::willPerformHTTPRedirection(const ResourceResponse&amp; response, const ResourceRequest&amp; request, std::function&lt;void(const ResourceRequest&amp;)&gt; completionHandler)
+{
+    sharedWillSendRedirectedRequest(request, response);
+    completionHandler(request);
+}
+
+void NetworkLoad::didReceiveChallenge(const AuthenticationChallenge&amp; challenge, std::function&lt;void(AuthenticationChallengeDisposition, const Credential&amp;)&gt; completionHandler)
+{
+    notImplemented();
+    completionHandler(AuthenticationChallengeDisposition::PerformDefaultHandling, Credential());
+}
+
+void NetworkLoad::didReceiveResponse(const ResourceResponse&amp; response, std::function&lt;void(ResponseDisposition)&gt; completionHandler)
+{
+    ASSERT(isMainThread());
+    sharedDidReceiveResponse(response);
+    completionHandler(ResponseDisposition::Allow);
+}
+
+void NetworkLoad::didReceiveData(RefPtr&lt;SharedBuffer&gt;&amp;&amp; buffer)
+{
+    ASSERT(buffer);
+    auto size = buffer-&gt;size();
+    m_client.didReceiveBuffer(WTF::move(buffer), size);
+}
+
+void NetworkLoad::didCompleteWithError(const ResourceError&amp; error)
+{
+    if (error.isNull())
+        m_client.didFinishLoading(WTF::monotonicallyIncreasingTime());
+    else
+        m_client.didFailLoading(error);
+}
+
+#else
+
+void NetworkLoad::didReceiveResponseAsync(ResourceHandle* handle, const ResourceResponse&amp; receivedResponse)
+{
+    ASSERT_UNUSED(handle, handle == m_handle);
+    if (sharedDidReceiveResponse(receivedResponse) == NetworkLoadClient::ShouldContinueDidReceiveResponse::Yes)
+        m_handle-&gt;continueDidReceiveResponse();
+}
+
+void NetworkLoad::didReceiveData(ResourceHandle*, const char* /* data */, unsigned /* length */, int /* encodedDataLength */)
+{
+    // The NetworkProcess should never get a didReceiveData callback.
+    // We should always be using didReceiveBuffer.
+    ASSERT_NOT_REACHED();
+}
+
+void NetworkLoad::didReceiveBuffer(ResourceHandle* handle, PassRefPtr&lt;SharedBuffer&gt; buffer, int reportedEncodedDataLength)
+{
+    ASSERT_UNUSED(handle, handle == m_handle);
+    m_client.didReceiveBuffer(WTF::move(buffer), reportedEncodedDataLength);
+}
+
+void NetworkLoad::didFinishLoading(ResourceHandle* handle, double finishTime)
+{
+    ASSERT_UNUSED(handle, handle == m_handle);
+    m_client.didFinishLoading(finishTime);
+}
+
+void NetworkLoad::didFail(ResourceHandle* handle, const ResourceError&amp; error)
+{
+    ASSERT_UNUSED(handle, !handle || handle == m_handle);
+    ASSERT(!error.isNull());
+
+    m_client.didFailLoading(error);
+}
+
+void NetworkLoad::willSendRequestAsync(ResourceHandle* handle, const ResourceRequest&amp; request, const ResourceResponse&amp; redirectResponse)
+{
+    ASSERT_UNUSED(handle, handle == m_handle);
+    sharedWillSendRedirectedRequest(request, redirectResponse);
+}
+
+#endif // USE(NETWORK_SESSION)
+
+#if USE(PROTECTION_SPACE_AUTH_CALLBACK) &amp;&amp; !USE(NETWORK_SESSION)
+void NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync(ResourceHandle* handle, const ProtectionSpace&amp; protectionSpace)
+{
+    ASSERT(RunLoop::isMain());
+    ASSERT_UNUSED(handle, handle == m_handle);
+
+    // Handle server trust evaluation at platform-level if requested, for performance reasons.
+    if (protectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested
+        &amp;&amp; !NetworkProcess::singleton().canHandleHTTPSServerTrustEvaluation()) {
+        continueCanAuthenticateAgainstProtectionSpace(false);
+        return;
+    }
+
+    if (m_client.isSynchronous()) {
+        // FIXME: We should ask the WebProcess like the asynchronous case below does.
+        // This is currently impossible as the WebProcess is blocked waiting on this synchronous load.
+        // It's possible that we can jump straight to the UI process to resolve this.
+        continueCanAuthenticateAgainstProtectionSpace(true);
+        return;
+    }
+
+    m_client.canAuthenticateAgainstProtectionSpaceAsync(protectionSpace);
+}
+#endif
+
+#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
+void NetworkLoad::continueCanAuthenticateAgainstProtectionSpace(bool result)
+{
+#if USE(NETWORK_SESSION)
+    // FIXME: Do something here.
+    notImplemented();
+#else
+    m_handle-&gt;continueCanAuthenticateAgainstProtectionSpace(result);
+#endif
+}
+#endif
+
+#if USE(NETWORK_CFDATA_ARRAY_CALLBACK) &amp;&amp; !USE(NETWORK_SESSION)
+bool NetworkLoad::supportsDataArray()
+{
+    notImplemented();
+    return false;
+}
+
+void NetworkLoad::didReceiveDataArray(ResourceHandle*, CFArrayRef)
+{
+    ASSERT_NOT_REACHED();
+    notImplemented();
+}
+#endif
+
+#if !USE(NETWORK_SESSION)
+
+void NetworkLoad::didSendData(ResourceHandle* handle, unsigned long long bytesSent, unsigned long long totalBytesToBeSent)
+{
+    ASSERT_UNUSED(handle, handle == m_handle);
+
+    m_client.didSendData(bytesSent, totalBytesToBeSent);
+}
+
+void NetworkLoad::wasBlocked(ResourceHandle* handle)
+{
+    ASSERT_UNUSED(handle, handle == m_handle);
+
+    didFail(handle, WebKit::blockedError(m_currentRequest));
+}
+
+void NetworkLoad::cannotShowURL(ResourceHandle* handle)
+{
+    ASSERT_UNUSED(handle, handle == m_handle);
+
+    didFail(handle, WebKit::cannotShowURLError(m_currentRequest));
+}
+
+bool NetworkLoad::shouldUseCredentialStorage(ResourceHandle* handle)
+{
+    ASSERT_UNUSED(handle, handle == m_handle || !m_handle); // m_handle will be 0 if called from ResourceHandle::start().
+
+    // When the WebProcess is handling loading a client is consulted each time this shouldUseCredentialStorage question is asked.
+    // In NetworkProcess mode we ask the WebProcess client up front once and then reuse the cached answer.
+
+    // We still need this sync version, because ResourceHandle itself uses it internally, even when the delegate uses an async one.
+
+    return m_parameters.allowStoredCredentials == AllowStoredCredentials;
+}
+
+void NetworkLoad::didReceiveAuthenticationChallenge(ResourceHandle* handle, const AuthenticationChallenge&amp; challenge)
+{
+    ASSERT_UNUSED(handle, handle == m_handle);
+    // NetworkResourceLoader does not know whether the request is cross origin, so Web process computes an applicable credential policy for it.
+    ASSERT(m_parameters.clientCredentialPolicy != DoNotAskClientForCrossOriginCredentials);
+
+    if (m_parameters.clientCredentialPolicy == DoNotAskClientForAnyCredentials) {
+        challenge.authenticationClient()-&gt;receivedRequestToContinueWithoutCredential(challenge);
+        return;
+    }
+
+    NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge(m_parameters.webPageID, m_parameters.webFrameID, challenge);
+}
+
+void NetworkLoad::didCancelAuthenticationChallenge(ResourceHandle* handle, const AuthenticationChallenge&amp;)
+{
+    ASSERT_UNUSED(handle, handle == m_handle);
+
+    // This function is probably not needed (see &lt;rdar://problem/8960124&gt;).
+    notImplemented();
+}
+
+void NetworkLoad::receivedCancellation(ResourceHandle* handle, const AuthenticationChallenge&amp;)
+{
+    ASSERT_UNUSED(handle, handle == m_handle);
+
+    m_handle-&gt;cancel();
+    didFail(m_handle.get(), cancelledError(m_currentRequest));
+}
+
+#endif // !USE(NETWORK_SESSION)
+
+#if PLATFORM(COCOA)
+
+#endif
+
+} // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
</ins></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkLoadh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/NetworkProcess/NetworkLoad.h (0 => 192038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkLoad.h                                (rev 0)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkLoad.h        2015-11-04 22:39:15 UTC (rev 192038)
</span><span class="lines">@@ -0,0 +1,131 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef NetworkLoad_h
+#define NetworkLoad_h
+
+#if ENABLE(NETWORK_PROCESS)
+
+#include &quot;NetworkLoadClient.h&quot;
+#include &quot;NetworkLoadParameters.h&quot;
+#include &quot;RemoteNetworkingContext.h&quot;
+
+#if USE(NETWORK_SESSION)
+#include &quot;NetworkSession.h&quot;
+#else
+#include &lt;WebCore/ResourceHandleClient.h&gt;
+#endif
+
+namespace WebKit {
+
+class NetworkLoad
+#if USE(NETWORK_SESSION)
+    : public NetworkSessionTaskClient
+#else
+    : public WebCore::ResourceHandleClient
+#endif
+{
+public:
+    NetworkLoad(NetworkLoadClient&amp;, const NetworkLoadParameters&amp;);
+    ~NetworkLoad();
+
+    void setDefersLoading(bool);
+    void cancel();
+
+    void clearCurrentRequest() { m_currentRequest = WebCore::ResourceRequest(); }
+
+    void continueWillSendRequest(const WebCore::ResourceRequest&amp;);
+    void continueDidReceiveResponse();
+
+#if USE(NETWORK_SESSION)
+    // NetworkSessionTaskClient.
+    virtual void willPerformHTTPRedirection(const WebCore::ResourceResponse&amp;, const WebCore::ResourceRequest&amp;, std::function&lt;void(const WebCore::ResourceRequest&amp;)&gt;) final override;
+    virtual void didReceiveChallenge(const WebCore::AuthenticationChallenge&amp;, std::function&lt;void(AuthenticationChallengeDisposition, const WebCore::Credential&amp;)&gt;) final override;
+    virtual void didReceiveResponse(const WebCore::ResourceResponse&amp;, std::function&lt;void(ResponseDisposition)&gt;) final override;
+    virtual void didReceiveData(RefPtr&lt;WebCore::SharedBuffer&gt;&amp;&amp;) final override;
+    virtual void didCompleteWithError(const WebCore::ResourceError&amp;) final override;
+#else
+    // ResourceHandleClient
+    virtual void willSendRequestAsync(WebCore::ResourceHandle*, const WebCore::ResourceRequest&amp;, const WebCore::ResourceResponse&amp; redirectResponse) override;
+    virtual void didSendData(WebCore::ResourceHandle*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override;
+    virtual void didReceiveResponseAsync(WebCore::ResourceHandle*, const WebCore::ResourceResponse&amp;) override;
+    virtual void didReceiveData(WebCore::ResourceHandle*, const char*, unsigned, int encodedDataLength) override;
+    virtual void didReceiveBuffer(WebCore::ResourceHandle*, PassRefPtr&lt;WebCore::SharedBuffer&gt;, int encodedDataLength) override;
+    virtual void didFinishLoading(WebCore::ResourceHandle*, double finishTime) override;
+    virtual void didFail(WebCore::ResourceHandle*, const WebCore::ResourceError&amp;) override;
+    virtual void wasBlocked(WebCore::ResourceHandle*) override;
+    virtual void cannotShowURL(WebCore::ResourceHandle*) override;
+    virtual bool shouldUseCredentialStorage(WebCore::ResourceHandle*) override;
+    virtual void didReceiveAuthenticationChallenge(WebCore::ResourceHandle*, const WebCore::AuthenticationChallenge&amp;) override;
+    virtual void didCancelAuthenticationChallenge(WebCore::ResourceHandle*, const WebCore::AuthenticationChallenge&amp;) override;
+    virtual void receivedCancellation(WebCore::ResourceHandle*, const WebCore::AuthenticationChallenge&amp;) override;
+    virtual bool usesAsyncCallbacks() override { return true; }
+    virtual bool loadingSynchronousXHR() override { return m_client.isSynchronous(); }
+
+#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
+    virtual void canAuthenticateAgainstProtectionSpaceAsync(WebCore::ResourceHandle*, const WebCore::ProtectionSpace&amp;) override;
+#endif
+#if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
+    virtual bool supportsDataArray() override;
+    virtual void didReceiveDataArray(WebCore::ResourceHandle*, CFArrayRef) override;
+#endif
+#if PLATFORM(COCOA)
+#if USE(CFNETWORK)
+    virtual void willCacheResponseAsync(WebCore::ResourceHandle*, CFCachedURLResponseRef) override;
+#else
+    virtual void willCacheResponseAsync(WebCore::ResourceHandle*, NSCachedURLResponse *) override;
+#endif
+#endif
+#endif // USE(NETWORK_SESSION)
+
+#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
+    void continueCanAuthenticateAgainstProtectionSpace(bool);
+#endif
+
+#if !USE(NETWORK_SESSION)
+    WebCore::ResourceHandle* handle() const { return m_handle.get(); }
+#endif
+
+private:
+    NetworkLoadClient::ShouldContinueDidReceiveResponse sharedDidReceiveResponse(const WebCore::ResourceResponse&amp;);
+    void sharedWillSendRedirectedRequest(const WebCore::ResourceRequest&amp;, const WebCore::ResourceResponse&amp;);
+
+    NetworkLoadClient&amp; m_client;
+    const NetworkLoadParameters m_parameters;
+    RefPtr&lt;RemoteNetworkingContext&gt; m_networkingContext;
+#if USE(NETWORK_SESSION)
+    RefPtr&lt;NetworkDataTask&gt; m_task;
+#else
+    RefPtr&lt;WebCore::ResourceHandle&gt; m_handle;
+#endif
+
+    WebCore::ResourceRequest m_currentRequest; // Updated on redirects.
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
+
+#endif // NetworkLoad_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkLoadClienth"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/NetworkProcess/NetworkLoadClient.h (0 => 192038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkLoadClient.h                                (rev 0)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkLoadClient.h        2015-11-04 22:39:15 UTC (rev 192038)
</span><span class="lines">@@ -0,0 +1,72 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef NetworkLoadClient_h
+#define NetworkLoadClient_h
+
+#if ENABLE(NETWORK_PROCESS)
+
+#include &lt;WebCore/ResourceError.h&gt;
+#include &lt;WebCore/ResourceRequest.h&gt;
+#include &lt;WebCore/ResourceResponse.h&gt;
+#include &lt;WebCore/SharedBuffer.h&gt;
+#include &lt;wtf/Forward.h&gt;
+
+#if PLATFORM(COCOA)
+typedef const struct _CFCachedURLResponse* CFCachedURLResponseRef;
+#endif
+
+namespace WebCore {
+class ProtectionSpace;
+}
+
+namespace WebKit {
+
+class NetworkLoadClient {
+public:
+    virtual ~NetworkLoadClient() { }
+
+    virtual bool isSynchronous() const = 0;
+
+    virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) = 0;
+    virtual void canAuthenticateAgainstProtectionSpaceAsync(const WebCore::ProtectionSpace&amp;) = 0;
+    virtual void willSendRedirectedRequest(const WebCore::ResourceRequest&amp;, const WebCore::ResourceResponse&amp; redirectResponse) = 0;
+    enum class ShouldContinueDidReceiveResponse { No, Yes };
+    virtual ShouldContinueDidReceiveResponse didReceiveResponse(const WebCore::ResourceResponse&amp;) = 0;
+    virtual void didReceiveBuffer(RefPtr&lt;WebCore::SharedBuffer&gt;&amp;&amp;, int reportedEncodedDataLength) = 0;
+    virtual void didFinishLoading(double finishTime) = 0;
+    virtual void didFailLoading(const WebCore::ResourceError&amp;) = 0;
+
+#if PLATFORM(COCOA)
+    virtual void willCacheResponseAsync(CFCachedURLResponseRef) = 0;
+#endif
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
+
+#endif // NetworkLoadClient_h
+
</ins></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkLoadParameterscpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/NetworkProcess/NetworkLoadParameters.cpp (0 => 192038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkLoadParameters.cpp                                (rev 0)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkLoadParameters.cpp        2015-11-04 22:39:15 UTC (rev 192038)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+
+#if ENABLE(NETWORK_PROCESS)
+#include &quot;NetworkLoadParameters.h&quot;
+
+#include &quot;NetworkResourceLoadParameters.h&quot;
+
+namespace WebKit {
+
+NetworkLoadParameters::NetworkLoadParameters(const NetworkResourceLoadParameters&amp; parameters)
+    : webPageID(parameters.webPageID)
+    , webFrameID(parameters.webFrameID)
+    , sessionID(parameters.sessionID)
+    , request(parameters.request)
+    , contentSniffingPolicy(parameters.contentSniffingPolicy)
+    , allowStoredCredentials(parameters.allowStoredCredentials)
+    , clientCredentialPolicy(parameters.clientCredentialPolicy)
+    , shouldClearReferrerOnHTTPSToHTTPRedirect(parameters.shouldClearReferrerOnHTTPSToHTTPRedirect)
+    , defersLoading(parameters.defersLoading)
+    , needsCertificateInfo(parameters.needsCertificateInfo)
+{
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
</ins></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkLoadParametersh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/NetworkProcess/NetworkLoadParameters.h (0 => 192038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkLoadParameters.h                                (rev 0)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkLoadParameters.h        2015-11-04 22:39:15 UTC (rev 192038)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef NetworkLoadParameters_h
+#define NetworkLoadParameters_h
+
+#if ENABLE(NETWORK_PROCESS)
+
+#include &lt;WebCore/ResourceLoaderOptions.h&gt;
+#include &lt;WebCore/ResourceRequest.h&gt;
+#include &lt;WebCore/SessionID.h&gt;
+
+namespace WebKit {
+
+class NetworkResourceLoadParameters;
+
+class NetworkLoadParameters {
+public:
+    NetworkLoadParameters() = default;
+    NetworkLoadParameters(const NetworkResourceLoadParameters&amp;);
+
+    uint64_t webPageID { 0 };
+    uint64_t webFrameID { 0 };
+    WebCore::SessionID sessionID { WebCore::SessionID::emptySessionID() };
+    WebCore::ResourceRequest request;
+    WebCore::ContentSniffingPolicy contentSniffingPolicy { WebCore::SniffContent };
+    WebCore::StoredCredentials allowStoredCredentials { WebCore::DoNotAllowStoredCredentials };
+    WebCore::ClientCredentialPolicy clientCredentialPolicy { WebCore::DoNotAskClientForAnyCredentials };
+    bool shouldClearReferrerOnHTTPSToHTTPRedirect { true };
+    bool defersLoading { false };
+    bool needsCertificateInfo { false };
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
+
+#endif // NetworkLoadParameters_h
</ins></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp (192037 => 192038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2015-11-04 22:34:01 UTC (rev 192037)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2015-11-04 22:39:15 UTC (rev 192038)
</span><span class="lines">@@ -28,35 +28,28 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETWORK_PROCESS)
</span><span class="cx"> 
</span><del>-#include &quot;AuthenticationManager.h&quot;
</del><span class="cx"> #include &quot;DataReference.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="cx"> #include &quot;NetworkBlobRegistry.h&quot;
</span><span class="cx"> #include &quot;NetworkCache.h&quot;
</span><span class="cx"> #include &quot;NetworkConnectionToWebProcess.h&quot;
</span><ins>+#include &quot;NetworkLoad.h&quot;
</ins><span class="cx"> #include &quot;NetworkProcess.h&quot;
</span><span class="cx"> #include &quot;NetworkProcessConnectionMessages.h&quot;
</span><span class="cx"> #include &quot;NetworkResourceLoadParameters.h&quot;
</span><del>-#include &quot;RemoteNetworkingContext.h&quot;
-#include &quot;SessionTracker.h&quot;
</del><span class="cx"> #include &quot;ShareableResource.h&quot;
</span><span class="cx"> #include &quot;SharedMemory.h&quot;
</span><span class="cx"> #include &quot;WebCoreArgumentCoders.h&quot;
</span><del>-#include &quot;WebErrors.h&quot;
</del><span class="cx"> #include &quot;WebResourceLoaderMessages.h&quot;
</span><span class="cx"> #include &lt;WebCore/BlobDataFileReference.h&gt;
</span><span class="cx"> #include &lt;WebCore/CertificateInfo.h&gt;
</span><span class="cx"> #include &lt;WebCore/HTTPHeaderNames.h&gt;
</span><del>-#include &lt;WebCore/NotImplemented.h&gt;
</del><ins>+#include &lt;WebCore/ProtectionSpace.h&gt;
</ins><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><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> 
</span><del>-#if !USE(NETWORK_SESSION)
-#include &lt;WebCore/ResourceHandle.h&gt;
-#endif
-
</del><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -120,11 +113,7 @@
</span><span class="cx"> NetworkResourceLoader::~NetworkResourceLoader()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(RunLoop::isMain());
</span><del>-#if USE(NETWORK_SESSION)
-    ASSERT(!m_task);
-#else
-    ASSERT(!m_handle);
-#endif
</del><ins>+    ASSERT(!m_networkLoad);
</ins><span class="cx">     ASSERT(!isSynchronous() || !m_synchronousLoadData-&gt;delayedReply);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -140,8 +129,6 @@
</span><span class="cx">     if (m_defersLoading)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    m_currentRequest = originalRequest();
-
</del><span class="cx"> #if ENABLE(NETWORK_CACHE)
</span><span class="cx">     if (!NetworkCache::singleton().isEnabled() || sessionID().isEphemeral() || !originalRequest().url().protocolIsInHTTPFamily()) {
</span><span class="cx">         startNetworkLoad();
</span><span class="lines">@@ -173,10 +160,8 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkResourceLoader::startNetworkLoad()
</del><ins>+void NetworkResourceLoader::startNetworkLoad(const Optional&lt;ResourceRequest&gt;&amp; updatedRequest)
</ins><span class="cx"> {
</span><del>-    m_networkingContext = RemoteNetworkingContext::create(sessionID(), m_parameters.shouldClearReferrerOnHTTPSToHTTPRedirect);
-
</del><span class="cx">     consumeSandboxExtensions();
</span><span class="cx"> 
</span><span class="cx">     if (isSynchronous() || m_parameters.maximumBufferingTime &gt; 0_ms)
</span><span class="lines">@@ -187,14 +172,10 @@
</span><span class="cx">         m_bufferedDataForCache = WebCore::SharedBuffer::create();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    bool shouldSniff = m_parameters.contentSniffingPolicy == SniffContent;
-#if USE(NETWORK_SESSION)
-    UNUSED_PARAM(shouldSniff); // FIXME: Use this.
-    m_task = SessionTracker::networkSession(sessionID())-&gt;createDataTaskWithRequest(m_currentRequest, *this);
-    m_task-&gt;resume();
-#else
-    m_handle = ResourceHandle::create(m_networkingContext.get(), m_currentRequest, this, m_defersLoading, shouldSniff);
-#endif
</del><ins>+    NetworkLoadParameters parameters = m_parameters;
+    if (updatedRequest)
+        parameters.request = updatedRequest.value();
+    m_networkLoad = std::make_unique&lt;NetworkLoad&gt;(*this, parameters);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::setDefersLoading(bool defers)
</span><span class="lines">@@ -202,15 +183,9 @@
</span><span class="cx">     if (m_defersLoading == defers)
</span><span class="cx">         return;
</span><span class="cx">     m_defersLoading = defers;
</span><del>-#if USE(NETWORK_SESSION)
-    // FIXME: Do something here.
-    notImplemented();
-#else
-    if (m_handle) {
-        m_handle-&gt;setDefersLoading(defers);
-        return;
-    }
-#endif
</del><ins>+
+    m_networkLoad-&gt;setDefersLoading(defers);
+
</ins><span class="cx">     if (!m_defersLoading)
</span><span class="cx">         start();
</span><span class="cx"> }
</span><span class="lines">@@ -223,42 +198,24 @@
</span><span class="cx"> 
</span><span class="cx">     invalidateSandboxExtensions();
</span><span class="cx"> 
</span><del>-#if USE(NETWORK_SESSION)
-    if (m_task) {
-        m_task-&gt;clearClient();
-        m_task = nullptr;
-    }
-#else
-    if (m_handle) {
-        m_handle-&gt;clearClient();
-        m_handle = nullptr;
-    }
-#endif
</del><ins>+    m_networkLoad = nullptr;
</ins><span class="cx"> 
</span><span class="cx">     // This will cause NetworkResourceLoader to be destroyed and therefore we do it last.
</span><span class="cx">     m_connection-&gt;didCleanupResourceLoader(*this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if !USE(NETWORK_SESSION)
</del><span class="cx"> void NetworkResourceLoader::didConvertHandleToDownload()
</span><span class="cx"> {
</span><del>-    ASSERT(m_handle);
</del><ins>+    ASSERT(m_networkLoad);
</ins><span class="cx">     m_didConvertHandleToDownload = true;
</span><span class="cx"> }
</span><del>-#endif
</del><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 USE(NETWORK_SESSION)
-    if (m_task)
-        m_task-&gt;cancel();
-    // FIXME: Do something with the network cache here.
-    notImplemented();
-#else
-    if (m_handle &amp;&amp; !m_didConvertHandleToDownload) {
-        m_handle-&gt;cancel();
</del><ins>+    if (m_networkLoad &amp;&amp; !m_didConvertHandleToDownload) {
+        m_networkLoad-&gt;cancel();
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETWORK_CACHE)
</span><span class="cx">         if (NetworkCache::singleton().isEnabled()) {
</span><span class="lines">@@ -268,17 +225,14 @@
</span><span class="cx">         }
</span><span class="cx"> #endif
</span><span class="cx">     }
</span><del>-#endif
</del><ins>+
</ins><span class="cx">     cleanup();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-NetworkResourceLoader::ShouldContinueDidReceiveResponse NetworkResourceLoader::sharedDidReceiveResponse(const WebCore::ResourceResponse&amp; receivedResponse)
</del><ins>+auto NetworkResourceLoader::didReceiveResponse(const ResourceResponse&amp; receivedResponse) -&gt; ShouldContinueDidReceiveResponse
</ins><span class="cx"> {
</span><span class="cx">     m_response = receivedResponse;
</span><span class="cx"> 
</span><del>-    m_response.setSource(ResourceResponse::Source::Network);
-    if (m_parameters.needsCertificateInfo)
-        m_response.includeCertificateInfo();
</del><span class="cx">     // For multipart/x-mixed-replace didReceiveResponseAsync gets called multiple times and buffering would require special handling.
</span><span class="cx">     if (!isSynchronous() &amp;&amp; m_response.isMultipart())
</span><span class="cx">         m_bufferedData = nullptr;
</span><span class="lines">@@ -322,7 +276,7 @@
</span><span class="cx">     return ShouldContinueDidReceiveResponse::Yes;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkResourceLoader::sharedDidReceiveBuffer(RefPtr&lt;WebCore::SharedBuffer&gt;&amp;&amp; buffer, int reportedEncodedDataLength)
</del><ins>+void NetworkResourceLoader::didReceiveBuffer(RefPtr&lt;SharedBuffer&gt;&amp;&amp; buffer, int reportedEncodedDataLength)
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(NETWORK_CACHE)
</span><span class="cx">     ASSERT(!m_cacheEntryForValidation);
</span><span class="lines">@@ -349,7 +303,7 @@
</span><span class="cx">     sendBufferMaybeAborting(*buffer, encodedDataLength);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkResourceLoader::sharedDidFinishLoading(double finishTime)
</del><ins>+void NetworkResourceLoader::didFinishLoading(double finishTime)
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(NETWORK_CACHE)
</span><span class="cx">     if (NetworkCache::singleton().isEnabled()) {
</span><span class="lines">@@ -404,7 +358,7 @@
</span><span class="cx">     cleanup();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkResourceLoader::sharedDidFail(const WebCore::ResourceError&amp; error)
</del><ins>+void NetworkResourceLoader::didFailLoading(const ResourceError&amp; error)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!error.isNull());
</span><span class="cx"> 
</span><span class="lines">@@ -421,221 +375,47 @@
</span><span class="cx">     cleanup();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkResourceLoader::sharedWillSendRedirectedRequest(const WebCore::ResourceRequest&amp; request, const WebCore::ResourceResponse&amp; redirectResponse)
</del><ins>+void NetworkResourceLoader::willSendRedirectedRequest(const ResourceRequest&amp; request, const ResourceResponse&amp; redirectResponse)
</ins><span class="cx"> {
</span><del>-    // We only expect to get the willSendRequest callback from ResourceHandle as the result of a redirect.
-    ASSERT(!redirectResponse.isNull());
-    ASSERT(RunLoop::isMain());
-
-    m_currentRequest = request;
-
</del><span class="cx"> #if ENABLE(NETWORK_CACHE)
</span><span class="cx">     WebCore::updateRedirectChainStatus(m_redirectChainCacheStatus, redirectResponse);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     if (isSynchronous()) {
</span><ins>+        ResourceRequest overridenRequest = request;
</ins><span class="cx">         // FIXME: This needs to be fixed to follow the redirect correctly even for cross-domain requests.
</span><span class="cx">         // This includes at least updating host records, and comparing the current request instead of the original request here.
</span><del>-        if (!protocolHostAndPortAreEqual(originalRequest().url(), m_currentRequest.url())) {
</del><ins>+        if (!protocolHostAndPortAreEqual(originalRequest().url(), request.url())) {
</ins><span class="cx">             ASSERT(m_synchronousLoadData-&gt;error.isNull());
</span><span class="cx">             m_synchronousLoadData-&gt;error = SynchronousLoaderClient::platformBadResponseError();
</span><del>-            m_currentRequest = ResourceRequest();
</del><ins>+            m_networkLoad-&gt;clearCurrentRequest();
+            overridenRequest = ResourceRequest();
</ins><span class="cx">         }
</span><del>-        continueWillSendRequest(m_currentRequest);
</del><ins>+        continueWillSendRequest(overridenRequest);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    sendAbortingOnFailure(Messages::WebResourceLoader::WillSendRequest(m_currentRequest, redirectResponse));
</del><ins>+    sendAbortingOnFailure(Messages::WebResourceLoader::WillSendRequest(request, redirectResponse));
</ins><span class="cx"> }
</span><span class="cx">     
</span><del>-#if USE(NETWORK_SESSION)
-
-void NetworkResourceLoader::willPerformHTTPRedirection(const WebCore::ResourceResponse&amp; response, const WebCore::ResourceRequest&amp; request, std::function&lt;void(const WebCore::ResourceRequest&amp;)&gt; completionHandler)
-{
-    sharedWillSendRedirectedRequest(request, response);
-    completionHandler(request);
-}
-
-void NetworkResourceLoader::didReceiveChallenge(const WebCore::AuthenticationChallenge&amp; challenge, std::function&lt;void(AuthenticationChallengeDisposition, const WebCore::Credential&amp;)&gt; completionHandler)
-{
-    notImplemented();
-    completionHandler(AuthenticationChallengeDisposition::PerformDefaultHandling, WebCore::Credential());
-}
-
-void NetworkResourceLoader::didReceiveResponse(const WebCore::ResourceResponse&amp; response, std::function&lt;void(ResponseDisposition)&gt; completionHandler)
-{
-    ASSERT(isMainThread());
-    sharedDidReceiveResponse(response);
-    completionHandler(ResponseDisposition::Allow);
-}
-
-void NetworkResourceLoader::didReceiveData(RefPtr&lt;WebCore::SharedBuffer&gt;&amp;&amp; buffer)
-{
-    ASSERT(buffer);
-    auto size = buffer-&gt;size();
-    sharedDidReceiveBuffer(WTF::move(buffer), size);
-}
-
-void NetworkResourceLoader::didCompleteWithError(const WebCore::ResourceError&amp; error)
-{
-    if (error.isNull())
-        sharedDidFinishLoading(WTF::monotonicallyIncreasingTime());
-    else
-        sharedDidFail(error);
-}
-
-#else
-
-void NetworkResourceLoader::didReceiveResponseAsync(ResourceHandle* handle, const ResourceResponse&amp; receivedResponse)
-{
-    ASSERT_UNUSED(handle, handle == m_handle);
-    if (sharedDidReceiveResponse(receivedResponse) == ShouldContinueDidReceiveResponse::Yes)
-        m_handle-&gt;continueDidReceiveResponse();
-}
-
-void NetworkResourceLoader::didReceiveData(ResourceHandle*, const char* /* data */, unsigned /* length */, int /* encodedDataLength */)
-{
-    // The NetworkProcess should never get a didReceiveData callback.
-    // We should always be using didReceiveBuffer.
-    ASSERT_NOT_REACHED();
-}
-
-void NetworkResourceLoader::didReceiveBuffer(ResourceHandle* handle, PassRefPtr&lt;WebCore::SharedBuffer&gt; buffer, int reportedEncodedDataLength)
-{
-    ASSERT_UNUSED(handle, handle == m_handle);
-    sharedDidReceiveBuffer(WTF::move(buffer), reportedEncodedDataLength);
-}
-
-void NetworkResourceLoader::didFinishLoading(ResourceHandle* handle, double finishTime)
-{
-    ASSERT_UNUSED(handle, handle == m_handle);
-    sharedDidFinishLoading(finishTime);
-}
-
-void NetworkResourceLoader::didFail(ResourceHandle* handle, const ResourceError&amp; error)
-{
-    ASSERT_UNUSED(handle, !handle || handle == m_handle);
-    sharedDidFail(error);
-}
-
-void NetworkResourceLoader::willSendRequestAsync(ResourceHandle* handle, const ResourceRequest&amp; request, const ResourceResponse&amp; redirectResponse)
-{
-    ASSERT_UNUSED(handle, handle == m_handle);
-    sharedWillSendRedirectedRequest(request, redirectResponse);
-}
-
-#endif // USE(NETWORK_SESSION)
-    
</del><span class="cx"> void NetworkResourceLoader::continueWillSendRequest(const ResourceRequest&amp; newRequest)
</span><span class="cx"> {
</span><del>-#if PLATFORM(COCOA)
-    m_currentRequest.updateFromDelegatePreservingOldProperties(newRequest.nsURLRequest(DoNotUpdateHTTPBody));
-#elif USE(SOUP)
-    // FIXME: Implement ResourceRequest::updateFromDelegatePreservingOldProperties. See https://bugs.webkit.org/show_bug.cgi?id=126127.
-    m_currentRequest.updateFromDelegatePreservingOldProperties(newRequest);
-#endif
-
-    if (m_currentRequest.isNull()) {
-#if USE(NETWORK_SESSION)
-        // FIXME: Do something here.
-        notImplemented();
-#else
-        m_handle-&gt;cancel();
-        didFail(m_handle.get(), cancelledError(m_currentRequest));
-#endif
-        return;
-    }
-
-#if USE(NETWORK_SESSION)
-    // FIXME: Do something here.
-    notImplemented();
-#else
-    m_handle-&gt;continueWillSendRequest(m_currentRequest);
-#endif
</del><ins>+    m_networkLoad-&gt;continueWillSendRequest(newRequest);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::continueDidReceiveResponse()
</span><span class="cx"> {
</span><span class="cx">     // FIXME: Remove this check once BlobResourceHandle implements didReceiveResponseAsync correctly.
</span><span class="cx">     // Currently, it does not wait for response, so the load is likely to finish before continueDidReceiveResponse.
</span><del>-#if USE(NETWORK_SESSION)
-    // FIXME: Do something here.
-    notImplemented();
-#else
-    if (!m_handle)
-        return;
-
-    m_handle-&gt;continueDidReceiveResponse();
-#endif
</del><ins>+    if (m_networkLoad)
+        m_networkLoad-&gt;continueDidReceiveResponse();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if !USE(NETWORK_SESSION)
-
-void NetworkResourceLoader::didSendData(ResourceHandle* handle, unsigned long long bytesSent, unsigned long long totalBytesToBeSent)
</del><ins>+void NetworkResourceLoader::didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent)
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(handle, handle == m_handle);
-
</del><span class="cx">     if (!isSynchronous())
</span><span class="cx">         send(Messages::WebResourceLoader::DidSendData(bytesSent, totalBytesToBeSent));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkResourceLoader::wasBlocked(ResourceHandle* handle)
-{
-    ASSERT_UNUSED(handle, handle == m_handle);
-
-    didFail(handle, WebKit::blockedError(m_currentRequest));
-}
-
-void NetworkResourceLoader::cannotShowURL(ResourceHandle* handle)
-{
-    ASSERT_UNUSED(handle, handle == m_handle);
-
-    didFail(handle, WebKit::cannotShowURLError(m_currentRequest));
-}
-
-bool NetworkResourceLoader::shouldUseCredentialStorage(ResourceHandle* handle)
-{
-    ASSERT_UNUSED(handle, handle == m_handle || !m_handle); // m_handle will be 0 if called from ResourceHandle::start().
-
-    // When the WebProcess is handling loading a client is consulted each time this shouldUseCredentialStorage question is asked.
-    // In NetworkProcess mode we ask the WebProcess client up front once and then reuse the cached answer.
-
-    // We still need this sync version, because ResourceHandle itself uses it internally, even when the delegate uses an async one.
-
-    return m_parameters.allowStoredCredentials == AllowStoredCredentials;
-}
-
-void NetworkResourceLoader::didReceiveAuthenticationChallenge(ResourceHandle* handle, const AuthenticationChallenge&amp; challenge)
-{
-    ASSERT_UNUSED(handle, handle == m_handle);
-    // NetworkResourceLoader does not know whether the request is cross origin, so Web process computes an applicable credential policy for it.
-    ASSERT(m_parameters.clientCredentialPolicy != DoNotAskClientForCrossOriginCredentials);
-
-    if (m_parameters.clientCredentialPolicy == DoNotAskClientForAnyCredentials) {
-        challenge.authenticationClient()-&gt;receivedRequestToContinueWithoutCredential(challenge);
-        return;
-    }
-
-    NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge(m_parameters.webPageID, m_parameters.webFrameID, challenge);
-}
-
-void NetworkResourceLoader::didCancelAuthenticationChallenge(ResourceHandle* handle, const AuthenticationChallenge&amp;)
-{
-    ASSERT_UNUSED(handle, handle == m_handle);
-
-    // This function is probably not needed (see &lt;rdar://problem/8960124&gt;).
-    notImplemented();
-}
-
-void NetworkResourceLoader::receivedCancellation(ResourceHandle* handle, const AuthenticationChallenge&amp;)
-{
-    ASSERT_UNUSED(handle, handle == m_handle);
-
-    m_handle-&gt;cancel();
-    didFail(m_handle.get(), cancelledError(m_currentRequest));
-}
-
-#endif // !USE(NETWORK_SESSION)
-
</del><span class="cx"> void NetworkResourceLoader::startBufferingTimerIfNeeded()
</span><span class="cx"> {
</span><span class="cx">     if (isSynchronous())
</span><span class="lines">@@ -648,9 +428,8 @@
</span><span class="cx"> void NetworkResourceLoader::bufferingTimerFired()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_bufferedData);
</span><del>-#if !USE(NETWORK_SESSION)
-    ASSERT(m_handle);
-#endif
</del><ins>+    ASSERT(m_networkLoad);
+
</ins><span class="cx">     if (!m_bufferedData-&gt;size())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -718,24 +497,23 @@
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::validateCacheEntry(std::unique_ptr&lt;NetworkCache::Entry&gt; entry)
</span><span class="cx"> {
</span><del>-#if !USE(NETWORK_SESSION)
-    ASSERT(!m_handle);
-#endif
</del><ins>+    ASSERT(!m_networkLoad);
</ins><span class="cx"> 
</span><span class="cx">     // If the request is already conditional then the revalidation was not triggered by the disk cache
</span><span class="cx">     // and we should not overwrite the existing conditional headers.
</span><del>-    if (!m_currentRequest.isConditional()) {
</del><ins>+    ResourceRequest revalidationRequest = originalRequest();
+    if (!revalidationRequest.isConditional()) {
</ins><span class="cx">         String eTag = entry-&gt;response().httpHeaderField(WebCore::HTTPHeaderName::ETag);
</span><span class="cx">         String lastModified = entry-&gt;response().httpHeaderField(WebCore::HTTPHeaderName::LastModified);
</span><span class="cx">         if (!eTag.isEmpty())
</span><del>-            m_currentRequest.setHTTPHeaderField(WebCore::HTTPHeaderName::IfNoneMatch, eTag);
</del><ins>+            revalidationRequest.setHTTPHeaderField(WebCore::HTTPHeaderName::IfNoneMatch, eTag);
</ins><span class="cx">         if (!lastModified.isEmpty())
</span><del>-            m_currentRequest.setHTTPHeaderField(WebCore::HTTPHeaderName::IfModifiedSince, lastModified);
</del><ins>+            revalidationRequest.setHTTPHeaderField(WebCore::HTTPHeaderName::IfModifiedSince, lastModified);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_cacheEntryForValidation = WTF::move(entry);
</span><span class="cx"> 
</span><del>-    startNetworkLoad();
</del><ins>+    startNetworkLoad(revalidationRequest);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -783,56 +561,22 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if USE(PROTECTION_SPACE_AUTH_CALLBACK) &amp;&amp; !USE(NETWORK_SESSION)
-void NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync(ResourceHandle* handle, const ProtectionSpace&amp; protectionSpace)
</del><ins>+void NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync(const ProtectionSpace&amp; protectionSpace)
</ins><span class="cx"> {
</span><del>-    ASSERT(RunLoop::isMain());
-    ASSERT_UNUSED(handle, handle == m_handle);
-
-    // Handle server trust evaluation at platform-level if requested, for performance reasons.
-    if (protectionSpace.authenticationScheme() == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested
-        &amp;&amp; !NetworkProcess::singleton().canHandleHTTPSServerTrustEvaluation()) {
-        continueCanAuthenticateAgainstProtectionSpace(false);
-        return;
-    }
-
-    if (isSynchronous()) {
-        // FIXME: We should ask the WebProcess like the asynchronous case below does.
-        // This is currently impossible as the WebProcess is blocked waiting on this synchronous load.
-        // It's possible that we can jump straight to the UI process to resolve this.
-        continueCanAuthenticateAgainstProtectionSpace(true);
-        return;
-    }
</del><ins>+#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
</ins><span class="cx">     sendAbortingOnFailure(Messages::WebResourceLoader::CanAuthenticateAgainstProtectionSpace(protectionSpace));
</span><del>-}
</del><ins>+#else
+    UNUSED_PARAM(protectionSpace);
</ins><span class="cx"> #endif
</span><ins>+}
</ins><span class="cx"> 
</span><span class="cx"> #if USE(PROTECTION_SPACE_AUTH_CALLBACK)
</span><span class="cx"> void NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace(bool result)
</span><span class="cx"> {
</span><del>-#if USE(NETWORK_SESSION)
-    // FIXME: Do something here.
-    notImplemented();
-#else
-    m_handle-&gt;continueCanAuthenticateAgainstProtectionSpace(result);
-#endif
</del><ins>+    m_networkLoad-&gt;continueCanAuthenticateAgainstProtectionSpace(result);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if USE(NETWORK_CFDATA_ARRAY_CALLBACK) &amp;&amp; !USE(NETWORK_SESSION)
-bool NetworkResourceLoader::supportsDataArray()
-{
-    notImplemented();
-    return false;
-}
-
-void NetworkResourceLoader::didReceiveDataArray(ResourceHandle*, CFArrayRef)
-{
-    ASSERT_NOT_REACHED();
-    notImplemented();
-}
-#endif
-
</del><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(NETWORK_PROCESS)
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkResourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h (192037 => 192038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h        2015-11-04 22:34:01 UTC (rev 192037)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h        2015-11-04 22:39:15 UTC (rev 192038)
</span><span class="lines">@@ -31,31 +31,17 @@
</span><span class="cx"> #include &quot;MessageSender.h&quot;
</span><span class="cx"> #include &quot;NetworkCache.h&quot;
</span><span class="cx"> #include &quot;NetworkConnectionToWebProcessMessages.h&quot;
</span><ins>+#include &quot;NetworkLoadClient.h&quot;
</ins><span class="cx"> #include &quot;NetworkResourceLoadParameters.h&quot;
</span><span class="cx"> #include &quot;ShareableResource.h&quot;
</span><span class="cx"> #include &lt;WebCore/CacheValidation.h&gt;
</span><del>-#include &lt;WebCore/ResourceError.h&gt;
</del><span class="cx"> #include &lt;WebCore/ResourceLoaderOptions.h&gt;
</span><del>-#include &lt;WebCore/ResourceRequest.h&gt;
-#include &lt;WebCore/ResourceResponse.h&gt;
</del><span class="cx"> #include &lt;WebCore/SessionID.h&gt;
</span><span class="cx"> #include &lt;WebCore/Timer.h&gt;
</span><del>-#include &lt;wtf/MainThread.h&gt;
-#include &lt;wtf/RunLoop.h&gt;
</del><ins>+#include &lt;wtf/Optional.h&gt;
</ins><span class="cx"> 
</span><del>-#if USE(NETWORK_SESSION)
-#include &quot;NetworkSession.h&quot;
-#else
-#include &lt;WebCore/ResourceHandleClient.h&gt;
-#endif
-
-typedef const struct _CFCachedURLResponse* CFCachedURLResponseRef;
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> class BlobDataFileReference;
</span><del>-#if !USE(NETWORK_SESSION)
-class ResourceHandle;
-#endif
</del><span class="cx"> class ResourceRequest;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -63,16 +49,12 @@
</span><span class="cx"> 
</span><span class="cx"> class NetworkConnectionToWebProcess;
</span><span class="cx"> class NetworkResourceLoadParameters;
</span><del>-class RemoteNetworkingContext;
</del><ins>+class NetworkLoad;
</ins><span class="cx"> class SandboxExtension;
</span><span class="cx"> 
</span><span class="cx"> class NetworkResourceLoader
</span><span class="cx">     : public RefCounted&lt;NetworkResourceLoader&gt;
</span><del>-#if USE(NETWORK_SESSION)
-    , public NetworkSessionTaskClient
-#else
-    , public WebCore::ResourceHandleClient
-#endif
</del><ins>+    , public NetworkLoadClient
</ins><span class="cx">     , public IPC::MessageSender {
</span><span class="cx"> public:
</span><span class="cx">     static Ref&lt;NetworkResourceLoader&gt; create(const NetworkResourceLoadParameters&amp; parameters, NetworkConnectionToWebProcess* connection)
</span><span class="lines">@@ -88,12 +70,8 @@
</span><span class="cx"> 
</span><span class="cx">     const WebCore::ResourceRequest&amp; originalRequest() const { return m_parameters.request; }
</span><span class="cx"> 
</span><del>-    // Changes with redirects.
-    WebCore::ResourceRequest&amp; currentRequest() { return m_currentRequest; }
</del><ins>+    NetworkLoad* networkLoad() const { return m_networkLoad.get(); }
</ins><span class="cx"> 
</span><del>-#if !USE(NETWORK_SESSION)
-    WebCore::ResourceHandle* handle() const { return m_handle.get(); }
-#endif
</del><span class="cx">     void didConvertHandleToDownload();
</span><span class="cx"> 
</span><span class="cx">     void start();
</span><span class="lines">@@ -103,7 +81,9 @@
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     static size_t fileBackedResourceMinimumSize();
</span><ins>+    virtual void willCacheResponseAsync(CFCachedURLResponseRef) override;
</ins><span class="cx"> #endif
</span><ins>+
</ins><span class="cx">     // Message handlers.
</span><span class="cx">     void didReceiveNetworkResourceLoaderMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -126,6 +106,16 @@
</span><span class="cx"> 
</span><span class="cx">     struct SynchronousLoadData;
</span><span class="cx"> 
</span><ins>+    // NetworkLoadClient.
+    virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override;
+    virtual void canAuthenticateAgainstProtectionSpaceAsync(const WebCore::ProtectionSpace&amp;) override;
+    virtual bool isSynchronous() const override;
+    virtual void willSendRedirectedRequest(const WebCore::ResourceRequest&amp;, const WebCore::ResourceResponse&amp; redirectResponse) override;
+    virtual ShouldContinueDidReceiveResponse didReceiveResponse(const WebCore::ResourceResponse&amp;) override;
+    virtual void didReceiveBuffer(RefPtr&lt;WebCore::SharedBuffer&gt;&amp;&amp;, int reportedEncodedDataLength) override;
+    virtual void didFinishLoading(double finishTime) override;
+    virtual void didFailLoading(const WebCore::ResourceError&amp;) override;
+
</ins><span class="cx"> private:
</span><span class="cx">     NetworkResourceLoader(const NetworkResourceLoadParameters&amp;, NetworkConnectionToWebProcess*, PassRefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt;);
</span><span class="cx"> 
</span><span class="lines">@@ -133,63 +123,12 @@
</span><span class="cx">     virtual IPC::Connection* messageSenderConnection() override;
</span><span class="cx">     virtual uint64_t messageSenderDestinationID() override { return m_parameters.identifier; }
</span><span class="cx"> 
</span><del>-    enum ShouldContinueDidReceiveResponse {
-        Yes,
-        No
-    };
-    ShouldContinueDidReceiveResponse sharedDidReceiveResponse(const WebCore::ResourceResponse&amp;);
-        void sharedWillSendRedirectedRequest(const WebCore::ResourceRequest&amp;, const WebCore::ResourceResponse&amp;);
-    void sharedDidReceiveBuffer(RefPtr&lt;WebCore::SharedBuffer&gt;&amp;&amp;, int reportedEncodedDataLength);
-    void sharedDidFail(const WebCore::ResourceError&amp;);
-    void sharedDidFinishLoading(double finishTime);
-
-#if USE(NETWORK_SESSION)
-    // NetworkSessionTaskClient.
-    virtual void willPerformHTTPRedirection(const WebCore::ResourceResponse&amp;, const WebCore::ResourceRequest&amp;, std::function&lt;void(const WebCore::ResourceRequest&amp;)&gt;) final override;
-    virtual void didReceiveChallenge(const WebCore::AuthenticationChallenge&amp;, std::function&lt;void(AuthenticationChallengeDisposition, const WebCore::Credential&amp;)&gt;) final override;
-    virtual void didReceiveResponse(const WebCore::ResourceResponse&amp;, std::function&lt;void(ResponseDisposition)&gt;) final override;
-    virtual void didReceiveData(RefPtr&lt;WebCore::SharedBuffer&gt;&amp;&amp;) final override;
-    virtual void didCompleteWithError(const WebCore::ResourceError&amp;) final override;
-#else
-    // ResourceHandleClient
-    virtual void willSendRequestAsync(WebCore::ResourceHandle*, const WebCore::ResourceRequest&amp;, const WebCore::ResourceResponse&amp; redirectResponse) override;
-    virtual void didSendData(WebCore::ResourceHandle*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override;
-    virtual void didReceiveResponseAsync(WebCore::ResourceHandle*, const WebCore::ResourceResponse&amp;) override;
-    virtual void didReceiveData(WebCore::ResourceHandle*, const char*, unsigned, int encodedDataLength) override;
-    virtual void didReceiveBuffer(WebCore::ResourceHandle*, PassRefPtr&lt;WebCore::SharedBuffer&gt;, int encodedDataLength) override;
-    virtual void didFinishLoading(WebCore::ResourceHandle*, double finishTime) override;
-    virtual void didFail(WebCore::ResourceHandle*, const WebCore::ResourceError&amp;) override;
-    virtual void wasBlocked(WebCore::ResourceHandle*) override;
-    virtual void cannotShowURL(WebCore::ResourceHandle*) override;
-    virtual bool shouldUseCredentialStorage(WebCore::ResourceHandle*) override;
-    virtual void didReceiveAuthenticationChallenge(WebCore::ResourceHandle*, const WebCore::AuthenticationChallenge&amp;) override;
-    virtual void didCancelAuthenticationChallenge(WebCore::ResourceHandle*, const WebCore::AuthenticationChallenge&amp;) override;
-    virtual void receivedCancellation(WebCore::ResourceHandle*, const WebCore::AuthenticationChallenge&amp;) override;
-    virtual bool usesAsyncCallbacks() override { return true; }
-    virtual bool loadingSynchronousXHR() override { return isSynchronous(); }
-
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    virtual void canAuthenticateAgainstProtectionSpaceAsync(WebCore::ResourceHandle*, const WebCore::ProtectionSpace&amp;) override;
-#endif
-#if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
-    virtual bool supportsDataArray() override;
-    virtual void didReceiveDataArray(WebCore::ResourceHandle*, CFArrayRef) override;
-#endif
-#if PLATFORM(COCOA)
-#if USE(CFNETWORK)
-    virtual void willCacheResponseAsync(WebCore::ResourceHandle*, CFCachedURLResponseRef) override;
-#else
-    virtual void willCacheResponseAsync(WebCore::ResourceHandle*, NSCachedURLResponse *) override;
-#endif
-#endif
-#endif // USE(NETWORK_SESSION)
-
</del><span class="cx"> #if ENABLE(NETWORK_CACHE)
</span><span class="cx">     void didRetrieveCacheEntry(std::unique_ptr&lt;NetworkCache::Entry&gt;);
</span><span class="cx">     void validateCacheEntry(std::unique_ptr&lt;NetworkCache::Entry&gt;);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    void startNetworkLoad();
</del><ins>+    void startNetworkLoad(const Optional&lt;WebCore::ResourceRequest&gt;&amp; updatedRequest = { });
</ins><span class="cx">     void continueDidReceiveResponse();
</span><span class="cx"> 
</span><span class="cx">     void cleanup();
</span><span class="lines">@@ -200,8 +139,6 @@
</span><span class="cx">     void bufferingTimerFired();
</span><span class="cx">     bool sendBufferMaybeAborting(const WebCore::SharedBuffer&amp;, size_t encodedDataLength);
</span><span class="cx"> 
</span><del>-    bool isSynchronous() const;
-
</del><span class="cx">     void consumeSandboxExtensions();
</span><span class="cx">     void invalidateSandboxExtensions();
</span><span class="cx"> 
</span><span class="lines">@@ -211,14 +148,8 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;NetworkConnectionToWebProcess&gt; m_connection;
</span><span class="cx"> 
</span><del>-    RefPtr&lt;RemoteNetworkingContext&gt; m_networkingContext;
-#if USE(NETWORK_SESSION)
-    RefPtr&lt;NetworkDataTask&gt; m_task;
-#else
-    RefPtr&lt;WebCore::ResourceHandle&gt; m_handle;
-#endif
</del><ins>+    std::unique_ptr&lt;NetworkLoad&gt; m_networkLoad;
</ins><span class="cx"> 
</span><del>-    WebCore::ResourceRequest m_currentRequest;
</del><span class="cx">     WebCore::ResourceResponse m_response;
</span><span class="cx"> 
</span><span class="cx">     size_t m_bytesReceived;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessmacNetworkLoadMacmm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit2/NetworkProcess/mac/NetworkLoadMac.mm (0 => 192038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/mac/NetworkLoadMac.mm                                (rev 0)
+++ trunk/Source/WebKit2/NetworkProcess/mac/NetworkLoadMac.mm        2015-11-04 22:39:15 UTC (rev 192038)
</span><span class="lines">@@ -0,0 +1,64 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import &quot;config.h&quot;
+
+#if ENABLE(NETWORK_PROCESS)
+#import &quot;NetworkLoad.h&quot;
+
+#import &lt;WebCore/CFNetworkSPI.h&gt;
+#import &lt;WebCore/ResourceHandle.h&gt;
+
+namespace WebKit {
+
+using namespace WebCore;
+
+#if USE(CFNETWORK)
+
+void NetworkLoad::willCacheResponseAsync(ResourceHandle* handle, CFCachedURLResponseRef cfResponse)
+{
+    ASSERT_UNUSED(handle, handle == m_handle);
+
+    m_client.willCacheResponseAsync(cfResponse);
+
+    m_handle-&gt;continueWillCacheResponse(cfResponse);
+}
+
+#elif !USE(NETWORK_SESSION)
+
+void NetworkLoad::willCacheResponseAsync(ResourceHandle* handle, NSCachedURLResponse *nsResponse)
+{
+    ASSERT_UNUSED(handle, handle == m_handle);
+
+    m_client.willCacheResponseAsync([nsResponse _CFCachedURLResponse]);
+
+    m_handle-&gt;continueWillCacheResponse(nsResponse);
+}
+
+#endif // !USE(CFNETWORK)
+
+} // namespace WebKit
+
+#endif // ENABLE(NETWORK_PROCESS)
</ins></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessmacNetworkResourceLoaderMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/mac/NetworkResourceLoaderMac.mm (192037 => 192038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/mac/NetworkResourceLoaderMac.mm        2015-11-04 22:34:01 UTC (rev 192037)
+++ trunk/Source/WebKit2/NetworkProcess/mac/NetworkResourceLoaderMac.mm        2015-11-04 22:39:15 UTC (rev 192038)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #import &lt;WebCore/CFNetworkSPI.h&gt;
</span><span class="cx"> #import &lt;WebCore/ResourceHandle.h&gt;
</span><span class="cx"> #import &lt;WebCore/SharedBuffer.h&gt;
</span><ins>+#import &lt;wtf/MainThread.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="lines">@@ -82,32 +83,12 @@
</span><span class="cx">     return SharedMemory::systemPageSize();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if USE(CFNETWORK)
-
-void NetworkResourceLoader::willCacheResponseAsync(ResourceHandle* handle, CFCachedURLResponseRef cfResponse)
</del><ins>+void NetworkResourceLoader::willCacheResponseAsync(CFCachedURLResponseRef cfResponse)
</ins><span class="cx"> {
</span><del>-    ASSERT_UNUSED(handle, handle == m_handle);
-
</del><span class="cx">     if (m_bytesReceived &gt;= fileBackedResourceMinimumSize())
</span><span class="cx">         NetworkDiskCacheMonitor::monitorFileBackingStoreCreation(cfResponse, this);
</span><del>-
-    m_handle-&gt;continueWillCacheResponse(cfResponse);
</del><span class="cx"> }
</span><span class="cx"> 
</span><del>-#elif !USE(NETWORK_SESSION)
-
-void NetworkResourceLoader::willCacheResponseAsync(ResourceHandle* handle, NSCachedURLResponse *nsResponse)
-{
-    ASSERT_UNUSED(handle, handle == m_handle);
-
-    if (m_bytesReceived &gt;= fileBackedResourceMinimumSize())
-        NetworkDiskCacheMonitor::monitorFileBackingStoreCreation([nsResponse _CFCachedURLResponse], this);
-
-    m_handle-&gt;continueWillCacheResponse(nsResponse);
-}
-
-#endif // !USE(CFNETWORK)
-
</del><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(NETWORK_PROCESS)
</span></span></pre></div>
<a id="trunkSourceWebKit2PlatformMaccmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/PlatformMac.cmake (192037 => 192038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/PlatformMac.cmake        2015-11-04 22:34:01 UTC (rev 192037)
+++ trunk/Source/WebKit2/PlatformMac.cmake        2015-11-04 22:39:15 UTC (rev 192038)
</span><span class="lines">@@ -18,6 +18,7 @@
</span><span class="cx">     NetworkProcess/cocoa/NetworkProcessCocoa.mm
</span><span class="cx"> 
</span><span class="cx">     NetworkProcess/mac/NetworkDiskCacheMonitor.mm
</span><ins>+    NetworkProcess/mac/NetworkLoadMac.mm
</ins><span class="cx">     NetworkProcess/mac/NetworkProcessMac.mm
</span><span class="cx">     NetworkProcess/mac/NetworkResourceLoaderMac.mm
</span><span class="cx">     NetworkProcess/mac/RemoteNetworkingContext.mm
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (192037 => 192038)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-11-04 22:34:01 UTC (rev 192037)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-11-04 22:39:15 UTC (rev 192038)
</span><span class="lines">@@ -1180,6 +1180,7 @@
</span><span class="cx">                 834B25121A842C8700CFB150 /* NetworkCacheStatistics.h in Headers */ = {isa = PBXBuildFile; fileRef = 834B25101A842C8700CFB150 /* NetworkCacheStatistics.h */; };
</span><span class="cx">                 8360349F1ACB34D600626549 /* WebSQLiteDatabaseTracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8360349D1ACB34D600626549 /* WebSQLiteDatabaseTracker.cpp */; };
</span><span class="cx">                 836034A01ACB34D600626549 /* WebSQLiteDatabaseTracker.h in Headers */ = {isa = PBXBuildFile; fileRef = 8360349E1ACB34D600626549 /* WebSQLiteDatabaseTracker.h */; };
</span><ins>+                836EEB801BE9EC9E006B4B82 /* NetworkLoadMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 836EEB7F1BE9EC9E006B4B82 /* NetworkLoadMac.mm */; };
</ins><span class="cx">                 8372DB251A674C8F00C697C5 /* WKPageDiagnosticLoggingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 8372DB241A674C8F00C697C5 /* WKPageDiagnosticLoggingClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 8372DB281A67562800C697C5 /* WebPageDiagnosticLoggingClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8372DB261A67562800C697C5 /* WebPageDiagnosticLoggingClient.cpp */; };
</span><span class="cx">                 8372DB291A67562800C697C5 /* WebPageDiagnosticLoggingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 8372DB271A67562800C697C5 /* WebPageDiagnosticLoggingClient.h */; };
</span><span class="lines">@@ -1188,7 +1189,12 @@
</span><span class="cx">                 83891B691A68BEBC0030F386 /* _WKDiagnosticLoggingDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 83891B681A68BEBC0030F386 /* _WKDiagnosticLoggingDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 83891B6C1A68C30B0030F386 /* DiagnosticLoggingClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 83891B6A1A68C30B0030F386 /* DiagnosticLoggingClient.h */; };
</span><span class="cx">                 83891B6D1A68C30B0030F386 /* DiagnosticLoggingClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 83891B6B1A68C30B0030F386 /* DiagnosticLoggingClient.mm */; };
</span><ins>+                839149641BEA838500D2D953 /* NetworkLoadParameters.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 839149621BEA838500D2D953 /* NetworkLoadParameters.cpp */; };
+                839149651BEA838500D2D953 /* NetworkLoadParameters.h in Headers */ = {isa = PBXBuildFile; fileRef = 839149631BEA838500D2D953 /* NetworkLoadParameters.h */; };
+                839902021BE9A02B000F3653 /* NetworkLoad.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 839901FF1BE9A01B000F3653 /* NetworkLoad.cpp */; };
+                839902031BE9A02B000F3653 /* NetworkLoad.h in Headers */ = {isa = PBXBuildFile; fileRef = 839901FE1BE9A01B000F3653 /* NetworkLoad.h */; };
</ins><span class="cx">                 83BDCCB91AC5FDB6003F6441 /* NetworkCacheStatistics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 83BDCCB81AC5FDB6003F6441 /* NetworkCacheStatistics.cpp */; };
</span><ins>+                83D454D71BE9D3C4006C93BD /* NetworkLoadClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 83D454D61BE9D3C4006C93BD /* NetworkLoadClient.h */; };
</ins><span class="cx">                 84477853176FCC0800CDC7BB /* InjectedBundleHitTestResultMediaType.h in Headers */ = {isa = PBXBuildFile; fileRef = 84477851176FCAC100CDC7BB /* InjectedBundleHitTestResultMediaType.h */; };
</span><span class="cx">                 868160D0187645570021E79D /* WindowServerConnection.mm in Sources */ = {isa = PBXBuildFile; fileRef = 868160CF187645370021E79D /* WindowServerConnection.mm */; };
</span><span class="cx">                 86E67A251910B9D100004AB7 /* ProcessThrottler.h in Headers */ = {isa = PBXBuildFile; fileRef = 86E67A21190F411800004AB7 /* ProcessThrottler.h */; };
</span><span class="lines">@@ -3408,6 +3414,7 @@
</span><span class="cx">                 834B25101A842C8700CFB150 /* NetworkCacheStatistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetworkCacheStatistics.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 8360349D1ACB34D600626549 /* WebSQLiteDatabaseTracker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSQLiteDatabaseTracker.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 8360349E1ACB34D600626549 /* WebSQLiteDatabaseTracker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSQLiteDatabaseTracker.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                836EEB7F1BE9EC9E006B4B82 /* NetworkLoadMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NetworkLoadMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 8372DB241A674C8F00C697C5 /* WKPageDiagnosticLoggingClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPageDiagnosticLoggingClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 8372DB261A67562800C697C5 /* WebPageDiagnosticLoggingClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageDiagnosticLoggingClient.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 8372DB271A67562800C697C5 /* WebPageDiagnosticLoggingClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageDiagnosticLoggingClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -3416,7 +3423,12 @@
</span><span class="cx">                 83891B681A68BEBC0030F386 /* _WKDiagnosticLoggingDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKDiagnosticLoggingDelegate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 83891B6A1A68C30B0030F386 /* DiagnosticLoggingClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiagnosticLoggingClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 83891B6B1A68C30B0030F386 /* DiagnosticLoggingClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DiagnosticLoggingClient.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                839149621BEA838500D2D953 /* NetworkLoadParameters.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkLoadParameters.cpp; path = NetworkProcess/NetworkLoadParameters.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                839149631BEA838500D2D953 /* NetworkLoadParameters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkLoadParameters.h; path = NetworkProcess/NetworkLoadParameters.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                839901FE1BE9A01B000F3653 /* NetworkLoad.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkLoad.h; path = NetworkProcess/NetworkLoad.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                839901FF1BE9A01B000F3653 /* NetworkLoad.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkLoad.cpp; path = NetworkProcess/NetworkLoad.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 83BDCCB81AC5FDB6003F6441 /* NetworkCacheStatistics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkCacheStatistics.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                83D454D61BE9D3C4006C93BD /* NetworkLoadClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkLoadClient.h; path = NetworkProcess/NetworkLoadClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 84477851176FCAC100CDC7BB /* InjectedBundleHitTestResultMediaType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundleHitTestResultMediaType.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 868160CD18763D4B0021E79D /* WindowServerConnection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WindowServerConnection.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 868160CF187645370021E79D /* WindowServerConnection.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WindowServerConnection.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5599,6 +5611,11 @@
</span><span class="cx">                                 513A16491630A9BF005D7D22 /* NetworkConnectionToWebProcess.cpp */,
</span><span class="cx">                                 513A164A1630A9BF005D7D22 /* NetworkConnectionToWebProcess.h */,
</span><span class="cx">                                 513A164B1630A9BF005D7D22 /* NetworkConnectionToWebProcess.messages.in */,
</span><ins>+                                839901FF1BE9A01B000F3653 /* NetworkLoad.cpp */,
+                                839901FE1BE9A01B000F3653 /* NetworkLoad.h */,
+                                83D454D61BE9D3C4006C93BD /* NetworkLoadClient.h */,
+                                839149621BEA838500D2D953 /* NetworkLoadParameters.cpp */,
+                                839149631BEA838500D2D953 /* NetworkLoadParameters.h */,
</ins><span class="cx">                                 510CC7DF16138E2900D03ED3 /* NetworkProcess.cpp */,
</span><span class="cx">                                 510CC7E016138E2900D03ED3 /* NetworkProcess.h */,
</span><span class="cx">                                 51A8A6171627F5BB000D90E9 /* NetworkProcess.messages.in */,
</span><span class="lines">@@ -5619,6 +5636,7 @@
</span><span class="cx">                                 E17AE2C116B9C139001C42F1 /* com.apple.WebKit.NetworkProcess.sb.in */,
</span><span class="cx">                                 5167EE9E170377BF007681CA /* NetworkDiskCacheMonitor.h */,
</span><span class="cx">                                 5167EE9F170377BF007681CA /* NetworkDiskCacheMonitor.mm */,
</span><ins>+                                836EEB7F1BE9EC9E006B4B82 /* NetworkLoadMac.mm */,
</ins><span class="cx">                                 51A8A6151627F3F9000D90E9 /* NetworkProcessMac.mm */,
</span><span class="cx">                                 51E3B67E16F266B3009968DC /* NetworkResourceLoaderMac.mm */,
</span><span class="cx">                                 E1B78472163F253E0007B692 /* RemoteNetworkingContext.mm */,
</span><span class="lines">@@ -7643,6 +7661,7 @@
</span><span class="cx">                                 376311FD1A3FB5F7005A2E51 /* _WKSameDocumentNavigationType.h in Headers */,
</span><span class="cx">                                 376311FE1A3FB600005A2E51 /* _WKSameDocumentNavigationTypeInternal.h in Headers */,
</span><span class="cx">                                 1A002D44196B338900B9AD44 /* _WKSessionState.h in Headers */,
</span><ins>+                                839902031BE9A02B000F3653 /* NetworkLoad.h in Headers */,
</ins><span class="cx">                                 1A002D43196B337000B9AD44 /* _WKSessionStateInternal.h in Headers */,
</span><span class="cx">                                 2D6B371B18A967AD0042AE80 /* _WKThumbnailView.h in Headers */,
</span><span class="cx">                                 2DACE64E18ADBFF000E4CA76 /* _WKThumbnailViewInternal.h in Headers */,
</span><span class="lines">@@ -7910,6 +7929,7 @@
</span><span class="cx">                                 1A8EF4CB1252403700F7067F /* PluginControllerProxy.h in Headers */,
</span><span class="cx">                                 1A8EF96F1252AF6B00F7067F /* PluginControllerProxyMessages.h in Headers */,
</span><span class="cx">                                 1A179780137EE82C00F97D45 /* PluginCreationParameters.h in Headers */,
</span><ins>+                                83D454D71BE9D3C4006C93BD /* NetworkLoadClient.h in Headers */,
</ins><span class="cx">                                 7C3F8C91173AF52D007B7F39 /* PluginInformation.h in Headers */,
</span><span class="cx">                                 1AEFCC1211D01F96008219D3 /* PluginInfoStore.h in Headers */,
</span><span class="cx">                                 1A3D610213A7CC2A00F95D4E /* PluginModuleInfo.h in Headers */,
</span><span class="lines">@@ -7962,6 +7982,7 @@
</span><span class="cx">                                 1AAB4A8D1296F0A20023952F /* SandboxExtension.h in Headers */,
</span><span class="cx">                                 E1E552C516AE065F004ED653 /* SandboxInitializationParameters.h in Headers */,
</span><span class="cx">                                 0F931C1C18C5711900DBA7C3 /* ScrollingTreeOverflowScrollingNodeIOS.h in Headers */,
</span><ins>+                                839149651BEA838500D2D953 /* NetworkLoadParameters.h in Headers */,
</ins><span class="cx">                                 51D130541382EAC000351EDD /* SecItemRequestData.h in Headers */,
</span><span class="cx">                                 51D130561382EAC000351EDD /* SecItemResponseData.h in Headers */,
</span><span class="cx">                                 E179088F169BAA6A006904C7 /* SecItemShim.h in Headers */,
</span><span class="lines">@@ -9529,6 +9550,7 @@
</span><span class="cx">                                 BC032DA510F437D10058C15A /* ArgumentDecoder.cpp in Sources */,
</span><span class="cx">                                 BC032DA710F437D10058C15A /* ArgumentEncoder.cpp in Sources */,
</span><span class="cx">                                 C59C4A5818B81174007BDCB6 /* AssistedNodeInformation.cpp in Sources */,
</span><ins>+                                839902021BE9A02B000F3653 /* NetworkLoad.cpp in Sources */,
</ins><span class="cx">                                 515E7727183DD6F60007203F /* AsyncRequest.cpp in Sources */,
</span><span class="cx">                                 BCEE966C112FAF57006BCC24 /* Attachment.cpp in Sources */,
</span><span class="cx">                                 E1A31735134CEA80007C9A4F /* AttributedString.mm in Sources */,
</span><span class="lines">@@ -9547,6 +9569,7 @@
</span><span class="cx">                                 9F54F88F16488E87007DF81A /* ChildProcessMac.mm in Sources */,
</span><span class="cx">                                 51FAEC3B1B0657680009C4E7 /* ChildProcessMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 E1513C66166EABB200149FCB /* ChildProcessProxy.cpp in Sources */,
</span><ins>+                                839149641BEA838500D2D953 /* NetworkLoadParameters.cpp in Sources */,
</ins><span class="cx">                                 1A2A4B0E1586A2240090C9E9 /* ColorSpaceData.mm in Sources */,
</span><span class="cx">                                 1A6F9FB711E1408500DB1371 /* CommandLinePOSIX.cpp in Sources */,
</span><span class="cx">                                 37BEC4E019491486008B4286 /* CompletionHandlerCallChecker.mm in Sources */,
</span><span class="lines">@@ -9841,6 +9864,7 @@
</span><span class="cx">                                 4A3CC18C19B0641500D14AEF /* UserMediaPermissionRequestProxy.cpp in Sources */,
</span><span class="cx">                                 E4E864921B16750100C82F40 /* VersionChecks.mm in Sources */,
</span><span class="cx">                                 2DAF4FFB1B636181006013D6 /* ViewGestureController.cpp in Sources */,
</span><ins>+                                836EEB801BE9EC9E006B4B82 /* NetworkLoadMac.mm in Sources */,
</ins><span class="cx">                                 2DF9593B18A42412009785A1 /* ViewGestureControllerIOS.mm in Sources */,
</span><span class="cx">                                 2D125C5F1857EA05003BA3CB /* ViewGestureControllerMac.mm in Sources */,
</span><span class="cx">                                 2D1B5D5D185869C8006C6596 /* ViewGestureControllerMessageReceiver.cpp in Sources */,
</span></span></pre>
</div>
</div>

</body>
</html>