Changeset 73281 in webkit


Ignore:
Timestamp:
Dec 3, 2010 11:41:49 AM (13 years ago)
Author:
beidson@apple.com
Message:

Groundwork for <rdar://problem/7660733> and https://bugs.webkit.org/show_bug.cgi?id=50191
WebKit2 Authentication Support

Reviewed by Anders Carlsson.

WebCore:

  • WebCore.exp.in:

Expose the AuthenticationClient for WK2 platforms (Windows already does this):

  • platform/network/mac/AuthenticationChallenge.h:
  • platform/network/mac/AuthenticationMac.mm:

(-[WebCoreAuthenticationClientAsChallengeSender client]):
(WebCore::AuthenticationChallenge::authenticationClient):

  • platform/network/qt/AuthenticationChallenge.h:

(WebCore::AuthenticationChallenge::authenticationClient):

WebKit2:

With this patch in place, authentication challenges are sent up from WebCore and shipped over the IPC layer.
Client apps can implement the related client methods to attempt to continue without credentials or cancel a
challenge.

There's not yet API to inspect a challenge or create a credential to use in reply - that will come later.

Build-system changes:

  • DerivedSources.make:
  • DerivedSources.pro:
  • WebKit2.pro:
  • WebKit2.xcodeproj/project.pbxproj:
  • win/WebKit2.vcproj:
  • win/WebKit2Common.vsprops:

Messages and casts for IPC and APIs:

  • Platform/CoreIPC/MessageID.h:
  • Shared/API/c/WKBase.h:
  • Shared/APIObject.h:
  • Shared/WebCoreArgumentCoders.h:
  • UIProcess/API/C/WKAPICast.h:
  • WebProcess/WebProcess.cpp:

(WebKit::WebProcess::didReceiveMessage):

Stub out the AuthenticationChallenge class family:

  • UIProcess/API/C/WKAuthenticationChallenge.cpp: Added.

(WKAuthenticationChallengeGetTypeID):

  • UIProcess/API/C/WKAuthenticationChallenge.h: Added.
  • UIProcess/API/C/WKCredential.cpp: Added.

(WKCredentialGetTypeID):

  • UIProcess/API/C/WKCredential.h: Added.
  • UIProcess/API/C/WKProtectionSpace.cpp: Added.

(WKProtectionSpaceGetTypeID):

  • UIProcess/API/C/WKProtectionSpace.h: Added.

Add an Authentication listener for the client app to respond to:

  • UIProcess/API/C/WKAuthenticationDecisionListener.cpp: Added.

(WKAuthenticationDecisionListenerGetTypeID):
(WKAuthenticationDecisionListenerUseCredential):
(WKAuthenticationDecisionListenerCancel):

  • UIProcess/API/C/WKAuthenticationDecisionListener.h: Added.

Add Authentication related methods to the page loader client:

  • UIProcess/API/C/WKPage.h:

Add empty implementations of the new API objects:

  • UIProcess/Authentication: Added.
  • UIProcess/Authentication/AuthenticationChallengeProxy.cpp: Added.

(WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
(WebKit::AuthenticationChallengeProxy::~AuthenticationChallengeProxy):
(WebKit::AuthenticationChallengeProxy::useCredential):
(WebKit::AuthenticationChallengeProxy::cancel):

  • UIProcess/Authentication/AuthenticationChallengeProxy.h: Added.

(WebKit::AuthenticationChallengeProxy::create):
(WebKit::AuthenticationChallengeProxy::listener):
(WebKit::AuthenticationChallengeProxy::type):

  • UIProcess/Authentication/WebCredential.cpp: Added.

(WebKit::WebCredential::core):

  • UIProcess/Authentication/WebCredential.h: Added.

(WebKit::WebCredential::create):
(WebKit::WebCredential::type):

  • UIProcess/Authentication/WebProtectionSpace.cpp: Added.

(WebKit::WebProtectionSpace::WebProtectionSpace):

  • UIProcess/Authentication/WebProtectionSpace.h: Added.

(WebKit::WebProtectionSpace::create):
(WebKit::WebProtectionSpace::type):

Add implementation of the Authentication decision listener:

  • UIProcess/Authentication/AuthenticationDecisionListener.cpp: Added.

(WebKit::AuthenticationDecisionListener::AuthenticationDecisionListener):
(WebKit::AuthenticationDecisionListener::useCredential):
(WebKit::AuthenticationDecisionListener::cancel):
(WebKit::AuthenticationDecisionListener::detachChallenge):

  • UIProcess/Authentication/AuthenticationDecisionListener.h: Added.

(WebKit::AuthenticationDecisionListener::create):
(WebKit::AuthenticationDecisionListener::type):

WebPage and PageLoaderClient glue:

  • UIProcess/WebLoaderClient.cpp:

(WebKit::WebLoaderClient::canAuthenticateAgainstProtectionSpaceInFrame):
(WebKit::WebLoaderClient::didReceiveAuthenticationChallengeInFrame):

  • UIProcess/WebLoaderClient.h:
  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::canAuthenticateAgainstProtectionSpaceInFrame):
(WebKit::WebPageProxy::didReceiveAuthenticationChallenge):

  • UIProcess/WebPageProxy.h:
  • UIProcess/WebPageProxy.messages.in:

Add a manager to map the actual platform authentication challenges to a challenge ID,
as at least some platforms require the object identity to persist:

  • WebProcess/Authentication: Added.
  • WebProcess/Authentication/AuthenticationManager.cpp: Added.

