WebKit Bugzilla
Attachment 347248 Details for
Bug 188639
: Stop using canAuthenticateAgainstProtectionSpace in modern WebKit
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188639-20180815225626.patch (text/plain), 40.13 KB, created by
Alex Christensen
on 2018-08-15 22:56:27 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2018-08-15 22:56:27 PDT
Size:
40.13 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 234912) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,63 @@ >+2018-08-15 Alex Christensen <achristensen@webkit.org> >+ >+ Stop using canAuthenticateAgainstProtectionSpace in modern WebKit >+ https://bugs.webkit.org/show_bug.cgi?id=188639 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ 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 Ansh Shukla <ansh_shukla@apple.com> > > NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault >Index: Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp (revision 234900) >+++ Source/WebKit/NetworkProcess/NetworkCORSPreflightChecker.cpp (working copy) >@@ -102,15 +102,7 @@ void NetworkCORSPreflightChecker::didRec > 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) >Index: Source/WebKit/NetworkProcess/NetworkLoad.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkLoad.cpp (revision 234900) >+++ Source/WebKit/NetworkProcess/NetworkLoad.cpp (working copy) >@@ -42,6 +42,7 @@ > > #if PLATFORM(COCOA) > #include "NetworkDataTaskCocoa.h" >+#include "NetworkSessionCocoa.h" > #endif > > #if ENABLE(NETWORK_CAPTURE) >@@ -121,10 +122,6 @@ NetworkLoad::~NetworkLoad() > 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::willPerformHTTPRedirec > > 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 @@ void NetworkLoad::completeAuthentication > 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()); >Index: Source/WebKit/NetworkProcess/NetworkLoad.h >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkLoad.h (revision 234900) >+++ Source/WebKit/NetworkProcess/NetworkLoad.h (working copy) >@@ -69,10 +69,6 @@ public: > > bool shouldCaptureExtraNetworkLoadMetrics() const final; > >-#if USE(PROTECTION_SPACE_AUTH_CALLBACK) >- void continueCanAuthenticateAgainstProtectionSpace(bool); >-#endif >- > String description() const; > > private: >@@ -95,16 +91,10 @@ private: > 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; >Index: Source/WebKit/NetworkProcess/NetworkLoadClient.h >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkLoadClient.h (revision 234900) >+++ Source/WebKit/NetworkProcess/NetworkLoadClient.h (working copy) >@@ -47,9 +47,6 @@ public: > 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; >Index: Source/WebKit/NetworkProcess/NetworkProcess.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkProcess.cpp (revision 234900) >+++ Source/WebKit/NetworkProcess/NetworkProcess.cpp (working copy) >@@ -667,26 +667,6 @@ void NetworkProcess::cancelDownload(Down > { > 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) > { >Index: Source/WebKit/NetworkProcess/NetworkProcess.h >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkProcess.h (revision 234900) >+++ Source/WebKit/NetworkProcess/NetworkProcess.h (working copy) >@@ -122,10 +122,6 @@ public: > > 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&&); >@@ -221,9 +217,6 @@ private: > 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); > >@@ -282,9 +275,6 @@ private: > 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; >Index: Source/WebKit/NetworkProcess/NetworkProcess.messages.in >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkProcess.messages.in (revision 234900) >+++ Source/WebKit/NetworkProcess/NetworkProcess.messages.in (working copy) >@@ -46,9 +46,6 @@ messages -> NetworkProcess LegacyReceive > 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) > >Index: Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp (revision 234900) >+++ Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp (working copy) >@@ -935,16 +935,6 @@ void NetworkResourceLoader::invalidateSa > 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())) >Index: Source/WebKit/NetworkProcess/NetworkResourceLoader.h >=================================================================== >--- Source/WebKit/NetworkProcess/NetworkResourceLoader.h (revision 234900) >+++ Source/WebKit/NetworkProcess/NetworkResourceLoader.h (working copy) >@@ -94,9 +94,6 @@ public: > > // 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; >Index: Source/WebKit/NetworkProcess/PreconnectTask.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/PreconnectTask.cpp (revision 234900) >+++ Source/WebKit/NetworkProcess/PreconnectTask.cpp (working copy) >@@ -96,19 +96,6 @@ void PreconnectTask::didSendData(unsigne > 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) >Index: Source/WebKit/NetworkProcess/PreconnectTask.h >=================================================================== >--- Source/WebKit/NetworkProcess/PreconnectTask.h (revision 234900) >+++ Source/WebKit/NetworkProcess/PreconnectTask.h (working copy) >@@ -50,7 +50,6 @@ private: > 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; >Index: Source/WebKit/NetworkProcess/Downloads/PendingDownload.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/Downloads/PendingDownload.cpp (revision 234900) >+++ Source/WebKit/NetworkProcess/Downloads/PendingDownload.cpp (working copy) >@@ -76,13 +76,6 @@ void PendingDownload::cancel() > 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, { })); >Index: Source/WebKit/NetworkProcess/Downloads/PendingDownload.h >=================================================================== >--- Source/WebKit/NetworkProcess/Downloads/PendingDownload.h (revision 234900) >+++ Source/WebKit/NetworkProcess/Downloads/PendingDownload.h (working copy) >@@ -51,9 +51,6 @@ public: > 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; >Index: Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp >=================================================================== >--- Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp (revision 234900) >+++ Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp (working copy) >@@ -122,13 +122,6 @@ void SpeculativeLoad::didFinishLoading(c > 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) >Index: Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.h >=================================================================== >--- Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.h (revision 234900) >+++ Source/WebKit/NetworkProcess/cache/NetworkCacheSpeculativeLoad.h (working copy) >@@ -53,9 +53,6 @@ public: > 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; >Index: Source/WebKit/Shared/Authentication/AuthenticationManager.cpp >=================================================================== >--- Source/WebKit/Shared/Authentication/AuthenticationManager.cpp (revision 234900) >+++ Source/WebKit/Shared/Authentication/AuthenticationManager.cpp (working copy) >@@ -111,8 +111,8 @@ Vector<uint64_t> AuthenticationManager:: > > 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) }); > >Index: Source/WebKit/Shared/Authentication/AuthenticationManager.h >=================================================================== >--- Source/WebKit/Shared/Authentication/AuthenticationManager.h (revision 234900) >+++ Source/WebKit/Shared/Authentication/AuthenticationManager.h (working copy) >@@ -68,9 +68,6 @@ public: > > 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); >Index: Source/WebKit/UIProcess/WebPageProxy.cpp >=================================================================== >--- Source/WebKit/UIProcess/WebPageProxy.cpp (revision 234900) >+++ Source/WebKit/UIProcess/WebPageProxy.cpp (working copy) >@@ -6389,24 +6389,6 @@ void WebPageProxy::gamepadActivity(const > > #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); >Index: Source/WebKit/UIProcess/WebPageProxy.h >=================================================================== >--- Source/WebKit/UIProcess/WebPageProxy.h (revision 234900) >+++ Source/WebKit/UIProcess/WebPageProxy.h (working copy) >@@ -1290,8 +1290,6 @@ public: > > 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 >Index: Source/WebKit/UIProcess/API/C/WKPage.cpp >=================================================================== >--- Source/WebKit/UIProcess/API/C/WKPage.cpp (revision 234900) >+++ Source/WebKit/UIProcess/API/C/WKPage.cpp (working copy) >@@ -2297,8 +2297,10 @@ void WKPageSetPageNavigationClient(WKPag > > 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); > } > >Index: Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h >=================================================================== >--- Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h (revision 234903) >+++ Source/WebKit/UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h (working copy) >@@ -75,8 +75,6 @@ static const WKNavigationResponsePolicy > > - (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; >Index: Source/WebKit/UIProcess/Cocoa/NavigationState.h >=================================================================== >--- Source/WebKit/UIProcess/Cocoa/NavigationState.h (revision 234903) >+++ Source/WebKit/UIProcess/Cocoa/NavigationState.h (working copy) >@@ -108,7 +108,6 @@ private: > > 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 @@ private: > bool webViewDidReceiveAuthenticationChallengeCompletionHandler : 1; > bool webViewWebContentProcessDidTerminate : 1; > bool webViewWebContentProcessDidTerminateWithReason : 1; >- bool webViewDidReceiveAuthenticationChallenge : 1; > bool webViewWebProcessDidCrash : 1; > bool webViewWebProcessDidBecomeResponsive : 1; > bool webViewWebProcessDidBecomeUnresponsive : 1; >Index: Source/WebKit/UIProcess/Cocoa/NavigationState.mm >=================================================================== >--- Source/WebKit/UIProcess/Cocoa/NavigationState.mm (revision 234903) >+++ Source/WebKit/UIProcess/Cocoa/NavigationState.mm (working copy) >@@ -164,7 +164,6 @@ void NavigationState::setNavigationDeleg > 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 @@ void NavigationState::NavigationClient:: > [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; >- >- case NSURLSessionAuthChallengeCancelAuthenticationChallenge: >- challenge->listener()->cancel(); >- break; >- >- case NSURLSessionAuthChallengeRejectProtectionSpace: >- challenge->listener()->rejectProtectionSpaceAndContinue(); >- break; >+ challenge->useCredential(webCredential.get()); >+ break; >+ } > >- default: >- [NSException raise:NSInvalidArgumentException format:@"Invalid NSURLSessionAuthChallengeDisposition (%ld)", (long)disposition]; >- } >- }).get()]; >- return; >- } >+ case NSURLSessionAuthChallengePerformDefaultHandling: >+ challenge->performDefaultHandling(); >+ break; > >- if (!m_navigationState.m_navigationDelegateMethods.webViewDidReceiveAuthenticationChallenge) >- return; >+ case NSURLSessionAuthChallengeCancelAuthenticationChallenge: >+ challenge->cancel(); >+ break; > >- auto navigationDelegate = m_navigationState.m_navigationDelegate.get(); >- if (!navigationDelegate) >- return; >+ case NSURLSessionAuthChallengeRejectProtectionSpace: >+ challenge->rejectProtectionSpaceAndContinue(); >+ break; > >-#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) >Index: Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp >=================================================================== >--- Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (revision 234900) >+++ Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp (working copy) >@@ -399,30 +399,6 @@ void NetworkProcessProxy::logDiagnosticM > 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) > { >Index: Source/WebKit/UIProcess/Network/NetworkProcessProxy.h >=================================================================== >--- Source/WebKit/UIProcess/Network/NetworkProcessProxy.h (revision 234900) >+++ Source/WebKit/UIProcess/Network/NetworkProcessProxy.h (working copy) >@@ -143,9 +143,6 @@ private: > 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); >Index: Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in >=================================================================== >--- Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in (revision 234900) >+++ Source/WebKit/UIProcess/Network/NetworkProcessProxy.messages.in (working copy) >@@ -43,9 +43,6 @@ messages -> NetworkProcessProxy LegacyRe > 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)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188639
:
347248
|
347251
|
347271