Changeset 86414 in webkit


Ignore:
Timestamp:
May 12, 2011 10:37:59 PM (13 years ago)
Author:
psolanki@apple.com
Message:

2011-05-12 Pratik Solanki <psolanki@apple.com>

Reviewed by Antti Koivisto.

Part of WebCore should use CFNetwork-based loader on Mac
https://bugs.webkit.org/show_bug.cgi?id=51836

Implement mac specific Authentication functions when using CFNetwork.

  • WebCore.exp.in:
  • WebCore.xcodeproj/project.pbxproj:
  • platform/network/ResourceHandle.h:
  • platform/network/cf/AuthenticationCF.cpp: (WebCore::AuthenticationChallenge::authenticationClient): (WebCore::createCF): (WebCore::core):
  • platform/network/cf/AuthenticationCF.h:
  • platform/network/cf/AuthenticationChallenge.h:
  • platform/network/mac/AuthenticationMac.mm: (WebCore::core): (WebCore::mac):
  • platform/network/mac/CredentialStorageMac.mm:

2011-05-12 Pratik Solanki <psolanki@apple.com>

Reviewed by Antti Koivisto.

Part of WebCore should use CFNetwork-based loader on Mac
https://bugs.webkit.org/show_bug.cgi?id=51836

Include AuthenticationCF.h header file.

  • Misc/WebDownload.mm:
  • Plugins/WebBaseNetscapePluginView.mm:
  • WebCoreSupport/WebFrameLoaderClient.mm:
