AuthenticationChallengeProxy.cpp [plain text]
#include "config.h"
#include "AuthenticationChallengeProxy.h"
#include "AuthenticationChallengeDisposition.h"
#include "AuthenticationDecisionListener.h"
#include "AuthenticationManager.h"
#include "AuthenticationManagerMessages.h"
#include "ChildProcessProxy.h"
#include "WebCertificateInfo.h"
#include "WebCoreArgumentCoders.h"
#include "WebCredential.h"
#include "WebProcessProxy.h"
#include "WebProtectionSpace.h"
#if HAVE(SEC_KEY_PROXY)
#include "SecKeyProxyStore.h"
#endif
namespace WebKit {
AuthenticationChallengeProxy::AuthenticationChallengeProxy(WebCore::AuthenticationChallenge&& authenticationChallenge, uint64_t challengeID, Ref<IPC::Connection>&& connection, WeakPtr<SecKeyProxyStore>&& secKeyProxyStore)
: m_coreAuthenticationChallenge(WTFMove(authenticationChallenge))
, m_listener(AuthenticationDecisionListener::create([challengeID, connection = WTFMove(connection), secKeyProxyStore = WTFMove(secKeyProxyStore)](AuthenticationChallengeDisposition disposition, const WebCore::Credential& credential) {
#if HAVE(SEC_KEY_PROXY)
if (secKeyProxyStore && secKeyProxyStore->initialize(credential)) {
sendClientCertificateCredentialOverXpc(connection, *secKeyProxyStore, challengeID, credential);
return;
}
#endif
connection->send(Messages::AuthenticationManager::CompleteAuthenticationChallenge(challengeID, disposition, credential), 0);
}))
{
}
WebCredential* AuthenticationChallengeProxy::proposedCredential() const
{
if (!m_webCredential)
m_webCredential = WebCredential::create(m_coreAuthenticationChallenge.proposedCredential());
return m_webCredential.get();
}
WebProtectionSpace* AuthenticationChallengeProxy::protectionSpace() const
{
if (!m_webProtectionSpace)
m_webProtectionSpace = WebProtectionSpace::create(m_coreAuthenticationChallenge.protectionSpace());
return m_webProtectionSpace.get();
}
}