<!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>[208732] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/208732">208732</a></dd>
<dt>Author</dt> <dd>dbates@webkit.org</dd>
<dt>Date</dt> <dd>2016-11-15 08:40:44 -0800 (Tue, 15 Nov 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Disallow loads using HTTP 0.9 at the ResourceHandle/NetworkDataTask level
https://bugs.webkit.org/show_bug.cgi?id=164662
&lt;rdar://problem/29268514&gt;

Source/WebCore:

Reviewed by Reviewed by Alex Christensen and Brady Eidson.

Currently we disallow non-default HTTP 0.9 loads at the ResourceLoader level and disallow
subresource loads using HTTP 0.9 on a default port when the embedding page loads using a
different HTTP version. However loads can still be initiated from other loaders (e.g. FrameLoader)
with regards to the first issue. The latter issue does not afford much protection and
increases code complexity. Instead we should simplify our policy and move our code to the
lowest networking abstraction level, ResourceHandle/NetworkDataTask, so that we disallow
all non-default port loads using HTTP 0.9 regardless of the loader used.

Tests: http/tests/security/http-0.9/image-default-port-allowed.html
       http/tests/security/http-0.9/xhr-blocked.html

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived): Remove logic to cancel an HTTP 0.9 load from here.
We will cancel the HTTP 0.9 load at the ResourceHandle/NetworkDataTask level.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveResponse): Ditto.
* platform/URL.h: Export stringCenterEllipsizedToLength() so that we can use it in WebKit2.
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::notifyResponseOnSuccess): Modified to call ResourceHandle::didReceiveResponse().
(WebCore::BlobResourceHandle::notifyResponseOnError): Ditto.
* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::didReceiveResponse): Added. Fail the load if it is using HTTP 0.9.
Otherwise notify the client that we received a response.
(WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse): Added. Perform any
additional platform-specific logic after notifying the resource handle client of the received
response. Only the libsoup backend overwrites this member function to do something meaningful.
* platform/network/ResourceHandle.h:
* platform/network/ResourceResponseBase.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse): Modified to
call ResourceHandle::didReceiveResponse().
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
(-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]): Ditto.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]): Ditto.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::nextMultipartResponsePartCallback): Ditto.
(WebCore::sendRequestCallback): Ditto.
(WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse): Added. Turns around and
calls continueAfterDidReceiveResponse().

Source/WebKit2:

Reviewed by Alex Christensen and Brady Eidson.

Make changes to NetworkDataTask similar to the changes made to ResourceHandle so as to
disallow non-default port HTTP 0.9 loads when using the ENABLE(NETWORK_SESSION) networking
code path in WebKit2.

* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::didReceiveResponse): Added. Fail the load if it is using HTTP 0.9.
Otherwise notify the client that we received a response.
* NetworkProcess/NetworkDataTask.h:
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::resume): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
as the latter has been renamed to the former.
(WebKit::NetworkDataTaskBlob::getSizeForNext): Ditto.
(WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): Renamed from didReceiveResponse().
* NetworkProcess/NetworkDataTaskBlob.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::didReceiveResponse): Deleted.
* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::didSendRequest): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
as the latter has been renamed to the former.
(WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Renamed from didReceiveResponse(). Also
remove the local variable response and inline its value into the call to ResourceHandle::didReceiveResponse()
as this variable is used exactly once in this function and its name does not describe its purpose any more
than its value.
(WebKit::NetworkDataTaskSoup::didRequestNextPart): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
as the latter has been renamed to the former.
* NetworkProcess/soup/NetworkDataTaskSoup.h:

LayoutTests:

Reviewed by Reviewed by Alex Christensen and Brady Eidson.

Add a test to ensure that we block a synchronous XHR load using HTTP 0.9.
Renamed test image-default-port-blocked.html to image-default-port-allowed.html
as we now allow a subresource load using HTTP 0.9 on a default port regardless
of the HTTP version the embedding page used.

Update test expectations as DRT/WTR do not emit a localized description for the
error associated with a load failure. Note that a message is emitted to
Web Inspector console.

* http/tests/security/http-0.9/iframe-blocked-expected.txt:
* http/tests/security/http-0.9/iframe-blocked.html: Dump frame load callbacks
to see that load was cancelled as there is no other unique visible indication
of success.
* http/tests/security/http-0.9/image-blocked-expected.txt: Update expected result.
* http/tests/security/http-0.9/image-default-port-allowed-expected.txt: Renamed from LayoutTests/http/tests/security/http-0.9/image-default-port-blocked-expected.txt.
* http/tests/security/http-0.9/image-default-port-allowed.html: Renamed from LayoutTests/http/tests/security/http-0.9/image-default-port-blocked.html.
* http/tests/security/http-0.9/image-on-HTTP-0.9-page-blocked-expected.txt: Update expected result.
* http/tests/security/http-0.9/image-on-HTTP-0.9-page-blocked.html: Ditto.
* http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation-expected.txt: Ditto.
* http/tests/security/http-0.9/worker-connect-src-blocked-expected.txt: Ditto.
* http/tests/security/http-0.9/worker-importScripts-blocked-expected.txt: Ditto.
* http/tests/security/http-0.9/xhr-asynchronous-blocked-expected.txt: Ditto.
* http/tests/security/http-0.9/xhr-blocked-expected.txt: Added.
* http/tests/security/http-0.9/xhr-blocked.html: Added.
* platform/wk2/TestExpectations: Skip the HTTP-0.9 tests in WebKit2 that use internals.registerDefaultPortForProtocol().
The function internals.registerDefaultPortForProtocol only updates the default-port-to-protocol map in the WebContent
process. However network loads in WebKit2 occur in the NetworkProcess. Further investigation is needed to determine
the best way to support testing with default ports. Ideally, we would run an HTTP server on port 80 for testing and
remove the need for internals.registerDefaultPortForProtocol().</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityhttp09iframeblockedexpectedtxt">trunk/LayoutTests/http/tests/security/http-0.9/iframe-blocked-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityhttp09iframeblockedhtml">trunk/LayoutTests/http/tests/security/http-0.9/iframe-blocked.html</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityhttp09imageblockedexpectedtxt">trunk/LayoutTests/http/tests/security/http-0.9/image-blocked-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityhttp09imageonHTTP09pageblockedexpectedtxt">trunk/LayoutTests/http/tests/security/http-0.9/image-on-HTTP-0.9-page-blocked-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityhttp09imageonHTTP09pageblockedhtml">trunk/LayoutTests/http/tests/security/http-0.9/image-on-HTTP-0.9-page-blocked.html</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityhttp09sandboxshouldnotpersistonnavigationexpectedtxt">trunk/LayoutTests/http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityhttp09workerconnectsrcblockedexpectedtxt">trunk/LayoutTests/http/tests/security/http-0.9/worker-connect-src-blocked-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityhttp09workerimportScriptsblockedexpectedtxt">trunk/LayoutTests/http/tests/security/http-0.9/worker-importScripts-blocked-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityhttp09xhrasynchronousblockedexpectedtxt">trunk/LayoutTests/http/tests/security/http-0.9/xhr-asynchronous-blocked-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformwk2TestExpectations">trunk/LayoutTests/platform/wk2/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentLoadercpp">trunk/Source/WebCore/loader/DocumentLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoadercpp">trunk/Source/WebCore/loader/ResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformURLh">trunk/Source/WebCore/platform/URL.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobResourceHandlecpp">trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceHandlecpp">trunk/Source/WebCore/platform/network/ResourceHandle.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceHandleh">trunk/Source/WebCore/platform/network/ResourceHandle.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkResourceResponseBaseh">trunk/Source/WebCore/platform/network/ResourceResponseBase.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkcfResourceHandleCFURLConnectionDelegateWithOperationQueuecpp">trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacWebCoreResourceHandleAsDelegatemm">trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsDelegate.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkmacWebCoreResourceHandleAsOperationQueueDelegatemm">trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworksoupResourceHandleSoupcpp">trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkDataTaskcpp">trunk/Source/WebKit2/NetworkProcess/NetworkDataTask.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkDataTaskh">trunk/Source/WebKit2/NetworkProcess/NetworkDataTask.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkDataTaskBlobcpp">trunk/Source/WebKit2/NetworkProcess/NetworkDataTaskBlob.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkDataTaskBlobh">trunk/Source/WebKit2/NetworkProcess/NetworkDataTaskBlob.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscocoaNetworkDataTaskCocoah">trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkDataTaskCocoa.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesscocoaNetworkDataTaskCocoamm">trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesssoupNetworkDataTaskSoupcpp">trunk/Source/WebKit2/NetworkProcess/soup/NetworkDataTaskSoup.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcesssoupNetworkDataTaskSouph">trunk/Source/WebKit2/NetworkProcess/soup/NetworkDataTaskSoup.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestssecurityhttp09imagedefaultportallowedexpectedtxt">trunk/LayoutTests/http/tests/security/http-0.9/image-default-port-allowed-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityhttp09imagedefaultportallowedhtml">trunk/LayoutTests/http/tests/security/http-0.9/image-default-port-allowed.html</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityhttp09xhrblockedexpectedtxt">trunk/LayoutTests/http/tests/security/http-0.9/xhr-blocked-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityhttp09xhrblockedhtml">trunk/LayoutTests/http/tests/security/http-0.9/xhr-blocked.html</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestssecurityhttp09imagedefaultportblockedexpectedtxt">trunk/LayoutTests/http/tests/security/http-0.9/image-default-port-blocked-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestssecurityhttp09imagedefaultportblockedhtml">trunk/LayoutTests/http/tests/security/http-0.9/image-default-port-blocked.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/LayoutTests/ChangeLog        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2016-11-15  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        Disallow loads using HTTP 0.9 at the ResourceHandle/NetworkDataTask level
+        https://bugs.webkit.org/show_bug.cgi?id=164662
+        &lt;rdar://problem/29268514&gt;
+
+        Reviewed by Reviewed by Alex Christensen and Brady Eidson.
+
+        Add a test to ensure that we block a synchronous XHR load using HTTP 0.9.
+        Renamed test image-default-port-blocked.html to image-default-port-allowed.html
+        as we now allow a subresource load using HTTP 0.9 on a default port regardless
+        of the HTTP version the embedding page used.
+
+        Update test expectations as DRT/WTR do not emit a localized description for the
+        error associated with a load failure. Note that a message is emitted to
+        Web Inspector console.
+
+        * http/tests/security/http-0.9/iframe-blocked-expected.txt:
+        * http/tests/security/http-0.9/iframe-blocked.html: Dump frame load callbacks
+        to see that load was cancelled as there is no other unique visible indication
+        of success.
+        * http/tests/security/http-0.9/image-blocked-expected.txt: Update expected result.
+        * http/tests/security/http-0.9/image-default-port-allowed-expected.txt: Renamed from LayoutTests/http/tests/security/http-0.9/image-default-port-blocked-expected.txt.
+        * http/tests/security/http-0.9/image-default-port-allowed.html: Renamed from LayoutTests/http/tests/security/http-0.9/image-default-port-blocked.html.
+        * http/tests/security/http-0.9/image-on-HTTP-0.9-page-blocked-expected.txt: Update expected result.
+        * http/tests/security/http-0.9/image-on-HTTP-0.9-page-blocked.html: Ditto.
+        * http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation-expected.txt: Ditto.
+        * http/tests/security/http-0.9/worker-connect-src-blocked-expected.txt: Ditto.
+        * http/tests/security/http-0.9/worker-importScripts-blocked-expected.txt: Ditto.
+        * http/tests/security/http-0.9/xhr-asynchronous-blocked-expected.txt: Ditto.
+        * http/tests/security/http-0.9/xhr-blocked-expected.txt: Added.
+        * http/tests/security/http-0.9/xhr-blocked.html: Added.
+        * platform/wk2/TestExpectations: Skip the HTTP-0.9 tests in WebKit2 that use internals.registerDefaultPortForProtocol().
+        The function internals.registerDefaultPortForProtocol only updates the default-port-to-protocol map in the WebContent
+        process. However network loads in WebKit2 occur in the NetworkProcess. Further investigation is needed to determine
+        the best way to support testing with default ports. Ideally, we would run an HTTP server on port 80 for testing and
+        remove the need for internals.registerDefaultPortForProtocol().
+
</ins><span class="cx"> 2016-11-15  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [MultiCol] Render tree should be all clean by the end of FrameView::layout().
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityhttp09iframeblockedexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/http-0.9/iframe-blocked-expected.txt (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/http-0.9/iframe-blocked-expected.txt        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/LayoutTests/http/tests/security/http-0.9/iframe-blocked-expected.txt        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -1,4 +1,8 @@
</span><del>-CONSOLE MESSAGE: Stopped document load from 'http://127.0.0.1:8000/security/http-0.9/resources/nph-fail.pl' because it is using HTTP/0.9 on a non-default port.
</del><ins>+frame &quot;&lt;!--framePath //&lt;!--frame0--&gt;--&gt;&quot; - didStartProvisionalLoadForFrame
+main frame - didFinishDocumentLoadForFrame
+main frame - didHandleOnloadEventsForFrame
+frame &quot;&lt;!--framePath //&lt;!--frame0--&gt;--&gt;&quot; - didFailProvisionalLoadWithError
+main frame - didFinishLoadForFrame
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> --------
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityhttp09iframeblockedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/http-0.9/iframe-blocked.html (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/http-0.9/iframe-blocked.html        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/LayoutTests/http/tests/security/http-0.9/iframe-blocked.html        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -5,6 +5,7 @@
</span><span class="cx"> if (window.testRunner) {
</span><span class="cx">     testRunner.dumpAsText();
</span><span class="cx">     testRunner.dumpChildFramesAsText();
</span><ins>+    testRunner.dumpFrameLoadCallbacks();
</ins><span class="cx"> }
</span><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;/head&gt;
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityhttp09imageblockedexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/http-0.9/image-blocked-expected.txt (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/http-0.9/image-blocked-expected.txt        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/LayoutTests/http/tests/security/http-0.9/image-blocked-expected.txt        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -1,3 +1,2 @@
</span><del>-CONSOLE MESSAGE: Cancelled resource load from 'http://127.0.0.1:8000/security/http-0.9/resources/nph-image.pl' because it is using HTTP/0.9 and the document was loaded with a different HTTP version.
</del><span class="cx"> ALERT: PASS
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityhttp09imagedefaultportallowedexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/security/http-0.9/image-default-port-allowed-expected.txt (0 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/http-0.9/image-default-port-allowed-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/security/http-0.9/image-default-port-allowed-expected.txt        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+ALERT: PASS
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityhttp09imagedefaultportallowedhtmlfromrev208731trunkLayoutTestshttptestssecurityhttp09imagedefaultportblockedhtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/http/tests/security/http-0.9/image-default-port-allowed.html (from rev 208731, trunk/LayoutTests/http/tests/security/http-0.9/image-default-port-blocked.html) (0 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/http-0.9/image-default-port-allowed.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/security/http-0.9/image-default-port-allowed.html        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    if (window.internals)
+        internals.registerDefaultPortForProtocol(8000, &quot;http&quot;);
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;img src=&quot;resources/nph-image.pl&quot; onload=&quot;alert('PASS')&quot; onerror=&quot;alert('FAIL')&quot;&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityhttp09imagedefaultportblockedexpectedtxt"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/http/tests/security/http-0.9/image-default-port-blocked-expected.txt (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/http-0.9/image-default-port-blocked-expected.txt        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/LayoutTests/http/tests/security/http-0.9/image-default-port-blocked-expected.txt        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -1,3 +0,0 @@
</span><del>-CONSOLE MESSAGE: Cancelled resource load from 'http://127.0.0.1:8000/security/http-0.9/resources/nph-image.pl' because it is using HTTP/0.9 and the document was loaded with a different HTTP version.
-ALERT: PASS
-
</del></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityhttp09imagedefaultportblockedhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/http/tests/security/http-0.9/image-default-port-blocked.html (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/http-0.9/image-default-port-blocked.html        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/LayoutTests/http/tests/security/http-0.9/image-default-port-blocked.html        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-&lt;!DOCTYPE html&gt;
-&lt;html&gt;
-&lt;head&gt;
-&lt;script&gt;
-if (window.testRunner) {
-    testRunner.dumpAsText();
-    if (window.internals)
-        internals.registerDefaultPortForProtocol(8000, &quot;http&quot;);
-}
-&lt;/script&gt;
-&lt;/head&gt;
-&lt;body&gt;
-&lt;img src=&quot;resources/nph-image.pl&quot; onload=&quot;alert('FAIL')&quot; onerror=&quot;alert('PASS')&quot;&gt;
-&lt;/body&gt;
-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityhttp09imageonHTTP09pageblockedexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/http-0.9/image-on-HTTP-0.9-page-blocked-expected.txt (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/http-0.9/image-on-HTTP-0.9-page-blocked-expected.txt        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/LayoutTests/http/tests/security/http-0.9/image-on-HTTP-0.9-page-blocked-expected.txt        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -1,5 +1,10 @@
</span><ins>+http://127.0.0.1:8000/security/http-0.9/resources/nph-image-on-HTTP-0.9-page-blocked.pl - willSendRequest &lt;NSURLRequest URL http://127.0.0.1:8000/security/http-0.9/resources/nph-image-on-HTTP-0.9-page-blocked.pl, main document URL http://127.0.0.1:8000/security/http-0.9/image-on-HTTP-0.9-page-blocked.html, http method GET&gt; redirectResponse (null)
+http://127.0.0.1:8000/security/http-0.9/image-on-HTTP-0.9-page-blocked.html - didFinishLoading
+http://127.0.0.1:8000/security/http-0.9/resources/nph-image-on-HTTP-0.9-page-blocked.pl - didReceiveResponse &lt;NSURLResponse http://127.0.0.1:8000/security/http-0.9/resources/nph-image-on-HTTP-0.9-page-blocked.pl, http status code 200&gt;
</ins><span class="cx"> CONSOLE MESSAGE: Sandboxing 'http://127.0.0.1:8000/security/http-0.9/resources/nph-image-on-HTTP-0.9-page-blocked.pl' because it is using HTTP/0.9.
</span><del>-CONSOLE MESSAGE: Cancelled resource load from 'http://127.0.0.1:8080/security/http-0.9/resources/nph-image.pl' because it is using HTTP/0.9 on a non-default port.
</del><ins>+http://127.0.0.1:8080/security/http-0.9/resources/nph-image.pl - willSendRequest &lt;NSURLRequest URL http://127.0.0.1:8080/security/http-0.9/resources/nph-image.pl, main document URL http://127.0.0.1:8000/security/http-0.9/image-on-HTTP-0.9-page-blocked.html, http method GET&gt; redirectResponse (null)
+http://127.0.0.1:8000/security/http-0.9/resources/nph-image-on-HTTP-0.9-page-blocked.pl - didFinishLoading
+http://127.0.0.1:8080/security/http-0.9/resources/nph-image.pl - didFailLoadingWithError: &lt;NSError domain , code 0, failing URL &quot;http://127.0.0.1:8080/security/http-0.9/resources/nph-image.pl&quot;&gt;
</ins><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> --------
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityhttp09imageonHTTP09pageblockedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/http-0.9/image-on-HTTP-0.9-page-blocked.html (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/http-0.9/image-on-HTTP-0.9-page-blocked.html        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/LayoutTests/http/tests/security/http-0.9/image-on-HTTP-0.9-page-blocked.html        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -5,6 +5,7 @@
</span><span class="cx"> if (window.testRunner) {
</span><span class="cx">     testRunner.dumpAsText();
</span><span class="cx">     testRunner.dumpChildFramesAsText();
</span><ins>+    testRunner.dumpResourceLoadCallbacks();
</ins><span class="cx">     if (window.internals)
</span><span class="cx">         internals.registerDefaultPortForProtocol(8000, &quot;http&quot;);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityhttp09sandboxshouldnotpersistonnavigationexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation-expected.txt (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation-expected.txt        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/LayoutTests/http/tests/security/http-0.9/sandbox-should-not-persist-on-navigation-expected.txt        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -1,2 +1 @@
</span><del>-CONSOLE MESSAGE: Cancelled resource load from 'http://127.0.0.1:8000/security/http-0.9/resources/nph-image.pl' because it is using HTTP/0.9 and the document was loaded with a different HTTP version.
</del><span class="cx"> PASS
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityhttp09workerconnectsrcblockedexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/http-0.9/worker-connect-src-blocked-expected.txt (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/http-0.9/worker-connect-src-blocked-expected.txt        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/LayoutTests/http/tests/security/http-0.9/worker-connect-src-blocked-expected.txt        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -1,3 +1,2 @@
</span><del>-CONSOLE MESSAGE: Cancelled resource load from 'http://127.0.0.1:8000/security/http-0.9/resources/nph-worker-fail.pl' because it is using HTTP/0.9 and the document was loaded with a different HTTP version.
</del><span class="cx"> ALERT: PASS
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityhttp09workerimportScriptsblockedexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/http-0.9/worker-importScripts-blocked-expected.txt (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/http-0.9/worker-importScripts-blocked-expected.txt        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/LayoutTests/http/tests/security/http-0.9/worker-importScripts-blocked-expected.txt        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -1,3 +1,2 @@
</span><del>-CONSOLE MESSAGE: Cancelled resource load from 'http://127.0.0.1:8000/security/http-0.9/resources/nph-worker-fail.pl' because it is using HTTP/0.9 and the document was loaded with a different HTTP version.
</del><span class="cx"> ALERT: PASS
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityhttp09xhrasynchronousblockedexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/security/http-0.9/xhr-asynchronous-blocked-expected.txt (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/http-0.9/xhr-asynchronous-blocked-expected.txt        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/LayoutTests/http/tests/security/http-0.9/xhr-asynchronous-blocked-expected.txt        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -1,3 +1,2 @@
</span><del>-CONSOLE MESSAGE: Cancelled resource load from 'http://127.0.0.1:8000/security/http-0.9/resources/nph-fail.pl' because it is using HTTP/0.9 and the document was loaded with a different HTTP version.
</del><span class="cx"> ALERT: PASS
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityhttp09xhrblockedexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/security/http-0.9/xhr-blocked-expected.txt (0 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/http-0.9/xhr-blocked-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/security/http-0.9/xhr-blocked-expected.txt        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+ALERT: PASS
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestssecurityhttp09xhrblockedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/security/http-0.9/xhr-blocked.html (0 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/security/http-0.9/xhr-blocked.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/security/http-0.9/xhr-blocked.html        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.dumpAsText();
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;script&gt;
+const isAsynchronous = false;
+var xhr = new XMLHttpRequest;
+try {
+    xhr.open(&quot;GET&quot;, &quot;resources/nph-fail.pl&quot;, isAsynchronous);
+    xhr.send();
+
+    alert(&quot;FAIL&quot;);
+} catch (e) {
+    // FIXME: Assert that a specific exception is thrown.
+    alert(&quot;PASS&quot;);
+}
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformwk2TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/wk2/TestExpectations (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/wk2/TestExpectations        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/LayoutTests/platform/wk2/TestExpectations        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -548,6 +548,15 @@
</span><span class="cx"> ########################################
</span><span class="cx"> ### START OF (4) Features that are not supported in WebKit2 and likely never will be
</span><span class="cx"> 
</span><ins>+# Internals.registerDefaultPortForProtocol() does not affect NetworkProcess. We should
+# look to remove it and write these test to make use of an HTTP server running on port 80.
+http/tests/security/http-0.9/default-port-plugin-blocked.html
+http/tests/security/http-0.9/default-port-script-blocked.html
+http/tests/security/http-0.9/image-default-port-allowed.html
+http/tests/security/http-0.9/image-on-HTTP-0.9-default-port-page-allowed-ref-test.html
+http/tests/security/http-0.9/image-on-HTTP-0.9-default-port-page-allowed.html
+http/tests/security/http-0.9/image-on-HTTP-0.9-page-blocked.html
+
</ins><span class="cx"> # WebKitTestRunner doesn't have appleScriptController
</span><span class="cx"> platform/mac/fast/AppleScript/001.html
</span><span class="cx"> platform/mac/fast/AppleScript/array.html
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebCore/ChangeLog        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2016-11-15  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        Disallow loads using HTTP 0.9 at the ResourceHandle/NetworkDataTask level
+        https://bugs.webkit.org/show_bug.cgi?id=164662
+        &lt;rdar://problem/29268514&gt;
+
+        Reviewed by Reviewed by Alex Christensen and Brady Eidson.
+
+        Currently we disallow non-default HTTP 0.9 loads at the ResourceLoader level and disallow
+        subresource loads using HTTP 0.9 on a default port when the embedding page loads using a
+        different HTTP version. However loads can still be initiated from other loaders (e.g. FrameLoader)
+        with regards to the first issue. The latter issue does not afford much protection and
+        increases code complexity. Instead we should simplify our policy and move our code to the
+        lowest networking abstraction level, ResourceHandle/NetworkDataTask, so that we disallow
+        all non-default port loads using HTTP 0.9 regardless of the loader used.
+
+        Tests: http/tests/security/http-0.9/image-default-port-allowed.html
+               http/tests/security/http-0.9/xhr-blocked.html
+
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::responseReceived): Remove logic to cancel an HTTP 0.9 load from here.
+        We will cancel the HTTP 0.9 load at the ResourceHandle/NetworkDataTask level.
+        * loader/ResourceLoader.cpp:
+        (WebCore::ResourceLoader::didReceiveResponse): Ditto.
+        * platform/URL.h: Export stringCenterEllipsizedToLength() so that we can use it in WebKit2.
+        * platform/network/BlobResourceHandle.cpp:
+        (WebCore::BlobResourceHandle::notifyResponseOnSuccess): Modified to call ResourceHandle::didReceiveResponse().
+        (WebCore::BlobResourceHandle::notifyResponseOnError): Ditto.
+        * platform/network/ResourceHandle.cpp:
+        (WebCore::ResourceHandle::didReceiveResponse): Added. Fail the load if it is using HTTP 0.9.
+        Otherwise notify the client that we received a response.
+        (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse): Added. Perform any
+        additional platform-specific logic after notifying the resource handle client of the received
+        response. Only the libsoup backend overwrites this member function to do something meaningful.
+        * platform/network/ResourceHandle.h:
+        * platform/network/ResourceResponseBase.h:
+        * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
+        (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse): Modified to
+        call ResourceHandle::didReceiveResponse().
+        * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
+        (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]): Ditto.
+        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
+        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]): Ditto.
+        * platform/network/soup/ResourceHandleSoup.cpp:
+        (WebCore::nextMultipartResponsePartCallback): Ditto.
+        (WebCore::sendRequestCallback): Ditto.
+        (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse): Added. Turns around and
+        calls continueAfterDidReceiveResponse().
+
</ins><span class="cx"> 2016-11-15  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [MultiCol] Render tree should be all clean by the end of FrameView::layout().
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.cpp        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -731,17 +731,6 @@
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    if (m_response.isHttpVersion0_9()) {
-        // Non-HTTP responses are interpreted as HTTP/0.9 which may allow exfiltration of data
-        // from non-HTTP services. Therefore cancel if the request was to a non-default port.
-        if (url.port() &amp;&amp; !isDefaultPortForProtocol(url.port().value(), url.protocol())) {
-            String message = &quot;Stopped document load from '&quot; + url.string() + &quot;' because it is using HTTP/0.9 on a non-default port.&quot;;
-            m_frame-&gt;document()-&gt;addConsoleMessage(MessageSource::Security, MessageLevel::Error, message, identifier);
-            stopLoading();
-            return;
-        }
-    }
-
</del><span class="cx">     frameLoader()-&gt;policyChecker().checkContentPolicy(m_response, [this](PolicyAction policy) {
</span><span class="cx">         continueAfterContentPolicy(policy);
</span><span class="cx">     });
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoader.cpp (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoader.cpp        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebCore/loader/ResourceLoader.cpp        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -437,27 +437,6 @@
</span><span class="cx"> 
</span><span class="cx">     m_response = r;
</span><span class="cx"> 
</span><del>-    if (m_response.isHttpVersion0_9()) {
-        auto url = m_response.url();
-        // Non-HTTP responses are interpreted as HTTP/0.9 which may allow exfiltration of data
-        // from non-HTTP services. Therefore cancel if the document was loaded with different
-        // HTTP version or if the resource request was to a non-default port.
-        if (!m_documentLoader-&gt;response().isHttpVersion0_9()) {
-            String message = &quot;Cancelled resource load from '&quot; + url.string() + &quot;' because it is using HTTP/0.9 and the document was loaded with a different HTTP version.&quot;;
-            m_frame-&gt;document()-&gt;addConsoleMessage(MessageSource::Security, MessageLevel::Error, message, identifier());
-            ResourceError error(emptyString(), 0, url, message);
-            didFail(error);
-            return;
-        }
-        if (url.port() &amp;&amp; !isDefaultPortForProtocol(url.port().value(), url.protocol())) {
-            String message = &quot;Cancelled resource load from '&quot; + url.string() + &quot;' because it is using HTTP/0.9 on a non-default port.&quot;;
-            m_frame-&gt;document()-&gt;addConsoleMessage(MessageSource::Security, MessageLevel::Error, message, identifier());
-            ResourceError error(emptyString(), 0, url, message);
-            didFail(error);
-            return;
-        }
-    }
-
</del><span class="cx">     if (FormData* data = m_request.httpBody())
</span><span class="cx">         data-&gt;removeGeneratedFilesIfNeeded();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformURLh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/URL.h (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/URL.h        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebCore/platform/URL.h        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx"> 
</span><span class="cx">     const String&amp; string() const { return m_string; }
</span><span class="cx"> 
</span><del>-    String stringCenterEllipsizedToLength(unsigned length = 1024) const;
</del><ins>+    WEBCORE_EXPORT String stringCenterEllipsizedToLength(unsigned length = 1024) const;
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT StringView protocol() const;
</span><span class="cx">     WEBCORE_EXPORT String host() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobResourceHandlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -575,10 +575,7 @@
</span><span class="cx">     // as if the response had a Content-Disposition header with the filename parameter set to the File's name attribute.
</span><span class="cx">     // Notably, this will affect a name suggested in &quot;File Save As&quot;.
</span><span class="cx"> 
</span><del>-    if (usesAsyncCallbacks())
-        client()-&gt;didReceiveResponseAsync(this, WTFMove(response));
-    else
-        client()-&gt;didReceiveResponse(this, WTFMove(response));
</del><ins>+    didReceiveResponse(WTFMove(response));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void BlobResourceHandle::notifyResponseOnError()
</span><span class="lines">@@ -601,10 +598,7 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (usesAsyncCallbacks())
-        client()-&gt;didReceiveResponseAsync(this, WTFMove(response));
-    else
-        client()-&gt;didReceiveResponse(this, WTFMove(response));
</del><ins>+    didReceiveResponse(WTFMove(response));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void BlobResourceHandle::notifyReceiveData(const char* data, int bytesRead)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceHandlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceHandle.cpp (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceHandle.cpp        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebCore/platform/network/ResourceHandle.cpp        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -150,6 +150,26 @@
</span><span class="cx">     d-&gt;m_client = nullptr;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ResourceHandle::didReceiveResponse(ResourceResponse&amp;&amp; response)
+{
+    if (response.isHttpVersion0_9()) {
+        auto url = response.url();
+        Optional&lt;uint16_t&gt; port = url.port();
+        if (port &amp;&amp; !isDefaultPortForProtocol(port.value(), url.protocol())) {
+            cancel();
+            String message = &quot;Cancelled load from '&quot; + url.stringCenterEllipsizedToLength() + &quot;' because it is using HTTP/0.9.&quot;;
+            d-&gt;m_client-&gt;didFail(this, { String(), 0, url, message });
+            return;
+        }
+    }
+    if (d-&gt;m_usesAsyncCallbacks)
+        d-&gt;m_client-&gt;didReceiveResponseAsync(this, WTFMove(response));
+    else {
+        d-&gt;m_client-&gt;didReceiveResponse(this, WTFMove(response));
+        platformContinueSynchronousDidReceiveResponse();
+    }
+}
+
</ins><span class="cx"> #if !PLATFORM(COCOA) &amp;&amp; !USE(CFURLCONNECTION) &amp;&amp; !USE(SOUP)
</span><span class="cx"> // ResourceHandle never uses async client calls on these platforms yet.
</span><span class="cx"> void ResourceHandle::continueWillSendRequest(ResourceRequest&amp;&amp;)
</span><span class="lines">@@ -170,6 +190,13 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if !USE(SOUP)
+void ResourceHandle::platformContinueSynchronousDidReceiveResponse()
+{
+    // Do nothing.
+}
+#endif
+
</ins><span class="cx"> ResourceRequest&amp; ResourceHandle::firstRequest()
</span><span class="cx"> {
</span><span class="cx">     return d-&gt;m_firstRequest;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceHandleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceHandle.h (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceHandle.h        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebCore/platform/network/ResourceHandle.h        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -103,6 +103,8 @@
</span><span class="cx">     ResourceRequest willSendRequest(ResourceRequest&amp;&amp;, ResourceResponse&amp;&amp;);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    void didReceiveResponse(ResourceResponse&amp;&amp;);
+
</ins><span class="cx">     bool shouldUseCredentialStorage();
</span><span class="cx">     void didReceiveAuthenticationChallenge(const AuthenticationChallenge&amp;);
</span><span class="cx">     void receivedCredential(const AuthenticationChallenge&amp;, const Credential&amp;) override;
</span><span class="lines">@@ -249,6 +251,8 @@
</span><span class="cx"> 
</span><span class="cx">     void platformSetDefersLoading(bool);
</span><span class="cx"> 
</span><ins>+    void platformContinueSynchronousDidReceiveResponse();
+
</ins><span class="cx">     void scheduleFailure(FailureType);
</span><span class="cx"> 
</span><span class="cx">     bool start();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkResourceResponseBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/ResourceResponseBase.h (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/ResourceResponseBase.h        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebCore/platform/network/ResourceResponseBase.h        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT const String&amp; httpVersion() const;
</span><span class="cx">     WEBCORE_EXPORT void setHTTPVersion(const String&amp;);
</span><del>-    bool isHttpVersion0_9() const;
</del><ins>+    WEBCORE_EXPORT bool isHttpVersion0_9() const;
</ins><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT const HTTPHeaderMap&amp; httpHeaderFields() const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkcfResourceHandleCFURLConnectionDelegateWithOperationQueuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebCore/platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -161,7 +161,7 @@
</span><span class="cx">         UNUSED_PARAM(connection);
</span><span class="cx"> #endif
</span><span class="cx">         
</span><del>-        m_handle-&gt;client()-&gt;didReceiveResponseAsync(m_handle, WTFMove(resourceResponse));
</del><ins>+        m_handle-&gt;didReceiveResponse(WTFMove(resourceResponse));
</ins><span class="cx">     });
</span><span class="cx">     dispatch_semaphore_wait(m_semaphore, DISPATCH_TIME_FOREVER);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacWebCoreResourceHandleAsDelegatemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsDelegate.mm (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsDelegate.mm        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsDelegate.mm        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -162,7 +162,7 @@
</span><span class="cx">     UNUSED_PARAM(connection);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    m_handle-&gt;client()-&gt;didReceiveResponse(m_handle, WTFMove(resourceResponse));
</del><ins>+    m_handle-&gt;didReceiveResponse(WTFMove(resourceResponse));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if USE(NETWORK_CFDATA_ARRAY_CALLBACK)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkmacWebCoreResourceHandleAsOperationQueueDelegatemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebCore/platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -199,7 +199,7 @@
</span><span class="cx"> #else
</span><span class="cx">         UNUSED_PARAM(connection);
</span><span class="cx"> #endif
</span><del>-        m_handle-&gt;client()-&gt;didReceiveResponseAsync(m_handle, WTFMove(resourceResponse));
</del><ins>+        m_handle-&gt;didReceiveResponse(WTFMove(resourceResponse));
</ins><span class="cx">     });
</span><span class="cx"> 
</span><span class="cx">     dispatch_semaphore_wait(m_semaphore, DISPATCH_TIME_FOREVER);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworksoupResourceHandleSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebCore/platform/network/soup/ResourceHandleSoup.cpp        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -449,12 +449,7 @@
</span><span class="cx"> 
</span><span class="cx">     d-&gt;m_previousPosition = 0;
</span><span class="cx"> 
</span><del>-    if (handle-&gt;client()-&gt;usesAsyncCallbacks())
-        handle-&gt;client()-&gt;didReceiveResponseAsync(handle.get(), ResourceResponse(d-&gt;m_response));
-    else {
-        handle-&gt;client()-&gt;didReceiveResponse(handle.get(), ResourceResponse(d-&gt;m_response));
-        continueAfterDidReceiveResponse(handle.get());
-    }
</del><ins>+    handle-&gt;didReceiveResponse(ResourceResponse(d-&gt;m_response));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void sendRequestCallback(GObject*, GAsyncResult* result, gpointer data)
</span><span class="lines">@@ -513,14 +508,14 @@
</span><span class="cx">     else
</span><span class="cx">         d-&gt;m_inputStream = inputStream;
</span><span class="cx"> 
</span><del>-    if (d-&gt;client()-&gt;usesAsyncCallbacks())
-        handle-&gt;client()-&gt;didReceiveResponseAsync(handle.get(), ResourceResponse(d-&gt;m_response));
-    else {
-        handle-&gt;client()-&gt;didReceiveResponse(handle.get(), ResourceResponse(d-&gt;m_response));
-        continueAfterDidReceiveResponse(handle.get());
-    }
</del><ins>+    handle-&gt;didReceiveResponse(ResourceResponse(d-&gt;m_response));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void ResourceHandle::platformContinueSynchronousDidReceiveResponse()
+{
+    continueAfterDidReceiveResponse(this);
+}
+
</ins><span class="cx"> static void continueAfterDidReceiveResponse(ResourceHandle* handle)
</span><span class="cx"> {
</span><span class="cx">     if (handle-&gt;cancelledOrClientless()) {
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebKit2/ChangeLog        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2016-11-15  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        Disallow loads using HTTP 0.9 at the ResourceHandle/NetworkDataTask level
+        https://bugs.webkit.org/show_bug.cgi?id=164662
+        &lt;rdar://problem/29268514&gt;
+
+        Reviewed by Alex Christensen and Brady Eidson.
+
+        Make changes to NetworkDataTask similar to the changes made to ResourceHandle so as to
+        disallow non-default port HTTP 0.9 loads when using the ENABLE(NETWORK_SESSION) networking
+        code path in WebKit2.
+
+        * NetworkProcess/NetworkDataTask.cpp:
+        (WebKit::NetworkDataTask::didReceiveResponse): Added. Fail the load if it is using HTTP 0.9.
+        Otherwise notify the client that we received a response.
+        * NetworkProcess/NetworkDataTask.h:
+        * NetworkProcess/NetworkDataTaskBlob.cpp:
+        (WebKit::NetworkDataTaskBlob::resume): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
+        as the latter has been renamed to the former.
+        (WebKit::NetworkDataTaskBlob::getSizeForNext): Ditto.
+        (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): Renamed from didReceiveResponse().
+        * NetworkProcess/NetworkDataTaskBlob.h:
+        * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
+        * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
+        (WebKit::NetworkDataTaskCocoa::didReceiveResponse): Deleted.
+        * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
+        (WebKit::NetworkDataTaskSoup::didSendRequest): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
+        as the latter has been renamed to the former.
+        (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Renamed from didReceiveResponse(). Also
+        remove the local variable response and inline its value into the call to ResourceHandle::didReceiveResponse()
+        as this variable is used exactly once in this function and its name does not describe its purpose any more
+        than its value.
+        (WebKit::NetworkDataTaskSoup::didRequestNextPart): Substitute dispatchDidReceiveResponse() for didReceiveResponse()
+        as the latter has been renamed to the former.
+        * NetworkProcess/soup/NetworkDataTaskSoup.h:
+
</ins><span class="cx"> 2016-11-14  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Move SecurityOrigin::createFromDatabaseIdentifier to SecurityOriginData
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkDataTaskcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkDataTask.cpp (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkDataTask.cpp        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkDataTask.cpp        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -31,6 +31,8 @@
</span><span class="cx"> #include &quot;NetworkDataTaskBlob.h&quot;
</span><span class="cx"> #include &quot;NetworkLoadParameters.h&quot;
</span><span class="cx"> #include &quot;NetworkSession.h&quot;
</span><ins>+#include &lt;WebCore/ResourceError.h&gt;
+#include &lt;WebCore/ResourceResponse.h&gt;
</ins><span class="cx"> #include &lt;wtf/MainThread.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="lines">@@ -92,6 +94,21 @@
</span><span class="cx">     m_failureTimer.startOneShot(0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void NetworkDataTask::didReceiveResponse(ResourceResponse&amp;&amp; response, ResponseCompletionHandler&amp;&amp; completionHandler)
+{
+    ASSERT(m_client);
+    if (response.isHttpVersion0_9()) {
+        auto url = response.url();
+        Optional&lt;uint16_t&gt; port = url.port();
+        if (port &amp;&amp; !isDefaultPortForProtocol(port.value(), url.protocol())) {
+            cancel();
+            m_client-&gt;didCompleteWithError({ String(), 0, url, &quot;Cancelled load from '&quot; + url.stringCenterEllipsizedToLength() + &quot;' because it is using HTTP/0.9.&quot; });
+            return;
+        }
+    }
+    m_client-&gt;didReceiveResponseNetworkSession(WTFMove(response), WTFMove(completionHandler));
+}
+
</ins><span class="cx"> void NetworkDataTask::failureTimerFired()
</span><span class="cx"> {
</span><span class="cx">     RefPtr&lt;NetworkDataTask&gt; protectedThis(this);
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkDataTaskh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkDataTask.h (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkDataTask.h        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkDataTask.h        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -82,6 +82,8 @@
</span><span class="cx">     virtual void resume() = 0;
</span><span class="cx">     virtual void invalidateAndCancel() = 0;
</span><span class="cx"> 
</span><ins>+    void didReceiveResponse(WebCore::ResourceResponse&amp;&amp;, ResponseCompletionHandler&amp;&amp;);
+
</ins><span class="cx">     enum class State {
</span><span class="cx">         Running,
</span><span class="cx">         Suspended,
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkDataTaskBlobcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkDataTaskBlob.cpp (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkDataTaskBlob.cpp        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkDataTaskBlob.cpp        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -143,7 +143,7 @@
</span><span class="cx">         // Parse the &quot;Range&quot; header we care about.
</span><span class="cx">         String range = m_firstRequest.httpHeaderField(HTTPHeaderName::Range);
</span><span class="cx">         if (!range.isEmpty() &amp;&amp; !parseRange(range, m_rangeOffset, m_rangeEnd, m_rangeSuffixLength)) {
</span><del>-            didReceiveResponse(Error::RangeError);
</del><ins>+            dispatchDidReceiveResponse(Error::RangeError);
</ins><span class="cx">             return;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -185,7 +185,7 @@
</span><span class="cx">     // Do we finish validating and counting size for all items?
</span><span class="cx">     if (m_sizeItemCount &gt;= m_blobData-&gt;items().size()) {
</span><span class="cx">         seek();
</span><del>-        didReceiveResponse();
</del><ins>+        dispatchDidReceiveResponse();
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -265,9 +265,9 @@
</span><span class="cx">         m_totalRemainingSize -= m_rangeOffset;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkDataTaskBlob::didReceiveResponse(Error errorCode)
</del><ins>+void NetworkDataTaskBlob::dispatchDidReceiveResponse(Error errorCode)
</ins><span class="cx"> {
</span><del>-    LOG(NetworkSession, &quot;%p - NetworkDataTaskBlob::didReceiveResponse(%u)&quot;, this, static_cast&lt;unsigned&gt;(errorCode));
</del><ins>+    LOG(NetworkSession, &quot;%p - NetworkDataTaskBlob::dispatchDidReceiveResponse(%u)&quot;, this, static_cast&lt;unsigned&gt;(errorCode));
</ins><span class="cx"> 
</span><span class="cx">     Ref&lt;NetworkDataTaskBlob&gt; protectedThis(*this);
</span><span class="cx">     ResourceResponse response(m_firstRequest.url(), errorCode != Error::NoError ? &quot;text/plain&quot; : m_blobData-&gt;contentType(), errorCode != Error::NoError ? 0 : m_totalRemainingSize, String());
</span><span class="lines">@@ -301,7 +301,7 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    m_client-&gt;didReceiveResponseNetworkSession(WTFMove(response), [this, protectedThis = WTFMove(protectedThis), errorCode](PolicyAction policyAction) {
</del><ins>+    didReceiveResponse(WTFMove(response), [this, protectedThis = WTFMove(protectedThis), errorCode](PolicyAction policyAction) {
</ins><span class="cx">         LOG(NetworkSession, &quot;%p - NetworkDataTaskBlob::didReceiveResponse completionHandler (%u)&quot;, this, static_cast&lt;unsigned&gt;(policyAction));
</span><span class="cx"> 
</span><span class="cx">         if (m_state == State::Canceling || m_state == State::Completed) {
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkDataTaskBlobh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkDataTaskBlob.h (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkDataTaskBlob.h        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkDataTaskBlob.h        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx"> 
</span><span class="cx">     void clearStream();
</span><span class="cx">     void getSizeForNext();
</span><del>-    void didReceiveResponse(Error = Error::NoError);
</del><ins>+    void dispatchDidReceiveResponse(Error = Error::NoError);
</ins><span class="cx">     void seek();
</span><span class="cx">     void consumeData(const char* data, int bytesRead);
</span><span class="cx">     void read();
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscocoaNetworkDataTaskCocoah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkDataTaskCocoa.h (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkDataTaskCocoa.h        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkDataTaskCocoa.h        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -51,7 +51,6 @@
</span><span class="cx">     void didSendData(uint64_t totalBytesSent, uint64_t totalBytesExpectedToSend);
</span><span class="cx">     void didReceiveChallenge(const WebCore::AuthenticationChallenge&amp;, ChallengeCompletionHandler&amp;&amp;);
</span><span class="cx">     void didCompleteWithError(const WebCore::ResourceError&amp;);
</span><del>-    void didReceiveResponse(WebCore::ResourceResponse&amp;&amp;, ResponseCompletionHandler&amp;&amp;);
</del><span class="cx">     void didReceiveData(Ref&lt;WebCore::SharedBuffer&gt;&amp;&amp;);
</span><span class="cx"> 
</span><span class="cx">     void willPerformHTTPRedirection(WebCore::ResourceResponse&amp;&amp;, WebCore::ResourceRequest&amp;&amp;, RedirectCompletionHandler&amp;&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesscocoaNetworkDataTaskCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebKit2/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -155,16 +155,6 @@
</span><span class="cx">         m_client-&gt;didCompleteWithError(error);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkDataTaskCocoa::didReceiveResponse(WebCore::ResourceResponse&amp;&amp; response, ResponseCompletionHandler&amp;&amp; completionHandler)
-{
-    if (m_client)
-        m_client-&gt;didReceiveResponseNetworkSession(WTFMove(response), WTFMove(completionHandler));
-    else {
-        ASSERT_NOT_REACHED();
-        completionHandler(WebCore::PolicyAction::PolicyIgnore);
-    }
-}
-
</del><span class="cx"> void NetworkDataTaskCocoa::didReceiveData(Ref&lt;WebCore::SharedBuffer&gt;&amp;&amp; data)
</span><span class="cx"> {
</span><span class="cx">     if (m_client)
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesssoupNetworkDataTaskSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/soup/NetworkDataTaskSoup.cpp (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/soup/NetworkDataTaskSoup.cpp        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebKit2/NetworkProcess/soup/NetworkDataTaskSoup.cpp        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -345,15 +345,14 @@
</span><span class="cx">         m_inputStream = WTFMove(inputStream);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    didReceiveResponse();
</del><ins>+    dispatchDidReceiveResponse();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkDataTaskSoup::didReceiveResponse()
</del><ins>+void NetworkDataTaskSoup::dispatchDidReceiveResponse()
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!m_response.isNull());
</span><span class="cx"> 
</span><del>-    auto response = ResourceResponse(m_response);
-    m_client-&gt;didReceiveResponseNetworkSession(WTFMove(response), [this, protectedThis = makeRef(*this)](PolicyAction policyAction) {
</del><ins>+    didReceiveResponse(ResourceResponse(m_response), [this, protectedThis = makeRef(*this)](PolicyAction policyAction) {
</ins><span class="cx">         if (m_state == State::Canceling || m_state == State::Completed) {
</span><span class="cx">             clearRequest();
</span><span class="cx">             return;
</span><span class="lines">@@ -772,7 +771,7 @@
</span><span class="cx">     m_response = ResourceResponse();
</span><span class="cx">     m_response.setURL(m_firstRequest.url());
</span><span class="cx">     m_response.updateFromSoupMessageHeaders(soup_multipart_input_stream_get_headers(m_multipartInputStream.get()));
</span><del>-    didReceiveResponse();
</del><ins>+    dispatchDidReceiveResponse();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkDataTaskSoup::didFinishRequestNextPart()
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcesssoupNetworkDataTaskSouph"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/soup/NetworkDataTaskSoup.h (208731 => 208732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/soup/NetworkDataTaskSoup.h        2016-11-15 16:02:44 UTC (rev 208731)
+++ trunk/Source/WebKit2/NetworkProcess/soup/NetworkDataTaskSoup.h        2016-11-15 16:40:44 UTC (rev 208732)
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx">     void clearRequest();
</span><span class="cx">     static void sendRequestCallback(SoupRequest*, GAsyncResult*, NetworkDataTaskSoup*);
</span><span class="cx">     void didSendRequest(GRefPtr&lt;GInputStream&gt;&amp;&amp;);
</span><del>-    void didReceiveResponse();
</del><ins>+    void dispatchDidReceiveResponse();
</ins><span class="cx"> 
</span><span class="cx">     static void tlsErrorsChangedCallback(SoupMessage*, GParamSpec*, NetworkDataTaskSoup*);
</span><span class="cx">     void tlsErrorsChanged();
</span></span></pre>
</div>
</div>

</body>
</html>