CachedCSSStyleSheet.h [plain text]
#ifndef CachedCSSStyleSheet_h
#define CachedCSSStyleSheet_h
#include "CachedResource.h"
#include <wtf/Vector.h>
namespace WebCore {
class CachedResourceClient;
class SharedBuffer;
class StyleSheetInternal;
class TextResourceDecoder;
struct CSSParserContext;
class CachedCSSStyleSheet : public CachedResource {
public:
CachedCSSStyleSheet(const ResourceRequest&, const String& charset);
virtual ~CachedCSSStyleSheet();
const String sheetText(bool enforceMIMEType = true, bool* hasValidMIMEType = 0) const;
virtual void didAddClient(CachedResourceClient*);
virtual void allClientsRemoved();
virtual void setEncoding(const String&);
virtual String encoding() const;
virtual void data(PassRefPtr<SharedBuffer> data, bool allDataReceived);
virtual void error(CachedResource::Status);
virtual void destroyDecodedData() OVERRIDE;
void checkNotify();
PassRefPtr<StyleSheetInternal> restoreParsedStyleSheet(const CSSParserContext&);
void saveParsedStyleSheet(PassRefPtr<StyleSheetInternal>);
private:
bool canUseSheet(bool enforceMIMEType, bool* hasValidMIMEType) const;
virtual PurgePriority purgePriority() const { return PurgeLast; }
protected:
RefPtr<TextResourceDecoder> m_decoder;
String m_decodedSheetText;
RefPtr<StyleSheetInternal> m_parsedStyleSheetCache;
};
}
#endif