Skip to content
Permalink
Browse files
Apply patch. rdar://problem/92780272
  • Loading branch information
alancoon committed May 11, 2022
1 parent e6d346b commit 589c2b5478bb71f69ca6a4828300d011ece7d164
Showing 1 changed file with 9 additions and 4 deletions.
@@ -372,24 +372,27 @@ static inline void continueAfterRequest(RetainPtr<id <ASCCredentialProtocol>> cr
{
m_proxy = adoptNS([allocASCAgentProxyInstance() init]);
#if PLATFORM(IOS)
[m_proxy performAuthorizationRequestsForContext:requestContext.get() withCompletionHandler:makeBlockPtr([handler = WTFMove(handler)](id<ASCCredentialProtocol> credential, NSError *error) mutable {
callOnMainRunLoop([handler = WTFMove(handler), proxy = WTFMove(proxy), credential = retainPtr(credential), error = retainPtr(error)] () mutable {
[m_proxy performAuthorizationRequestsForContext:requestContext.get() withCompletionHandler:makeBlockPtr([weakThis = WeakPtr { *this }, handler = WTFMove(handler)](id<ASCCredentialProtocol> credential, NSError *error) mutable {
callOnMainRunLoop([weakThis, handler = WTFMove(handler), proxy = WTFMove(proxy), credential = retainPtr(credential), error = retainPtr(error)] () mutable {
#elif PLATFORM(MAC)
RetainPtr<NSWindow> window = m_webPageProxy.platformWindow();
[m_proxy performAuthorizationRequestsForContext:requestContext.get() withClearanceHandler:makeBlockPtr([weakThis = WeakPtr { *this }, handler = WTFMove(handler), window = WTFMove(window)](NSXPCListenerEndpoint *daemonEndpoint, NSError *error) mutable {
callOnMainRunLoop([weakThis, handler = WTFMove(handler), window = WTFMove(window), daemonEndpoint = retainPtr(daemonEndpoint), error = retainPtr(error)] () mutable {
if (!weakThis || !daemonEndpoint) {
LOG_ERROR("Could not connect to authorization daemon: %@\n", error.get());
handler({ }, (AuthenticatorAttachment)0, ExceptionData { NotAllowedError, "Operation failed." });
if (weakThis)
weakThis->m_proxy.clear();
return;
}

weakThis->m_presenter = adoptNS([allocASCAuthorizationRemotePresenterInstance() init]);
[weakThis->m_presenter presentWithWindow:window.get() daemonEndpoint:daemonEndpoint.get() completionHandler:makeBlockPtr([handler = WTFMove(handler)](id<ASCCredentialProtocol> credentialNotRetain, NSError *errorNotRetain) mutable {
[weakThis->m_presenter presentWithWindow:window.get() daemonEndpoint:daemonEndpoint.get() completionHandler:makeBlockPtr([weakThis, handler = WTFMove(handler)](id<ASCCredentialProtocol> credentialNotRetain, NSError *errorNotRetain) mutable {
auto credential = retainPtr(credentialNotRetain);
auto error = retainPtr(errorNotRetain);
#endif
continueAfterRequest(credential, error, WTFMove(handler));
weakThis->m_proxy.clear();
#if PLATFORM(MAC)
}).get()];
#endif
@@ -409,8 +412,10 @@ static inline void continueAfterRequest(RetainPtr<id <ASCCredentialProtocol>> cr

void WebAuthenticatorCoordinatorProxy::cancel()
{
if (m_proxy)
if (m_proxy) {
[m_proxy cancelCurrentRequest];
m_proxy.clear();
}
}

} // namespace WebKit

0 comments on commit 589c2b5

Please sign in to comment.