<!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>[194902] 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/194902">194902</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2016-01-12 10:48:31 -0800 (Tue, 12 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Ask for UI Process approval of ProtectionSpace when authenticating downloads with NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=152999

Reviewed by Brady Eidson.

* DerivedSources.make:
I mistakenly added PendingDownload.messages.in in <a href="http://trac.webkit.org/projects/webkit/changeset/194810">r194810</a>, but this will not be needed because
the PendingDownload is not a MessageReceiver.  Rather, the NetworkProcess receives the messages
and forwards their contents to the PendingDownload through its DownloadManager.
* NetworkProcess/Downloads/DownloadManager.cpp:
(WebKit::DownloadManager::dataTaskBecameDownloadTask):
(WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
(WebKit::DownloadManager::convertHandleToDownload):
* NetworkProcess/Downloads/DownloadManager.h:
* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::continueWillSendRequest):
(WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync):
Instead of taking a shortcut I added in <a href="http://trac.webkit.org/projects/webkit/changeset/194810">r194810</a>, send a message to the UI process and wait for its
asynchronous reply to determine if we can authenticate against this protection space.
(WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace):
(WebKit::PendingDownload::didConvertToDownload):
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/Downloads/PendingDownload.messages.in: Removed.
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::cancelDownload):
(WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
(WebKit::NetworkProcess::setCacheModel):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* Shared/Authentication/AuthenticationManager.h:
* UIProcess/API/APIDownloadClient.h:
(API::DownloadClient::didFail):
(API::DownloadClient::didCancel):
(API::DownloadClient::processDidCrash):
(API::DownloadClient::canAuthenticateAgainstProtectionSpace):
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
(WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace):
(WebKit::DownloadProxy::didReceiveResponse):
* UIProcess/Downloads/DownloadProxy.h:
* UIProcess/Downloads/DownloadProxy.messages.in:
* WebKit2.xcodeproj/project.pbxproj:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2DerivedSourcesmake">trunk/Source/WebKit2/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessDownloadsDownloadManagercpp">trunk/Source/WebKit2/NetworkProcess/Downloads/DownloadManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessDownloadsDownloadManagerh">trunk/Source/WebKit2/NetworkProcess/Downloads/DownloadManager.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessDownloadsPendingDownloadcpp">trunk/Source/WebKit2/NetworkProcess/Downloads/PendingDownload.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessDownloadsPendingDownloadh">trunk/Source/WebKit2/NetworkProcess/Downloads/PendingDownload.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkProcesscpp">trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkProcessh">trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h</a></li>
<li><a href="#trunkSourceWebKit2NetworkProcessNetworkProcessmessagesin">trunk/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in</a></li>
<li><a href="#trunkSourceWebKit2SharedAuthenticationAuthenticationManagerh">trunk/Source/WebKit2/Shared/Authentication/AuthenticationManager.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPIAPIDownloadClienth">trunk/Source/WebKit2/UIProcess/API/APIDownloadClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessDownloadsDownloadProxycpp">trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessDownloadsDownloadProxyh">trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessDownloadsDownloadProxymessagesin">trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj">trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2NetworkProcessDownloadsPendingDownloadmessagesin">trunk/Source/WebKit2/NetworkProcess/Downloads/PendingDownload.messages.in</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (194901 => 194902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-01-12 18:44:23 UTC (rev 194901)
+++ trunk/Source/WebKit2/ChangeLog        2016-01-12 18:48:31 UTC (rev 194902)
</span><span class="lines">@@ -1,3 +1,48 @@
</span><ins>+2016-01-12  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Ask for UI Process approval of ProtectionSpace when authenticating downloads with NetworkSession
+        https://bugs.webkit.org/show_bug.cgi?id=152999
+
+        Reviewed by Brady Eidson.
+
+        * DerivedSources.make:
+        I mistakenly added PendingDownload.messages.in in r194810, but this will not be needed because
+        the PendingDownload is not a MessageReceiver.  Rather, the NetworkProcess receives the messages
+        and forwards their contents to the PendingDownload through its DownloadManager.
+        * NetworkProcess/Downloads/DownloadManager.cpp:
+        (WebKit::DownloadManager::dataTaskBecameDownloadTask):
+        (WebKit::DownloadManager::continueCanAuthenticateAgainstProtectionSpace):
+        (WebKit::DownloadManager::convertHandleToDownload):
+        * NetworkProcess/Downloads/DownloadManager.h:
+        * NetworkProcess/Downloads/PendingDownload.cpp:
+        (WebKit::PendingDownload::continueWillSendRequest):
+        (WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync):
+        Instead of taking a shortcut I added in r194810, send a message to the UI process and wait for its
+        asynchronous reply to determine if we can authenticate against this protection space.
+        (WebKit::PendingDownload::continueCanAuthenticateAgainstProtectionSpace):
+        (WebKit::PendingDownload::didConvertToDownload):
+        * NetworkProcess/Downloads/PendingDownload.h:
+        * NetworkProcess/Downloads/PendingDownload.messages.in: Removed.
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::cancelDownload):
+        (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace):
+        (WebKit::NetworkProcess::setCacheModel):
+        * NetworkProcess/NetworkProcess.h:
+        * NetworkProcess/NetworkProcess.messages.in:
+        * Shared/Authentication/AuthenticationManager.h:
+        * UIProcess/API/APIDownloadClient.h:
+        (API::DownloadClient::didFail):
+        (API::DownloadClient::didCancel):
+        (API::DownloadClient::processDidCrash):
+        (API::DownloadClient::canAuthenticateAgainstProtectionSpace):
+        * UIProcess/Downloads/DownloadProxy.cpp:
+        (WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
+        (WebKit::DownloadProxy::canAuthenticateAgainstProtectionSpace):
+        (WebKit::DownloadProxy::didReceiveResponse):
+        * UIProcess/Downloads/DownloadProxy.h:
+        * UIProcess/Downloads/DownloadProxy.messages.in:
+        * WebKit2.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2016-01-12  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Move ChildProcessProxy from Shared to UIProcess
</span></span></pre></div>
<a id="trunkSourceWebKit2DerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/DerivedSources.make (194901 => 194902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/DerivedSources.make        2016-01-12 18:44:23 UTC (rev 194901)
+++ trunk/Source/WebKit2/DerivedSources.make        2016-01-12 18:48:31 UTC (rev 194902)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx">     $(WebKit2)/DatabaseProcess/mac \
</span><span class="cx">     $(WebKit2)/NetworkProcess \
</span><span class="cx">     $(WebKit2)/NetworkProcess/CustomProtocols \
</span><del>-    $(WebKit2)/NetworkProcess/Downloads \
</del><span class="cx">     $(WebKit2)/NetworkProcess/mac \
</span><span class="cx">     $(WebKit2)/PluginProcess \
</span><span class="cx">     $(WebKit2)/PluginProcess/mac \
</span><span class="lines">@@ -87,7 +86,6 @@
</span><span class="cx">     NetworkProcessConnection \
</span><span class="cx">     NetworkProcessProxy \
</span><span class="cx">     NetworkResourceLoader \
</span><del>-    PendingDownload \
</del><span class="cx">     PluginControllerProxy \
</span><span class="cx">     PluginProcess \
</span><span class="cx">     PluginProcessConnection \
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessDownloadsDownloadManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/Downloads/DownloadManager.cpp (194901 => 194902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/Downloads/DownloadManager.cpp        2016-01-12 18:44:23 UTC (rev 194901)
+++ trunk/Source/WebKit2/NetworkProcess/Downloads/DownloadManager.cpp        2016-01-12 18:48:31 UTC (rev 194902)
</span><span class="lines">@@ -73,6 +73,14 @@
</span><span class="cx">     m_downloads.add(downloadID, WTFMove(download));
</span><span class="cx">     return pendingDownload;
</span><span class="cx"> }
</span><ins>+    
+void DownloadManager::continueCanAuthenticateAgainstProtectionSpace(DownloadID downloadID, bool canAuthenticate)
+{
+    auto* pendingDownload = m_pendingDownloads.get(downloadID);
+    ASSERT(pendingDownload);
+    if (pendingDownload)
+        pendingDownload-&gt;continueCanAuthenticateAgainstProtectionSpace(canAuthenticate);
+}
</ins><span class="cx"> #else
</span><span class="cx"> void DownloadManager::convertHandleToDownload(DownloadID downloadID, ResourceHandle* handle, const ResourceRequest&amp; request, const ResourceResponse&amp; response)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessDownloadsDownloadManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/Downloads/DownloadManager.h (194901 => 194902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/Downloads/DownloadManager.h        2016-01-12 18:44:23 UTC (rev 194901)
+++ trunk/Source/WebKit2/NetworkProcess/Downloads/DownloadManager.h        2016-01-12 18:48:31 UTC (rev 194902)
</span><span class="lines">@@ -73,6 +73,7 @@
</span><span class="cx">     void startDownload(WebCore::SessionID, DownloadID, const WebCore::ResourceRequest&amp;);
</span><span class="cx"> #if USE(NETWORK_SESSION)
</span><span class="cx">     std::unique_ptr&lt;PendingDownload&gt; dataTaskBecameDownloadTask(DownloadID, std::unique_ptr&lt;Download&gt;&amp;&amp;);
</span><ins>+    void continueCanAuthenticateAgainstProtectionSpace(DownloadID, bool canAuthenticate);
</ins><span class="cx"> #else
</span><span class="cx">     void convertHandleToDownload(DownloadID, WebCore::ResourceHandle*, const WebCore::ResourceRequest&amp;, const WebCore::ResourceResponse&amp;);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessDownloadsPendingDownloadcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/Downloads/PendingDownload.cpp (194901 => 194902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/Downloads/PendingDownload.cpp        2016-01-12 18:44:23 UTC (rev 194901)
+++ trunk/Source/WebKit2/NetworkProcess/Downloads/PendingDownload.cpp        2016-01-12 18:48:31 UTC (rev 194902)
</span><span class="lines">@@ -28,8 +28,10 @@
</span><span class="cx"> 
</span><span class="cx"> #if USE(NETWORK_SESSION)
</span><span class="cx"> 
</span><ins>+#include &quot;DownloadProxyMessages.h&quot;
</ins><span class="cx"> #include &quot;NetworkLoad.h&quot;
</span><span class="cx"> #include &quot;NetworkProcess.h&quot;
</span><ins>+#include &quot;WebCoreArgumentCoders.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="lines">@@ -53,17 +55,16 @@
</span><span class="cx">     m_networkLoad-&gt;continueWillSendRequest(newRequest);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PendingDownload::canAuthenticateAgainstProtectionSpaceAsync(const WebCore::ProtectionSpace&amp;)
</del><ins>+void PendingDownload::canAuthenticateAgainstProtectionSpaceAsync(const WebCore::ProtectionSpace&amp; protectionSpace)
</ins><span class="cx"> {
</span><del>-    // FIXME: This should ask the UI process.
-    continueCanAuthenticateAgainstProtectionSpace(true);
</del><ins>+    send(Messages::DownloadProxy::CanAuthenticateAgainstProtectionSpace(protectionSpace));
</ins><span class="cx"> }
</span><del>-    
</del><ins>+
</ins><span class="cx"> void PendingDownload::continueCanAuthenticateAgainstProtectionSpace(bool canAuthenticate)
</span><span class="cx"> {
</span><span class="cx">     m_networkLoad-&gt;continueCanAuthenticateAgainstProtectionSpace(canAuthenticate);
</span><span class="cx"> }
</span><del>-    
</del><ins>+
</ins><span class="cx"> void PendingDownload::didConvertToDownload()
</span><span class="cx"> {
</span><span class="cx">     m_networkLoad = nullptr;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessDownloadsPendingDownloadh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/Downloads/PendingDownload.h (194901 => 194902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/Downloads/PendingDownload.h        2016-01-12 18:44:23 UTC (rev 194901)
+++ trunk/Source/WebKit2/NetworkProcess/Downloads/PendingDownload.h        2016-01-12 18:48:31 UTC (rev 194902)
</span><span class="lines">@@ -45,6 +45,9 @@
</span><span class="cx"> public:
</span><span class="cx">     PendingDownload(const NetworkLoadParameters&amp;, DownloadID);
</span><span class="cx"> 
</span><ins>+    void continueWillSendRequest(const WebCore::ResourceRequest&amp;);
+    void continueCanAuthenticateAgainstProtectionSpace(bool canAuthenticate);
+
</ins><span class="cx"> private:    
</span><span class="cx">     // NetworkLoadClient.
</span><span class="cx">     virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override { }
</span><span class="lines">@@ -60,9 +63,6 @@
</span><span class="cx">     virtual void willCacheResponseAsync(CFCachedURLResponseRef) override { }
</span><span class="cx"> #endif
</span><span class="cx">     
</span><del>-    void continueWillSendRequest(const WebCore::ResourceRequest&amp;);
-    void continueCanAuthenticateAgainstProtectionSpace(bool canAuthenticate);
-
</del><span class="cx">     // MessageSender.
</span><span class="cx">     virtual IPC::Connection* messageSenderConnection() override;
</span><span class="cx">     virtual uint64_t messageSenderDestinationID() override;
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessDownloadsPendingDownloadmessagesin"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebKit2/NetworkProcess/Downloads/PendingDownload.messages.in (194901 => 194902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/Downloads/PendingDownload.messages.in        2016-01-12 18:44:23 UTC (rev 194901)
+++ trunk/Source/WebKit2/NetworkProcess/Downloads/PendingDownload.messages.in        2016-01-12 18:48:31 UTC (rev 194902)
</span><span class="lines">@@ -1,26 +0,0 @@
</span><del>-# Copyright (C) 2016 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.
-
-messages -&gt; PendingDownload {
-    ContinueWillSendRequest(WebCore::ResourceRequest request)
-    ContinueCanAuthenticateAgainstProtectionSpace(bool canAuthenticate)
-}
</del></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp (194901 => 194902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp        2016-01-12 18:44:23 UTC (rev 194901)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.cpp        2016-01-12 18:48:31 UTC (rev 194902)
</span><span class="lines">@@ -446,6 +446,13 @@
</span><span class="cx"> {
</span><span class="cx">     downloadManager().cancelDownload(downloadID);
</span><span class="cx"> }
</span><ins>+    
+#if USE(NETWORK_SESSION)
+void NetworkProcess::continueCanAuthenticateAgainstProtectionSpace(DownloadID downloadID, bool canAuthenticate)
+{
+    downloadManager().continueCanAuthenticateAgainstProtectionSpace(downloadID, canAuthenticate);
+}
+#endif
</ins><span class="cx"> 
</span><span class="cx"> void NetworkProcess::setCacheModel(uint32_t cm)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h (194901 => 194902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h        2016-01-12 18:44:23 UTC (rev 194901)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.h        2016-01-12 18:48:31 UTC (rev 194902)
</span><span class="lines">@@ -152,6 +152,9 @@
</span><span class="cx">     void downloadRequest(WebCore::SessionID, DownloadID, const WebCore::ResourceRequest&amp;);
</span><span class="cx">     void resumeDownload(WebCore::SessionID, DownloadID, const IPC::DataReference&amp; resumeData, const String&amp; path, const SandboxExtension::Handle&amp;);
</span><span class="cx">     void cancelDownload(DownloadID);
</span><ins>+#if USE(NETWORK_SESSION)
+    void continueCanAuthenticateAgainstProtectionSpace(DownloadID, bool canAuthenticate);
+#endif
</ins><span class="cx">     void setCacheModel(uint32_t);
</span><span class="cx">     void allowSpecificHTTPSCertificateForHost(const WebCore::CertificateInfo&amp;, const String&amp; host);
</span><span class="cx">     void setCanHandleHTTPSServerTrustEvaluation(bool);
</span></span></pre></div>
<a id="trunkSourceWebKit2NetworkProcessNetworkProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in (194901 => 194902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in        2016-01-12 18:44:23 UTC (rev 194901)
+++ trunk/Source/WebKit2/NetworkProcess/NetworkProcess.messages.in        2016-01-12 18:48:31 UTC (rev 194902)
</span><span class="lines">@@ -42,6 +42,9 @@
</span><span class="cx">     DownloadRequest(WebCore::SessionID sessionID, WebKit::DownloadID downloadID, WebCore::ResourceRequest request)
</span><span class="cx">     ResumeDownload(WebCore::SessionID sessionID, WebKit::DownloadID downloadID, IPC::DataReference resumeData, String path, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
</span><span class="cx">     CancelDownload(WebKit::DownloadID downloadID)
</span><ins>+#if USE(NETWORK_SESSION)
+    ContinueCanAuthenticateAgainstProtectionSpace(WebKit::DownloadID downloadID, bool canAuthenticate)
+#endif
</ins><span class="cx"> 
</span><span class="cx">     SetProcessSuppressionEnabled(bool flag)
</span><span class="cx"> #if PLATFORM(COCOA)
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedAuthenticationAuthenticationManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/Authentication/AuthenticationManager.h (194901 => 194902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/Authentication/AuthenticationManager.h        2016-01-12 18:44:23 UTC (rev 194901)
+++ trunk/Source/WebKit2/Shared/Authentication/AuthenticationManager.h        2016-01-12 18:48:31 UTC (rev 194902)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> 
</span><span class="cx"> class ChildProcess;
</span><span class="cx"> class Download;
</span><ins>+class DownloadID;
</ins><span class="cx"> class PendingDownload;
</span><span class="cx"> class WebFrame;
</span><span class="cx"> 
</span><span class="lines">@@ -58,6 +59,7 @@
</span><span class="cx">     typedef NetworkSessionTaskClient::ChallengeCompletionHandler ChallengeCompletionHandler;
</span><span class="cx">     void didReceiveAuthenticationChallenge(uint64_t pageID, uint64_t frameID, const WebCore::AuthenticationChallenge&amp;, ChallengeCompletionHandler);
</span><span class="cx">     void didReceiveAuthenticationChallenge(PendingDownload&amp;, const WebCore::AuthenticationChallenge&amp;, ChallengeCompletionHandler);
</span><ins>+    void continueCanAuthenticateAgainstProtectionSpace(DownloadID, bool canAuthenticate);
</ins><span class="cx"> #endif
</span><span class="cx">     // Called for resources in the WebProcess (NetworkProcess disabled)
</span><span class="cx">     void didReceiveAuthenticationChallenge(WebFrame*, const WebCore::AuthenticationChallenge&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPIAPIDownloadClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/APIDownloadClient.h (194901 => 194902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/APIDownloadClient.h        2016-01-12 18:44:23 UTC (rev 194901)
+++ trunk/Source/WebKit2/UIProcess/API/APIDownloadClient.h        2016-01-12 18:48:31 UTC (rev 194902)
</span><span class="lines">@@ -37,6 +37,7 @@
</span><span class="cx"> class AuthenticationChallengeProxy;
</span><span class="cx"> class DownloadProxy;
</span><span class="cx"> class WebProcessPool;
</span><ins>+class WebProtectionSpace;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace API {
</span><span class="lines">@@ -56,6 +57,7 @@
</span><span class="cx">     virtual void didFail(WebKit::WebProcessPool*, WebKit::DownloadProxy*, const WebCore::ResourceError&amp;) { }
</span><span class="cx">     virtual void didCancel(WebKit::WebProcessPool*, WebKit::DownloadProxy*) { }
</span><span class="cx">     virtual void processDidCrash(WebKit::WebProcessPool*, WebKit::DownloadProxy*) { }
</span><ins>+    virtual bool canAuthenticateAgainstProtectionSpace(WebKit::WebProtectionSpace*) { return true; }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace API
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessDownloadsDownloadProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp (194901 => 194902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp        2016-01-12 18:44:23 UTC (rev 194901)
+++ trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.cpp        2016-01-12 18:48:31 UTC (rev 194902)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> #include &quot;NetworkProcessProxy.h&quot;
</span><span class="cx"> #include &quot;WebProcessMessages.h&quot;
</span><span class="cx"> #include &quot;WebProcessPool.h&quot;
</span><ins>+#include &quot;WebProtectionSpace.h&quot;
</ins><span class="cx"> #include &lt;wtf/text/CString.h&gt;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -109,6 +110,22 @@
</span><span class="cx">     m_processPool-&gt;downloadClient().didReceiveAuthenticationChallenge(m_processPool.get(), this, authenticationChallengeProxy.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if USE(NETWORK_SESSION)
+void DownloadProxy::canAuthenticateAgainstProtectionSpace(const WebCore::ProtectionSpace&amp; protectionSpace)
+{
+    if (!m_processPool)
+        return;
+    
+    auto* networkProcessProxy = m_processPool-&gt;networkProcess();
+    if (!networkProcessProxy)
+        return;
+
+    bool result = m_processPool-&gt;downloadClient().canAuthenticateAgainstProtectionSpace(getPtr(WebProtectionSpace::create(protectionSpace)));
+    
+    networkProcessProxy-&gt;connection()-&gt;send(Messages::NetworkProcess::ContinueCanAuthenticateAgainstProtectionSpace(m_downloadID, result), 0);
+}
+#endif
+
</ins><span class="cx"> void DownloadProxy::didReceiveResponse(const ResourceResponse&amp; response)
</span><span class="cx"> {
</span><span class="cx">     if (!m_processPool)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessDownloadsDownloadProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h (194901 => 194902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h        2016-01-12 18:44:23 UTC (rev 194901)
+++ trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.h        2016-01-12 18:48:31 UTC (rev 194902)
</span><span class="lines">@@ -39,9 +39,10 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><del>-    class AuthenticationChallenge;
-    class ResourceError;
-    class ResourceResponse;
</del><ins>+class AuthenticationChallenge;
+class ProtectionSpace;
+class ResourceError;
+class ResourceResponse;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -85,6 +86,9 @@
</span><span class="cx">     void didFinish();
</span><span class="cx">     void didFail(const WebCore::ResourceError&amp;, const IPC::DataReference&amp; resumeData);
</span><span class="cx">     void didCancel(const IPC::DataReference&amp; resumeData);
</span><ins>+#if USE(NETWORK_SESSION)
+    void canAuthenticateAgainstProtectionSpace(const WebCore::ProtectionSpace&amp;);
+#endif
</ins><span class="cx"> 
</span><span class="cx">     DownloadProxyMap&amp; m_downloadProxyMap;
</span><span class="cx">     RefPtr&lt;WebProcessPool&gt; m_processPool;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessDownloadsDownloadProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.messages.in (194901 => 194902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.messages.in        2016-01-12 18:44:23 UTC (rev 194901)
+++ trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxy.messages.in        2016-01-12 18:48:31 UTC (rev 194902)
</span><span class="lines">@@ -23,6 +23,9 @@
</span><span class="cx"> messages -&gt; DownloadProxy {
</span><span class="cx">     DidStart(WebCore::ResourceRequest request)
</span><span class="cx">     DidReceiveAuthenticationChallenge(WebCore::AuthenticationChallenge challenge, uint64_t challengeID)
</span><ins>+#if USE(NETWORK_SESSION)
+    CanAuthenticateAgainstProtectionSpace(WebCore::ProtectionSpace protectionSpace)
+#endif
</ins><span class="cx"> 
</span><span class="cx">     DidReceiveResponse(WebCore::ResourceResponse response)
</span><span class="cx">     DidReceiveData(uint64_t length)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (194901 => 194902)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-01-12 18:44:23 UTC (rev 194901)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2016-01-12 18:48:31 UTC (rev 194902)
</span><span class="lines">@@ -3256,7 +3256,6 @@
</span><span class="cx">                 5C20CB9E1BB0DD1800895BB1 /* NetworkSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkSession.h; path = NetworkProcess/NetworkSession.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5C298D9E1C3DEF2900470AFE /* PendingDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PendingDownload.h; path = NetworkProcess/Downloads/PendingDownload.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5C85C7861C3F23C50061A4FA /* PendingDownload.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PendingDownload.cpp; path = NetworkProcess/Downloads/PendingDownload.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                5C85C7891C3F28400061A4FA /* PendingDownload.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = PendingDownload.messages.in; path = NetworkProcess/Downloads/PendingDownload.messages.in; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><span class="cx">                 5D442A5516D5856700AC3331 /* PluginService.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PluginService.entitlements; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5DA6ED081490606900B41D12 /* DynamicLinkerEnvironmentExtractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLinkerEnvironmentExtractor.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 5DA6ED091490606900B41D12 /* DynamicLinkerEnvironmentExtractor.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DynamicLinkerEnvironmentExtractor.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -5829,7 +5828,6 @@
</span><span class="cx">                 5C1426F11C23F81700D41183 /* Downloads */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><del>-                                5C85C7891C3F28400061A4FA /* PendingDownload.messages.in */,
</del><span class="cx">                                 5C85C7861C3F23C50061A4FA /* PendingDownload.cpp */,
</span><span class="cx">                                 5C298D9E1C3DEF2900470AFE /* PendingDownload.h */,
</span><span class="cx">                                 5C14270C1C23F87700D41183 /* ios */,
</span></span></pre>
</div>
</div>

</body>
</html>