Location:
trunk/Source
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86413 r86414  
     12011-05-12  Pratik Solanki  <psolanki@apple.com>
     2
     3        Reviewed by Antti Koivisto.
     4
     5        Part of WebCore should use CFNetwork-based loader on Mac
     6        https://bugs.webkit.org/show_bug.cgi?id=51836
     7
     8        Implement mac specific Authentication functions when using CFNetwork.
     9
     10        * WebCore.exp.in:
     11        * WebCore.xcodeproj/project.pbxproj:
     12        * platform/network/ResourceHandle.h:
     13        * platform/network/cf/AuthenticationCF.cpp:
     14        (WebCore::AuthenticationChallenge::authenticationClient):
     15        (WebCore::createCF):
     16        (WebCore::core):
     17        * platform/network/cf/AuthenticationCF.h:
     18        * platform/network/cf/AuthenticationChallenge.h:
     19        * platform/network/mac/AuthenticationMac.mm:
     20        (WebCore::core):
     21        (WebCore::mac):
     22        * platform/network/mac/CredentialStorageMac.mm:
     23
    1242011-05-12  Ben Wells  <benwells@chromium.org>
    225
  • trunk/Source/WebCore/WebCore.exp.in

    r86407 r86414  
    16531653#endif
    16541654
     1655#if USE(PROTECTION_SPACE_AUTH_CALLBACK) && USE(CFNETWORK)
     1656__ZN7WebCore8createCFERKNS_15ProtectionSpaceE
     1657#endif
     1658
    16551659#if ENABLE(SVG_ANIMATION) && ENABLE(SVG_DOM_OBJC_BINDINGS)
    16561660.objc_class_name_DOMSVGAnimateElement
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r86359 r86414  
    16431643                7E37EF2E1339208800B29250 /* SubresourceLoaderCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7E37EF2D1339208800B29250 /* SubresourceLoaderCF.cpp */; };
    16441644                7EE6845F12D26E3800E79415 /* AuthenticationCF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7EE6844C12D26E3800E79415 /* AuthenticationCF.cpp */; };
    1645                 7EE6846012D26E3800E79415 /* AuthenticationCF.h in Headers */ = {isa = PBXBuildFile; fileRef = 7EE6844D12D26E3800E79415 /* AuthenticationCF.h */; };
     1645                7EE6846012D26E3800E79415 /* AuthenticationCF.h in Headers */ = {isa = PBXBuildFile; fileRef = 7EE6844D12D26E3800E79415 /* AuthenticationCF.h */; settings = {ATTRIBUTES = (Private, ); }; };
    16461646                7EE6846112D26E3800E79415 /* AuthenticationChallenge.h in Headers */ = {isa = PBXBuildFile; fileRef = 7EE6844E12D26E3800E79415 /* AuthenticationChallenge.h */; settings = {ATTRIBUTES = (Private, ); }; };
    16471647                7EE6846212D26E3800E79415 /* CookieJarCFNet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7EE6844F12D26E3800E79415 /* CookieJarCFNet.cpp */; };
  • trunk/Source/WebCore/platform/network/ResourceHandle.h

    r86285 r86414  
    123123#endif
    124124
    125 #if PLATFORM(MAC)
     125#if PLATFORM(MAC) && !USE(CFNETWORK)
    126126    void didCancelAuthenticationChallenge(const AuthenticationChallenge&);
    127127#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
     
    132132    void releaseDelegate();
    133133    id releaseProxy();
    134 
     134#endif
     135
     136#if PLATFORM(MAC)
    135137    void schedule(SchedulePair*);
    136138    void unschedule(SchedulePair*);
    137 #elif USE(CFNETWORK)
     139#endif
     140#if USE(CFNETWORK)
    138141    CFURLConnectionRef connection() const;
    139142    CFURLConnectionRef releaseConnectionForDownload();
  • trunk/Source/WebCore/platform/network/cf/AuthenticationCF.cpp

    r79557 r86414  
    6969}
    7070
     71AuthenticationClient* AuthenticationChallenge::authenticationClient() const
     72{
     73    return m_authenticationClient.get();
     74}
     75
    7176bool AuthenticationChallenge::platformCompare(const AuthenticationChallenge& a, const AuthenticationChallenge& b)
    7277{
     
    171176        scheme = kCFURLProtectionSpaceAuthenticationSchemeNegotiate;
    172177        break;
     178#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
     179    case ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested:
     180        scheme = kCFURLProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested;
     181        break;
     182    case ProtectionSpaceAuthenticationSchemeClientCertificateRequested:
     183        scheme = kCFURLProtectionSpaceAuthenticationSchemeClientCertificateRequested;
     184        break;
     185#endif
    173186    default:
    174187        ASSERT_NOT_REACHED();
     
    259272        scheme = ProtectionSpaceAuthenticationSchemeNegotiate;
    260273        break;
     274#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
     275    case kCFURLProtectionSpaceAuthenticationSchemeClientCertificateRequested:
     276        scheme = ProtectionSpaceAuthenticationSchemeClientCertificateRequested;
     277        break;
     278    case kCFURLProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested:
     279        scheme = ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested;
     280        break;
     281#endif
    261282    default:
    262283        scheme = ProtectionSpaceAuthenticationSchemeUnknown;
  • trunk/Source/WebCore/platform/network/cf/AuthenticationCF.h

    r74943 r86414  
    2929#if USE(CFNETWORK)
    3030
     31#ifdef __OBJC__
     32@class NSURLAuthenticationChallenge;
     33@class NSURLCredential;
     34@class NSURLProtectionSpace;
     35#else
     36class NSURLAuthenticationChallenge;
     37class NSURLCredential;
     38class NSURLProtectionSpace;
     39#endif
     40
    3141#include <CFNetwork/CFURLCredentialPriv.h>
    3242
     
    4454CFURLProtectionSpaceRef createCF(const ProtectionSpace&);
    4555
     56#if PLATFORM(MAC)
     57AuthenticationChallenge core(CFURLAuthChallengeRef);
     58#endif
    4659Credential core(CFURLCredentialRef);
    4760ProtectionSpace core(CFURLProtectionSpaceRef);
     61
     62#if PLATFORM(MAC)
     63AuthenticationChallenge core(NSURLAuthenticationChallenge *);
     64Credential core(NSURLCredential *);
     65ProtectionSpace core(NSURLProtectionSpace*);
     66
     67NSURLAuthenticationChallenge *mac(const AuthenticationChallenge&);
     68NSURLCredential *mac(const Credential&);
     69NSURLProtectionSpace *mac(const ProtectionSpace&);
     70#endif
    4871
    4972}
  • trunk/Source/WebCore/platform/network/cf/AuthenticationChallenge.h

    r75103 r86414  
    5151    AuthenticationChallenge(CFURLAuthChallengeRef, AuthenticationClient*);
    5252
    53     AuthenticationClient* authenticationClient() const { return m_authenticationClient.get(); }
     53    AuthenticationClient* authenticationClient() const;
    5454    void setAuthenticationClient(AuthenticationClient* client) { m_authenticationClient = client; }
    5555
  • trunk/Source/WebCore/platform/network/mac/AuthenticationMac.mm

    r85036 r86414  
    2626#import "AuthenticationMac.h"
    2727
    28 #if !USE(CFNETWORK)
    29 
     28#import "AuthenticationCF.h"
    3029#import "AuthenticationChallenge.h"
    3130#import "AuthenticationClient.h"
     
    3635#import <Foundation/NSURLCredential.h>
    3736#import <Foundation/NSURLProtectionSpace.h>
     37
     38#if USE(CFNETWORK)
     39
     40@interface NSURLProtectionSpace (Details)
     41- (CFURLProtectionSpaceRef) _cfurlprotectionspace;
     42- (id)_initWithCFURLProtectionSpace:(CFURLProtectionSpaceRef)cfProtSpace;
     43@end
     44
     45@interface NSURLAuthenticationChallenge (Details)
     46-(CFURLAuthChallengeRef)_createCFAuthChallenge;
     47+(NSURLAuthenticationChallenge *)_authenticationChallengeForCFAuthChallenge:(CFURLAuthChallengeRef)cfChallenge sender:(id <NSURLAuthenticationChallengeSender>)sender;
     48@end
     49
     50@interface NSURLCredential (Details)
     51- (id) _initWithCFURLCredential:(CFURLCredentialRef)credential;
     52- (CFURLCredentialRef) _cfurlcredential;
     53@end
     54
     55#endif
    3856
    3957using namespace WebCore;
     
    90108
    91109namespace WebCore {
     110
     111#if USE(CFNETWORK)
     112
     113AuthenticationChallenge core(NSURLAuthenticationChallenge *macChallenge)
     114{
     115    WebCoreAuthenticationClientAsChallengeSender *challengeSender = (WebCoreAuthenticationClientAsChallengeSender*) [macChallenge sender];
     116    AuthenticationClient* authClient = [challengeSender client];
     117    return AuthenticationChallenge([macChallenge _createCFAuthChallenge], authClient);
     118}
     119
     120Credential core(NSURLCredential *macCredential)
     121{
     122    return core([macCredential _cfurlcredential]);
     123}
     124
     125ProtectionSpace core(NSURLProtectionSpace *macSpace)
     126{
     127    return core([macSpace _cfurlprotectionspace]);
     128}
     129
     130NSURLProtectionSpace *mac(const ProtectionSpace& coreSpace)
     131{
     132    RetainPtr<CFURLProtectionSpaceRef> protectionSpace(AdoptCF, createCF(coreSpace));
     133    return [[[NSURLProtectionSpace alloc] _initWithCFURLProtectionSpace:protectionSpace.get()] autorelease];
     134}
     135
     136NSURLAuthenticationChallenge *mac(const AuthenticationChallenge& coreChallenge)
     137{
     138    AuthenticationClient* authClient = coreChallenge.authenticationClient();
     139    RetainPtr<WebCoreAuthenticationClientAsChallengeSender> challengeSender(AdoptNS, [[WebCoreAuthenticationClientAsChallengeSender alloc] initWithAuthenticationClient:authClient]);
     140    RetainPtr<CFURLAuthChallengeRef> authChallenge(AdoptCF, createCF(coreChallenge));
     141    return [[NSURLAuthenticationChallenge _authenticationChallengeForCFAuthChallenge:authChallenge.get() sender:challengeSender.get()] autorelease];
     142}
     143
     144NSURLCredential *mac(const Credential& coreCredential)
     145{
     146    RetainPtr<CFURLCredentialRef> credential(AdoptCF, createCF(coreCredential));
     147    return [[[NSURLCredential alloc] _initWithCFURLCredential:credential.get()] autorelease];
     148}
     149
     150#else
    92151
    93152#ifdef BUILDING_ON_LEOPARD
     
    360419}
    361420
     421#endif // USE(CFNETWORK)
     422
    362423} // namespace WebCore
    363 
    364 #endif // !USE(CFNETWORK)
  • trunk/Source/WebCore/platform/network/mac/CredentialStorageMac.mm

    r51377 r86414  
    2727#include "CredentialStorage.h"
    2828
     29#if !USE(CFNETWORK)
     30
    2931#include "AuthenticationMac.h"
    3032#include "Credential.h"
     
    3941
    4042} // namespace WebCore
     43
     44#endif // !USE(CFNETWORK)
  • trunk/Source/WebKit/mac/ChangeLog

    r86407 r86414  
     12011-05-12  Pratik Solanki  <psolanki@apple.com>
     2
     3        Reviewed by Antti Koivisto.
     4
     5        Part of WebCore should use CFNetwork-based loader on Mac
     6        https://bugs.webkit.org/show_bug.cgi?id=51836
     7
     8        Include AuthenticationCF.h header file.
     9
     10        * Misc/WebDownload.mm:
     11        * Plugins/WebBaseNetscapePluginView.mm:
     12        * WebCoreSupport/WebFrameLoaderClient.mm:
     13
    1142011-05-12  Adele Peterson  <adele@apple.com>
    215
  • trunk/Source/WebKit/mac/Misc/WebDownload.mm

    r70838 r86414  
    3131#import <Foundation/NSURLAuthenticationChallenge.h>
    3232#import <Foundation/NSURLDownload.h>
     33#import <WebCore/AuthenticationCF.h>
    3334#import <WebCore/AuthenticationMac.h>
    3435#import <WebCore/Credential.h>
  • trunk/Source/WebKit/mac/Plugins/WebBaseNetscapePluginView.mm

    r85515 r86414  
    4242#import "WebViewInternal.h"
    4343
     44#import <WebCore/AuthenticationCF.h>
    4445#import <WebCore/AuthenticationMac.h>
    4546#import <WebCore/BitmapImage.h>
  • trunk/Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm

    r85785 r86414  
    7575#import "WebUIDelegatePrivate.h"
    7676#import "WebViewInternal.h"
     77#import <WebCore/AuthenticationCF.h>
    7778#import <WebCore/AuthenticationMac.h>
    7879#import <WebCore/BackForwardController.h>
Note: See TracChangeset for help on using the changeset viewer.