AuthenticationChallengeProxy.h [plain text]
#ifndef AuthenticationChallengeProxy_h
#define AuthenticationChallengeProxy_h
#include "APIObject.h"
#include <WebCore/AuthenticationChallenge.h>
#include <wtf/PassRefPtr.h>
namespace IPC {
class Connection;
}
namespace WebKit {
class AuthenticationDecisionListener;
class ChildProcessProxy;
class WebCredential;
class WebProtectionSpace;
class AuthenticationChallengeProxy : public API::ObjectImpl<API::Object::Type::AuthenticationChallenge> {
public:
static Ref<AuthenticationChallengeProxy> create(const WebCore::AuthenticationChallenge& authenticationChallenge, uint64_t challengeID, IPC::Connection* connection)
{
return adoptRef(*new AuthenticationChallengeProxy(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; }
private:
AuthenticationChallengeProxy(const WebCore::AuthenticationChallenge&, uint64_t challengeID, IPC::Connection*);
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;
};
}
#endif // WebAuthenticationChallengeProxy_h