ProtectionSpaceBase.h [plain text]
#ifndef ProtectionSpaceBase_h
#define ProtectionSpaceBase_h
#include <wtf/text/WTFString.h>
namespace WebCore {
class ProtectionSpace;
enum ProtectionSpaceServerType {
ProtectionSpaceServerHTTP = 1,
ProtectionSpaceServerHTTPS = 2,
ProtectionSpaceServerFTP = 3,
ProtectionSpaceServerFTPS = 4,
ProtectionSpaceProxyHTTP = 5,
ProtectionSpaceProxyHTTPS = 6,
ProtectionSpaceProxyFTP = 7,
ProtectionSpaceProxySOCKS = 8
};
enum ProtectionSpaceAuthenticationScheme {
ProtectionSpaceAuthenticationSchemeDefault = 1,
ProtectionSpaceAuthenticationSchemeHTTPBasic = 2,
ProtectionSpaceAuthenticationSchemeHTTPDigest = 3,
ProtectionSpaceAuthenticationSchemeHTMLForm = 4,
ProtectionSpaceAuthenticationSchemeNTLM = 5,
ProtectionSpaceAuthenticationSchemeNegotiate = 6,
ProtectionSpaceAuthenticationSchemeClientCertificateRequested = 7,
ProtectionSpaceAuthenticationSchemeServerTrustEvaluationRequested = 8,
ProtectionSpaceAuthenticationSchemeUnknown = 100
};
class ProtectionSpaceBase {
public:
bool isHashTableDeletedValue() const { return m_isHashTableDeletedValue; }
WEBCORE_EXPORT const String& host() const;
WEBCORE_EXPORT int port() const;
WEBCORE_EXPORT ProtectionSpaceServerType serverType() const;
WEBCORE_EXPORT bool isProxy() const;
WEBCORE_EXPORT const String& realm() const;
WEBCORE_EXPORT ProtectionSpaceAuthenticationScheme authenticationScheme() const;
bool receivesCredentialSecurely() const;
WEBCORE_EXPORT bool isPasswordBased() const;
bool encodingRequiresPlatformData() const { return false; }
WEBCORE_EXPORT static bool compare(const ProtectionSpace&, const ProtectionSpace&);
protected:
WEBCORE_EXPORT ProtectionSpaceBase();
WEBCORE_EXPORT ProtectionSpaceBase(const String& host, int port, ProtectionSpaceServerType, const String& realm, ProtectionSpaceAuthenticationScheme);
ProtectionSpaceBase(WTF::HashTableDeletedValueType) : m_isHashTableDeletedValue(true) { }
static bool platformCompare(const ProtectionSpace&, const ProtectionSpace&) { return true; }
private:
String m_host;
int m_port;
ProtectionSpaceServerType m_serverType;
String m_realm;
ProtectionSpaceAuthenticationScheme m_authenticationScheme;
bool m_isHashTableDeletedValue;
};
inline bool operator==(const ProtectionSpace& a, const ProtectionSpace& b) { return ProtectionSpaceBase::compare(a, b); }
inline bool operator!=(const ProtectionSpace& a, const ProtectionSpace& b) { return !(a == b); }
}
#endif // ProtectionSpaceBase_h