Changeset 259521 in webkit


Ignore:
Timestamp:
Apr 3, 2020 4:45:58 PM (4 years ago)
Author:
commit-queue@webkit.org
Message:

Use AuthenticationChallenge instead of AuthenticationChallengeProxy for ResourceLoadDelegate
https://bugs.webkit.org/show_bug.cgi?id=207639

Patch by Alex Christensen <achristensen@webkit.org> on 2020-04-03
Reviewed by David Kilzer.

In r254345 my younger and more naive self used AuthenticationChallengeProxy instead of AuthenticationChallenge
because he didn't know about the WebCore::mac function, which is called by AuthenticationChallengeProxy, and it's
all I needed to get an NSURLAuthenticationChallenge. Skipping the AuthenticationChallengeProxy step cleans up
AuthenticationChallengeProxy by removing the unnecessary ability to have a null CompletionHandler.

Covered by existing tests.

  • UIProcess/API/APIResourceLoadClient.h:
  • UIProcess/Authentication/AuthenticationChallengeProxy.cpp:

(WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
(): Deleted.

  • UIProcess/Cocoa/ResourceLoadDelegate.h:
  • UIProcess/Cocoa/ResourceLoadDelegate.mm:

(WebKit::ResourceLoadDelegate::ResourceLoadClient::didReceiveChallenge const):

  • UIProcess/Network/NetworkProcessProxy.cpp:

(WebKit::NetworkProcessProxy::resourceLoadDidReceiveChallenge):

  • UIProcess/WebPageProxy.cpp:
  • UIProcess/WebPageProxy.h:
Location:
trunk/Source/WebKit
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r259520 r259521  
     12020-04-03  Alex Christensen  <achristensen@webkit.org>
     2
     3        Use AuthenticationChallenge instead of AuthenticationChallengeProxy for ResourceLoadDelegate
     4        https://bugs.webkit.org/show_bug.cgi?id=207639
     5
     6        Reviewed by David Kilzer.
     7
     8        In r254345 my younger and more naive self used AuthenticationChallengeProxy instead of AuthenticationChallenge
     9        because he didn't know about the WebCore::mac function, which is called by AuthenticationChallengeProxy, and it's
     10        all I needed to get an NSURLAuthenticationChallenge.  Skipping the AuthenticationChallengeProxy step cleans up
     11        AuthenticationChallengeProxy by removing the unnecessary ability to have a null CompletionHandler.
     12
     13        Covered by existing tests.
     14
     15        * UIProcess/API/APIResourceLoadClient.h:
     16        * UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
     17        (WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
     18        (): Deleted.
     19        * UIProcess/Cocoa/ResourceLoadDelegate.h:
     20        * UIProcess/Cocoa/ResourceLoadDelegate.mm:
     21        (WebKit::ResourceLoadDelegate::ResourceLoadClient::didReceiveChallenge const):
     22        * UIProcess/Network/NetworkProcessProxy.cpp:
     23        (WebKit::NetworkProcessProxy::resourceLoadDidReceiveChallenge):
     24        * UIProcess/WebPageProxy.cpp:
     25        * UIProcess/WebPageProxy.h:
     26
    1272020-04-03  Kate Cheney  <katherine_cheney@apple.com>
    228
  • trunk/Source/WebKit/UIProcess/API/APIResourceLoadClient.h

    r257818 r259521  
    3030#include <WebCore/ResourceResponse.h>
    3131
     32namespace WebCore {
     33class AuthenticationChallenge;
     34}
     35
    3236namespace WebKit {
    33 class AuthenticationChallengeProxy;
    3437struct ResourceLoadInfo;
    3538}
     
    4346    virtual void didSendRequest(WebKit::ResourceLoadInfo&&, WebCore::ResourceRequest&&) const = 0;
    4447    virtual void didPerformHTTPRedirection(WebKit::ResourceLoadInfo&&, WebCore::ResourceResponse&&, WebCore::ResourceRequest&&) const = 0;
    45     virtual void didReceiveChallenge(WebKit::ResourceLoadInfo&&, WebKit::AuthenticationChallengeProxy&) const = 0;
     48    virtual void didReceiveChallenge(WebKit::ResourceLoadInfo&&, WebCore::AuthenticationChallenge&&) const = 0;
    4649    virtual void didReceiveResponse(WebKit::ResourceLoadInfo&&, WebCore::ResourceResponse&&) const = 0;
    4750    virtual void didCompleteWithError(WebKit::ResourceLoadInfo&&, WebCore::ResourceResponse&&, WebCore::ResourceError&&) const = 0;
  • trunk/Source/WebKit/UIProcess/Authentication/AuthenticationChallengeProxy.cpp

    r254345 r259521  
    4646AuthenticationChallengeProxy::AuthenticationChallengeProxy(WebCore::AuthenticationChallenge&& authenticationChallenge, uint64_t challengeID, Ref<IPC::Connection>&& connection, WeakPtr<SecKeyProxyStore>&& secKeyProxyStore)
    4747    : m_coreAuthenticationChallenge(WTFMove(authenticationChallenge))
    48     , m_listener(AuthenticationDecisionListener::create(challengeID ? CompletionHandler<void(AuthenticationChallengeDisposition, const WebCore::Credential&)>([challengeID, connection = WTFMove(connection), secKeyProxyStore = WTFMove(secKeyProxyStore)](AuthenticationChallengeDisposition disposition, const WebCore::Credential& credential) {
     48    , m_listener(AuthenticationDecisionListener::create([challengeID, connection = WTFMove(connection), secKeyProxyStore = WTFMove(secKeyProxyStore)](AuthenticationChallengeDisposition disposition, const WebCore::Credential& credential) {
    4949#if HAVE(SEC_KEY_PROXY)
    5050        if (secKeyProxyStore && secKeyProxyStore->initialize(credential)) {
     
    5454#endif
    5555        connection->send(Messages::AuthenticationManager::CompleteAuthenticationChallenge(challengeID, disposition, credential), 0);
    56     }) : nullptr))
     56    }))
    5757{
     58    ASSERT(challengeID);
    5859}
    5960
  • trunk/Source/WebKit/UIProcess/Cocoa/ResourceLoadDelegate.h

    r257818 r259521  
    6262        void didSendRequest(ResourceLoadInfo&&, WebCore::ResourceRequest&&) const final;
    6363        void didPerformHTTPRedirection(ResourceLoadInfo&&, WebCore::ResourceResponse&&, WebCore::ResourceRequest&&) const final;
    64         void didReceiveChallenge(ResourceLoadInfo&&, WebKit::AuthenticationChallengeProxy&) const final;
     64        void didReceiveChallenge(ResourceLoadInfo&&, WebCore::AuthenticationChallenge&&) const final;
    6565        void didReceiveResponse(ResourceLoadInfo&&, WebCore::ResourceResponse&&) const final;
    6666        void didCompleteWithError(ResourceLoadInfo&&, WebCore::ResourceResponse&&, WebCore::ResourceError&&) const final;
  • trunk/Source/WebKit/UIProcess/Cocoa/ResourceLoadDelegate.mm

    r257818 r259521  
    2727#import "ResourceLoadDelegate.h"
    2828
     29#import <WebCore/AuthenticationMac.h>
    2930#import "AuthenticationChallengeProxy.h"
    3031#import "WKNSURLAuthenticationChallenge.h"
     
    9899}
    99100
    100 void ResourceLoadDelegate::ResourceLoadClient::didReceiveChallenge(WebKit::ResourceLoadInfo&& loadInfo, WebKit::AuthenticationChallengeProxy& challenge) const
     101void ResourceLoadDelegate::ResourceLoadClient::didReceiveChallenge(WebKit::ResourceLoadInfo&& loadInfo, WebCore::AuthenticationChallenge&& challenge) const
    101102{
    102103    if (!m_resourceLoadDelegate.m_delegateMethods.didReceiveChallenge)
     
    107108        return;
    108109
    109     [delegate webView:m_resourceLoadDelegate.m_webView.get().get() resourceLoad:wrapper(API::ResourceLoadInfo::create(WTFMove(loadInfo)).get()) didReceiveChallenge:wrapper(challenge)];
     110    [delegate webView:m_resourceLoadDelegate.m_webView.get().get() resourceLoad:wrapper(API::ResourceLoadInfo::create(WTFMove(loadInfo)).get()) didReceiveChallenge:mac(challenge)];
    110111}
    111112
  • trunk/Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp

    r259275 r259521  
    505505        return;
    506506
    507     auto challengeProxy = AuthenticationChallengeProxy::create(WTFMove(challenge), 0, *connection(), nullptr);
    508     page->resourceLoadDidReceiveChallenge(WTFMove(loadInfo), challengeProxy.get());
     507    page->resourceLoadDidReceiveChallenge(WTFMove(loadInfo), WTFMove(challenge));
    509508}
    510509
  • trunk/Source/WebKit/UIProcess/WebPageProxy.cpp

    r259507 r259521  
    61066106}
    61076107
    6108 void WebPageProxy::resourceLoadDidReceiveChallenge(ResourceLoadInfo&& loadInfo, WebKit::AuthenticationChallengeProxy& challenge)
     6108void WebPageProxy::resourceLoadDidReceiveChallenge(ResourceLoadInfo&& loadInfo, WebCore::AuthenticationChallenge&& challenge)
    61096109{
    61106110    if (m_resourceLoadClient)
    6111         m_resourceLoadClient->didReceiveChallenge(WTFMove(loadInfo), challenge);
     6111        m_resourceLoadClient->didReceiveChallenge(WTFMove(loadInfo), WTFMove(challenge));
    61126112}
    61136113
  • trunk/Source/WebKit/UIProcess/WebPageProxy.h

    r259507 r259521  
    477477    void resourceLoadDidSendRequest(ResourceLoadInfo&&, WebCore::ResourceRequest&&);
    478478    void resourceLoadDidPerformHTTPRedirection(ResourceLoadInfo&&, WebCore::ResourceResponse&&, WebCore::ResourceRequest&&);
    479     void resourceLoadDidReceiveChallenge(ResourceLoadInfo&&, WebKit::AuthenticationChallengeProxy&);
     479    void resourceLoadDidReceiveChallenge(ResourceLoadInfo&&, WebCore::AuthenticationChallenge&&);
    480480    void resourceLoadDidReceiveResponse(ResourceLoadInfo&&, WebCore::ResourceResponse&&);
    481481    void resourceLoadDidCompleteWithError(ResourceLoadInfo&&, WebCore::ResourceResponse&&, WebCore::ResourceError&&);
Note: See TracChangeset for help on using the changeset viewer.