(WebKit::generateAuthenticationChallengeID):
(WebKit::AuthenticationManager::shared):
(WebKit::AuthenticationManager::AuthenticationManager):
(WebKit::AuthenticationManager::didReceiveMessage):
(WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
(WebKit::AuthenticationManager::useCredentialForChallenge):
(WebKit::AuthenticationManager::continueWithoutCredentialForChallenge):
(WebKit::AuthenticationManager::cancelChallenge):

  • WebProcess/Authentication/AuthenticationManager.h: Added.
  • WebProcess/Authentication/AuthenticationManager.messages.in: Added.

Hand off Authentication challenges to the manager to be sent over IPC:

  • WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:

(WebKit::WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
(WebKit::WebFrameLoaderClient::canAuthenticateAgainstProtectionSpace):

  • UIProcess/API/qt/qwkpage.cpp:

WebKitTools:

Keep these builds working:

  • MiniBrowser/mac/BrowserWindowController.m:

(-[BrowserWindowController awakeFromNib]):

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::initialize):

Location:
trunk
Files:
21 added
29 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r73279 r73281  
     12010-12-03  Brady Eidson  <beidson@apple.com>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Groundwork for <rdar://problem/7660733> and https://bugs.webkit.org/show_bug.cgi?id=50191
     6        WebKit2 Authentication Support
     7
     8        * WebCore.exp.in:
     9
     10        Expose the AuthenticationClient for WK2 platforms (Windows already does this):
     11        * platform/network/mac/AuthenticationChallenge.h:
     12        * platform/network/mac/AuthenticationMac.mm:
     13        (-[WebCoreAuthenticationClientAsChallengeSender client]):
     14        (WebCore::AuthenticationChallenge::authenticationClient):
     15
     16        * platform/network/qt/AuthenticationChallenge.h:
     17        (WebCore::AuthenticationChallenge::authenticationClient):
     18
    1192010-12-03  Ryosuke Niwa  <rniwa@webkit.org>
    220
  • trunk/WebCore/WebCore.exp.in

    r73267 r73281  
    138138__ZN3WTF6StringC1EP8NSString
    139139__ZN3WTF6StringC1EPK10__CFString
     140__ZN7WebCore10CredentialC1Ev
    140141__ZN7WebCore10JSDocument6s_infoE
    141142__ZN7WebCore10MouseEventC1ERKN3WTF12AtomicStringEbbNS1_10PassRefPtrINS_9DOMWindowEEEiiiiibbbbtNS5_INS_11EventTargetEEENS5_INS_9ClipboardEEEb
     
    369370__ZN7WebCore15GraphicsContextD1Ev
    370371__ZN7WebCore15JSDOMWindowBase18commonJSGlobalDataEv
     372__ZN7WebCore15ProtectionSpaceC1Ev
    371373__ZN7WebCore15ScrollAlignment17alignCenterAlwaysE
    372374__ZN7WebCore15ScrollAlignment19alignToEdgeIfNeededE
     
    535537__ZN7WebCore26contextMenuItemTagOpenLinkEv
    536538__ZN7WebCore26usesTestModeFocusRingColorEv
     539__ZN7WebCore27AuthenticationChallengeBaseC2Ev
    537540__ZN7WebCore27CSSComputedStyleDeclarationC1EN3WTF10PassRefPtrINS_4NodeEEEbRKNS1_6StringE
    538541__ZN7WebCore27DeviceOrientationClientMock14setOrientationEN3WTF10PassRefPtrINS_17DeviceOrientationEEE
     
    10481051__ZNK7WebCore21BackForwardController9backCountEv
    10491052__ZNK7WebCore21UserContentURLPattern7matchesERKNS_4KURLE
     1053__ZNK7WebCore23AuthenticationChallenge20authenticationClientEv
    10501054__ZNK7WebCore23FrameLoaderStateMachine15firstLayoutDoneEv
    10511055__ZNK7WebCore23FrameLoaderStateMachine23committingFirstRealLoadEv
    10521056__ZNK7WebCore26NetscapePlugInStreamLoader6isDoneEv
     1057__ZNK7WebCore27AuthenticationChallengeBase6isNullEv
    10531058__ZNK7WebCore4Font10floatWidthERKNS_7TextRunEPN3WTF7HashSetIPKNS_14SimpleFontDataENS4_7PtrHashIS8_EENS4_10HashTraitsIS8_EEEEPNS_13GlyphOverflowE
    10541059__ZNK7WebCore4Font8drawTextEPNS_15GraphicsContextERKNS_7TextRunERKNS_10FloatPointEii
  • trunk/WebCore/platform/network/mac/AuthenticationChallenge.h

    r50882 r73281  
    5050
    5151    void setAuthenticationClient(AuthenticationClient*); // Changes sender to one that invokes client methods.
     52    AuthenticationClient* authenticationClient() const;
    5253
    5354private:
  • trunk/WebCore/platform/network/mac/AuthenticationMac.mm

    r58442 r73281  
    4242}
    4343- (id)initWithAuthenticationClient:(AuthenticationClient*)client;
     44- (AuthenticationClient*)client;
    4445- (void)detachClient;
    4546@end
     
    5455    m_client = client;
    5556    return self;
     57}
     58
     59- (AuthenticationClient*)client
     60{
     61    return m_client;
    5662}
    5763
     
    122128            [(WebCoreAuthenticationClientAsChallengeSender *)m_sender.get() detachClient];
    123129    }
     130}
     131
     132AuthenticationClient* AuthenticationChallenge::authenticationClient() const
     133{
     134    if ([m_sender.get() isMemberOfClass:[WebCoreAuthenticationClientAsChallengeSender class]])
     135        return [static_cast<WebCoreAuthenticationClientAsChallengeSender*>(m_sender.get()) client];
     136   
     137    return 0;
    124138}
    125139
  • trunk/WebCore/platform/network/qt/AuthenticationChallenge.h

    r30584 r73281  
    3030namespace WebCore {
    3131
     32class AuthenticationClient;
     33
    3234class AuthenticationChallenge : public AuthenticationChallengeBase {
    3335public:
     
    4042    {
    4143    }
     44
     45    AuthenticationClient* authenticationClient() const { return 0; } // FIXME: Implement!
     46
    4247};
    4348
  • trunk/WebKit2/ChangeLog

    r73275 r73281  
     12010-12-03  Brady Eidson  <beidson@apple.com>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Groundwork for <rdar://problem/7660733> and https://bugs.webkit.org/show_bug.cgi?id=50191
     6        WebKit2 Authentication Support
     7
     8        With this patch in place, authentication challenges are sent up from WebCore and shipped over the IPC layer.
     9        Client apps can implement the related client methods to attempt to continue without credentials or cancel a
     10        challenge.
     11
     12        There's not yet API to inspect a challenge or create a credential to use in reply - that will come later.
     13
     14        Build-system changes:
     15        * DerivedSources.make:
     16        * DerivedSources.pro:
     17        * WebKit2.pro:
     18        * WebKit2.xcodeproj/project.pbxproj:
     19        * win/WebKit2.vcproj:
     20        * win/WebKit2Common.vsprops:
     21
     22        Messages and casts for IPC and APIs:
     23        * Platform/CoreIPC/MessageID.h:
     24        * Shared/API/c/WKBase.h:
     25        * Shared/APIObject.h:
     26        * Shared/WebCoreArgumentCoders.h:
     27        * UIProcess/API/C/WKAPICast.h:
     28        * WebProcess/WebProcess.cpp:
     29        (WebKit::WebProcess::didReceiveMessage):
     30
     31        Stub out the AuthenticationChallenge class family:
     32        * UIProcess/API/C/WKAuthenticationChallenge.cpp: Added.
     33        (WKAuthenticationChallengeGetTypeID):
     34        * UIProcess/API/C/WKAuthenticationChallenge.h: Added.
     35        * UIProcess/API/C/WKCredential.cpp: Added.
     36        (WKCredentialGetTypeID):
     37        * UIProcess/API/C/WKCredential.h: Added.
     38        * UIProcess/API/C/WKProtectionSpace.cpp: Added.
     39        (WKProtectionSpaceGetTypeID):
     40        * UIProcess/API/C/WKProtectionSpace.h: Added.
     41
     42        Add an Authentication listener for the client app to respond to:
     43        * UIProcess/API/C/WKAuthenticationDecisionListener.cpp: Added.
     44        (WKAuthenticationDecisionListenerGetTypeID):
     45        (WKAuthenticationDecisionListenerUseCredential):
     46        (WKAuthenticationDecisionListenerCancel):
     47        * UIProcess/API/C/WKAuthenticationDecisionListener.h: Added.
     48
     49        Add Authentication related methods to the page loader client:
     50        * UIProcess/API/C/WKPage.h:
     51
     52        Add empty implementations of the new API objects:
     53        * UIProcess/Authentication: Added.
     54        * UIProcess/Authentication/AuthenticationChallengeProxy.cpp: Added.
     55        (WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
     56        (WebKit::AuthenticationChallengeProxy::~AuthenticationChallengeProxy):
     57        (WebKit::AuthenticationChallengeProxy::useCredential):
     58        (WebKit::AuthenticationChallengeProxy::cancel):
     59        * UIProcess/Authentication/AuthenticationChallengeProxy.h: Added.
     60        (WebKit::AuthenticationChallengeProxy::create):
     61        (WebKit::AuthenticationChallengeProxy::listener):
     62        (WebKit::AuthenticationChallengeProxy::type):
     63
     64        * UIProcess/Authentication/WebCredential.cpp: Added.
     65        (WebKit::WebCredential::core):
     66        * UIProcess/Authentication/WebCredential.h: Added.
     67        (WebKit::WebCredential::create):
     68        (WebKit::WebCredential::type):
     69        * UIProcess/Authentication/WebProtectionSpace.cpp: Added.
     70        (WebKit::WebProtectionSpace::WebProtectionSpace):
     71        * UIProcess/Authentication/WebProtectionSpace.h: Added.
     72        (WebKit::WebProtectionSpace::create):
     73        (WebKit::WebProtectionSpace::type):
     74
     75        Add implementation of the Authentication decision listener:
     76        * UIProcess/Authentication/AuthenticationDecisionListener.cpp: Added.
     77        (WebKit::AuthenticationDecisionListener::AuthenticationDecisionListener):
     78        (WebKit::AuthenticationDecisionListener::useCredential):
     79        (WebKit::AuthenticationDecisionListener::cancel):
     80        (WebKit::AuthenticationDecisionListener::detachChallenge):
     81        * UIProcess/Authentication/AuthenticationDecisionListener.h: Added.
     82        (WebKit::AuthenticationDecisionListener::create):
     83        (WebKit::AuthenticationDecisionListener::type):
     84
     85        WebPage and PageLoaderClient glue:
     86        * UIProcess/WebLoaderClient.cpp:
     87        (WebKit::WebLoaderClient::canAuthenticateAgainstProtectionSpaceInFrame):
     88        (WebKit::WebLoaderClient::didReceiveAuthenticationChallengeInFrame):
     89        * UIProcess/WebLoaderClient.h:
     90        * UIProcess/WebPageProxy.cpp:
     91        (WebKit::WebPageProxy::canAuthenticateAgainstProtectionSpaceInFrame):
     92        (WebKit::WebPageProxy::didReceiveAuthenticationChallenge):
     93        * UIProcess/WebPageProxy.h:
     94        * UIProcess/WebPageProxy.messages.in:
     95
     96        Add a manager to map the actual platform authentication challenges to a challenge ID,
     97        as at least some platforms require the object identity to persist:
     98        * WebProcess/Authentication: Added.
     99        * WebProcess/Authentication/AuthenticationManager.cpp: Added.
     100        (WebKit::generateAuthenticationChallengeID):
     101        (WebKit::AuthenticationManager::shared):
     102        (WebKit::AuthenticationManager::AuthenticationManager):
     103        (WebKit::AuthenticationManager::didReceiveMessage):
     104        (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
     105        (WebKit::AuthenticationManager::useCredentialForChallenge):
     106        (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge):
     107        (WebKit::AuthenticationManager::cancelChallenge):
     108        * WebProcess/Authentication/AuthenticationManager.h: Added.
     109        * WebProcess/Authentication/AuthenticationManager.messages.in: Added.
     110
     111        Hand off Authentication challenges to the manager to be sent over IPC:
     112        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     113        (WebKit::WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge):
     114        (WebKit::WebFrameLoaderClient::canAuthenticateAgainstProtectionSpace):
     115
     116        * UIProcess/API/qt/qwkpage.cpp:
     117
    11182010-12-03  Anders Carlsson  <andersca@apple.com>
    2119
  • trunk/WebKit2/DerivedSources.make

    r71857 r73281  
    2424    $(WebKit2)/PluginProcess \
    2525    $(WebKit2)/Shared/Plugins \
     26    $(WebKit2)/WebProcess/Authentication \
    2627    $(WebKit2)/WebProcess/Plugins \
    2728    $(WebKit2)/WebProcess/WebPage \
     
    3334
    3435MESSAGE_RECEIVERS = \
     36    AuthenticationManager \
    3537    DownloadProxy \
    3638    NPObjectMessageReceiver \
  • trunk/WebKit2/DerivedSources.pro

    r72792 r73281  
    8686VPATH = \
    8787    PluginProcess \
     88    WebProcess/Authentication \
    8889    WebProcess/Plugins \
    8990    WebProcess/WebPage \
     
    9495
    9596MESSAGE_RECEIVERS = \
     97    AuthenticationManager.messages.in \
    9698    DownloadProxy.messages.in \
    9799    PluginControllerProxy.messages.in \
  • trunk/WebKit2/Platform/CoreIPC/MessageID.h

    r71655 r73281  
    3636
    3737    // Messages sent by the UI process to the web process.
     38    MessageClassAuthenticationManager,
    3839    MessageClassDrawingArea,
    3940    MessageClassInjectedBundle,
  • trunk/WebKit2/Shared/API/c/WKBase.h

    r73267 r73281  
    6161/* WebKit2 main API types */
    6262
     63typedef const struct OpaqueWKAuthenticationChallenge* WKAuthenticationChallengeRef;
     64typedef const struct OpaqueWKAuthenticationDecisionListener* WKAuthenticationDecisionListenerRef;
    6365typedef const struct OpaqueWKBackForwardList* WKBackForwardListRef;
    6466typedef const struct OpaqueWKBackForwardListItem* WKBackForwardListItemRef;
    6567typedef const struct OpaqueWKContext* WKContextRef;
     68typedef const struct OpaqueWKCredential* WKCredentialRef;
    6669typedef const struct OpaqueWKDownload* WKDownloadRef;
    6770typedef const struct OpaqueWKFormSubmissionListener* WKFormSubmissionListenerRef;
     
    7477typedef const struct OpaqueWKPageNamespace* WKPageNamespaceRef;
    7578typedef const struct OpaqueWKPreferences* WKPreferencesRef;
     79typedef const struct OpaqueWKProtectionSpace* WKProtectionSpaceRef;
    7680
    7781/* WebKit2 Bundle types */
  • trunk/WebKit2/Shared/APIObject.h

    r73267 r73281  
    3737        TypeNull = 0,
    3838        TypeArray,
     39        TypeAuthenticationChallenge,
     40        TypeAuthenticationDecisionListener,
    3941        TypeCertificateInfo,
    4042        TypeContextMenuItem,
     43        TypeCredential,
    4144        TypeData,
    4245        TypeDictionary,
    4346        TypeError,
     47        TypeProtectionSpace,
    4448        TypeSecurityOrigin,
    4549        TypeSerializedScriptValue,
  • trunk/WebKit2/Shared/WebCoreArgumentCoders.h

    r71868 r73281  
    3131#include "ArgumentEncoder.h"
    3232#include "Arguments.h"
     33#include <WebCore/AuthenticationChallenge.h>
     34#include <WebCore/Credential.h>
    3335#include <WebCore/Cursor.h>
    3436#include <WebCore/FloatRect.h>
     
    3638#include <WebCore/KeyboardEvent.h>
    3739#include <WebCore/PluginData.h>
     40#include <WebCore/ProtectionSpace.h>
    3841#include <WebCore/ResourceError.h>
    3942#include <WebCore/ResourceRequest.h>
     
    107110    {
    108111        return decoder->decode(static_cast<HashMap<AtomicString, String, CaseFoldingHash>&>(headerMap));
     112    }
     113};
     114
     115template<> struct ArgumentCoder<WebCore::AuthenticationChallenge> {
     116    static void encode(ArgumentEncoder* encoder, const WebCore::AuthenticationChallenge& challenge)
     117    {
     118        // FIXME: Implement
     119    }
     120
     121    static bool decode(ArgumentDecoder* decoder, WebCore::AuthenticationChallenge& credential)
     122    {
     123        // FIXME: Implement
     124        return true;
     125    }
     126};
     127
     128template<> struct ArgumentCoder<WebCore::ProtectionSpace> {
     129    static void encode(ArgumentEncoder* encoder, const WebCore::ProtectionSpace& challenge)
     130    {
     131        // FIXME: Implement
     132    }
     133
     134    static bool decode(ArgumentDecoder* decoder, WebCore::ProtectionSpace& credential)
     135    {
     136        // FIXME: Implement
     137        return true;
     138    }
     139};
     140
     141template<> struct ArgumentCoder<WebCore::Credential> {
     142    static void encode(ArgumentEncoder* encoder, const WebCore::Credential& credential)
     143    {
     144        // FIXME: Implement
     145    }
     146
     147    static bool decode(ArgumentDecoder* decoder, WebCore::Credential& credential)
     148    {
     149        // FIXME: Implement
     150        return true;
    109151    }
    110152};
  • trunk/WebKit2/UIProcess/API/C/WKAPICast.h

    r73066 r73281  
    3737namespace WebKit {
    3838
     39class AuthenticationChallengeProxy;
     40class AuthenticationDecisionListener;
    3941class DownloadProxy;
    4042class WebBackForwardList;
    4143class WebBackForwardListItem;
    4244class WebContext;
     45class WebCredential;
    4346class WebFormSubmissionListenerProxy;
    4447class WebFramePolicyListenerProxy;
     
    5053class WebPageProxy;
    5154class WebPreferences;
     55class WebProtectionSpace;
    5256
     57WK_ADD_API_MAPPING(WKAuthenticationChallengeRef, AuthenticationChallengeProxy)
     58WK_ADD_API_MAPPING(WKAuthenticationDecisionListenerRef, AuthenticationDecisionListener)
    5359WK_ADD_API_MAPPING(WKBackForwardListItemRef, WebBackForwardListItem)
    5460WK_ADD_API_MAPPING(WKBackForwardListRef, WebBackForwardList)
    5561WK_ADD_API_MAPPING(WKContextRef, WebContext)
     62WK_ADD_API_MAPPING(WKCredentialRef, WebCredential)
    5663WK_ADD_API_MAPPING(WKDownloadRef, DownloadProxy)
    5764WK_ADD_API_MAPPING(WKFormSubmissionListenerRef, WebFormSubmissionListenerProxy)
     
    6673WK_ADD_API_MAPPING(WKPageRef, WebPageProxy)
    6774WK_ADD_API_MAPPING(WKPreferencesRef, WebPreferences)
     75WK_ADD_API_MAPPING(WKProtectionSpaceRef, WebProtectionSpace)
    6876
    6977/* Enum conversions */
  • trunk/WebKit2/UIProcess/API/C/WKPage.h

    r73066 r73281  
    6565typedef void (*WKPageDidDisplayInsecureContentForFrameCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
    6666typedef void (*WKPageDidRunInsecureContentForFrameCallback)(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo);
     67typedef bool (*WKPageCanAuthenticateAgainstProtectionSpaceInFrameCallback)(WKPageRef page, WKFrameRef frame, WKProtectionSpaceRef protectionSpace, const void *clientInfo);
     68typedef void (*WKPageDidReceiveAuthenticationChallengeInFrameCallback)(WKPageRef page, WKFrameRef frame, WKAuthenticationChallengeRef authenticationChallenge, WKAuthenticationDecisionListenerRef listener, const void *clientInfo);
    6769
    6870// Progress Client
     
    9597    WKPageDidDisplayInsecureContentForFrameCallback                     didDisplayInsecureContentForFrame;
    9698    WKPageDidRunInsecureContentForFrameCallback                         didRunInsecureContentForFrame;
     99    WKPageCanAuthenticateAgainstProtectionSpaceInFrameCallback          canAuthenticateAgainstProtectionSpaceInFrame;
     100    WKPageDidReceiveAuthenticationChallengeInFrameCallback              didReceiveAuthenticationChallengeInFrame;
    97101
    98102    // FIXME: Move to progress client.
  • trunk/WebKit2/UIProcess/API/qt/qwkpage.cpp

    r73221 r73281  
    324324        0, /* didDisplayInsecureContentForFrame */
    325325        0, /* didRunInsecureContentForFrame */
     326        0, /* canAuthenticateAgainstProtectionSpaceInFrame */
     327        0, /* didReceiveAuthenticationChallengeInFrame */
    326328        qt_wk_didStartProgress,
    327329        qt_wk_didChangeProgress,
  • trunk/WebKit2/UIProcess/WebLoaderClient.cpp

    r71746 r73281  
    137137}
    138138
     139bool WebLoaderClient::canAuthenticateAgainstProtectionSpaceInFrame(WebPageProxy* page, WebFrameProxy* frame, WebProtectionSpace* protectionSpace)
     140{
     141    if (!m_client.canAuthenticateAgainstProtectionSpaceInFrame)
     142        return false;
     143
     144    return m_client.canAuthenticateAgainstProtectionSpaceInFrame(toAPI(page), toAPI(frame), toAPI(protectionSpace), m_client.clientInfo);
     145}
     146
     147void WebLoaderClient::didReceiveAuthenticationChallengeInFrame(WebPageProxy* page, WebFrameProxy* frame, AuthenticationChallengeProxy* authenticationChallenge, AuthenticationDecisionListener* listener)
     148{
     149    if (!m_client.didReceiveAuthenticationChallengeInFrame)
     150        return;
     151
     152    m_client.didReceiveAuthenticationChallengeInFrame(toAPI(page), toAPI(frame), toAPI(authenticationChallenge), toAPI(listener), m_client.clientInfo);
     153}
     154
    139155void WebLoaderClient::didStartProgress(WebPageProxy* page)
    140156{
  • trunk/WebKit2/UIProcess/WebLoaderClient.h

    r71746 r73281  
    3838
    3939class APIObject;
     40class AuthenticationChallengeProxy;
     41class AuthenticationDecisionListener;
     42class WebFrameProxy;
    4043class WebPageProxy;
    41 class WebFrameProxy;
     44class WebProtectionSpace;
    4245
    4346class WebLoaderClient : public APIClient<WKPageLoaderClient> {
     
    5659    void didDisplayInsecureContentForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
    5760    void didRunInsecureContentForFrame(WebPageProxy*, WebFrameProxy*, APIObject*);
     61   
     62    bool canAuthenticateAgainstProtectionSpaceInFrame(WebPageProxy*, WebFrameProxy*, WebProtectionSpace*);
     63    void didReceiveAuthenticationChallengeInFrame(WebPageProxy*, WebFrameProxy*, AuthenticationChallengeProxy*, AuthenticationDecisionListener*);
    5864
    5965    void didStartProgress(WebPageProxy*);
  • trunk/WebKit2/UIProcess/WebPageProxy.cpp

    r73215 r73281  
    2626#include "WebPageProxy.h"
    2727
     28#include "AuthenticationChallengeProxy.h"
     29#include "AuthenticationDecisionListener.h"
    2830#include "DrawingAreaProxy.h"
    2931#include "FindIndicator.h"
     
    5658#include "WebProcessMessages.h"
    5759#include "WebProcessProxy.h"
     60#include "WebProtectionSpace.h"
    5861#include "WebURLRequest.h"
    5962#include <WebCore/FloatRect.h>
     
    15301533}
    15311534
     1535void WebPageProxy::canAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, const WebCore::ProtectionSpace& coreProtectionSpace, bool& canAuthenticate)
     1536{
     1537    WebFrameProxy* frame = process()->webFrame(frameID);
     1538    RefPtr<WebProtectionSpace> protectionSpace = WebProtectionSpace::create(coreProtectionSpace);
     1539   
     1540    canAuthenticate = m_loaderClient.canAuthenticateAgainstProtectionSpaceInFrame(this, frame, protectionSpace.get());
     1541}
     1542
     1543void WebPageProxy::didReceiveAuthenticationChallenge(uint64_t frameID, const WebCore::AuthenticationChallenge& coreChallenge, uint64_t challengeID)
     1544{
     1545    WebFrameProxy* frame = process()->webFrame(frameID);
     1546    RefPtr<AuthenticationChallengeProxy> authenticationChallenge = AuthenticationChallengeProxy::create(coreChallenge, challengeID, this);
     1547   
     1548    m_loaderClient.didReceiveAuthenticationChallengeInFrame(this, frame, authenticationChallenge.get(), authenticationChallenge->listener());
     1549}
     1550
    15321551} // namespace WebKit
  • trunk/WebKit2/UIProcess/WebPageProxy.h

    r73090 r73281  
    6262
    6363namespace WebCore {
     64    class AuthenticationChallenge;
    6465    class Cursor;
    6566    class FloatRect;
    6667    class IntSize;
     68    class ProtectionSpace;
    6769    struct ViewportArguments;
    6870    struct WindowFeatures;
     
    378380#endif
    379381
     382    void canAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, const WebCore::ProtectionSpace&, bool& canAuthenticate);
     383    void didReceiveAuthenticationChallenge(uint64_t frameID, const WebCore::AuthenticationChallenge&, uint64_t challengeID);
     384
    380385    PageClient* m_pageClient;
    381386    WebLoaderClient m_loaderClient;
  • trunk/WebKit2/UIProcess/WebPageProxy.messages.in

    r73036 r73281  
    136136    DidChangeAcceleratedCompositing(bool compositing) -> (WebKit::DrawingAreaInfo newDrawingArea)
    137137#endif
     138
     139    # Authentication
     140    CanAuthenticateAgainstProtectionSpaceInFrame(uint64_t frameID, WebCore::ProtectionSpace protectionSpace) -> (bool canAuthenticate)
     141    DidReceiveAuthenticationChallenge(uint64_t frameID, WebCore::AuthenticationChallenge challenge, uint64_t challengeID)
    138142}
  • trunk/WebKit2/WebKit2.pro

    r73267 r73281  
    131131    UIProcess/API/cpp/qt \
    132132    UIProcess/API/qt \
     133    UIProcess/Authentication \
    133134    UIProcess/Downloads \
    134135    UIProcess/Launcher \
     
    136137    UIProcess/qt \
    137138    WebProcess \
     139    WebProcess/Authentication \
    138140    WebProcess/Downloads \
    139141    WebProcess/Downloads/qt \
     
    160162
    161163WEBKIT2_GENERATED_HEADERS = \
     164    $$WEBKIT2_GENERATED_SOURCES_DIR/AuthenticationManagerMessages.h \
    162165    $$WEBKIT2_GENERATED_SOURCES_DIR/DownloadProxyMessages.h \
    163166    $$WEBKIT2_GENERATED_SOURCES_DIR/PluginControllerProxyMessages.h \
     
    175178
    176179WEBKIT2_GENERATED_SOURCES = \
     180    $$WEBKIT2_GENERATED_SOURCES_DIR/AuthenticationManagerMessageReceiver.cpp \
    177181    $$WEBKIT2_GENERATED_SOURCES_DIR/DownloadProxyMessageReceiver.cpp \
    178182    $$WEBKIT2_GENERATED_SOURCES_DIR/PluginControllerProxyMessageReceiver.cpp \
     
    263267    Shared/qt/WebEventFactoryQt.h \
    264268    UIProcess/API/C/WKAPICast.h \
     269    UIProcess/API/C/WKAuthenticationChallenge.h \
     270    UIProcess/API/C/WKAuthenticationDecisionListener.h \
    265271    UIProcess/API/C/WKBackForwardList.h \
    266272    UIProcess/API/C/WKBackForwardListItem.h \
    267273    UIProcess/API/C/WKContext.h \
    268274    UIProcess/API/C/WKContextPrivate.h \
     275    UIProcess/API/C/WKCredential.h \
    269276    UIProcess/API/C/WKDownload.h \
    270277    UIProcess/API/C/WKFrame.h \
     
    278285    UIProcess/API/C/WKPreferences.h \
    279286    UIProcess/API/C/WKPreferencesPrivate.h \
     287    UIProcess/API/C/WKProtectionSpace.h \
    280288    UIProcess/API/C/WebKit2.h \
    281289    UIProcess/API/C/qt/WKNativeEvent.h \
     
    290298    UIProcess/API/qt/qwkpage_p.h \
    291299    UIProcess/API/qt/qwkpreferences.h \
     300    UIProcess/Authentication/AuthenticationChallengeProxy.h \
     301    UIProcess/Authentication/AuthenticationDecisionListener.h \
     302    UIProcess/Authentication/WebCredential.h \
     303    UIProcess/Authentication/WebProtectionSpace.h \
    292304    UIProcess/ChunkedUpdateDrawingAreaProxy.h \
    293305    UIProcess/Downloads/DownloadProxy.h \
     
    330342    UIProcess/qt/WebContextMenuProxyQt.h \
    331343    UIProcess/qt/WebPopupMenuProxyQt.h \
     344    WebProcess/Authentication/AuthenticationManager.h \
    332345    WebProcess/Downloads/Download.h \
    333346    WebProcess/Downloads/DownloadManager.h \
     
    449462    Shared/qt/WebURLRequestQt.cpp \
    450463    Shared/qt/WebURLResponseQt.cpp \
     464    UIProcess/API/C/WKAuthenticationChallenge.cpp \
     465    UIProcess/API/C/WKAuthenticationDecisionListener.cpp \
    451466    UIProcess/API/C/WKBackForwardList.cpp \
    452467    UIProcess/API/C/WKBackForwardListItem.cpp \
    453468    UIProcess/API/C/WKContext.cpp \
     469    UIProcess/API/C/WKCredential.cpp \
    454470    UIProcess/API/C/WKDownload.cpp \
    455471    UIProcess/API/C/WKFrame.cpp \
     
    461477    UIProcess/API/C/WKPageNamespace.cpp \
    462478    UIProcess/API/C/WKPreferences.cpp \
     479    UIProcess/API/C/WKProtectionSpace.cpp \
    463480    UIProcess/API/cpp/qt/WKStringQt.cpp \
    464481    UIProcess/API/cpp/qt/WKURLQt.cpp \
     
    468485    UIProcess/API/qt/qwkpage.cpp \
    469486    UIProcess/API/qt/qwkpreferences.cpp \
     487    UIProcess/Authentication/AuthenticationChallengeProxy.cpp \
     488    UIProcess/Authentication/AuthenticationDecisionListener.cpp \
     489    UIProcess/Authentication/WebCredential.cpp \
     490    UIProcess/Authentication/WebProtectionSpace.cpp \
    470491    UIProcess/ChunkedUpdateDrawingAreaProxy.cpp \
    471492    UIProcess/Downloads/DownloadProxy.cpp \
     
    515536    UIProcess/qt/WebPopupMenuProxyQt.cpp \
    516537    UIProcess/qt/WebPreferencesQt.cpp \
     538    WebProcess/Authentication/AuthenticationManager.cpp \
    517539    WebProcess/Downloads/Download.cpp \
    518540    WebProcess/Downloads/DownloadManager.cpp \
  • trunk/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r73267 r73281  
    206206                512935E31288D97800A4B695 /* InjectedBundlePageContextMenuClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512935E11288D97800A4B695 /* InjectedBundlePageContextMenuClient.cpp */; };
    207207                512935E41288D97800A4B695 /* InjectedBundlePageContextMenuClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 512935E21288D97800A4B695 /* InjectedBundlePageContextMenuClient.h */; };
     208                512F588A12A8836600629530 /* AuthenticationManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512F588712A8836600629530 /* AuthenticationManager.cpp */; };
     209                512F588B12A8836600629530 /* AuthenticationManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 512F588812A8836600629530 /* AuthenticationManager.h */; };
     210                512F588C12A8836600629530 /* AuthenticationManager.messages.in in Resources */ = {isa = PBXBuildFile; fileRef = 512F588912A8836600629530 /* AuthenticationManager.messages.in */; };
     211                512F589612A8838800629530 /* AuthenticationChallengeProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512F588E12A8838800629530 /* AuthenticationChallengeProxy.cpp */; };
     212                512F589712A8838800629530 /* AuthenticationChallengeProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 512F588F12A8838800629530 /* AuthenticationChallengeProxy.h */; };
     213                512F589812A8838800629530 /* AuthenticationDecisionListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512F589012A8838800629530 /* AuthenticationDecisionListener.cpp */; };
     214                512F589912A8838800629530 /* AuthenticationDecisionListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 512F589112A8838800629530 /* AuthenticationDecisionListener.h */; };
     215                512F589A12A8838800629530 /* WebCredential.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512F589212A8838800629530 /* WebCredential.cpp */; };
     216                512F589B12A8838800629530 /* WebCredential.h in Headers */ = {isa = PBXBuildFile; fileRef = 512F589312A8838800629530 /* WebCredential.h */; };
     217                512F589C12A8838800629530 /* WebProtectionSpace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512F589412A8838800629530 /* WebProtectionSpace.cpp */; };
     218                512F589D12A8838800629530 /* WebProtectionSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 512F589512A8838800629530 /* WebProtectionSpace.h */; };
     219                512F58A212A883AD00629530 /* AuthenticationManagerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512F58A012A883AD00629530 /* AuthenticationManagerMessageReceiver.cpp */; };
     220                512F58A312A883AD00629530 /* AuthenticationManagerMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 512F58A112A883AD00629530 /* AuthenticationManagerMessages.h */; };
     221                512F58F512A88A5400629530 /* WKAuthenticationChallenge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512F58ED12A88A5400629530 /* WKAuthenticationChallenge.cpp */; };
     222                512F58F612A88A5400629530 /* WKAuthenticationChallenge.h in Headers */ = {isa = PBXBuildFile; fileRef = 512F58EE12A88A5400629530 /* WKAuthenticationChallenge.h */; };
     223                512F58F712A88A5400629530 /* WKAuthenticationDecisionListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512F58EF12A88A5400629530 /* WKAuthenticationDecisionListener.cpp */; };
     224                512F58F812A88A5400629530 /* WKAuthenticationDecisionListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 512F58F012A88A5400629530 /* WKAuthenticationDecisionListener.h */; };
     225                512F58F912A88A5400629530 /* WKCredential.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512F58F112A88A5400629530 /* WKCredential.cpp */; };
     226                512F58FA12A88A5400629530 /* WKCredential.h in Headers */ = {isa = PBXBuildFile; fileRef = 512F58F212A88A5400629530 /* WKCredential.h */; };
     227                512F58FB12A88A5400629530 /* WKProtectionSpace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 512F58F312A88A5400629530 /* WKProtectionSpace.cpp */; };
     228                512F58FC12A88A5400629530 /* WKProtectionSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = 512F58F412A88A5400629530 /* WKProtectionSpace.h */; };
    208229                5153569C1291B1D2000749DC /* WebPageContextMenuClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5153569A1291B1D2000749DC /* WebPageContextMenuClient.cpp */; };
    209230                5153569D1291B1D2000749DC /* WebPageContextMenuClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 5153569B1291B1D2000749DC /* WebPageContextMenuClient.h */; };
     
    811832                512935E11288D97800A4B695 /* InjectedBundlePageContextMenuClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePageContextMenuClient.cpp; sourceTree = "<group>"; };
    812833                512935E21288D97800A4B695 /* InjectedBundlePageContextMenuClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePageContextMenuClient.h; sourceTree = "<group>"; };
     834                512F588712A8836600629530 /* AuthenticationManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AuthenticationManager.cpp; sourceTree = "<group>"; };
     835                512F588812A8836600629530 /* AuthenticationManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationManager.h; sourceTree = "<group>"; };
     836                512F588912A8836600629530 /* AuthenticationManager.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AuthenticationManager.messages.in; sourceTree = "<group>"; };
     837                512F588E12A8838800629530 /* AuthenticationChallengeProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AuthenticationChallengeProxy.cpp; sourceTree = "<group>"; };
     838                512F588F12A8838800629530 /* AuthenticationChallengeProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationChallengeProxy.h; sourceTree = "<group>"; };
     839                512F589012A8838800629530 /* AuthenticationDecisionListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AuthenticationDecisionListener.cpp; sourceTree = "<group>"; };
     840                512F589112A8838800629530 /* AuthenticationDecisionListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationDecisionListener.h; sourceTree = "<group>"; };
     841                512F589212A8838800629530 /* WebCredential.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebCredential.cpp; sourceTree = "<group>"; };
     842                512F589312A8838800629530 /* WebCredential.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCredential.h; sourceTree = "<group>"; };
     843                512F589412A8838800629530 /* WebProtectionSpace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebProtectionSpace.cpp; sourceTree = "<group>"; };
     844                512F589512A8838800629530 /* WebProtectionSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebProtectionSpace.h; sourceTree = "<group>"; };
     845                512F58A012A883AD00629530 /* AuthenticationManagerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AuthenticationManagerMessageReceiver.cpp; sourceTree = "<group>"; };
     846                512F58A112A883AD00629530 /* AuthenticationManagerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthenticationManagerMessages.h; sourceTree = "<group>"; };
     847                512F58ED12A88A5400629530 /* WKAuthenticationChallenge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKAuthenticationChallenge.cpp; sourceTree = "<group>"; };
     848                512F58EE12A88A5400629530 /* WKAuthenticationChallenge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKAuthenticationChallenge.h; sourceTree = "<group>"; };
     849                512F58EF12A88A5400629530 /* WKAuthenticationDecisionListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKAuthenticationDecisionListener.cpp; sourceTree = "<group>"; };
     850                512F58F012A88A5400629530 /* WKAuthenticationDecisionListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKAuthenticationDecisionListener.h; sourceTree = "<group>"; };
     851                512F58F112A88A5400629530 /* WKCredential.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKCredential.cpp; sourceTree = "<group>"; };
     852                512F58F212A88A5400629530 /* WKCredential.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKCredential.h; sourceTree = "<group>"; };
     853                512F58F312A88A5400629530 /* WKProtectionSpace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKProtectionSpace.cpp; sourceTree = "<group>"; };
     854                512F58F412A88A5400629530 /* WKProtectionSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKProtectionSpace.h; sourceTree = "<group>"; };
    813855                5153569A1291B1D2000749DC /* WebPageContextMenuClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageContextMenuClient.cpp; sourceTree = "<group>"; };
    814856                5153569B1291B1D2000749DC /* WebPageContextMenuClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPageContextMenuClient.h; sourceTree = "<group>"; };
     
    16141656                        usesTabs = 0;
    16151657                };
     1658                512F588612A8834700629530 /* Authentication */ = {
     1659                        isa = PBXGroup;
     1660                        children = (
     1661                                512F588712A8836600629530 /* AuthenticationManager.cpp */,
     1662                                512F588812A8836600629530 /* AuthenticationManager.h */,
     1663                                512F588912A8836600629530 /* AuthenticationManager.messages.in */,
     1664                        );
     1665                        path = Authentication;
     1666                        sourceTree = "<group>";
     1667                };
     1668                512F588D12A8836F00629530 /* Authentication */ = {
     1669                        isa = PBXGroup;
     1670                        children = (
     1671                                512F588E12A8838800629530 /* AuthenticationChallengeProxy.cpp */,
     1672                                512F588F12A8838800629530 /* AuthenticationChallengeProxy.h */,
     1673                                512F589012A8838800629530 /* AuthenticationDecisionListener.cpp */,
     1674                                512F589112A8838800629530 /* AuthenticationDecisionListener.h */,
     1675                                512F589212A8838800629530 /* WebCredential.cpp */,
     1676                                512F589312A8838800629530 /* WebCredential.h */,
     1677                                512F589412A8838800629530 /* WebProtectionSpace.cpp */,
     1678                                512F589512A8838800629530 /* WebProtectionSpace.h */,
     1679                        );
     1680                        path = Authentication;
     1681                        sourceTree = "<group>";
     1682                };
    16161683                51B3004D12529CF5000B5CA0 /* cf */ = {
    16171684                        isa = PBXGroup;
     
    16271694                        isa = PBXGroup;
    16281695                        children = (
     1696                                512F588612A8834700629530 /* Authentication */,
    16291697                                1A61614C127798B5003ACD86 /* Downloads */,
    16301698                                BC204EDF11C83E72008F3375 /* InjectedBundle */,
     
    17111779                        children = (
    17121780                                BC032DC410F4387C0058C15A /* API */,
     1781                                512F588D12A8836F00629530 /* Authentication */,
    17131782                                51B3004D12529CF5000B5CA0 /* cf */,
    17141783                                1AB7D4C71288AA9A00CFD08C /* Downloads */,
     
    18101879                                BCB63477116BF10600603215 /* WebKit2.h */,
    18111880                                BCDDB32C124EC2E10048D13C /* WKAPICast.h */,
     1881                                512F58ED12A88A5400629530 /* WKAuthenticationChallenge.cpp */,
     1882                                512F58EE12A88A5400629530 /* WKAuthenticationChallenge.h */,
     1883                                512F58EF12A88A5400629530 /* WKAuthenticationDecisionListener.cpp */,
     1884                                512F58F012A88A5400629530 /* WKAuthenticationDecisionListener.h */,
    18121885                                BC646C1611DD399F006455B0 /* WKBackForwardList.cpp */,
    18131886                                BC646C1711DD399F006455B0 /* WKBackForwardList.h */,
     
    18171890                                BCB9E2491120E15C00A137E0 /* WKContext.h */,
    18181891                                BCC938E01180DE440085E5FE /* WKContextPrivate.h */,
     1892                                512F58F112A88A5400629530 /* WKCredential.cpp */,
     1893                                512F58F212A88A5400629530 /* WKCredential.h */,
    18191894                                1AB7D78C1288CD9A00CFD08C /* WKDownload.cpp */,
    18201895                                1AB7D78B1288CD9A00CFD08C /* WKDownload.h */,
     
    18401915                                BCD597CE112B56AC00EC8C23 /* WKPreferences.h */,
    18411916                                762B7484120BBA2D00819339 /* WKPreferencesPrivate.h */,
     1917                                512F58F312A88A5400629530 /* WKProtectionSpace.cpp */,
     1918                                512F58F412A88A5400629530 /* WKProtectionSpace.h */,
    18421919                        );
    18431920                        path = C;
     
    21962273                        isa = PBXGroup;
    21972274                        children = (
     2275                                512F58A012A883AD00629530 /* AuthenticationManagerMessageReceiver.cpp */,
     2276                                512F58A112A883AD00629530 /* AuthenticationManagerMessages.h */,
    21982277                                1AB7D6171288B9D900CFD08C /* DownloadProxyMessageReceiver.cpp */,
    21992278                                1AB7D6181288B9D900CFD08C /* DownloadProxyMessages.h */,
     
    25292608                                BC7B633D12A45D1200D174A4 /* WKBundlePageGroup.h in Headers */,
    25302609                                37F623B812A57B6200E3FDF6 /* WKFindOptions.h in Headers */,
     2610                                512F588B12A8836600629530 /* AuthenticationManager.h in Headers */,
     2611                                512F589712A8838800629530 /* AuthenticationChallengeProxy.h in Headers */,
     2612                                512F589912A8838800629530 /* AuthenticationDecisionListener.h in Headers */,
     2613                                512F589B12A8838800629530 /* WebCredential.h in Headers */,
     2614                                512F589D12A8838800629530 /* WebProtectionSpace.h in Headers */,
     2615                                512F58A312A883AD00629530 /* AuthenticationManagerMessages.h in Headers */,
     2616                                512F58F612A88A5400629530 /* WKAuthenticationChallenge.h in Headers */,
     2617                                512F58F812A88A5400629530 /* WKAuthenticationDecisionListener.h in Headers */,
     2618                                512F58FA12A88A5400629530 /* WKCredential.h in Headers */,
     2619                                512F58FC12A88A5400629530 /* WKProtectionSpace.h in Headers */,
    25312620                                F634445612A885C8000612D8 /* WebSecurityOrigin.h in Headers */,
    25322621                                F634445D12A885E9000612D8 /* WKSecurityOrigin.h in Headers */,
     
    26362725                        files = (
    26372726                                8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */,
     2727                                512F588C12A8836600629530 /* AuthenticationManager.messages.in in Resources */,
    26382728                        );
    26392729                        runOnlyForDeploymentPostprocessing = 0;
     
    29263016                                BC84EB1812A7100C0083F2DA /* WebPreferencesMac.mm in Sources */,
    29273017                                BC2DFBA312A761A500E732A3 /* WebPreferencesCF.cpp in Sources */,
     3018                                512F588A12A8836600629530 /* AuthenticationManager.cpp in Sources */,
     3019                                512F589612A8838800629530 /* AuthenticationChallengeProxy.cpp in Sources */,
     3020                                512F589812A8838800629530 /* AuthenticationDecisionListener.cpp in Sources */,
     3021                                512F589A12A8838800629530 /* WebCredential.cpp in Sources */,
     3022                                512F589C12A8838800629530 /* WebProtectionSpace.cpp in Sources */,
     3023                                512F58A212A883AD00629530 /* AuthenticationManagerMessageReceiver.cpp in Sources */,
     3024                                512F58F512A88A5400629530 /* WKAuthenticationChallenge.cpp in Sources */,
     3025                                512F58F712A88A5400629530 /* WKAuthenticationDecisionListener.cpp in Sources */,
     3026                                512F58F912A88A5400629530 /* WKCredential.cpp in Sources */,
     3027                                512F58FB12A88A5400629530 /* WKProtectionSpace.cpp in Sources */,
    29283028                                F634445C12A885E9000612D8 /* WKSecurityOrigin.cpp in Sources */,
    29293029                        );
  • trunk/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r72612 r73281  
    2929#include "NotImplemented.h"
    3030
     31#include "AuthenticationManager.h"
    3132#include "InjectedBundleUserMessageCoders.h"
    3233#include "PlatformCertificateInfo.h"
     
    156157}
    157158
    158 void WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long identifier, const AuthenticationChallenge&)
    159 {
    160     notImplemented();
     159void WebFrameLoaderClient::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge& challenge)
     160{
     161    // FIXME: Authentication is a per-resource concept, but we don't do per-resource handling in the UIProcess at the API level quite yet.
     162    // Once we do, we might need to make sure authentication fits with our solution.
     163
     164    WebPage* webPage = m_frame->page();
     165    if (!webPage)
     166        return;
     167
     168    AuthenticationManager::shared().didReceiveAuthenticationChallenge(m_frame, challenge);
    161169}
    162170
     
    167175
    168176#if USE(PROTECTION_SPACE_AUTH_CALLBACK)
    169 bool WebFrameLoaderClient::canAuthenticateAgainstProtectionSpace(DocumentLoader*, unsigned long identifier, const ProtectionSpace&)
    170 {
    171     notImplemented();
    172     return false;
     177bool WebFrameLoaderClient::canAuthenticateAgainstProtectionSpace(DocumentLoader*, unsigned long, const ProtectionSpace& protectionSpace)
     178{
     179    // FIXME: Authentication is a per-resource concept, but we don't do per-resource handling in the UIProcess at the API level quite yet.
     180    // Once we do, we might need to make sure authentication fits with our solution.
     181   
     182    WebPage* webPage = m_frame->page();
     183    if (!webPage)
     184        return false;
     185       
     186    bool canAuthenticate;
     187    if (!webPage->sendSync(Messages::WebPageProxy::CanAuthenticateAgainstProtectionSpaceInFrame(m_frame->frameID(), protectionSpace), Messages::WebPageProxy::CanAuthenticateAgainstProtectionSpaceInFrame::Reply(canAuthenticate)))
     188        return false;
     189   
     190    return canAuthenticate;
    173191}
    174192#endif
  • trunk/WebKit2/WebProcess/WebProcess.cpp

    r73221 r73281  
    2626#include "WebProcess.h"
    2727
     28#include "AuthenticationManager.h"
    2829#include "DownloadManager.h"
    2930#include "InjectedBundle.h"
     
    459460    }
    460461
     462    if (messageID.is<CoreIPC::MessageClassAuthenticationManager>()) {
     463        AuthenticationManager::shared().didReceiveMessage(connection, messageID, arguments);
     464        return;
     465    }
     466
    461467    if (messageID.is<CoreIPC::MessageClassInjectedBundle>()) {
    462468        if (!m_injectedBundle)
  • trunk/WebKit2/win/WebKit2.vcproj

    r73267 r73281  
    11001100                        </File>
    11011101                        <Filter
     1102                                Name="Authentication"
     1103                                >
     1104                                <File
     1105                                        RelativePath="..\WebProcess\Authentication\AuthenticationManager.cpp"
     1106                                        >
     1107                                </File>
     1108                                <File
     1109                                        RelativePath="..\WebProcess\Authentication\AuthenticationManager.h"
     1110                                        >
     1111                                </File>
     1112                                <File
     1113                                        RelativePath="..\WebProcess\Authentication\AuthenticationManager.messages.in"
     1114                                        >
     1115                                </File>
     1116                        </Filter>
     1117                        <Filter
    11021118                                Name="WebCoreSupport"
    11031119                                >
     
    20302046                                        </File>
    20312047                                        <File
     2048                                                RelativePath="..\UIProcess\API\C\WKAuthenticationChallenge.cpp"
     2049                                                >
     2050                                        </File>
     2051                                        <File
     2052                                                RelativePath="..\UIProcess\API\C\WKAuthenticationChallenge.h"
     2053                                                >
     2054                                        </File>
     2055                                        <File
     2056                                                RelativePath="..\UIProcess\API\C\WKAuthenticationDecisionListener.cpp"
     2057                                                >
     2058                                        </File>
     2059                                        <File
     2060                                                RelativePath="..\UIProcess\API\C\WKAuthenticationDecisionListener.h"
     2061                                                >
     2062                                        </File>
     2063                                        <File
    20322064                                                RelativePath="..\UIProcess\API\C\WKBackForwardList.cpp"
    20332065                                                >
     
    20662098                                        </File>
    20672099                                        <File
     2100                                                RelativePath="..\UIProcess\API\C\WKCredential.cpp"
     2101                                                >
     2102                                        </File>
     2103                                        <File
     2104                                                RelativePath="..\UIProcess\API\C\WKCredential.h"
     2105                                                >
     2106                                        </File>
     2107                                        <File
    20682108                                                RelativePath="..\UIProcess\API\C\WKDownload.cpp"
    20692109                                                >
     
    21552195                                        <File
    21562196                                                RelativePath="..\UIProcess\API\C\WKPreferencesPrivate.h"
     2197                                                >
     2198                                        </File>
     2199                                        <File
     2200                                                RelativePath="..\UIProcess\API\C\WKProtectionSpace.cpp"
     2201                                                >
     2202                                        </File>
     2203                                        <File
     2204                                                RelativePath="..\UIProcess\API\C\WKProtectionSpace.h"
    21572205                                                >
    21582206                                        </File>
     
    21942242                                        </File>
    21952243                                </Filter>
     2244                        </Filter>
     2245                        <Filter
     2246                                Name="Authentication"
     2247                                >
     2248                                <File
     2249                                        RelativePath="..\UIProcess\Authentication\AuthenticationChallengeProxy.cpp"
     2250                                        >
     2251                                </File>
     2252                                <File
     2253                                        RelativePath="..\UIProcess\Authentication\AuthenticationChallengeProxy.h"
     2254                                        >
     2255                                </File>
     2256                                <File
     2257                                        RelativePath="..\UIProcess\Authentication\AuthenticationDecisionListener.cpp"
     2258                                        >
     2259                                </File>
     2260                                <File
     2261                                        RelativePath="..\UIProcess\Authentication\AuthenticationDecisionListener.h"
     2262                                        >
     2263                                </File>
     2264                                <File
     2265                                        RelativePath="..\UIProcess\Authentication\WebCredential.cpp"
     2266                                        >
     2267                                </File>
     2268                                <File
     2269                                        RelativePath="..\UIProcess\Authentication\WebCredential.h"
     2270                                        >
     2271                                </File>
     2272                                <File
     2273                                        RelativePath="..\UIProcess\Authentication\WebProtectionSpace.cpp"
     2274                                        >
     2275                                </File>
     2276                                <File
     2277                                        RelativePath="..\UIProcess\Authentication\WebProtectionSpace.h"
     2278                                        >
     2279                                </File>
    21962280                        </Filter>
    21972281                        <Filter
     
    25952679                        Name="Derived Sources"
    25962680                        >
     2681                        <File
     2682                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\AuthenticationManagerMessageReceiver.cpp"
     2683                                >
     2684                        </File>
     2685                        <File
     2686                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\AuthenticationManagerMessages.h"
     2687                                >
     2688                        </File>
    25972689                        <File
    25982690                                RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\DownloadProxyMessageReceiver.cpp"
  • trunk/WebKit2/win/WebKit2Common.vsprops

    r73060 r73281  
    77        <Tool
    88                Name="VCCLCompilerTool"
    9                 AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\PluginProcess&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\API\c&quot;;&quot;$(ProjectDir)\..\Shared\API\c\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C\win&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Downloads&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport\win&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads\cf&quot;;&quot;$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
     9                AdditionalIncludeDirectories="&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\PluginProcess&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\API\c&quot;;&quot;$(ProjectDir)\..\Shared\API\c\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C\win&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Authentication&quot;;&quot;$(ProjectDir)\..\UIProcess\Downloads&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport\win&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Authentication&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads\cf&quot;;&quot;$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources&quot;;&quot;$(WebKitOutputDir)\Include&quot;;&quot;$(WebKitOutputDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(WebKitOutputDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitOutputDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
    1010                PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;BUILDING_WEBKIT"
    1111                UsePrecompiledHeader="2"
  • trunk/WebKitTools/ChangeLog

    r73274 r73281  
     12010-12-03  Brady Eidson  <beidson@apple.com>
     2
     3        Reviewed by Anders Carlsson.
     4
     5        Groundwork for <rdar://problem/7660733> and https://bugs.webkit.org/show_bug.cgi?id=50191
     6        WebKit2 Authentication Support
     7
     8        Keep these builds working:
     9        * MiniBrowser/mac/BrowserWindowController.m:
     10        (-[BrowserWindowController awakeFromNib]):
     11
     12        * WebKitTestRunner/TestController.cpp:
     13        (WTR::TestController::initialize):
     14
    1152010-12-02  Mihai Parparita  <mihaip@chromium.org>
    216
  • trunk/WebKitTools/MiniBrowser/mac/BrowserWindowController.m

    r72887 r73281  
    555555        didDisplayInsecureContentForFrame,
    556556        didRunInsecureContentForFrame,
     557        0, // canAuthenticateAgainstProtectionSpaceInFrame
     558        0, // didReceiveAuthenticationChallengeInFrame
    557559        didStartProgress,
    558560        didChangeProgress,
  • trunk/WebKitTools/WebKitTestRunner/TestController.cpp

    r73215 r73281  
    258258        0, // didDisplayInsecureContentForFrame
    259259        0, // didRunInsecureContentForFrame
     260        0, // canAuthenticateAgainstProtectionSpaceInFrame
     261        0, // didReceiveAuthenticationChallengeInFrame
    260262        0, // didStartProgress
    261263        0, // didChangeProgress
Note: See TracChangeset for help on using the changeset viewer.