Changeset 91799 in webkit
- Timestamp:
- Jul 26, 2011 4:43:15 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r91797 r91799 1 2011-07-26 Pratik Solanki <psolanki@apple.com> 2 3 Add protection space authentication callback code to CFNetwork loader on Mac 4 https://bugs.webkit.org/show_bug.cgi?id=65190 5 <rdar://problem/9842424> 6 7 Reviewed by Oliver Hunt. 8 9 Port over protection space authentication callback code from ResourceHandleMac.mm to 10 ResourceHandleCFNet.cpp. 11 12 * platform/network/ResourceHandle.h: 13 * platform/network/cf/ResourceHandleCFNet.cpp: 14 (WebCore::canRespondToProtectionSpace): 15 (WebCore::ResourceHandle::createCFURLConnection): 16 (WebCore::ResourceHandle::canAuthenticateAgainstProtectionSpace): 17 (WebCore::WebCoreSynchronousLoaderClient::canAuthenticateAgainstProtectionSpace): 18 * platform/network/mac/ResourceHandleMac.mm: 19 (-[WebCoreResourceHandleAsDelegate connection:canAuthenticateAgainstProtectionSpace:]): Add logging. 20 1 21 2011-07-26 Sadrul Habib Chowdhury <sadrul@chromium.org> 2 22 -
trunk/Source/WebCore/platform/network/ResourceHandle.h
r90873 r91799 123 123 #endif 124 124 125 #if PLATFORM(MAC) && !USE(CFNETWORK) 126 void didCancelAuthenticationChallenge(const AuthenticationChallenge&); 125 #if PLATFORM(MAC) 127 126 #if USE(PROTECTION_SPACE_AUTH_CALLBACK) 128 127 bool canAuthenticateAgainstProtectionSpace(const ProtectionSpace&); 129 128 #endif 129 #if !USE(CFNETWORK) 130 void didCancelAuthenticationChallenge(const AuthenticationChallenge&); 130 131 NSURLConnection *connection() const; 131 132 WebCoreResourceHandleAsDelegate *delegate(); … … 134 135 #endif 135 136 136 #if PLATFORM(MAC)137 137 void schedule(SchedulePair*); 138 138 void unschedule(SchedulePair*); -
trunk/Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp
r91200 r91799 104 104 virtual void didFinishLoading(ResourceHandle*, double /*finishTime*/); 105 105 virtual void didFail(ResourceHandle*, const ResourceError&); 106 #if USE(PROTECTION_SPACE_AUTH_CALLBACK) 107 virtual bool canAuthenticateAgainstProtectionSpace(ResourceHandle*, const ProtectionSpace&); 108 #endif 106 109 107 110 bool m_allowStoredCredentials; … … 348 351 handle->didReceiveAuthenticationChallenge(AuthenticationChallenge(challenge, handle)); 349 352 } 353 354 #if USE(PROTECTION_SPACE_AUTH_CALLBACK) 355 static Boolean canRespondToProtectionSpace(CFURLConnectionRef conn, CFURLProtectionSpaceRef protectionSpace, const void* clientInfo) 356 { 357 #if LOG_DISABLED 358 UNUSED_PARAM(conn); 359 #endif 360 ResourceHandle* handle = static_cast<ResourceHandle*>(const_cast<void*>(clientInfo)); 361 ASSERT(handle); 362 363 LOG(Network, "CFNet - canRespondToProtectionSpace(conn=%p, handle=%p (%s)", conn, handle, handle->firstRequest().url().string().utf8().data()); 364 365 return handle->canAuthenticateAgainstProtectionSpace(core(protectionSpace)); 366 } 367 #endif 350 368 351 369 ResourceHandleInternal::~ResourceHandleInternal() … … 459 477 RetainPtr<CFURLRequestRef> request(AdoptCF, makeFinalRequest(firstRequest(), shouldContentSniff)); 460 478 461 #if HAVE(CFNETWORK_DATA_ARRAY_CALLBACK) 462 CFURLConnectionClient_V6 client = { 6, this, 0, 0, 0, WebCore::willSendRequest, didReceiveResponse, didReceiveData, 0, didFinishLoading, didFail, willCacheResponse, didReceiveChallenge, didSendBodyData, shouldUseCredentialStorageCallback, 0, 0, 0, didReceiveDataArray};479 #if HAVE(CFNETWORK_DATA_ARRAY_CALLBACK) && USE(PROTECTION_SPACE_AUTH_CALLBACK) 480 CFURLConnectionClient_V6 client = { 6, this, 0, 0, 0, WebCore::willSendRequest, didReceiveResponse, didReceiveData, 0, didFinishLoading, didFail, willCacheResponse, didReceiveChallenge, didSendBodyData, shouldUseCredentialStorageCallback, 0, canRespondToProtectionSpace, 0, didReceiveDataArray}; 463 481 #else 464 482 CFURLConnectionClient_V3 client = { 3, this, 0, 0, 0, WebCore::willSendRequest, didReceiveResponse, didReceiveData, 0, didFinishLoading, didFail, willCacheResponse, didReceiveChallenge, didSendBodyData, shouldUseCredentialStorageCallback, 0}; … … 597 615 } 598 616 617 #if USE(PROTECTION_SPACE_AUTH_CALLBACK) 618 bool ResourceHandle::canAuthenticateAgainstProtectionSpace(const ProtectionSpace& protectionSpace) 619 { 620 if (client()) 621 return client()->canAuthenticateAgainstProtectionSpace(this, protectionSpace); 622 623 return false; 624 } 625 #endif 626 599 627 void ResourceHandle::receivedCredential(const AuthenticationChallenge& challenge, const Credential& credential) 600 628 { … … 888 916 } 889 917 918 #if USE(PROTECTION_SPACE_AUTH_CALLBACK) 919 bool WebCoreSynchronousLoaderClient::canAuthenticateAgainstProtectionSpace(ResourceHandle*, const ProtectionSpace&) 920 { 921 // FIXME: We should ask FrameLoaderClient. <http://webkit.org/b/65196> 922 return true; 923 } 924 #endif 925 890 926 #endif // USE(CFNETWORK) 891 927 -
trunk/Source/WebCore/platform/network/mac/ResourceHandleMac.mm
r90834 r91799 766 766 767 767 #if USE(PROTECTION_SPACE_AUTH_CALLBACK) 768 - (BOOL)connection:(NSURLConnection *)unusedConnection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace 769 { 770 UNUSED_PARAM(unusedConnection); 771 768 - (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace 769 { 770 #if LOG_DISABLED 771 UNUSED_PARAM(connection); 772 #endif 773 774 LOG(Network, "Handle %p delegate connection:%p canAuthenticateAgainstProtectionSpace:%p", m_handle, connection); 775 772 776 if (!m_handle) 773 777 return NO; 774 778 775 779 return m_handle->canAuthenticateAgainstProtectionSpace(core(protectionSpace)); 776 780 } … … 952 956 bool WebCoreSynchronousLoaderClient::canAuthenticateAgainstProtectionSpace(ResourceHandle*, const ProtectionSpace&) 953 957 { 954 // FIXME: We should ask FrameLoaderClient. 958 // FIXME: We should ask FrameLoaderClient. <http://webkit.org/b/65196> 955 959 return true; 956 960 }
Note: See TracChangeset
for help on using the changeset viewer.