Title: [234941] trunk/Source/WebKit
Revision
234941
Author
[email protected]
Date
2018-08-16 10:59:30 -0700 (Thu, 16 Aug 2018)

Log Message

Stop using canAuthenticateAgainstProtectionSpace in modern WebKit
https://bugs.webkit.org/show_bug.cgi?id=188639

Reviewed by Youenn Fablet.

canAuthenticateAgainstProtectionSpace is an unnecessary step in the authentication process.
It is leftover from when it was necessary when we used NSURLConnection, which is only used in WebKitLegacy now.
Now it's just an extra IPC roundtrip asking if we should use NSURLSessionAuthChallengeRejectProtectionSpace
or if we are going to ask the API client.  We can move this step into the C API for compatibility
with the 1 client that still uses it (not for long, see rdar://problem/43358403) and simplify and optimize
authentication.

* NetworkProcess/Downloads/PendingDownload.cpp:
(WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/NetworkCORSPreflightChecker.cpp:
(WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::~NetworkLoad):
(WebKit::NetworkLoad::didReceiveChallenge):
(WebKit::NetworkLoad::completeAuthenticationChallenge): Deleted.
(WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace): Deleted.
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkLoadClient.h:
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::cancelDownload):
(WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace): Deleted.
(WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace): Deleted.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/PreconnectTask.cpp:
(WebKit::PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
* NetworkProcess/PreconnectTask.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
* Shared/Authentication/AuthenticationManager.cpp:
(WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
* Shared/Authentication/AuthenticationManager.h:
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient):
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
(WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace): Deleted.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace): Deleted.
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::canAuthenticateAgainstProtectionSpace): Deleted.
* UIProcess/WebPageProxy.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (234940 => 234941)


