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 Credential;
}
namespace WebKit {
class ChildProcess;
class Download;
class PlatformCertificateInfo;
class WebFrame;
class AuthenticationManager : public WebProcessSupplement, public NetworkProcessSupplement, public CoreIPC::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 PlatformCertificateInfo&);
void continueWithoutCredentialForChallenge(uint64_t challengeID);
void cancelChallenge(uint64_t challengeID);
uint64_t outstandingAuthenticationChallengeCount() const { return m_challenges.size(); }
private:
virtual void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageDecoder&) OVERRIDE;
bool tryUsePlatformCertificateInfoForChallenge(const WebCore::AuthenticationChallenge&, const PlatformCertificateInfo&);
uint64_t establishIdentifierForChallenge(const WebCore::AuthenticationChallenge&);
ChildProcess* m_process;
typedef HashMap<uint64_t, WebCore::AuthenticationChallenge> AuthenticationChallengeMap;
AuthenticationChallengeMap m_challenges;
};
}
#endif // AuthenticationManager_h