CachedRawResource.h [plain text]
#ifndef CachedRawResource_h
#define CachedRawResource_h
#include "CachedResource.h"
#include "CachedResourceClient.h"
namespace WebCore {
class CachedRawResourceCallback;
class CachedRawResourceClient;
class CachedRawResource : public CachedResource {
public:
CachedRawResource(ResourceRequest&);
virtual void setDefersLoading(bool);
unsigned long identifier() const { return m_identifier; }
bool canReuse(const ResourceRequest&) const;
private:
virtual void didAddClient(CachedResourceClient*);
virtual void data(PassRefPtr<SharedBuffer> data, bool allDataReceived);
virtual bool shouldIgnoreHTTPStatusCodeErrors() const { return true; }
virtual void allClientsRemoved();
virtual void willSendRequest(ResourceRequest&, const ResourceResponse&);
virtual void setResponse(const ResourceResponse&);
virtual void didSendData(unsigned long long bytesSent, unsigned long long totalBytesToBeSent);
#if PLATFORM(CHROMIUM)
virtual void didDownloadData(int);
#endif
unsigned long m_identifier;
};
class CachedRawResourceClient : public CachedResourceClient {
public:
virtual ~CachedRawResourceClient() { }
static CachedResourceClientType expectedType() { return RawResourceType; }
virtual CachedResourceClientType resourceClientType() { return expectedType(); }
virtual void dataSent(CachedResource*, unsigned long long , unsigned long long ) { }
virtual void responseReceived(CachedResource*, const ResourceResponse&) { }
virtual void dataReceived(CachedResource*, const char* , int ) { }
virtual void redirectReceived(CachedResource*, ResourceRequest&, const ResourceResponse&) { }
#if PLATFORM(CHROMIUM)
virtual void dataDownloaded(CachedResource*, int) { }
#endif
};
}
#endif // CachedRawResource_h