ResourceResponse.h [plain text]
#ifndef ResourceResponse_h
#define ResourceResponse_h
#include "File.h"
#include "NotImplemented.h"
#include "ResourceResponseBase.h"
#include <wtf/text/CString.h>
namespace WebCore {
class ResourceResponse : public ResourceResponseBase {
public:
class ExtraData : public RefCounted<ExtraData> {
public:
virtual ~ExtraData() { }
};
ResourceResponse()
: m_appCacheID(0)
, m_isMultipartPayload(false)
, m_wasFetchedViaSPDY(false)
, m_wasNpnNegotiated(false)
, m_wasAlternateProtocolAvailable(false)
, m_wasFetchedViaProxy(false)
, m_responseTime(0)
, m_remotePort(0)
{
}
ResourceResponse(const KURL& url, const String& mimeType, long long expectedLength, const String& textEncodingName, const String& filename)
: ResourceResponseBase(url, mimeType, expectedLength, textEncodingName, filename)
, m_appCacheID(0)
, m_isMultipartPayload(false)
, m_wasFetchedViaSPDY(false)
, m_wasNpnNegotiated(false)
, m_wasAlternateProtocolAvailable(false)
, m_wasFetchedViaProxy(false)
, m_responseTime(0)
, m_remotePort(0)
{
}
const CString& getSecurityInfo() const { return m_securityInfo; }
void setSecurityInfo(const CString& securityInfo) { m_securityInfo = securityInfo; }
long long appCacheID() const { return m_appCacheID; }
void setAppCacheID(long long id) { m_appCacheID = id; }
const KURL& appCacheManifestURL() const { return m_appCacheManifestURL; }
void setAppCacheManifestURL(const KURL& url) { m_appCacheManifestURL = url; }
bool wasFetchedViaSPDY() const { return m_wasFetchedViaSPDY; }
void setWasFetchedViaSPDY(bool value) { m_wasFetchedViaSPDY = value; }
bool wasNpnNegotiated() const { return m_wasNpnNegotiated; }
void setWasNpnNegotiated(bool value) { m_wasNpnNegotiated = value; }
bool wasAlternateProtocolAvailable() const
{
return m_wasAlternateProtocolAvailable;
}
void setWasAlternateProtocolAvailable(bool value)
{
m_wasAlternateProtocolAvailable = value;
}
bool wasFetchedViaProxy() const { return m_wasFetchedViaProxy; }
void setWasFetchedViaProxy(bool value) { m_wasFetchedViaProxy = value; }
bool isMultipartPayload() const { return m_isMultipartPayload; }
void setIsMultipartPayload(bool value) { m_isMultipartPayload = value; }
double responseTime() const { return m_responseTime; }
void setResponseTime(double responseTime) { m_responseTime = responseTime; }
const String& remoteIPAddress() const { return m_remoteIPAddress; }
void setRemoteIPAddress(const String& value) { m_remoteIPAddress = value; }
unsigned short remotePort() const { return m_remotePort; }
void setRemotePort(unsigned short value) { m_remotePort = value; }
const File* downloadedFile() const { return m_downloadedFile.get(); }
void setDownloadedFile(PassRefPtr<File> downloadedFile) { m_downloadedFile = downloadedFile; }
ExtraData* extraData() const { return m_extraData.get(); }
void setExtraData(PassRefPtr<ExtraData> extraData) { m_extraData = extraData; }
private:
friend class ResourceResponseBase;
CString m_securityInfo;
void doUpdateResourceResponse()
{
notImplemented();
}
PassOwnPtr<CrossThreadResourceResponseData> doPlatformCopyData(PassOwnPtr<CrossThreadResourceResponseData>) const;
void doPlatformAdopt(PassOwnPtr<CrossThreadResourceResponseData>);
long long m_appCacheID;
KURL m_appCacheManifestURL;
bool m_isMultipartPayload;
bool m_wasFetchedViaSPDY;
bool m_wasNpnNegotiated;
bool m_wasAlternateProtocolAvailable;
bool m_wasFetchedViaProxy;
double m_responseTime;
String m_remoteIPAddress;
unsigned short m_remotePort;
RefPtr<File> m_downloadedFile;
RefPtr<ExtraData> m_extraData;
};
struct CrossThreadResourceResponseData : public CrossThreadResourceResponseDataBase {
long long m_appCacheID;
KURL m_appCacheManifestURL;
bool m_isMultipartPayload;
bool m_wasFetchedViaSPDY;
bool m_wasNpnNegotiated;
bool m_wasAlternateProtocolAvailable;
bool m_wasFetchedViaProxy;
double m_responseTime;
String m_remoteIPAddress;
unsigned short m_remotePort;
String m_downloadFilePath;
};
}
#endif