Add canAuthenticateAgainstProtectionSpace() to frame loader so that a protection...
authormthole@apple.com <mthole@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Apr 2010 23:16:41 +0000 (23:16 +0000)
committermthole@apple.com <mthole@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 28 Apr 2010 23:16:41 +0000 (23:16 +0000)
commit613bc986b088e6325eec193cf3c068a51bfb3658
tree9a5f5c66f6066e0cae5a9bfc1f3d5cb5a0b4e2e4
parent5e086f167c01ec03abde6a3ee06d6a5d706ddafc
Add canAuthenticateAgainstProtectionSpace() to frame loader so that a protection space
can be inspected before attempting to authenticate against it
https://bugs.webkit.org/show_bug.cgi?id=38271

Reviewed by David Kilzer.

JavaScriptCore:

* wtf/Platform.h: Add WTF_USE_PROTECTION_SPACE_AUTH_CALLBACK define.

WebCore:

* loader/EmptyClients.h:
(WebCore::EmptyFrameLoaderClient::canAuthenticateAgainstProtectionSpace): Added.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::canAuthenticateAgainstProtectionSpace): Added.
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpace): Added.
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::canAuthenticateAgainstProtectionSpace): Added.
* platform/network/ProtectionSpace.h:
(WebCore::):
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::canAuthenticateAgainstProtectionSpace): Added.
* platform/network/mac/AuthenticationMac.mm:
(WebCore::mac):
Add cases for case ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested and
ProtectionSpaceAuthenticationSchemeClientCertificateRequested.  Guarded with the
#if USE(PROTECTION_SPACE_AUTH_CALLBACK) as the new NSURLProtectionSpace constants don't
exist prior to Mac OS X 10.6.
(WebCore::core): Ditto.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace): Added.
(-[WebCoreResourceHandleAsDelegate connection:canAuthenticateAgainstProtectionSpace:]): Added.

WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::canAuthenticateAgainstProtectionSpace):
Added.  If the resource load delegate implements the callback, use its answer.  If it does
not, then only send authentication challenges for pre-10.6 protection spaces, which matches
CFNetwork's default behavior.
* WebView/WebDelegateImplementationCaching.h:
* WebView/WebDelegateImplementationCaching.mm:
(CallResourceLoadDelegateReturningBoolean): Added case for passing three objects.
* WebView/WebResourceLoadDelegatePrivate.h:
Added private SPI definition: webView:resource:canAuthenticateAgainstProtectionSpace:forDataSource:
* WebView/WebView.mm:
(-[WebView _cacheResourceLoadDelegateImplementations]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@58442 268f45cc-cd09-0410-ab3c-d52691b4dbfc
21 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/wtf/Platform.h
WebCore/ChangeLog
WebCore/loader/EmptyClients.h
WebCore/loader/FrameLoader.cpp
WebCore/loader/FrameLoader.h
WebCore/loader/FrameLoaderClient.h
WebCore/loader/ResourceLoader.cpp
WebCore/loader/ResourceLoader.h
WebCore/platform/network/ProtectionSpace.h
WebCore/platform/network/ResourceHandle.h
WebCore/platform/network/ResourceHandleClient.h
WebCore/platform/network/mac/AuthenticationMac.mm
WebCore/platform/network/mac/ResourceHandleMac.mm
WebKit/mac/ChangeLog
WebKit/mac/WebCoreSupport/WebFrameLoaderClient.h
WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
WebKit/mac/WebView/WebDelegateImplementationCaching.h
WebKit/mac/WebView/WebDelegateImplementationCaching.mm
WebKit/mac/WebView/WebResourceLoadDelegatePrivate.h
WebKit/mac/WebView/WebView.mm