AuthenticationChallengeProxy.h [plain text]
#pragma once
#include "APIObject.h"
#include <WebCore/AuthenticationChallenge.h>
#include <wtf/WeakPtr.h>
namespace IPC {
class Connection;
}
namespace WebKit {
class AuthenticationDecisionListener;
class ChildProcessProxy;
class SecKeyProxyStore;
class WebCredential;
class WebProtectionSpace;
class AuthenticationChallengeProxy : public API::ObjectImpl<API::Object::Type::AuthenticationChallenge> {
public:
static Ref<AuthenticationChallengeProxy> create(WebCore::AuthenticationChallenge&& authenticationChallenge, uint64_t challengeID, IPC::Connection* connection)
{
return adoptRef(*new AuthenticationChallengeProxy(WTFMove(authenticationChallenge), challengeID, connection));
}
~AuthenticationChallengeProxy();
void useCredential(WebCredential*);
void cancel();
void performDefaultHandling();
void rejectProtectionSpaceAndContinue();
AuthenticationDecisionListener* listener() const { return m_listener.get(); }
WebCredential* proposedCredential() const;
WebProtectionSpace* protectionSpace() const;
int previousFailureCount() const { return m_coreAuthenticationChallenge.previousFailureCount(); }
const WebCore::AuthenticationChallenge& core() { return m_coreAuthenticationChallenge; }
#if HAVE(SEC_KEY_PROXY)
void setSecKeyProxyStore(SecKeyProxyStore&);
#endif
private:
AuthenticationChallengeProxy(WebCore::AuthenticationChallenge&&, uint64_t challengeID, IPC::Connection*);
#if HAVE(SEC_KEY_PROXY)
void sendClientCertificateCredentialOverXpc(uint64_t challengeID, const WebCore::Credential&) const;
#endif
WebCore::AuthenticationChallenge m_coreAuthenticationChallenge;
uint64_t m_challengeID;
RefPtr<IPC::Connection> m_connection;
RefPtr<AuthenticationDecisionListener> m_listener;
mutable RefPtr<WebCredential> m_webCredential;
mutable RefPtr<WebProtectionSpace> m_webProtectionSpace;
#if HAVE(SEC_KEY_PROXY)
WeakPtr<SecKeyProxyStore> m_secKeyProxyStore;
#endif
};
}