Title: [235277] tags/Safari-607.1.3/Source/WebKit
Revision
235277
Author
[email protected]
Date
2018-08-24 00:27:46 -0700 (Fri, 24 Aug 2018)

Log Message

Revert r235266. rdar://problem/43667266

Modified Paths

Diff

Modified: tags/Safari-607.1.3/Source/WebKit/ChangeLog (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/ChangeLog	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/ChangeLog	2018-08-24 07:27:46 UTC (rev 235277)
@@ -1,5 +1,9 @@
 2018-08-23  Kocsen Chung  <[email protected]>
 
+        Revert r235266. rdar://problem/43667266
+
+2018-08-23  Kocsen Chung  <[email protected]>
+
         Revert r235270. rdar://problem/43667266
 
 2018-08-23  Kocsen Chung  <[email protected]>

Modified: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/Downloads/PendingDownload.cpp (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/Downloads/PendingDownload.cpp	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/Downloads/PendingDownload.cpp	2018-08-24 07:27:46 UTC (rev 235277)
@@ -75,13 +75,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: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/Downloads/PendingDownload.h (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/Downloads/PendingDownload.h	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/Downloads/PendingDownload.h	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.h (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.h	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.h	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkLoad.cpp (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkLoad.cpp	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkLoad.cpp	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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) {
@@ -275,36 +261,13 @@
         completionHandler(AuthenticationChallengeDisposition::UseCredential, { });
         return;
     }
-
-    if (!m_task)
-        return;
+    
     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: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkLoad.h (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkLoad.h	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkLoad.h	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkLoadClient.h (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkLoadClient.h	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkLoadClient.h	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkProcess.cpp (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkProcess.cpp	2018-08-24 07:27:46 UTC (rev 235277)
@@ -677,27 +677,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: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkProcess.h (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkProcess.h	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkProcess.h	2018-08-24 07:27:46 UTC (rev 235277)
@@ -126,10 +126,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&&);
@@ -225,9 +221,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);
 
@@ -286,9 +279,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: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkProcess.messages.in (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkProcess.messages.in	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkProcess.messages.in	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp	2018-08-24 07:27:46 UTC (rev 235277)
@@ -934,16 +934,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: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkResourceLoader.h (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkResourceLoader.h	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/NetworkResourceLoader.h	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/PreconnectTask.cpp (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/PreconnectTask.cpp	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/PreconnectTask.cpp	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/PreconnectTask.h (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/PreconnectTask.h	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/PreconnectTask.h	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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: tags/Safari-607.1.3/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.h (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.h	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.h	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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: tags/Safari-607.1.3/Source/WebKit/Shared/Authentication/AuthenticationManager.cpp (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/Shared/Authentication/AuthenticationManager.cpp	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/Shared/Authentication/AuthenticationManager.cpp	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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: tags/Safari-607.1.3/Source/WebKit/Shared/Authentication/AuthenticationManager.h (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/Shared/Authentication/AuthenticationManager.h	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/Shared/Authentication/AuthenticationManager.h	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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: tags/Safari-607.1.3/Source/WebKit/UIProcess/API/C/WKPage.cpp (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/UIProcess/API/C/WKPage.cpp	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/UIProcess/API/C/WKPage.cpp	2018-08-24 07:27:46 UTC (rev 235277)
@@ -2318,8 +2318,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: tags/Safari-607.1.3/Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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: tags/Safari-607.1.3/Source/WebKit/UIProcess/Cocoa/NavigationState.h (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/UIProcess/Cocoa/NavigationState.h	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/UIProcess/Cocoa/NavigationState.h	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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: tags/Safari-607.1.3/Source/WebKit/UIProcess/Cocoa/NavigationState.mm (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/UIProcess/Cocoa/NavigationState.mm	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/UIProcess/Cocoa/NavigationState.mm	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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:)];
@@ -846,66 +845,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: tags/Safari-607.1.3/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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: tags/Safari-607.1.3/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/UIProcess/Network/NetworkProcessProxy.h	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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: tags/Safari-607.1.3/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in	2018-08-24 07:27:46 UTC (rev 235277)
@@ -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: tags/Safari-607.1.3/Source/WebKit/UIProcess/WebPageProxy.cpp (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/UIProcess/WebPageProxy.cpp	2018-08-24 07:27:46 UTC (rev 235277)
@@ -6335,24 +6335,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: tags/Safari-607.1.3/Source/WebKit/UIProcess/WebPageProxy.h (235276 => 235277)


--- tags/Safari-607.1.3/Source/WebKit/UIProcess/WebPageProxy.h	2018-08-24 07:27:36 UTC (rev 235276)
+++ tags/Safari-607.1.3/Source/WebKit/UIProcess/WebPageProxy.h	2018-08-24 07:27:46 UTC (rev 235277)
@@ -1284,8 +1284,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