WebKit Bugzilla
Attachment 348063 Details for
Bug 188939
: Fix authentication for clients of WKPageLoaderClient after r234941
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188939-20180824174236.patch (text/plain), 6.16 KB, created by
Alex Christensen
on 2018-08-24 17:42:37 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2018-08-24 17:42:37 PDT
Size:
6.16 KB
patch
obsolete
>Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 235338) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,24 @@ >+2018-08-24 Alex Christensen <achristensen@webkit.org> >+ >+ Fix authentication for clients of WKPageLoaderClient after r234941 >+ https://bugs.webkit.org/show_bug.cgi?id=188939 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ I simplified the authentication code path elegantly for clients of WKPageNavigationClient/WKNavigationDelegate, >+ but clients of WKPageLoaderClient that do not implement didReceiveAuthenticationChallengeInFrame would hang. >+ This fixes that. I've also made the performDefaultHandling (when delegates are not implemented) and rejectProtectionSpaceAndContinue >+ (when canAuthenticationAgainstProtectionSpace returns false) behave correctly. >+ >+ * UIProcess/API/APILoaderClient.h: >+ (API::LoaderClient::didReachLayoutMilestone): >+ (API::LoaderClient::canAuthenticateAgainstProtectionSpaceInFrame): Deleted. >+ * UIProcess/API/C/WKPage.cpp: >+ (WKPageSetPageLoaderClient): >+ (WKPageSetPageNavigationClient): >+ * UIProcess/Cocoa/NavigationState.mm: >+ (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge): >+ > 2018-08-23 Jeff Miller <jeffm@apple.com> > > Remove -[WKNavigationDelegate _webView:decidePolicyForPluginLoadWithCurrentPolicy:pluginInfo:unavailabilityDescription:] >Index: Source/WebKit/UIProcess/API/APILoaderClient.h >=================================================================== >--- Source/WebKit/UIProcess/API/APILoaderClient.h (revision 235338) >+++ Source/WebKit/UIProcess/API/APILoaderClient.h (working copy) >@@ -76,8 +76,6 @@ public: > virtual void didDetectXSSForFrame(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, API::Object*) { } > > virtual void didReachLayoutMilestone(WebKit::WebPageProxy&, WebCore::LayoutMilestones) { } >- >- virtual bool canAuthenticateAgainstProtectionSpaceInFrame(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, WebKit::WebProtectionSpace*) { return false; } > virtual void didReceiveAuthenticationChallengeInFrame(WebKit::WebPageProxy&, WebKit::WebFrameProxy&, WebKit::AuthenticationChallengeProxy&) { } > > virtual void didStartProgress(WebKit::WebPageProxy&) { } >Index: Source/WebKit/UIProcess/API/C/WKPage.cpp >=================================================================== >--- Source/WebKit/UIProcess/API/C/WKPage.cpp (revision 235338) >+++ Source/WebKit/UIProcess/API/C/WKPage.cpp (working copy) >@@ -1165,18 +1165,12 @@ void WKPageSetPageLoaderClient(WKPageRef > m_client.didDetectXSSForFrame(toAPI(&page), toAPI(&frame), toAPI(userData), m_client.base.clientInfo); > } > >- bool canAuthenticateAgainstProtectionSpaceInFrame(WebPageProxy& page, WebFrameProxy& frame, WebProtectionSpace* protectionSpace) override >- { >- if (!m_client.canAuthenticateAgainstProtectionSpaceInFrame) >- return false; >- >- return m_client.canAuthenticateAgainstProtectionSpaceInFrame(toAPI(&page), toAPI(&frame), toAPI(protectionSpace), m_client.base.clientInfo); >- } >- > void didReceiveAuthenticationChallengeInFrame(WebPageProxy& page, WebFrameProxy& frame, AuthenticationChallengeProxy& authenticationChallenge) override > { >+ if (m_client.canAuthenticateAgainstProtectionSpaceInFrame && !m_client.canAuthenticateAgainstProtectionSpaceInFrame(toAPI(&page), toAPI(&frame), toAPI(authenticationChallenge.protectionSpace()), m_client.base.clientInfo)) >+ return authenticationChallenge.rejectProtectionSpaceAndContinue(); > if (!m_client.didReceiveAuthenticationChallengeInFrame) >- return; >+ return authenticationChallenge.performDefaultHandling(); > > m_client.didReceiveAuthenticationChallengeInFrame(toAPI(&page), toAPI(&frame), toAPI(&authenticationChallenge), m_client.base.clientInfo); > } >@@ -2310,19 +2304,12 @@ void WKPageSetPageNavigationClient(WKPag > m_client.renderingProgressDidChange(toAPI(&page), pageRenderingProgressEvents(milestones), nullptr, m_client.base.clientInfo); > } > >- bool canAuthenticateAgainstProtectionSpace(WebPageProxy& page, WebProtectionSpace* protectionSpace) override >- { >- if (!m_client.canAuthenticateAgainstProtectionSpace) >- return false; >- return m_client.canAuthenticateAgainstProtectionSpace(toAPI(&page), toAPI(protectionSpace), m_client.base.clientInfo); >- } >- > 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 authenticationChallenge.rejectProtectionSpaceAndContinue(); >+ return authenticationChallenge.performDefaultHandling(); > m_client.didReceiveAuthenticationChallenge(toAPI(&page), toAPI(&authenticationChallenge), m_client.base.clientInfo); > } > >Index: Source/WebKit/UIProcess/Cocoa/NavigationState.mm >=================================================================== >--- Source/WebKit/UIProcess/Cocoa/NavigationState.mm (revision 235338) >+++ Source/WebKit/UIProcess/Cocoa/NavigationState.mm (working copy) >@@ -853,7 +853,7 @@ void NavigationState::NavigationClient:: > void NavigationState::NavigationClient::didReceiveAuthenticationChallenge(WebPageProxy&, AuthenticationChallengeProxy& authenticationChallenge) > { > if (!m_navigationState.m_navigationDelegateMethods.webViewDidReceiveAuthenticationChallengeCompletionHandler) >- return authenticationChallenge.rejectProtectionSpaceAndContinue(); >+ return authenticationChallenge.performDefaultHandling(); > > auto navigationDelegate = m_navigationState.m_navigationDelegate.get(); > if (!navigationDelegate)
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
Flags:
youennf
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188939
: 348063