diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/loader/cache/CachedScript.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/loader/cache/CachedScript.h')
-rw-r--r-- | Source/WebCore/loader/cache/CachedScript.h | 55 |
1 files changed, 31 insertions, 24 deletions
diff --git a/Source/WebCore/loader/cache/CachedScript.h b/Source/WebCore/loader/cache/CachedScript.h index 80b073c2a..f8898d378 100644 --- a/Source/WebCore/loader/cache/CachedScript.h +++ b/Source/WebCore/loader/cache/CachedScript.h @@ -23,44 +23,51 @@ pages from the web. It has a memory cache for these objects. */ -#ifndef CachedScript_h -#define CachedScript_h +#pragma once #include "CachedResource.h" namespace WebCore { - class CachedResourceLoader; - class TextResourceDecoder; +class TextResourceDecoder; - class CachedScript final : public CachedResource { - public: - CachedScript(const ResourceRequest&, const String& charset); - virtual ~CachedScript(); +class CachedScript final : public CachedResource { +public: + CachedScript(CachedResourceRequest&&, SessionID); + virtual ~CachedScript(); - const String& script(); + StringView script(); + unsigned scriptHash(); - String mimeType() const; + String mimeType() const; #if ENABLE(NOSNIFF) - bool mimeTypeAllowedByNosniff() const; + bool mimeTypeAllowedByNosniff() const; #endif - private: - virtual PurgePriority purgePriority() const override { return PurgeLast; } - virtual bool mayTryReplaceEncodedData() const override { return true; } +private: + bool mayTryReplaceEncodedData() const final { return true; } - virtual bool shouldIgnoreHTTPStatusCodeErrors() const override; + bool shouldIgnoreHTTPStatusCodeErrors() const final; - virtual void setEncoding(const String&) override; - virtual String encoding() const override; - virtual void finishLoading(ResourceBuffer*) override; + void setEncoding(const String&) final; + String encoding() const final; + const TextResourceDecoder* textResourceDecoder() const final { return m_decoder.get(); } + void finishLoading(SharedBuffer*) final; - virtual void destroyDecodedData() override; + void destroyDecodedData() final; - String m_script; - RefPtr<TextResourceDecoder> m_decoder; - }; -} + void setBodyDataFrom(const CachedResource&) final; -#endif + String m_script; + unsigned m_scriptHash { 0 }; + + enum DecodingState { NeverDecoded, DataAndDecodedStringHaveSameBytes, DataAndDecodedStringHaveDifferentBytes }; + DecodingState m_decodingState { NeverDecoded }; + + RefPtr<TextResourceDecoder> m_decoder; +}; + +} // namespace WebCore + +SPECIALIZE_TYPE_TRAITS_CACHED_RESOURCE(CachedScript, CachedResource::Script) |