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/TextResourceDecoder.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/loader/TextResourceDecoder.h')
-rw-r--r-- | Source/WebCore/loader/TextResourceDecoder.h | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/Source/WebCore/loader/TextResourceDecoder.h b/Source/WebCore/loader/TextResourceDecoder.h index e51f1f7a8..98ec9257a 100644 --- a/Source/WebCore/loader/TextResourceDecoder.h +++ b/Source/WebCore/loader/TextResourceDecoder.h @@ -20,8 +20,7 @@ */ -#ifndef TextResourceDecoder_h -#define TextResourceDecoder_h +#pragma once #include "TextEncoding.h" #include <wtf/RefCounted.h> @@ -43,17 +42,21 @@ public: EncodingFromParentFrame }; - static PassRefPtr<TextResourceDecoder> create(const String& mimeType, const TextEncoding& defaultEncoding = TextEncoding(), bool usesEncodingDetector = false) + static Ref<TextResourceDecoder> create(const String& mimeType, const TextEncoding& defaultEncoding = TextEncoding(), bool usesEncodingDetector = false) { - return adoptRef(new TextResourceDecoder(mimeType, defaultEncoding, usesEncodingDetector)); + return adoptRef(*new TextResourceDecoder(mimeType, defaultEncoding, usesEncodingDetector)); } - ~TextResourceDecoder(); + WEBCORE_EXPORT ~TextResourceDecoder(); void setEncoding(const TextEncoding&, EncodingSource); const TextEncoding& encoding() const { return m_encoding; } - String decode(const char* data, size_t length); - String flush(); + bool hasEqualEncodingForCharset(const String&) const; + + WEBCORE_EXPORT String decode(const char* data, size_t length); + WEBCORE_EXPORT String flush(); + + WEBCORE_EXPORT String decodeAndFlush(const char* data, size_t length); void setHintEncoding(const TextResourceDecoder* hintDecoder) { @@ -67,7 +70,7 @@ public: bool sawError() const { return m_sawError; } private: - TextResourceDecoder(const String& mimeType, const TextEncoding& defaultEncoding, bool usesEncodingDetector); + WEBCORE_EXPORT TextResourceDecoder(const String& mimeType, const TextEncoding& defaultEncoding, bool usesEncodingDetector); enum ContentType { PlainText, HTML, XML, CSS }; // PlainText only checks for BOM. static ContentType determineContentType(const String& mimeType); @@ -82,7 +85,7 @@ private: ContentType m_contentType; TextEncoding m_encoding; - OwnPtr<TextCodec> m_codec; + std::unique_ptr<TextCodec> m_codec; EncodingSource m_source; const char* m_hintEncoding; Vector<char> m_buffer; @@ -96,6 +99,4 @@ private: std::unique_ptr<HTMLMetaCharsetParser> m_charsetParser; }; -} - -#endif +} // namespace WebCore |