--- trunk/Source/WebKit/ChangeLog	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/ChangeLog	2018-08-16 17:59:30 UTC (rev 234941)
@@ -1,3 +1,63 @@
+2018-08-16  Alex Christensen  <[email protected]>
+
+        Stop using canAuthenticateAgainstProtectionSpace in modern WebKit
+        https://bugs.webkit.org/show_bug.cgi?id=188639
+
+        Reviewed by Youenn Fablet.
+
+        canAuthenticateAgainstProtectionSpace is an unnecessary step in the authentication process.
+        It is leftover from when it was necessary when we used NSURLConnection, which is only used in WebKitLegacy now.
+        Now it's just an extra IPC roundtrip asking if we should use NSURLSessionAuthChallengeRejectProtectionSpace
+        or if we are going to ask the API client.  We can move this step into the C API for compatibility
+        with the 1 client that still uses it (not for long, see rdar://problem/43358403) and simplify and optimize
+        authentication.
+
+        * NetworkProcess/Downloads/PendingDownload.cpp:
+        (WebKit::PendingDownload::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
+        * NetworkProcess/Downloads/PendingDownload.h:
+        * NetworkProcess/NetworkCORSPreflightChecker.cpp:
+        (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
+        * NetworkProcess/NetworkLoad.cpp:
+        (WebKit::NetworkLoad::~NetworkLoad):
+        (WebKit::NetworkLoad::didReceiveChallenge):
+        (WebKit::NetworkLoad::completeAuthenticationChallenge): Deleted.
+        (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace): Deleted.
+        * NetworkProcess/NetworkLoad.h:
+        * NetworkProcess/NetworkLoadClient.h:
+        * NetworkProcess/NetworkProcess.cpp:
+        (WebKit::NetworkProcess::cancelDownload):
+        (WebKit::NetworkProcess::canAuthenticateAgainstProtectionSpace): Deleted.
+        (WebKit::NetworkProcess::continueCanAuthenticateAgainstProtectionSpace): Deleted.
+        * NetworkProcess/NetworkProcess.h:
+        * NetworkProcess/NetworkProcess.messages.in:
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        (WebKit::NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
+        * NetworkProcess/NetworkResourceLoader.h:
+        * NetworkProcess/PreconnectTask.cpp:
+        (WebKit::PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
+        * NetworkProcess/PreconnectTask.h:
+        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
+        (WebKit::NetworkCache::SpeculativeLoad::canAuthenticateAgainstProtectionSpaceAsync): Deleted.
+        * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
+        * Shared/Authentication/AuthenticationManager.cpp:
+        (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
+        * Shared/Authentication/AuthenticationManager.h:
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageSetPageNavigationClient):
+        * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
+        * UIProcess/Cocoa/NavigationState.h:
+        * UIProcess/Cocoa/NavigationState.mm:
+        (WebKit::NavigationState::setNavigationDelegate):
+        (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
+        (WebKit::NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace): Deleted.
+        * UIProcess/Network/NetworkProcessProxy.cpp:
+        (WebKit::NetworkProcessProxy::canAuthenticateAgainstProtectionSpace): Deleted.
+        * UIProcess/Network/NetworkProcessProxy.h:
+        * UIProcess/Network/NetworkProcessProxy.messages.in:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::canAuthenticateAgainstProtectionSpace): Deleted.
+        * UIProcess/WebPageProxy.h:
+
 2018-08-15  Jer Noble  <[email protected]>
 
         Add Experimental Feature support for SourceBuffer.changeType()

Modified: trunk/Source/WebKit/NetworkProcess/Downloads/PendingDownload.cpp (234940 => 234941)


--- trunk/Source/WebKit/NetworkProcess/Downloads/PendingDownload.cpp	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/NetworkProcess/Downloads/PendingDownload.cpp	2018-08-16 17:59:30 UTC (rev 234941)
@@ -76,13 +76,6 @@
     send(Messages::DownloadProxy::DidCancel({ }));
 }
 
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-void PendingDownload::canAuthenticateAgainstProtectionSpaceAsync(const WebCore::ProtectionSpace& protectionSpace)
-{
-    m_networkLoad->continueCanAuthenticateAgainstProtectionSpace(true);
-}
-#endif
-
 void PendingDownload::didFailLoading(const WebCore::ResourceError& error)
 {
     send(Messages::DownloadProxy::DidFail(error, { }));

Modified: trunk/Source/WebKit/NetworkProcess/Downloads/PendingDownload.h (234940 => 234941)


--- trunk/Source/WebKit/NetworkProcess/Downloads/PendingDownload.h	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/NetworkProcess/Downloads/PendingDownload.h	2018-08-16 17:59:30 UTC (rev 234941)
@@ -51,9 +51,6 @@
 private:    
     // NetworkLoadClient.
     void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override { }
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    void canAuthenticateAgainstProtectionSpaceAsync(const WebCore::ProtectionSpace&) override;
-#endif
     bool isSynchronous() const override { return false; }
     bool isAllowedToAskUserForCredentials() const final { return m_isAllowedToAskUserForCredentials; }
     void willSendRedirectedRequest(WebCore::ResourceRequest&&, WebCore::ResourceRequest&& redirectRequest, WebCore::ResourceResponse&& redirectResponse) override;

Modified: trunk/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp (234940 => 234941)


--- trunk/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp	2018-08-16 17:59:30 UTC (rev 234941)
@@ -102,15 +102,7 @@
         return;
     }
 
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    NetworkProcess::singleton().canAuthenticateAgainstProtectionSpace(challenge.protectionSpace(), m_parameters.pageID, m_parameters.frameID, [this, weakThis = makeWeakPtr(this), completionHandler = WTFMove(completionHandler), challenge = WTFMove(challenge)] (bool canAuthenticate) mutable {
-        if (!canAuthenticate)
-            return completionHandler(AuthenticationChallengeDisposition::RejectProtectionSpace, { });
-        NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge(m_parameters.pageID, m_parameters.frameID, challenge, WTFMove(completionHandler));
-    });
-#else
     NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge(m_parameters.pageID, m_parameters.frameID, challenge, WTFMove(completionHandler));
-#endif
 }
 
 void NetworkCORSPreflightChecker::didReceiveResponseNetworkSession(WebCore::ResourceResponse&& response, ResponseCompletionHandler&& completionHandler)

Modified: trunk/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.h (234940 => 234941)


--- trunk/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.h	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.h	2018-08-16 17:59:30 UTC (rev 234941)
@@ -39,7 +39,7 @@
 
 namespace WebKit {
 
-class NetworkCORSPreflightChecker final : private NetworkDataTaskClient, public CanMakeWeakPtr<NetworkCORSPreflightChecker> {
+class NetworkCORSPreflightChecker final : private NetworkDataTaskClient {
     WTF_MAKE_FAST_ALLOCATED;
 public:
     struct Parameters {

Modified: trunk/Source/WebKit/NetworkProcess/NetworkLoad.cpp (234940 => 234941)


--- trunk/Source/WebKit/NetworkProcess/NetworkLoad.cpp	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/NetworkProcess/NetworkLoad.cpp	2018-08-16 17:59:30 UTC (rev 234941)
@@ -42,6 +42,7 @@
 
 #if PLATFORM(COCOA)
 #include "NetworkDataTaskCocoa.h"
+#include "NetworkSessionCocoa.h"
 #endif
 
 #if ENABLE(NETWORK_CAPTURE)
@@ -121,10 +122,6 @@
         m_redirectCompletionHandler({ });
     if (m_responseCompletionHandler)
         m_responseCompletionHandler(PolicyAction::Ignore);
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    if (m_challengeCompletionHandler)
-        m_challengeCompletionHandler(AuthenticationChallengeDisposition::Cancel, { });
-#endif
     if (m_task)
         m_task->clearClient();
 }
@@ -256,18 +253,7 @@
 
 void NetworkLoad::didReceiveChallenge(AuthenticationChallenge&& challenge, ChallengeCompletionHandler&& completionHandler)
 {
-    m_challenge = challenge;
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    m_challengeCompletionHandler = WTFMove(completionHandler);
-    m_client.get().canAuthenticateAgainstProtectionSpaceAsync(challenge.protectionSpace());
-#else
-    completeAuthenticationChallenge(WTFMove(completionHandler));
-#endif
-}
-
-void NetworkLoad::completeAuthenticationChallenge(ChallengeCompletionHandler&& completionHandler)
-{
-    auto scheme = m_challenge->protectionSpace().authenticationScheme();
+    auto scheme = challenge.protectionSpace().authenticationScheme();
     bool isTLSHandshake = scheme == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested
         || scheme == ProtectionSpaceAuthenticationSchemeClientCertificateRequested;
     if (!isAllowedToAskUserForCredentials() && !isTLSHandshake) {
@@ -276,36 +262,18 @@
         return;
     }
 
-    if (!m_task)
-        return;
-
+#if PLATFORM(COCOA)
+    if (scheme == ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested
+        && NetworkSessionCocoa::allowsSpecificHTTPSCertificateForHost(challenge))
+        return completionHandler(AuthenticationChallengeDisposition::UseCredential, serverTrustCredential(challenge));
+#endif
+    
     if (auto* pendingDownload = m_task->pendingDownload())
-        NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge(*pendingDownload, *m_challenge, WTFMove(completionHandler));
+        NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge(*pendingDownload, challenge, WTFMove(completionHandler));
     else
-        NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge(m_parameters.webPageID, m_parameters.webFrameID, *m_challenge, WTFMove(completionHandler));
+        NetworkProcess::singleton().authenticationManager().didReceiveAuthenticationChallenge(m_parameters.webPageID, m_parameters.webFrameID, challenge, WTFMove(completionHandler));
 }
 
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-void NetworkLoad::continueCanAuthenticateAgainstProtectionSpace(bool result)
-{
-    if (!m_challengeCompletionHandler) {
-        ASSERT_NOT_REACHED();
-        return;
-    }
-
-    auto completionHandler = std::exchange(m_challengeCompletionHandler, nullptr);
-    if (!result) {
-        if (NetworkSession::allowsSpecificHTTPSCertificateForHost(*m_challenge))
-            completionHandler(AuthenticationChallengeDisposition::UseCredential, serverTrustCredential(*m_challenge));
-        else
-            completionHandler(AuthenticationChallengeDisposition::RejectProtectionSpace, { });
-        return;
-    }
-
-    completeAuthenticationChallenge(WTFMove(completionHandler));
-}
-#endif
-
 void NetworkLoad::didReceiveResponseNetworkSession(ResourceResponse&& response, ResponseCompletionHandler&& completionHandler)
 {
     ASSERT(RunLoop::isMain());

Modified: trunk/Source/WebKit/NetworkProcess/NetworkLoad.h (234940 => 234941)


--- trunk/Source/WebKit/NetworkProcess/NetworkLoad.h	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/NetworkProcess/NetworkLoad.h	2018-08-16 17:59:30 UTC (rev 234941)
@@ -69,10 +69,6 @@
 
     bool shouldCaptureExtraNetworkLoadMetrics() const final;
 
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    void continueCanAuthenticateAgainstProtectionSpace(bool);
-#endif
-
     String description() const;
 
 private:
@@ -95,16 +91,10 @@
     void notifyDidReceiveResponse(WebCore::ResourceResponse&&, ResponseCompletionHandler&&);
     void throttleDelayCompleted();
 
-    void completeAuthenticationChallenge(ChallengeCompletionHandler&&);
-
     std::reference_wrapper<NetworkLoadClient> m_client;
     const NetworkLoadParameters m_parameters;
     CompletionHandler<void(WebCore::ResourceRequest&&)> m_redirectCompletionHandler;
     RefPtr<NetworkDataTask> m_task;
-    std::optional<WebCore::AuthenticationChallenge> m_challenge;
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    ChallengeCompletionHandler m_challengeCompletionHandler;
-#endif
     ResponseCompletionHandler m_responseCompletionHandler;
     
     struct Throttle;

Modified: trunk/Source/WebKit/NetworkProcess/NetworkLoadClient.h (234940 => 234941)


--- trunk/Source/WebKit/NetworkProcess/NetworkLoadClient.h	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/NetworkProcess/NetworkLoadClient.h	2018-08-16 17:59:30 UTC (rev 234941)
@@ -47,9 +47,6 @@
     virtual bool isAllowedToAskUserForCredentials() const = 0;
 
     virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) = 0;
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    virtual void canAuthenticateAgainstProtectionSpaceAsync(const WebCore::ProtectionSpace&) = 0;
-#endif
     virtual void willSendRedirectedRequest(WebCore::ResourceRequest&&, WebCore::ResourceRequest&& redirectRequest, WebCore::ResourceResponse&& redirectResponse) = 0;
     enum class ShouldContinueDidReceiveResponse { No, Yes };
     virtual ShouldContinueDidReceiveResponse didReceiveResponse(WebCore::ResourceResponse&&) = 0;

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp (234940 => 234941)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2018-08-16 17:59:30 UTC (rev 234941)
@@ -667,27 +667,7 @@
 {
     downloadManager().cancelDownload(downloadID);
 }
-    
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-void NetworkProcess::canAuthenticateAgainstProtectionSpace(const WebCore::ProtectionSpace& protectionSpace, uint64_t pageID, uint64_t frameID, CompletionHandler<void(bool)>&& completionHandler)
-{
-    static uint64_t lastCompletionHandlerID = 0;
-    uint64_t completionHandlerID = ++lastCompletionHandlerID;
-    m_canAuthenticateAgainstProtectionSpaceCompletionHandlers.add(completionHandlerID, WTFMove(completionHandler));
-    parentProcessConnection()->send(Messages::NetworkProcessProxy::CanAuthenticateAgainstProtectionSpace(completionHandlerID, pageID, frameID, protectionSpace), 0);
-}
 
-void NetworkProcess::continueCanAuthenticateAgainstProtectionSpace(uint64_t completionHandlerID, bool canAuthenticate)
-{
-    if (auto completionHandler = m_canAuthenticateAgainstProtectionSpaceCompletionHandlers.take(completionHandlerID)) {
-        completionHandler(canAuthenticate);
-        return;
-    }
-    ASSERT_NOT_REACHED();
-}
-
-#endif
-
 void NetworkProcess::continueWillSendRequest(DownloadID downloadID, WebCore::ResourceRequest&& request)
 {
     downloadManager().continueWillSendRequest(downloadID, WTFMove(request));

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.h (234940 => 234941)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.h	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.h	2018-08-16 17:59:30 UTC (rev 234941)
@@ -123,10 +123,6 @@
 
     void findPendingDownloadLocation(NetworkDataTask&, ResponseCompletionHandler&&, const WebCore::ResourceResponse&);
 
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    void canAuthenticateAgainstProtectionSpace(const WebCore::ProtectionSpace&, uint64_t pageID, uint64_t frameID, CompletionHandler<void(bool)>&&);
-#endif
-
     void prefetchDNS(const String&);
 
     void addWebsiteDataStore(WebsiteDataStoreParameters&&);
@@ -222,9 +218,6 @@
     void downloadRequest(PAL::SessionID, DownloadID, const WebCore::ResourceRequest&, const String& suggestedFilename);
     void resumeDownload(PAL::SessionID, DownloadID, const IPC::DataReference& resumeData, const String& path, SandboxExtension::Handle&&);
     void cancelDownload(DownloadID);
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    void continueCanAuthenticateAgainstProtectionSpace(uint64_t completionHandlerID, bool canAuthenticate);
-#endif
     void continueWillSendRequest(DownloadID, WebCore::ResourceRequest&&);
     void continueDecidePendingDownloadDestination(DownloadID, String destination, SandboxExtension::Handle&&, bool allowOverwrite);
 
@@ -283,9 +276,6 @@
     NetworkProcessSupplementMap m_supplements;
 
     HashMap<uint64_t, Function<void()>> m_sandboxExtensionForBlobsCompletionHandlers;
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    HashMap<uint64_t, CompletionHandler<void(bool)>> m_canAuthenticateAgainstProtectionSpaceCompletionHandlers;
-#endif
     HashSet<PAL::SessionID> m_sessionsControlledByAutomation;
 
     HashMap<PAL::SessionID, Vector<CacheStorageParametersCallback>> m_cacheStorageParametersCallbacks;

Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in (234940 => 234941)


--- trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcess.messages.in	2018-08-16 17:59:30 UTC (rev 234941)
@@ -46,9 +46,6 @@
     ResumeDownload(PAL::SessionID sessionID, WebKit::DownloadID downloadID, IPC::DataReference resumeData, String path, WebKit::SandboxExtension::Handle sandboxExtensionHandle)
     CancelDownload(WebKit::DownloadID downloadID)
 
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    ContinueCanAuthenticateAgainstProtectionSpace(uint64_t loaderID, bool canAuthenticate)
-#endif
     ContinueWillSendRequest(WebKit::DownloadID downloadID, WebCore::ResourceRequest request)
     ContinueDecidePendingDownloadDestination(WebKit::DownloadID downloadID, String destination, WebKit::SandboxExtension::Handle sandboxExtensionHandle, bool allowOverwrite)
 

Modified: trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp (234940 => 234941)


--- trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp	2018-08-16 17:59:30 UTC (rev 234941)
@@ -935,16 +935,6 @@
     m_fileReferences.clear();
 }
 
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-void NetworkResourceLoader::canAuthenticateAgainstProtectionSpaceAsync(const ProtectionSpace& protectionSpace)
-{
-    NetworkProcess::singleton().canAuthenticateAgainstProtectionSpace(protectionSpace, pageID(), frameID(), [this, protectedThis = makeRef(*this)] (bool result) {
-        if (m_networkLoad)
-            m_networkLoad->continueCanAuthenticateAgainstProtectionSpace(result);
-    });
-}
-#endif
-
 bool NetworkResourceLoader::isAlwaysOnLoggingAllowed() const
 {
     if (NetworkProcess::singleton().sessionIsControlledByAutomation(sessionID()))

Modified: trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.h (234940 => 234941)


--- trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.h	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/NetworkProcess/NetworkResourceLoader.h	2018-08-16 17:59:30 UTC (rev 234941)
@@ -94,9 +94,6 @@
 
     // NetworkLoadClient.
     void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override;
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    void canAuthenticateAgainstProtectionSpaceAsync(const WebCore::ProtectionSpace&) override;
-#endif
     bool isSynchronous() const override;
     bool isAllowedToAskUserForCredentials() const override { return m_isAllowedToAskUserForCredentials; }
     void willSendRedirectedRequest(WebCore::ResourceRequest&&, WebCore::ResourceRequest&& redirectRequest, WebCore::ResourceResponse&&) override;

Modified: trunk/Source/WebKit/NetworkProcess/PreconnectTask.cpp (234940 => 234941)


--- trunk/Source/WebKit/NetworkProcess/PreconnectTask.cpp	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/NetworkProcess/PreconnectTask.cpp	2018-08-16 17:59:30 UTC (rev 234941)
@@ -96,19 +96,6 @@
     ASSERT_NOT_REACHED();
 }
 
-void PreconnectTask::canAuthenticateAgainstProtectionSpaceAsync(const ProtectionSpace& protectionSpace)
-{
-    if (!pageID()) {
-        // The preconnect was started by the UIProcess.
-        m_networkLoad->continueCanAuthenticateAgainstProtectionSpace(false);
-        return;
-    }
-    NetworkProcess::singleton().canAuthenticateAgainstProtectionSpace(protectionSpace, pageID(), frameID(), [weakThis = makeWeakPtr(this)] (bool result) {
-        if (weakThis)
-            weakThis->m_networkLoad->continueCanAuthenticateAgainstProtectionSpace(result);
-    });
-}
-
 void PreconnectTask::didFinish(const ResourceError& error)
 {
     if (m_completionHandler)

Modified: trunk/Source/WebKit/NetworkProcess/PreconnectTask.h (234940 => 234941)


--- trunk/Source/WebKit/NetworkProcess/PreconnectTask.h	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/NetworkProcess/PreconnectTask.h	2018-08-16 17:59:30 UTC (rev 234941)
@@ -37,7 +37,7 @@
 class NetworkLoad;
 class NetworkLoadParameters;
 
-class PreconnectTask final : public NetworkLoadClient, public CanMakeWeakPtr<PreconnectTask> {
+class PreconnectTask final : public NetworkLoadClient {
 public:
     explicit PreconnectTask(NetworkLoadParameters&&, WTF::CompletionHandler<void(const WebCore::ResourceError&)>&& completionHandler = { });
     ~PreconnectTask();
@@ -50,7 +50,6 @@
     bool isSynchronous() const final { return false; }
     bool isAllowedToAskUserForCredentials() const final { return false; }
     void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) final;
-    void canAuthenticateAgainstProtectionSpaceAsync(const WebCore::ProtectionSpace&) final;
     void willSendRedirectedRequest(WebCore::ResourceRequest&&, WebCore::ResourceRequest&& redirectRequest, WebCore::ResourceResponse&& redirectResponse) final;
     ShouldContinueDidReceiveResponse didReceiveResponse(WebCore::ResourceResponse&&) final;
     void didReceiveBuffer(Ref<WebCore::SharedBuffer>&&, int reportedEncodedDataLength) final;

Modified: trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp (234940 => 234941)


--- trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp	2018-08-16 17:59:30 UTC (rev 234941)
@@ -122,13 +122,6 @@
     didComplete();
 }
 
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-void SpeculativeLoad::canAuthenticateAgainstProtectionSpaceAsync(const WebCore::ProtectionSpace&)
-{
-    m_networkLoad->continueCanAuthenticateAgainstProtectionSpace(false);
-}
-#endif
-
 void SpeculativeLoad::didFailLoading(const ResourceError&)
 {
     if (m_didComplete)

Modified: trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.h (234940 => 234941)


--- trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.h	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.h	2018-08-16 17:59:30 UTC (rev 234941)
@@ -53,9 +53,6 @@
 private:
     // NetworkLoadClient.
     void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent) override { }
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    void canAuthenticateAgainstProtectionSpaceAsync(const WebCore::ProtectionSpace&) override;
-#endif
     bool isSynchronous() const override { return false; }
     bool isAllowedToAskUserForCredentials() const final { return false; }
     void willSendRedirectedRequest(WebCore::ResourceRequest&&, WebCore::ResourceRequest&& redirectRequest, WebCore::ResourceResponse&& redirectResponse) override;

Modified: trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.cpp (234940 => 234941)


--- trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.cpp	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.cpp	2018-08-16 17:59:30 UTC (rev 234941)
@@ -111,8 +111,8 @@
 
 void AuthenticationManager::didReceiveAuthenticationChallenge(uint64_t pageID, uint64_t frameID, const AuthenticationChallenge& authenticationChallenge, ChallengeCompletionHandler&& completionHandler)
 {
-    ASSERT(pageID);
-    ASSERT(frameID);
+    if (!pageID || !frameID) // Initiated by SpeculativeLoadManager
+        return completionHandler(AuthenticationChallengeDisposition::RejectProtectionSpace, { });
 
     uint64_t challengeID = addChallengeToChallengeMap({ pageID, authenticationChallenge, WTFMove(completionHandler) });
 

Modified: trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.h (234940 => 234941)


--- trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.h	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/Shared/Authentication/AuthenticationManager.h	2018-08-16 17:59:30 UTC (rev 234941)
@@ -68,9 +68,6 @@
 
     void didReceiveAuthenticationChallenge(uint64_t pageID, uint64_t frameID, const WebCore::AuthenticationChallenge&, ChallengeCompletionHandler&&);
     void didReceiveAuthenticationChallenge(IPC::MessageSender& download, const WebCore::AuthenticationChallenge&, ChallengeCompletionHandler&&);
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    void continueCanAuthenticateAgainstProtectionSpace(DownloadID, bool canAuthenticate);
-#endif
 
     void useCredentialForChallenge(uint64_t challengeID, const WebCore::Credential&);
     void continueWithoutCredentialForChallenge(uint64_t challengeID);

Modified: trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp (234940 => 234941)


--- trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/UIProcess/API/C/WKPage.cpp	2018-08-16 17:59:30 UTC (rev 234941)
@@ -2297,8 +2297,10 @@
         
         void didReceiveAuthenticationChallenge(WebPageProxy& page, AuthenticationChallengeProxy& authenticationChallenge) override
         {
+            if (m_client.canAuthenticateAgainstProtectionSpace && !m_client.canAuthenticateAgainstProtectionSpace(toAPI(&page), toAPI(authenticationChallenge.protectionSpace()), m_client.base.clientInfo))
+                return authenticationChallenge.rejectProtectionSpaceAndContinue();
             if (!m_client.didReceiveAuthenticationChallenge)
-                return;
+                return authenticationChallenge.rejectProtectionSpaceAndContinue();
             m_client.didReceiveAuthenticationChallenge(toAPI(&page), toAPI(&authenticationChallenge), m_client.base.clientInfo);
         }
 

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h (234940 => 234941)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h	2018-08-16 17:59:30 UTC (rev 234941)
@@ -75,8 +75,6 @@
 
 - (void)_webView:(WKWebView *)webView renderingProgressDidChange:(_WKRenderingProgressEvents)progressEvents;
 
-- (void)_webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge WK_API_DEPRECATED_WITH_REPLACEMENT("webView:didReceiveAuthenticationChallenge:completionHandler:", macosx(10.10, 10.13.4), ios(8.0, 11.3));
-
 - (void)_webViewWebProcessDidCrash:(WKWebView *)webView;
 - (void)_webViewWebProcessDidBecomeResponsive:(WKWebView *)webView;
 - (void)_webViewWebProcessDidBecomeUnresponsive:(WKWebView *)webView;

Modified: trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h (234940 => 234941)


--- trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.h	2018-08-16 17:59:30 UTC (rev 234941)
@@ -108,7 +108,6 @@
 
         void renderingProgressDidChange(WebPageProxy&, WebCore::LayoutMilestones) override;
 
-        bool canAuthenticateAgainstProtectionSpace(WebPageProxy&, WebProtectionSpace*) override;
         void didReceiveAuthenticationChallenge(WebPageProxy&, AuthenticationChallengeProxy&) override;
         bool processDidTerminate(WebPageProxy&, ProcessTerminationReason) override;
         void processDidBecomeResponsive(WebPageProxy&) override;
@@ -207,7 +206,6 @@
         bool webViewDidReceiveAuthenticationChallengeCompletionHandler : 1;
         bool webViewWebContentProcessDidTerminate : 1;
         bool webViewWebContentProcessDidTerminateWithReason : 1;
-        bool webViewDidReceiveAuthenticationChallenge : 1;
         bool webViewWebProcessDidCrash : 1;
         bool webViewWebProcessDidBecomeResponsive : 1;
         bool webViewWebProcessDidBecomeUnresponsive : 1;

Modified: trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm (234940 => 234941)


--- trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/UIProcess/Cocoa/NavigationState.mm	2018-08-16 17:59:30 UTC (rev 234941)
@@ -164,7 +164,6 @@
     m_navigationDelegateMethods.webViewDidReceiveAuthenticationChallengeCompletionHandler = [delegate respondsToSelector:@selector(webView:didReceiveAuthenticationChallenge:completionHandler:)];
     m_navigationDelegateMethods.webViewWebContentProcessDidTerminate = [delegate respondsToSelector:@selector(webViewWebContentProcessDidTerminate:)];
     m_navigationDelegateMethods.webViewWebContentProcessDidTerminateWithReason = [delegate respondsToSelector:@selector(_webView:webContentProcessDidTerminateWithReason:)];
-    m_navigationDelegateMethods.webViewDidReceiveAuthenticationChallenge = [delegate respondsToSelector:@selector(_webView:didReceiveAuthenticationChallenge:)];
     m_navigationDelegateMethods.webViewWebProcessDidCrash = [delegate respondsToSelector:@selector(_webViewWebProcessDidCrash:)];
     m_navigationDelegateMethods.webViewWebProcessDidBecomeResponsive = [delegate respondsToSelector:@selector(_webViewWebProcessDidBecomeResponsive:)];
     m_navigationDelegateMethods.webViewWebProcessDidBecomeUnresponsive = [delegate respondsToSelector:@selector(_webViewWebProcessDidBecomeUnresponsive:)];
@@ -869,66 +868,47 @@
     [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate.get()) _webView:m_navigationState.m_webView renderingProgressDidChange:renderingProgressEvents(layoutMilestones)];
 }
 
-bool NavigationState::NavigationClient::canAuthenticateAgainstProtectionSpace(WebPageProxy&, WebProtectionSpace* protectionSpace)
-{
-    return !!m_navigationState.m_navigationDelegateMethods.webViewDidReceiveAuthenticationChallengeCompletionHandler;
-}
-
 void NavigationState::NavigationClient::didReceiveAuthenticationChallenge(WebPageProxy&, AuthenticationChallengeProxy& authenticationChallenge)
 {
-    if (m_navigationState.m_navigationDelegateMethods.webViewDidReceiveAuthenticationChallengeCompletionHandler) {
-        auto navigationDelegate = m_navigationState.m_navigationDelegate.get();
-        if (!navigationDelegate) {
-            authenticationChallenge.listener()->performDefaultHandling();
-            return;
-        }
+    if (!m_navigationState.m_navigationDelegateMethods.webViewDidReceiveAuthenticationChallengeCompletionHandler)
+        return authenticationChallenge.rejectProtectionSpaceAndContinue();
 
-        auto checker = CompletionHandlerCallChecker::create(navigationDelegate.get(), @selector(webView:didReceiveAuthenticationChallenge:completionHandler:));
-        [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate.get()) webView:m_navigationState.m_webView didReceiveAuthenticationChallenge:wrapper(authenticationChallenge) completionHandler:BlockPtr<void(NSURLSessionAuthChallengeDisposition, NSURLCredential *)>::fromCallable([challenge = makeRef(authenticationChallenge), checker = WTFMove(checker)](NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential) {
-            if (checker->completionHandlerHasBeenCalled())
-                return;
-            checker->didCallCompletionHandler();
+    auto navigationDelegate = m_navigationState.m_navigationDelegate.get();
+    if (!navigationDelegate)
+        return authenticationChallenge.performDefaultHandling();
 
-            switch (disposition) {
-            case NSURLSessionAuthChallengeUseCredential: {
-                RefPtr<WebCredential> webCredential;
-                if (credential)
-                    webCredential = WebCredential::create(WebCore::Credential(credential));
+    auto checker = CompletionHandlerCallChecker::create(navigationDelegate.get(), @selector(webView:didReceiveAuthenticationChallenge:completionHandler:));
+    [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate.get()) webView:m_navigationState.m_webView didReceiveAuthenticationChallenge:wrapper(authenticationChallenge) completionHandler:BlockPtr<void(NSURLSessionAuthChallengeDisposition, NSURLCredential *)>::fromCallable([challenge = makeRef(authenticationChallenge), checker = WTFMove(checker)](NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential) {
+        if (checker->completionHandlerHasBeenCalled())
+            return;
+        checker->didCallCompletionHandler();
 
-                challenge->listener()->useCredential(webCredential.get());
-                break;
-            }
+        switch (disposition) {
+        case NSURLSessionAuthChallengeUseCredential: {
+            RefPtr<WebCredential> webCredential;
+            if (credential)
+                webCredential = WebCredential::create(WebCore::Credential(credential));
 
-            case NSURLSessionAuthChallengePerformDefaultHandling:
-                challenge->listener()->performDefaultHandling();
-                break;
+            challenge->useCredential(webCredential.get());
+            break;
+        }
 
-            case NSURLSessionAuthChallengeCancelAuthenticationChallenge:
-                challenge->listener()->cancel();
-                break;
+        case NSURLSessionAuthChallengePerformDefaultHandling:
+            challenge->performDefaultHandling();
+            break;
 
-            case NSURLSessionAuthChallengeRejectProtectionSpace:
-                challenge->listener()->rejectProtectionSpaceAndContinue();
-                break;
+        case NSURLSessionAuthChallengeCancelAuthenticationChallenge:
+            challenge->cancel();
+            break;
 
-            default:
-                [NSException raise:NSInvalidArgumentException format:@"Invalid NSURLSessionAuthChallengeDisposition (%ld)", (long)disposition];
-            }
-        }).get()];
-        return;
-    }
+        case NSURLSessionAuthChallengeRejectProtectionSpace:
+            challenge->rejectProtectionSpaceAndContinue();
+            break;
 
-    if (!m_navigationState.m_navigationDelegateMethods.webViewDidReceiveAuthenticationChallenge)
-        return;
-
-    auto navigationDelegate = m_navigationState.m_navigationDelegate.get();
-    if (!navigationDelegate)
-        return;
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    [static_cast<id <WKNavigationDelegatePrivate>>(navigationDelegate.get()) _webView:m_navigationState.m_webView didReceiveAuthenticationChallenge:wrapper(authenticationChallenge)];
-#pragma clang diagnostic pop
+        default:
+            [NSException raise:NSInvalidArgumentException format:@"Invalid NSURLSessionAuthChallengeDisposition (%ld)", (long)disposition];
+        }
+    }).get()];
 }
 
 static _WKProcessTerminationReason wkProcessTerminationReason(ProcessTerminationReason reason)

Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (234940 => 234941)


--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp	2018-08-16 17:59:30 UTC (rev 234941)
@@ -399,30 +399,6 @@
     page->logDiagnosticMessageWithValue(message, description, value, significantFigures, shouldSample);
 }
 
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-void NetworkProcessProxy::canAuthenticateAgainstProtectionSpace(uint64_t loaderID, uint64_t pageID, uint64_t frameID, const WebCore::ProtectionSpace& protectionSpace)
-{
-    // NetworkProcess state cannot asynchronously be kept in sync with these objects
-    // like we expect WebProcess <-> UIProcess state to be kept in sync.
-    // So there's no guarantee the messaged WebPageProxy or WebFrameProxy exist here in the UIProcess.
-    // We need to validate both the page and the frame up front.
-    if (auto* page = WebProcessProxy::webPage(pageID)) {
-        if (page->process().webFrame(frameID)) {
-            page->canAuthenticateAgainstProtectionSpace(loaderID, frameID, protectionSpace);
-            return;
-        }
-#if ENABLE(SERVICE_WORKER)
-    } else if (m_processPool.serviceWorkerProcessProxyFromPageID(pageID)) {
-        send(Messages::NetworkProcess::ContinueCanAuthenticateAgainstProtectionSpace(loaderID, true), 0);
-        return;
-#endif
-    }
-    // In the case where we will not be able to reply to this message with a client reply,
-    // we should message back a default to the Networking process.
-    send(Messages::NetworkProcess::ContinueCanAuthenticateAgainstProtectionSpace(loaderID, false), 0);
-}
-#endif
-
 #if HAVE(CFNETWORK_STORAGE_PARTITIONING)
 void NetworkProcessProxy::updatePrevalentDomainsToBlockCookiesFor(PAL::SessionID sessionID, const Vector<String>& domainsToBlock, ShouldClearFirst shouldClearFirst, CompletionHandler<void()>&& completionHandler)
 {

Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h (234940 => 234941)


--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h	2018-08-16 17:59:30 UTC (rev 234941)
@@ -143,9 +143,6 @@
     void logDiagnosticMessage(uint64_t pageID, const String& message, const String& description, WebCore::ShouldSample);
     void logDiagnosticMessageWithResult(uint64_t pageID, const String& message, const String& description, uint32_t result, WebCore::ShouldSample);
     void logDiagnosticMessageWithValue(uint64_t pageID, const String& message, const String& description, double value, unsigned significantFigures, WebCore::ShouldSample);
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    void canAuthenticateAgainstProtectionSpace(uint64_t loaderID, uint64_t pageID, uint64_t frameID, const WebCore::ProtectionSpace&);
-#endif
 #if HAVE(CFNETWORK_STORAGE_PARTITIONING)
     void didUpdateBlockCookies(uint64_t contextId);
     void storageAccessRequestResult(bool wasGranted, uint64_t contextId);

Modified: trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in (234940 => 234941)


--- trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in	2018-08-16 17:59:30 UTC (rev 234941)
@@ -43,9 +43,6 @@
     LogDiagnosticMessageWithResult(uint64_t pageID, String message, String description, uint32_t result, enum WebCore::ShouldSample shouldSample)
     LogDiagnosticMessageWithValue(uint64_t pageID, String message, String description, double value, unsigned significantFigures, enum WebCore::ShouldSample shouldSample)
 
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    CanAuthenticateAgainstProtectionSpace(uint64_t loaderID, uint64_t pageID, uint64_t frameID, WebCore::ProtectionSpace protectionSpace)
-#endif
 #if HAVE(CFNETWORK_STORAGE_PARTITIONING)
     DidUpdateBlockCookies(uint64_t callbackId)
     StorageAccessRequestResult(bool wasGranted, uint64_t contextId)

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (234940 => 234941)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-08-16 17:59:30 UTC (rev 234941)
@@ -6389,24 +6389,6 @@
 
 #endif
 
-void WebPageProxy::canAuthenticateAgainstProtectionSpace(uint64_t loaderID, uint64_t frameID, const ProtectionSpace& coreProtectionSpace)
-{
-#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
-    WebFrameProxy* frame = m_process->webFrame(frameID);
-    MESSAGE_CHECK(frame);
-
-    RefPtr<WebProtectionSpace> protectionSpace = WebProtectionSpace::create(coreProtectionSpace);
-
-    bool canAuthenticate;
-    if (m_navigationClient)
-        canAuthenticate = m_navigationClient->canAuthenticateAgainstProtectionSpace(*this, protectionSpace.get());
-    else
-        canAuthenticate = m_loaderClient->canAuthenticateAgainstProtectionSpaceInFrame(*this, *frame, protectionSpace.get());
-
-    m_process->processPool().sendToNetworkingProcess(Messages::NetworkProcess::ContinueCanAuthenticateAgainstProtectionSpace(loaderID, canAuthenticate));
-#endif
-}
-
 void WebPageProxy::didReceiveAuthenticationChallengeProxy(uint64_t frameID, Ref<AuthenticationChallengeProxy>&& authenticationChallenge)
 {
     WebFrameProxy* frame = m_process->webFrame(frameID);

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (234940 => 234941)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2018-08-16 17:57:01 UTC (rev 234940)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2018-08-16 17:59:30 UTC (rev 234941)
@@ -1290,8 +1290,6 @@
 
     bool isAlwaysOnLoggingAllowed() const;
 
-    void canAuthenticateAgainstProtectionSpace(uint64_t loaderID, uint64_t frameID, const WebCore::ProtectionSpace&);
-
 #if ENABLE(GAMEPAD)
     void gamepadActivity(const Vector<GamepadData>&, bool shouldMakeGamepadsVisible);
 #endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to