AuthenticationManager.h [plain text]
#ifndef AuthenticationManager_h
#define AuthenticationManager_h
#include "MessageReceiver.h"
#include "NetworkProcessSupplement.h"
#include "WebProcessSupplement.h"
#include <WebCore/AuthenticationChallenge.h>
#include <wtf/Forward.h>
#include <wtf/HashMap.h>
namespace WebCore {
class AuthenticationChallenge;
class CertificateInfo;
class Credential;
}
namespace WebKit {
class ChildProcess;
class Download;
class WebFrame;
class AuthenticationManager : public WebProcessSupplement, public NetworkProcessSupplement, public IPC::MessageReceiver {
WTF_MAKE_NONCOPYABLE(AuthenticationManager);
public:
explicit AuthenticationManager(ChildProcess*);
static const char* supplementName();
void didReceiveAuthenticationChallenge(WebFrame*, const WebCore::AuthenticationChallenge&);
void didReceiveAuthenticationChallenge(uint64_t pageID, uint64_t frameID, const WebCore::AuthenticationChallenge&);
void didReceiveAuthenticationChallenge(Download*, const WebCore::AuthenticationChallenge&);
void useCredentialForChallenge(uint64_t challengeID, const WebCore::Credential&, const WebCore::CertificateInfo&);
void continueWithoutCredentialForChallenge(uint64_t challengeID);
void cancelChallenge(uint64_t challengeID);
void performDefaultHandling(uint64_t challengeID);
void rejectProtectionSpaceAndContinue(uint64_t challengeID);
uint64_t outstandingAuthenticationChallengeCount() const { return m_challenges.size(); }
private:
virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) override;
bool tryUseCertificateInfoForChallenge(const WebCore::AuthenticationChallenge&, const WebCore::CertificateInfo&);
uint64_t establishIdentifierForChallenge(const WebCore::AuthenticationChallenge&);
ChildProcess* m_process;
typedef HashMap<uint64_t, WebCore::AuthenticationChallenge> AuthenticationChallengeMap;
AuthenticationChallengeMap m_challenges;
};
}
#endif // AuthenticationManager_h