#ifndef ParsedCookie_h
#define ParsedCookie_h
#include "Cookie.h"
#include <wtf/FastAllocBase.h>
namespace WTF {
class String;
}
namespace WebCore {
class KURL;
class ParsedCookie {
WTF_MAKE_FAST_ALLOCATED;
public:
ParsedCookie(double currentTime);
ParsedCookie(const String& name, const String& value, const String& domain, const String& protocol, const String& path, double expiry, double lastAccessed, double creationTime, bool isSecure, bool isHttpOnly);
ParsedCookie(const ParsedCookie*);
~ParsedCookie();
const String& name() const { return m_name; }
void setName(const String& name) { m_name = name; }
const String& value() const { return m_value; }
void setValue(const String& value) { m_value = value; }
const String& path() const { return m_path; }
void setPath(const String& path) { m_path = path; }
const String& domain() const { return m_domain; }
void setDomain(const String& domain) { m_domain = domain.lower(); }
const String& protocol() const { return m_protocol; }
void setProtocol(const String& protocol) { m_protocol = protocol; }
double expiry() const { return m_expiry; }
void setExpiry(const String&);
void forceExpire() { m_isForceExpired = true; }
void setMaxAge(const String&);
double lastAccessed() const { return m_lastAccessed; }
void setLastAccessed(double lastAccessed) { m_lastAccessed = lastAccessed;}
double creationTime() const { return m_creationTime; }
void setCreationTime(double creationTime) { m_creationTime = creationTime; }
bool isSecure() const { return m_isSecure; }
void setSecureFlag(bool secure) { m_isSecure = secure; }
bool isHttpOnly() const { return m_isHttpOnly; }
void setIsHttpOnly(bool isHttpOnly) { m_isHttpOnly = isHttpOnly; }
bool isSession() const { return m_isSession; }
bool hasExpired() const;
bool isForceExpired() const { return m_isForceExpired; }
bool isUnderSizeLimit() const;
String toString() const;
String toNameValuePair() const;
void appendWebCoreCookie(Vector<Cookie>& cookieVector) const;
private:
String m_name;
String m_value;
String m_domain;
String m_protocol;
String m_path;
double m_expiry;
double m_creationTime;
double m_lastAccessed;
bool m_isSecure;
bool m_isHttpOnly;
bool m_isSession;
bool m_isForceExpired;
};
}
#endif // ParsedCookie_h