AuthenticationChallenge.h [plain text]
#ifndef AuthenticationChallenge_h
#define AuthenticationChallenge_h
#include "AuthenticationChallengeBase.h"
#include "AuthenticationClient.h"
#include <wtf/RefPtr.h>
#if USE(CFNETWORK)
typedef struct _CFURLAuthChallenge* CFURLAuthChallengeRef;
#else
#ifndef __OBJC__
typedef struct objc_object *id;
#endif
OBJC_CLASS NSURLAuthenticationChallenge;
#endif
namespace WebCore {
class AuthenticationChallenge : public AuthenticationChallengeBase {
public:
AuthenticationChallenge() {}
WEBCORE_EXPORT AuthenticationChallenge(const ProtectionSpace&, const Credential& proposedCredential, unsigned previousFailureCount, const ResourceResponse&, const ResourceError&);
#if USE(CFNETWORK)
AuthenticationChallenge(CFURLAuthChallengeRef, AuthenticationClient*);
CFURLAuthChallengeRef cfURLAuthChallengeRef() const { return m_cfChallenge.get(); }
#else
WEBCORE_EXPORT AuthenticationChallenge(NSURLAuthenticationChallenge *);
id sender() const { return m_sender.get(); }
NSURLAuthenticationChallenge *nsURLAuthenticationChallenge() const { return m_nsChallenge.get(); }
#endif
WEBCORE_EXPORT void setAuthenticationClient(AuthenticationClient*); WEBCORE_EXPORT AuthenticationClient* authenticationClient() const;
private:
friend class AuthenticationChallengeBase;
static bool platformCompare(const AuthenticationChallenge& a, const AuthenticationChallenge& b);
#if USE(CFNETWORK)
RefPtr<AuthenticationClient> m_authenticationClient;
RetainPtr<CFURLAuthChallengeRef> m_cfChallenge;
#else
RetainPtr<id> m_sender;
RetainPtr<NSURLAuthenticationChallenge *> m_nsChallenge;
#endif
};
}
#endif