diff options
Diffstat (limited to 'Source/WebCore/html/parser/HTMLMetaCharsetParser.h')
-rw-r--r-- | Source/WebCore/html/parser/HTMLMetaCharsetParser.h | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/Source/WebCore/html/parser/HTMLMetaCharsetParser.h b/Source/WebCore/html/parser/HTMLMetaCharsetParser.h index 618ce7ff6..8d7b89fa5 100644 --- a/Source/WebCore/html/parser/HTMLMetaCharsetParser.h +++ b/Source/WebCore/html/parser/HTMLMetaCharsetParser.h @@ -23,54 +23,39 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef HTMLMetaCharsetParser_h -#define HTMLMetaCharsetParser_h +#pragma once -#include "HTMLToken.h" +#include "HTMLTokenizer.h" #include "SegmentedString.h" #include "TextEncoding.h" -#include <wtf/Noncopyable.h> namespace WebCore { -class HTMLTokenizer; class TextCodec; class HTMLMetaCharsetParser { WTF_MAKE_NONCOPYABLE(HTMLMetaCharsetParser); WTF_MAKE_FAST_ALLOCATED; public: HTMLMetaCharsetParser(); - ~HTMLMetaCharsetParser(); // Returns true if done checking, regardless whether an encoding is found. bool checkForMetaCharset(const char*, size_t); const TextEncoding& encoding() { return m_encoding; } - typedef Vector<std::pair<String, String>> AttributeList; // The returned encoding might not be valid. - static TextEncoding encodingFromMetaAttributes(const AttributeList& -); + typedef Vector<std::pair<String, String>> AttributeList; + static TextEncoding encodingFromMetaAttributes(const AttributeList&); private: - bool processMeta(); - static String extractCharset(const String&); + bool processMeta(HTMLToken&); - enum Mode { - None, - Charset, - Pragma, - }; - - std::unique_ptr<HTMLTokenizer> m_tokenizer; - OwnPtr<TextCodec> m_assumedCodec; + HTMLTokenizer m_tokenizer; + const std::unique_ptr<TextCodec> m_codec; SegmentedString m_input; - HTMLToken m_token; - bool m_inHeadSection; - - bool m_doneChecking; + bool m_inHeadSection { true }; + bool m_doneChecking { false }; TextEncoding m_encoding; }; -} -#endif +} // namespace WebCore |