From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/html/parser/HTMLMetaCharsetParser.h | 35 +++++++--------------- 1 file changed, 10 insertions(+), 25 deletions(-) (limited to 'Source/WebCore/html/parser/HTMLMetaCharsetParser.h') 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 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> AttributeList; // The returned encoding might not be valid. - static TextEncoding encodingFromMetaAttributes(const AttributeList& -); + typedef Vector> 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 m_tokenizer; - OwnPtr m_assumedCodec; + HTMLTokenizer m_tokenizer; + const std::unique_ptr 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 -- cgit v1.2.1