<!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>[173115] 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/173115">173115</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2014-08-29 11:15:04 -0700 (Fri, 29 Aug 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove NetworkResourceLoaderClient and subclasses.
https://bugs.webkit.org/show_bug.cgi?id=136370

Reviewed by Darin Adler.

This code is needlessly abstract. Move what logic these classes have to NetworkResourceLoader.

* NetworkProcess/AsynchronousNetworkLoaderClient.cpp: Removed.
* NetworkProcess/AsynchronousNetworkLoaderClient.h: Removed.
* NetworkProcess/NetworkLoaderClient.h: Removed.
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::NetworkResourceLoader):
(WebKit::NetworkResourceLoader::~NetworkResourceLoader):
(WebKit::NetworkResourceLoader::isSynchronous):
(WebKit::NetworkResourceLoader::didReceiveResponseAsync):
(WebKit::NetworkResourceLoader::didReceiveBuffer):
(WebKit::NetworkResourceLoader::didFinishLoading):
(WebKit::NetworkResourceLoader::didFail):
(WebKit::NetworkResourceLoader::willSendRequestAsync):
(WebKit::NetworkResourceLoader::didSendData):
(WebKit::NetworkResourceLoader::sendBuffer):
(WebKit::NetworkResourceLoader::sendReplyToSynchronousRequest):
(WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
* NetworkProcess/NetworkResourceLoader.h:
(WebKit::NetworkResourceLoader::SynchronousLoadData::SynchronousLoadData):
* NetworkProcess/SynchronousNetworkLoaderClient.cpp: Removed.
* NetworkProcess/SynchronousNetworkLoaderClient.h: Removed.
* 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="#trunkSourceWebKit2NetworkProcessNetworkResourceLoadercpp">trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkResourceLoaderh">trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2NetworkProcessAsynchronousNetworkLoaderClientcpp">trunk/Source/WebKit2/NetworkProcess/AsynchronousNetworkLoaderClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessAsynchronousNetworkLoaderClienth">trunk/Source/WebKit2/NetworkProcess/AsynchronousNetworkLoaderClient.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkLoaderClienth">trunk/Source/WebKit2/NetworkProcess/NetworkLoaderClient.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessSynchronousNetworkLoaderClientcpp">trunk/Source/WebKit2/NetworkProcess/SynchronousNetworkLoaderClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessSynchronousNetworkLoaderClienth">trunk/Source/WebKit2/NetworkProcess/SynchronousNetworkLoaderClient.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2CMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/CMakeLists.txt (173114 => 173115)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/CMakeLists.txt        2014-08-29 17:55:34 UTC (rev 173114)
+++ trunk/Source/WebKit2/CMakeLists.txt        2014-08-29 18:15:04 UTC (rev 173115)
</span><span class="lines">@@ -145,13 +145,11 @@
</span><span class="cx"> endif ()
</span><span class="cx"> 
</span><span class="cx"> set(WebKit2_SOURCES
</span><del>-    NetworkProcess/AsynchronousNetworkLoaderClient.cpp
</del><span class="cx">     NetworkProcess/NetworkConnectionToWebProcess.cpp
</span><span class="cx">     NetworkProcess/NetworkProcess.cpp
</span><span class="cx">     NetworkProcess/NetworkProcessPlatformStrategies.cpp
</span><span class="cx">     NetworkProcess/NetworkResourceLoadScheduler.cpp
</span><span class="cx">     NetworkProcess/NetworkResourceLoader.cpp
</span><del>-    NetworkProcess/SynchronousNetworkLoaderClient.cpp
</del><span class="cx"> 
</span><span class="cx">     NetworkProcess/FileAPI/NetworkBlobRegistry.cpp
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (173114 => 173115)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-08-29 17:55:34 UTC (rev 173114)
+++ trunk/Source/WebKit2/ChangeLog        2014-08-29 18:15:04 UTC (rev 173115)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2014-08-29  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        Remove NetworkResourceLoaderClient and subclasses.
+        https://bugs.webkit.org/show_bug.cgi?id=136370
+
+        Reviewed by Darin Adler.
+
+        This code is needlessly abstract. Move what logic these classes have to NetworkResourceLoader.
+
+        * NetworkProcess/AsynchronousNetworkLoaderClient.cpp: Removed.
+        * NetworkProcess/AsynchronousNetworkLoaderClient.h: Removed.
+        * NetworkProcess/NetworkLoaderClient.h: Removed.
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        (WebKit::NetworkResourceLoader::NetworkResourceLoader):
+        (WebKit::NetworkResourceLoader::~NetworkResourceLoader):
+        (WebKit::NetworkResourceLoader::isSynchronous):
+        (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
+        (WebKit::NetworkResourceLoader::didReceiveBuffer):
+        (WebKit::NetworkResourceLoader::didFinishLoading):
+        (WebKit::NetworkResourceLoader::didFail):
+        (WebKit::NetworkResourceLoader::willSendRequestAsync):
+        (WebKit::NetworkResourceLoader::didSendData):
+        (WebKit::NetworkResourceLoader::sendBuffer):
+        (WebKit::NetworkResourceLoader::sendReplyToSynchronousRequest):
+        (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync):
+        * NetworkProcess/NetworkResourceLoader.h:
+        (WebKit::NetworkResourceLoader::SynchronousLoadData::SynchronousLoadData):
+        * NetworkProcess/SynchronousNetworkLoaderClient.cpp: Removed.
+        * NetworkProcess/SynchronousNetworkLoaderClient.h: Removed.
+        * WebKit2.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2014-08-29  Csaba Osztrogonác  &lt;ossy@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviwed, remove empty directories.
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessAsynchronousNetworkLoaderClientcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/NetworkProcess/AsynchronousNetworkLoaderClient.cpp (173114 => 173115)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/AsynchronousNetworkLoaderClient.cpp        2014-08-29 17:55:34 UTC (rev 173114)
+++ trunk/Source/WebKit2/NetworkProcess/AsynchronousNetworkLoaderClient.cpp        2014-08-29 18:15:04 UTC (rev 173115)
</span><span class="lines">@@ -1,99 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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;
-#include &quot;AsynchronousNetworkLoaderClient.h&quot;
-
-#include &quot;DataReference.h&quot;
-#include &quot;NetworkResourceLoader.h&quot;
-#include &quot;WebCoreArgumentCoders.h&quot;
-#include &quot;WebResourceLoaderMessages.h&quot;
-#include &lt;WebCore/CertificateInfo.h&gt;
-#include &lt;WebCore/ResourceError.h&gt;
-#include &lt;WebCore/SharedBuffer.h&gt;
-#include &lt;wtf/CurrentTime.h&gt;
-
-#if ENABLE(NETWORK_PROCESS)
-
-using namespace WebCore;
-
-namespace WebKit {
-
-AsynchronousNetworkLoaderClient::AsynchronousNetworkLoaderClient()
-{
-}
-
-void AsynchronousNetworkLoaderClient::willSendRequest(NetworkResourceLoader* loader, ResourceRequest&amp; request, const ResourceResponse&amp; redirectResponse)
-{
-    loader-&gt;sendAbortingOnFailure(Messages::WebResourceLoader::WillSendRequest(request, redirectResponse));
-}
-
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-void AsynchronousNetworkLoaderClient::canAuthenticateAgainstProtectionSpace(NetworkResourceLoader* loader, const ProtectionSpace&amp; protectionSpace)
-{
-    loader-&gt;sendAbortingOnFailure(Messages::WebResourceLoader::CanAuthenticateAgainstProtectionSpace(protectionSpace));
-}
-#endif
-
-void AsynchronousNetworkLoaderClient::didReceiveResponse(NetworkResourceLoader* loader, const ResourceResponse&amp; response)
-{
-    loader-&gt;sendAbortingOnFailure(Messages::WebResourceLoader::DidReceiveResponseWithCertificateInfo(response, CertificateInfo(response), loader-&gt;isLoadingMainResource()));
-}
-
-void AsynchronousNetworkLoaderClient::didReceiveBuffer(NetworkResourceLoader* loader, SharedBuffer* buffer, int encodedDataLength)
-{
-#if PLATFORM(IOS) || (PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090)
-    ShareableResource::Handle shareableResourceHandle;
-    NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer(shareableResourceHandle, buffer);
-    if (!shareableResourceHandle.isNull()) {
-        // Since we're delivering this resource by ourselves all at once and don't need anymore data or callbacks from the network layer, abort the loader.
-        loader-&gt;abort();
-        loader-&gt;send(Messages::WebResourceLoader::DidReceiveResource(shareableResourceHandle, currentTime()));
-        return;
-    }
-#endif // __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090
-
-    IPC::SharedBufferDataReference dataReference(buffer);
-    loader-&gt;sendAbortingOnFailure(Messages::WebResourceLoader::DidReceiveData(dataReference, encodedDataLength));
-}
-
-void AsynchronousNetworkLoaderClient::didSendData(NetworkResourceLoader* loader, unsigned long long bytesSent, unsigned long long totalBytesToBeSent)
-{
-    loader-&gt;send(Messages::WebResourceLoader::DidSendData(bytesSent, totalBytesToBeSent));
-}
-
-void AsynchronousNetworkLoaderClient::didFinishLoading(NetworkResourceLoader* loader, double finishTime)
-{
-    loader-&gt;send(Messages::WebResourceLoader::DidFinishResourceLoad(finishTime));
-}
-
-void AsynchronousNetworkLoaderClient::didFail(NetworkResourceLoader* loader, const ResourceError&amp; error)
-{
-    loader-&gt;send(Messages::WebResourceLoader::DidFailResourceLoad(error));
-}
-
-} // namespace WebKit
-
-#endif // ENABLE(NETWORK_PROCESS)
</del></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessAsynchronousNetworkLoaderClienth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/NetworkProcess/AsynchronousNetworkLoaderClient.h (173114 => 173115)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/AsynchronousNetworkLoaderClient.h        2014-08-29 17:55:34 UTC (rev 173114)
+++ trunk/Source/WebKit2/NetworkProcess/AsynchronousNetworkLoaderClient.h        2014-08-29 18:15:04 UTC (rev 173115)
</span><span class="lines">@@ -1,56 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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 AsynchronousNetworkLoaderClient_h
-#define AsynchronousNetworkLoaderClient_h
-
-#include &quot;NetworkLoaderClient.h&quot;
-#include &quot;ShareableResource.h&quot;
-
-#if ENABLE(NETWORK_PROCESS)
-
-namespace WebKit {
-
-class AsynchronousNetworkLoaderClient : public NetworkLoaderClient {
-public:
-    AsynchronousNetworkLoaderClient();
-
-private:
-    virtual void willSendRequest(NetworkResourceLoader*, WebCore::ResourceRequest&amp; newRequest, const WebCore::ResourceResponse&amp; redirectResponse) override;
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    virtual void canAuthenticateAgainstProtectionSpace(NetworkResourceLoader*, const WebCore::ProtectionSpace&amp;) override;
-#endif
-    virtual void didReceiveResponse(NetworkResourceLoader*, const WebCore::ResourceResponse&amp;) override;
-    virtual void didReceiveBuffer(NetworkResourceLoader*, WebCore::SharedBuffer*, int encodedDataLength) override;
-    virtual void didSendData(NetworkResourceLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override;
-    virtual void didFinishLoading(NetworkResourceLoader*, double finishTime) override;
-    virtual void didFail(NetworkResourceLoader*, const WebCore::ResourceError&amp;) override;
-};
-
-} // namespace WebKit
-
-#endif // ENABLE(NETWORK_PROCESS)
-
-#endif // AsynchronousNetworkLoaderClient_h
</del></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkLoaderClienth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/NetworkProcess/NetworkLoaderClient.h (173114 => 173115)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkLoaderClient.h        2014-08-29 17:55:34 UTC (rev 173114)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkLoaderClient.h        2014-08-29 18:15:04 UTC (rev 173115)
</span><span class="lines">@@ -1,69 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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 NetworkLoaderClient_h
-#define NetworkLoaderClient_h
-
-#include &lt;wtf/RefCounted.h&gt;
-
-#if ENABLE(NETWORK_PROCESS)
-
-namespace WebCore {
-class ProtectionSpace;
-class ResourceError;
-class ResourceRequest;
-class ResourceResponse;
-class SharedBuffer;
-}
-
-namespace WebKit {
-
-class NetworkResourceLoader;
-
-class NetworkLoaderClient {
-public:
-    virtual ~NetworkLoaderClient() { }
-
-    virtual void willSendRequest(NetworkResourceLoader*, WebCore::ResourceRequest&amp; newRequest, const WebCore::ResourceResponse&amp; redirectResponse) = 0;
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    virtual void canAuthenticateAgainstProtectionSpace(NetworkResourceLoader*, const WebCore::ProtectionSpace&amp;) = 0;
-#endif
-    virtual void didReceiveResponse(NetworkResourceLoader*, const WebCore::ResourceResponse&amp;) = 0;
-    virtual void didReceiveBuffer(NetworkResourceLoader*, WebCore::SharedBuffer*, int encodedDataLength) = 0;
-    virtual void didSendData(NetworkResourceLoader*, unsigned long long bytesSent, unsigned long long totalBytesToBeSent) = 0;
-    virtual void didFinishLoading(NetworkResourceLoader*, double finishTime) = 0;
-    virtual void didFail(NetworkResourceLoader*, const WebCore::ResourceError&amp;) = 0;
-
-    virtual bool isSynchronous() { return false; }
-
-protected:
-    NetworkLoaderClient() { }
-};
-
-} // namespace WebKit
-
-#endif // ENABLE(NETWORK_PROCESS)
-
-#endif // NetworkLoaderClient_h
</del></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp (173114 => 173115)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2014-08-29 17:55:34 UTC (rev 173114)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp        2014-08-29 18:15:04 UTC (rev 173115)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETWORK_PROCESS)
</span><span class="cx"> 
</span><del>-#include &quot;AsynchronousNetworkLoaderClient.h&quot;
</del><span class="cx"> #include &quot;AuthenticationManager.h&quot;
</span><span class="cx"> #include &quot;DataReference.h&quot;
</span><span class="cx"> #include &quot;Logging.h&quot;
</span><span class="lines">@@ -40,21 +39,50 @@
</span><span class="cx"> #include &quot;RemoteNetworkingContext.h&quot;
</span><span class="cx"> #include &quot;ShareableResource.h&quot;
</span><span class="cx"> #include &quot;SharedMemory.h&quot;
</span><del>-#include &quot;SynchronousNetworkLoaderClient.h&quot;
</del><span class="cx"> #include &quot;WebCoreArgumentCoders.h&quot;
</span><span class="cx"> #include &quot;WebErrors.h&quot;
</span><span class="cx"> #include &quot;WebResourceLoaderMessages.h&quot;
</span><span class="cx"> #include &lt;WebCore/BlobDataFileReference.h&gt;
</span><ins>+#include &lt;WebCore/CertificateInfo.h&gt;
</ins><span class="cx"> #include &lt;WebCore/NotImplemented.h&gt;
</span><span class="cx"> #include &lt;WebCore/ResourceBuffer.h&gt;
</span><span class="cx"> #include &lt;WebCore/ResourceHandle.h&gt;
</span><span class="cx"> #include &lt;WebCore/SharedBuffer.h&gt;
</span><ins>+#include &lt;WebCore/SynchronousLoaderClient.h&gt;
+#include &lt;wtf/CurrentTime.h&gt;
</ins><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><ins>+struct NetworkResourceLoader::SynchronousLoadData {
+        SynchronousLoadData(WebCore::ResourceRequest&amp; request, PassRefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt; reply)
+        : m_originalRequest(request)
+        , m_delayedReply(reply)
+    {
+        ASSERT(m_delayedReply);
+    }
+    WebCore::ResourceRequest m_originalRequest;
+    WebCore::ResourceRequest m_currentRequest;
+    RefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt; m_delayedReply;
+    WebCore::ResourceResponse m_response;
+    WebCore::ResourceError m_error;
+};
+
+static void sendReplyToSynchronousRequest(NetworkResourceLoader::SynchronousLoadData&amp; data, WebCore::SharedBuffer* buffer)
+{
+    ASSERT(data.m_delayedReply);
+    ASSERT(!data.m_response.isNull() || !data.m_error.isNull());
+
+    Vector&lt;char&gt; responseBuffer;
+    if (buffer &amp;&amp; buffer-&gt;size())
+        responseBuffer.append(buffer-&gt;data(), buffer-&gt;size());
+
+    data.m_delayedReply-&gt;send(data.m_error, data.m_response, responseBuffer);
+    data.m_delayedReply = nullptr;
+}
+
</ins><span class="cx"> NetworkResourceLoader::NetworkResourceLoader(const NetworkResourceLoadParameters&amp; parameters, NetworkConnectionToWebProcess* connection, PassRefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt; reply)
</span><span class="cx">     : m_bytesReceived(0)
</span><span class="cx">     , m_handleConvertedToDownload(false)
</span><span class="lines">@@ -103,20 +131,19 @@
</span><span class="cx">         m_bufferedData = WebCore::SharedBuffer::create();
</span><span class="cx"> 
</span><span class="cx">     if (reply)
</span><del>-        m_networkLoaderClient = std::make_unique&lt;SynchronousNetworkLoaderClient&gt;(m_request, reply);
-    else
-        m_networkLoaderClient = std::make_unique&lt;AsynchronousNetworkLoaderClient&gt;();
</del><ins>+        m_synchronousLoadData = std::make_unique&lt;SynchronousLoadData&gt;(m_request, reply);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> NetworkResourceLoader::~NetworkResourceLoader()
</span><span class="cx"> {
</span><span class="cx">     ASSERT(RunLoop::isMain());
</span><span class="cx">     ASSERT(!m_handle);
</span><ins>+    ASSERT(!isSynchronous() || !m_synchronousLoadData-&gt;m_delayedReply);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool NetworkResourceLoader::isSynchronous() const
</span><span class="cx"> {
</span><del>-    return m_networkLoaderClient-&gt;isSynchronous();
</del><ins>+    return !!m_synchronousLoadData;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::start()
</span><span class="lines">@@ -189,9 +216,12 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT_UNUSED(handle, handle == m_handle);
</span><span class="cx"> 
</span><del>-    m_networkLoaderClient-&gt;didReceiveResponse(this, response);
</del><ins>+    if (isSynchronous())
+        m_synchronousLoadData-&gt;m_response = response;
+    else
+        sendAbortingOnFailure(Messages::WebResourceLoader::DidReceiveResponseWithCertificateInfo(response, CertificateInfo(response), isLoadingMainResource()));
</ins><span class="cx"> 
</span><del>-    // m_handle will be 0 if the request got aborted above.
</del><ins>+    // m_handle will be null if the request got aborted above.
</ins><span class="cx">     if (!m_handle)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -212,26 +242,26 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT_UNUSED(handle, handle == m_handle);
</span><span class="cx"> 
</span><del>-    // FIXME (NetworkProcess): For the memory cache we'll also need to cache the response data here.
-    // Such buffering will need to be thread safe, as this callback is happening on a background thread.
-    
</del><span class="cx">     m_bytesReceived += buffer-&gt;size();
</span><del>-    if (m_bufferedData)
</del><ins>+    if (m_bufferedData) {
</ins><span class="cx">         m_bufferedData-&gt;append(buffer.get());
</span><del>-    else
-        m_networkLoaderClient-&gt;didReceiveBuffer(this, buffer.get(), encodedDataLength);
</del><ins>+        return;
+    }
+    sendBuffer(buffer.get(), encodedDataLength);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::didFinishLoading(ResourceHandle* handle, double finishTime)
</span><span class="cx"> {
</span><span class="cx">     ASSERT_UNUSED(handle, handle == m_handle);
</span><span class="cx"> 
</span><del>-    // Send the full resource data if we were buffering it.
-    if (m_bufferedData &amp;&amp; m_bufferedData-&gt;size())
-        m_networkLoaderClient-&gt;didReceiveBuffer(this, m_bufferedData.get(), m_bufferedData-&gt;size());
</del><ins>+    if (isSynchronous())
+        sendReplyToSynchronousRequest(*m_synchronousLoadData, m_bufferedData.get());
+    else {
+        if (m_bufferedData &amp;&amp; m_bufferedData-&gt;size())
+            sendBuffer(m_bufferedData.get(), m_bufferedData-&gt;size());
+        send(Messages::WebResourceLoader::DidFinishResourceLoad(finishTime));
+    }
</ins><span class="cx"> 
</span><del>-    m_networkLoaderClient-&gt;didFinishLoading(this, finishTime);
-
</del><span class="cx">     cleanup();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -239,7 +269,11 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT_UNUSED(handle, handle == m_handle);
</span><span class="cx"> 
</span><del>-    m_networkLoaderClient-&gt;didFail(this, error);
</del><ins>+    if (isSynchronous()) {
+        m_synchronousLoadData-&gt;m_error = error;
+        sendReplyToSynchronousRequest(*m_synchronousLoadData, nullptr);
+    } else
+        send(Messages::WebResourceLoader::DidFailResourceLoad(error));
</ins><span class="cx"> 
</span><span class="cx">     cleanup();
</span><span class="cx"> }
</span><span class="lines">@@ -252,10 +286,22 @@
</span><span class="cx">     ASSERT(!redirectResponse.isNull());
</span><span class="cx">     ASSERT(RunLoop::isMain());
</span><span class="cx"> 
</span><del>-    ResourceRequest proposedRequest = request;
</del><span class="cx">     m_suggestedRequestForWillSendRequest = request;
</span><span class="cx"> 
</span><del>-    m_networkLoaderClient-&gt;willSendRequest(this, proposedRequest, redirectResponse);
</del><ins>+    if (isSynchronous()) {
+        // FIXME: This needs to be fixed to follow the redirect correctly even for cross-domain requests.
+        // This includes at least updating host records, and comparing the current request instead of the original request here.
+        if (protocolHostAndPortAreEqual(m_synchronousLoadData-&gt;m_originalRequest.url(), request.url()))
+            m_synchronousLoadData-&gt;m_currentRequest = request;
+        else {
+            ASSERT(m_synchronousLoadData-&gt;m_error.isNull());
+            m_synchronousLoadData-&gt;m_error = SynchronousLoaderClient::platformBadResponseError();
+            m_synchronousLoadData-&gt;m_currentRequest = ResourceRequest();
+        }
+        continueWillSendRequest(m_synchronousLoadData-&gt;m_currentRequest);
+        return;
+    }
+    sendAbortingOnFailure(Messages::WebResourceLoader::WillSendRequest(request, redirectResponse));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::continueWillSendRequest(const ResourceRequest&amp; newRequest)
</span><span class="lines">@@ -292,7 +338,8 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT_UNUSED(handle, handle == m_handle);
</span><span class="cx"> 
</span><del>-    m_networkLoaderClient-&gt;didSendData(this, bytesSent, totalBytesToBeSent);
</del><ins>+    if (!isSynchronous())
+        send(Messages::WebResourceLoader::DidSendData(bytesSent, totalBytesToBeSent));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::wasBlocked(ResourceHandle* handle)
</span><span class="lines">@@ -352,6 +399,24 @@
</span><span class="cx">     didFail(m_handle.get(), cancelledError(m_request));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void NetworkResourceLoader::sendBuffer(WebCore::SharedBuffer* buffer, int encodedDataLength)
+{
+    ASSERT(!isSynchronous());
+
+#if PLATFORM(IOS) || (PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 1090)
+    ShareableResource::Handle shareableResourceHandle;
+    NetworkResourceLoader::tryGetShareableHandleFromSharedBuffer(shareableResourceHandle, buffer);
+    if (!shareableResourceHandle.isNull()) {
+        // Since we're delivering this resource by ourselves all at once and don't need anymore data or callbacks from the network layer, abort the loader.
+        abort();
+        send(Messages::WebResourceLoader::DidReceiveResource(shareableResourceHandle, currentTime()));
+        return;
+    }
+#endif
+    IPC::SharedBufferDataReference dataReference(buffer);
+    sendAbortingOnFailure(Messages::WebResourceLoader::DidReceiveData(dataReference, encodedDataLength));
+}
+
</ins><span class="cx"> IPC::Connection* NetworkResourceLoader::messageSenderConnection()
</span><span class="cx"> {
</span><span class="cx">     return connectionToWebProcess()-&gt;connection();
</span><span class="lines">@@ -395,14 +460,20 @@
</span><span class="cx">     ASSERT(RunLoop::isMain());
</span><span class="cx">     ASSERT_UNUSED(handle, handle == m_handle);
</span><span class="cx"> 
</span><del>-    m_networkLoaderClient-&gt;canAuthenticateAgainstProtectionSpace(this, protectionSpace);
</del><ins>+    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;
+    }
+    sendAbortingOnFailure(Messages::WebResourceLoader::CanAuthenticateAgainstProtectionSpace(protectionSpace));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkResourceLoader::continueCanAuthenticateAgainstProtectionSpace(bool result)
</span><span class="cx"> {
</span><span class="cx">     m_handle-&gt;continueCanAuthenticateAgainstProtectionSpace(result);
</span><span class="cx"> }
</span><del>-
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkResourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h (173114 => 173115)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h        2014-08-29 17:55:34 UTC (rev 173114)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkResourceLoader.h        2014-08-29 18:15:04 UTC (rev 173115)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2012 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2012-2014 Apple Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * Redistribution and use in source and binary forms, with or without
</span><span class="cx">  * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -32,9 +32,11 @@
</span><span class="cx"> #include &quot;NetworkConnectionToWebProcessMessages.h&quot;
</span><span class="cx"> #include &quot;NetworkResourceLoadParameters.h&quot;
</span><span class="cx"> #include &quot;ShareableResource.h&quot;
</span><ins>+#include &lt;WebCore/ResourceError.h&gt;
</ins><span class="cx"> #include &lt;WebCore/ResourceHandleClient.h&gt;
</span><span class="cx"> #include &lt;WebCore/ResourceLoaderOptions.h&gt;
</span><span class="cx"> #include &lt;WebCore/ResourceRequest.h&gt;
</span><ins>+#include &lt;WebCore/ResourceResponse.h&gt;
</ins><span class="cx"> #include &lt;WebCore/SessionID.h&gt;
</span><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> #include &lt;wtf/RunLoop.h&gt;
</span><span class="lines">@@ -51,7 +53,6 @@
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> class NetworkConnectionToWebProcess;
</span><del>-class NetworkLoaderClient;
</del><span class="cx"> class NetworkResourceLoadParameters;
</span><span class="cx"> class RemoteNetworkingContext;
</span><span class="cx"> class SandboxExtension;
</span><span class="lines">@@ -145,6 +146,8 @@
</span><span class="cx"> 
</span><span class="cx">     WebCore::SharedBuffer* bufferedData() const { return m_bufferedData.get(); }
</span><span class="cx"> 
</span><ins>+    struct SynchronousLoadData;
+
</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">@@ -158,6 +161,8 @@
</span><span class="cx">     
</span><span class="cx">     void platformDidReceiveResponse(const WebCore::ResourceResponse&amp;);
</span><span class="cx"> 
</span><ins>+    void sendBuffer(WebCore::SharedBuffer*, int encodedDataLength);
+
</ins><span class="cx">     void consumeSandboxExtensions();
</span><span class="cx">     void invalidateSandboxExtensions();
</span><span class="cx"> 
</span><span class="lines">@@ -170,8 +175,9 @@
</span><span class="cx">     uint64_t m_bytesReceived;
</span><span class="cx"> 
</span><span class="cx">     bool m_handleConvertedToDownload;
</span><del>-    std::unique_ptr&lt;NetworkLoaderClient&gt; m_networkLoaderClient;
</del><span class="cx"> 
</span><ins>+    std::unique_ptr&lt;SynchronousLoadData&gt; m_synchronousLoadData;
+
</ins><span class="cx">     ResourceLoadIdentifier m_identifier;
</span><span class="cx">     uint64_t m_webPageID;
</span><span class="cx">     uint64_t m_webFrameID;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessSynchronousNetworkLoaderClientcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/NetworkProcess/SynchronousNetworkLoaderClient.cpp (173114 => 173115)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/SynchronousNetworkLoaderClient.cpp        2014-08-29 17:55:34 UTC (rev 173114)
+++ trunk/Source/WebKit2/NetworkProcess/SynchronousNetworkLoaderClient.cpp        2014-08-29 18:15:04 UTC (rev 173115)
</span><span class="lines">@@ -1,121 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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;
-#include &quot;SynchronousNetworkLoaderClient.h&quot;
-
-#if ENABLE(NETWORK_PROCESS)
-
-#include &quot;DataReference.h&quot;
-#include &quot;NetworkResourceLoader.h&quot;
-#include &quot;WebErrors.h&quot;
-#include &lt;WebCore/ResourceRequest.h&gt;
-#include &lt;WebCore/SharedBuffer.h&gt;
-#include &lt;WebCore/SynchronousLoaderClient.h&gt;
-
-using namespace WebCore;
-
-namespace WebKit {
-
-SynchronousNetworkLoaderClient::SynchronousNetworkLoaderClient(const ResourceRequest&amp; request, PassRefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt; reply)
-    : m_originalRequest(request)
-    , m_delayedReply(reply)
-{
-    ASSERT(m_delayedReply);
-}
-
-SynchronousNetworkLoaderClient::~SynchronousNetworkLoaderClient()
-{
-    // By the time a SynchronousNetworkLoaderClient is being destroyed, it must always have sent its reply to the WebProcess.
-    ASSERT(!m_delayedReply);
-}
-
-void SynchronousNetworkLoaderClient::willSendRequest(NetworkResourceLoader* loader, ResourceRequest&amp; proposedRequest, const ResourceResponse&amp; /* redirectResponse */)
-{
-    // FIXME: This needs to be fixed to follow the redirect correctly even for cross-domain requests.
-    // This includes at least updating host records, and comparing the current request instead of the original request here.
-    if (!protocolHostAndPortAreEqual(m_originalRequest.url(), proposedRequest.url())) {
-        ASSERT(m_error.isNull());
-        m_error = SynchronousLoaderClient::platformBadResponseError();
-        proposedRequest = ResourceRequest();
-    }
-    
-    m_currentRequest = proposedRequest;
-    loader-&gt;continueWillSendRequest(m_currentRequest);
-}
-
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-void SynchronousNetworkLoaderClient::canAuthenticateAgainstProtectionSpace(NetworkResourceLoader* loader, const ProtectionSpace&amp;)
-{
-    // 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.
-    loader-&gt;continueCanAuthenticateAgainstProtectionSpace(true);
-}
-#endif
-
-void SynchronousNetworkLoaderClient::didReceiveResponse(NetworkResourceLoader*, const ResourceResponse&amp; response)
-{
-    m_response = response;
-}
-
-void SynchronousNetworkLoaderClient::didReceiveBuffer(NetworkResourceLoader*, SharedBuffer*, int /* encodedDataLength */)
-{
-    // Nothing to do here. Data is buffered in NetworkResourceLoader and we will grab it from there
-    // in sendDelayedReply().
-}
-
-void SynchronousNetworkLoaderClient::didFinishLoading(NetworkResourceLoader* loader, double /* finishTime */)
-{
-    sendDelayedReply(*loader);
-}
-
-void SynchronousNetworkLoaderClient::didFail(NetworkResourceLoader* loader, const ResourceError&amp; error)
-{
-    m_error = error;
-    sendDelayedReply(*loader);
-}
-
-void SynchronousNetworkLoaderClient::sendDelayedReply(NetworkResourceLoader&amp; loader)
-{
-    ASSERT(m_delayedReply);
-
-    if (m_response.isNull()) {
-        ASSERT(!m_error.isNull());
-        //platformSynthesizeErrorResponse();
-    }
-
-    Vector&lt;char&gt; responseData;
-    SharedBuffer* buffer = loader.bufferedData();
-    if (buffer &amp;&amp; buffer-&gt;size())
-        responseData.append(buffer-&gt;data(), buffer-&gt;size());
-
-    m_delayedReply-&gt;send(m_error, m_response, responseData);
-    m_delayedReply = nullptr;
-}
-
-} // namespace WebKit
-
-#endif // ENABLE(NETWORK_PROCESS)
</del></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessSynchronousNetworkLoaderClienth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/NetworkProcess/SynchronousNetworkLoaderClient.h (173114 => 173115)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/SynchronousNetworkLoaderClient.h        2014-08-29 17:55:34 UTC (rev 173114)
+++ trunk/Source/WebKit2/NetworkProcess/SynchronousNetworkLoaderClient.h        2014-08-29 18:15:04 UTC (rev 173115)
</span><span class="lines">@@ -1,76 +0,0 @@
</span><del>-/*
- * Copyright (C) 2013 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 SynchronousNetworkLoaderClient_h
-#define SynchronousNetworkLoaderClient_h
-
-#include &quot;NetworkConnectionToWebProcessMessages.h&quot;
-#include &quot;NetworkLoaderClient.h&quot;
-#include &lt;WebCore/ResourceError.h&gt;
-#include &lt;WebCore/ResourceRequest.h&gt;
-#include &lt;WebCore/ResourceResponse.h&gt;
-#include &lt;memory&gt;
-#include &lt;wtf/RefCounted.h&gt;
-
-#if ENABLE(NETWORK_PROCESS)
-
-namespace WebCore {
-class SharedBuffer;
-}
-
-namespace WebKit {
-
-class SynchronousNetworkLoaderClient : public NetworkLoaderClient {
-public:
-    SynchronousNetworkLoaderClient(const WebCore::ResourceRequest&amp; originalRequest, PassRefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt;);
-    virtual ~SynchronousNetworkLoaderClient() override;
-
-    virtual bool isSynchronous() override { return true; }
-
-private:
-    virtual void willSendRequest(NetworkResourceLoader*, WebCore::ResourceRequest&amp; proposedRequest, const WebCore::ResourceResponse&amp; redirectResponse) override;
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    virtual void canAuthenticateAgainstProtectionSpace(NetworkResourceLoader*, const WebCore::ProtectionSpace&amp;) override;
-#endif
-    virtual void didReceiveResponse(NetworkResourceLoader*, const WebCore::ResourceResponse&amp;) override;
-    virtual void didReceiveBuffer(NetworkResourceLoader*, WebCore::SharedBuffer*, int encodedDataLength) override;
-    virtual void didSendData(NetworkResourceLoader*, unsigned long long /* bytesSent */, unsigned long long /* totalBytesToBeSent */) override { }
-    virtual void didFinishLoading(NetworkResourceLoader*, double finishTime) override;
-    virtual void didFail(NetworkResourceLoader*, const WebCore::ResourceError&amp;) override;
-
-    void sendDelayedReply(NetworkResourceLoader&amp;);
-
-    WebCore::ResourceRequest m_originalRequest;
-    WebCore::ResourceRequest m_currentRequest;
-    RefPtr&lt;Messages::NetworkConnectionToWebProcess::PerformSynchronousLoad::DelayedReply&gt; m_delayedReply;
-    WebCore::ResourceResponse m_response;
-    WebCore::ResourceError m_error;
-};
-
-} // namespace WebKit
-
-#endif // ENABLE(NETWORK_PROCESS)
-
-#endif // SynchronousNetworkLoaderClient_h
</del></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (173114 => 173115)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-08-29 17:55:34 UTC (rev 173114)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2014-08-29 18:15:04 UTC (rev 173115)
</span><span class="lines">@@ -994,11 +994,6 @@
</span><span class="cx">                 51FA2D7415212DF100C1BA0B /* InjectedBundleDOMWindowExtension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FA2D5C15211A5000C1BA0B /* InjectedBundleDOMWindowExtension.cpp */; };
</span><span class="cx">                 51FA2D7715212E2600C1BA0B /* WKBundleDOMWindowExtension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FA2D7515212E1E00C1BA0B /* WKBundleDOMWindowExtension.cpp */; };
</span><span class="cx">                 51FB08FF1639DE1A00EC324A /* WebResourceLoadScheduler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51ABF65616392F1500132A7A /* WebResourceLoadScheduler.cpp */; };
</span><del>-                51FCB18517BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FCB18017BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.cpp */; };
-                51FCB18617BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FCB18117BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.h */; };
-                51FCB18717BBFE0300394CD8 /* NetworkLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FCB18217BBFE0300394CD8 /* NetworkLoaderClient.h */; };
-                51FCB18817BBFE0300394CD8 /* SynchronousNetworkLoaderClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FCB18317BBFE0300394CD8 /* SynchronousNetworkLoaderClient.cpp */; };
-                51FCB18917BBFE0300394CD8 /* SynchronousNetworkLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FCB18417BBFE0300394CD8 /* SynchronousNetworkLoaderClient.h */; };
</del><span class="cx">                 51FD18B51651FBAD00DBE1CE /* NetworkResourceLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 51FD18B31651FBAD00DBE1CE /* NetworkResourceLoader.cpp */; };
</span><span class="cx">                 51FD18B61651FBAD00DBE1CE /* NetworkResourceLoader.h in Headers */ = {isa = PBXBuildFile; fileRef = 51FD18B41651FBAD00DBE1CE /* NetworkResourceLoader.h */; };
</span><span class="cx">                 5272B28A1406985D0096A5D0 /* StatisticsData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5272B2881406985D0096A5D0 /* StatisticsData.cpp */; };
</span><span class="lines">@@ -3034,11 +3029,6 @@
</span><span class="cx">                 51FA2D5C15211A5000C1BA0B /* InjectedBundleDOMWindowExtension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundleDOMWindowExtension.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51FA2D7515212E1E00C1BA0B /* WKBundleDOMWindowExtension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundleDOMWindowExtension.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51FB0902163A3B1C00EC324A /* NetworkProcessConnection.messages.in */ = {isa = PBXFileReference; lastKnownFileType = text; name = NetworkProcessConnection.messages.in; path = Network/NetworkProcessConnection.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                51FCB18017BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AsynchronousNetworkLoaderClient.cpp; path = NetworkProcess/AsynchronousNetworkLoaderClient.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                51FCB18117BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AsynchronousNetworkLoaderClient.h; path = NetworkProcess/AsynchronousNetworkLoaderClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                51FCB18217BBFE0300394CD8 /* NetworkLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkLoaderClient.h; path = NetworkProcess/NetworkLoaderClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                51FCB18317BBFE0300394CD8 /* SynchronousNetworkLoaderClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SynchronousNetworkLoaderClient.cpp; path = NetworkProcess/SynchronousNetworkLoaderClient.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
-                51FCB18417BBFE0300394CD8 /* SynchronousNetworkLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SynchronousNetworkLoaderClient.h; path = NetworkProcess/SynchronousNetworkLoaderClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 51FD18B31651FBAD00DBE1CE /* NetworkResourceLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetworkResourceLoader.cpp; path = NetworkProcess/NetworkResourceLoader.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 51FD18B41651FBAD00DBE1CE /* NetworkResourceLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkResourceLoader.h; path = NetworkProcess/NetworkResourceLoader.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5272B2881406985D0096A5D0 /* StatisticsData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StatisticsData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5176,12 +5166,9 @@
</span><span class="cx">                                 BC82837C16B45DA500A278FE /* EntryPoint */,
</span><span class="cx">                                 E1798C7616E6815500240139 /* FileAPI */,
</span><span class="cx">                                 510CC7DC16138E2900D03ED3 /* mac */,
</span><del>-                                51FCB18017BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.cpp */,
-                                51FCB18117BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.h */,
</del><span class="cx">                                 513A16491630A9BF005D7D22 /* NetworkConnectionToWebProcess.cpp */,
</span><span class="cx">                                 513A164A1630A9BF005D7D22 /* NetworkConnectionToWebProcess.h */,
</span><span class="cx">                                 513A164B1630A9BF005D7D22 /* NetworkConnectionToWebProcess.messages.in */,
</span><del>-                                51FCB18217BBFE0300394CD8 /* NetworkLoaderClient.h */,
</del><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">@@ -5193,8 +5180,6 @@
</span><span class="cx">                                 51829DA31637C70C000953D6 /* NetworkResourceLoadScheduler.cpp */,
</span><span class="cx">                                 51829DA41637C70C000953D6 /* NetworkResourceLoadScheduler.h */,
</span><span class="cx">                                 E1B78470163F24690007B692 /* RemoteNetworkingContext.h */,
</span><del>-                                51FCB18317BBFE0300394CD8 /* SynchronousNetworkLoaderClient.cpp */,
-                                51FCB18417BBFE0300394CD8 /* SynchronousNetworkLoaderClient.h */,
</del><span class="cx">                         );
</span><span class="cx">                         name = NetworkProcess;
</span><span class="cx">                         sourceTree = &quot;&lt;group&gt;&quot;;
</span><span class="lines">@@ -7217,7 +7202,6 @@
</span><span class="cx">                                 BCC56F791159957D001CCAF9 /* MachPort.h in Headers */,
</span><span class="cx">                                 1A24B5F311F531E800C38269 /* MachUtilities.h in Headers */,
</span><span class="cx">                                 1A232903162C867300D82F7A /* MessageDecoder.h in Headers */,
</span><del>-                                51FCB18617BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.h in Headers */,
</del><span class="cx">                                 1A3CC16918907EB0001E6ED8 /* WKProcessPoolInternal.h in Headers */,
</span><span class="cx">                                 2D1B5D5E185869C8006C6596 /* ViewGestureControllerMessages.h in Headers */,
</span><span class="cx">                                 1A2328FF162C866A00D82F7A /* MessageEncoder.h in Headers */,
</span><span class="lines">@@ -7288,7 +7272,6 @@
</span><span class="cx">                                 1A90C23712650717003E44D4 /* PageOverlay.h in Headers */,
</span><span class="cx">                                 C574A58112E66681002DFE98 /* PasteboardTypes.h in Headers */,
</span><span class="cx">                                 E19582D3153CBFD700B60875 /* PDFKitImports.h in Headers */,
</span><del>-                                51FCB18917BBFE0300394CD8 /* SynchronousNetworkLoaderClient.h in Headers */,
</del><span class="cx">                                 1AE00D4F182D6F5000087DD7 /* WKBrowsingContextHandleInternal.h in Headers */,
</span><span class="cx">                                 BCC43ABB127B95DC00317F16 /* PlatformPopupMenuData.h in Headers */,
</span><span class="cx">                                 BC8780FC1161C2B800CC2768 /* PlatformProcessIdentifier.h in Headers */,
</span><span class="lines">@@ -7764,7 +7747,6 @@
</span><span class="cx">                                 BCE17B7E1381F1170012A641 /* WKPagePrivateMac.h in Headers */,
</span><span class="cx">                                 A5EFD38C16B0E88C00B2F0E8 /* WKPageVisibilityTypes.h in Headers */,
</span><span class="cx">                                 370F34A51829BEA3009027C8 /* WKNavigationDataInternal.h in Headers */,
</span><del>-                                51FCB18717BBFE0300394CD8 /* NetworkLoaderClient.h in Headers */,
</del><span class="cx">                                 7C135AA9173B0BCA00586AE2 /* WKPluginInformation.h in Headers */,
</span><span class="cx">                                 1AC86FF4130B46D3002C1257 /* WKPluginSiteDataManager.h in Headers */,
</span><span class="cx">                                 BCD597D0112B56AC00EC8C23 /* WKPreferencesRef.h in Headers */,
</span><span class="lines">@@ -9309,7 +9291,6 @@
</span><span class="cx">                                 518353DE1887128B00D9FE44 /* KeyedDecoder.cpp in Sources */,
</span><span class="cx">                                 BC90A1D3122DD55E00CC8C50 /* APIURLResponse.cpp in Sources */,
</span><span class="cx">                                 C0337DD1127A2980008FF4F4 /* WebWheelEvent.cpp in Sources */,
</span><del>-                                51FCB18517BBFE0300394CD8 /* AsynchronousNetworkLoaderClient.cpp in Sources */,
</del><span class="cx">                                 29CD55AB128E294F00133C85 /* WKAccessibilityWebPageObjectBase.mm in Sources */,
</span><span class="cx">                                 1AC7537F183BE50F0072CB15 /* DataReference.cpp in Sources */,
</span><span class="cx">                                 0FCB4E4718BBE044000FCFC9 /* PageClientImplIOS.mm in Sources */,
</span><span class="lines">@@ -9416,7 +9397,6 @@
</span><span class="cx">                                 1ABC3DF51899E437004F0626 /* NavigationState.mm in Sources */,
</span><span class="cx">                                 BC85806312B8505700EDEB2E /* WKOpenPanelParameters.cpp in Sources */,
</span><span class="cx">                                 BC85806212B8505700EDEB2E /* WKOpenPanelResultListener.cpp in Sources */,
</span><del>-                                51FCB18817BBFE0300394CD8 /* SynchronousNetworkLoaderClient.cpp in Sources */,
</del><span class="cx">                                 3F418EFB1887BD97002795FD /* WebVideoFullscreenManagerProxyMessageReceiver.cpp in Sources */,
</span><span class="cx">                                 BCD597D6112B56DC00EC8C23 /* WKPage.cpp in Sources */,
</span><span class="cx">                                 3F889D171887859300FEADAF /* WebVideoFullscreenManager.mm in Sources */,
</span></span></pre>
</div>
</div>

</body>
</html>