⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 294849 in webkit


Ignore:
Timestamp:
May 25, 2022, 4:50:11 PM (4 years ago)
Author:
Alan Coon
Message:

Cherry-pick 589c2b5478bb. rdar://problem/92780272

Apply patch. rdar://problem/92780272

Canonical link: ​https://commits.webkit.org/245886.563@safari-7613.3.1.1-branch
git-svn-id: ​https://svn.webkit.org/repository/webkit/branches/safari-7613.3.1.1-branch@294055 268f45cc-cd09-0410-ab3c-d52691b4dbfc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-613-branch/Source/WebKit/UIProcess/WebAuthentication/Cocoa/WebAuthenticatorCoordinatorProxy.mm

    r294298 r294849  
    379379    m_proxy = adoptNS([allocASCAgentProxyInstance() init]);
    380380#if PLATFORM(IOS)
    381     [m_proxy performAuthorizationRequestsForContext:requestContext.get() withCompletionHandler:makeBlockPtr([handler = WTFMove(handler)](id<ASCCredentialProtocol> credential, NSError *error) mutable {
    382         callOnMainRunLoop([handler = WTFMove(handler), proxy = WTFMove(proxy), credential = retainPtr(credential), error = retainPtr(error)] () mutable {
     381    [m_proxy performAuthorizationRequestsForContext:requestContext.get() withCompletionHandler:makeBlockPtr([weakThis = WeakPtr { *this }, handler = WTFMove(handler)](id<ASCCredentialProtocol> credential, NSError *error) mutable {
     382        callOnMainRunLoop([weakThis, handler = WTFMove(handler), proxy = WTFMove(proxy), credential = retainPtr(credential), error = retainPtr(error)] () mutable {
    383383#elif PLATFORM(MAC)
    384384    RetainPtr<NSWindow> window = m_webPageProxy.platformWindow();
    … …  
    388388                LOG_ERROR("Could not connect to authorization daemon: %@\n", error.get());
    389389                handler({ }, (AuthenticatorAttachment)0, ExceptionData { NotAllowedError, "Operation failed." });
     390                if (weakThis)
     391                    weakThis->m_proxy.clear();
    390392                return;
    391393            }
    392394
    393395            weakThis->m_presenter = adoptNS([allocASCAuthorizationRemotePresenterInstance() init]);
    394             [weakThis->m_presenter presentWithWindow:window.get() daemonEndpoint:daemonEndpoint.get() completionHandler:makeBlockPtr([handler = WTFMove(handler)](id<ASCCredentialProtocol> credentialNotRetain, NSError *errorNotRetain) mutable {
     396            [weakThis->m_presenter presentWithWindow:window.get() daemonEndpoint:daemonEndpoint.get() completionHandler:makeBlockPtr([weakThis, handler = WTFMove(handler)](id<ASCCredentialProtocol> credentialNotRetain, NSError *errorNotRetain) mutable {
    395397                auto credential = retainPtr(credentialNotRetain);
    396398                auto error = retainPtr(errorNotRetain);
    397399#endif
    398400                continueAfterRequest(credential, error, WTFMove(handler));
     401                weakThis->m_proxy.clear();
    399402#if PLATFORM(MAC)
    400403            }).get()];
    … …  
    416419void WebAuthenticatorCoordinatorProxy::cancel()
    417420{
    418     if (m_proxy)
     421    if (m_proxy) {
    419422        [m_proxy cancelCurrentRequest];
     423        m_proxy.clear();
     424    }
    420425}
    421426
Note: See TracChangeset for help on using the changeset viewer.