Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(634)

Unified Diff: Source/core/fetch/TextResourceDecoder.h

Issue 74513003: Moved text decoding to the parser thread (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@parserthread_step25
Patch Set: Review fixes Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/fetch/TextResourceDecoder.h
diff --git a/Source/core/fetch/TextResourceDecoder.h b/Source/core/fetch/TextResourceDecoder.h
index 4c7734781487fe8e1f3cdd0cc5ec5cc53a8b076d..a485ea185f1ba8260c884190a0a7dc03a620febe 100644
--- a/Source/core/fetch/TextResourceDecoder.h
+++ b/Source/core/fetch/TextResourceDecoder.h
@@ -28,6 +28,7 @@
namespace WebCore {
+struct DocumentEncodingData;
class HTMLMetaCharsetParser;
class TextResourceDecoder {
@@ -52,11 +53,6 @@ public:
void setEncoding(const WTF::TextEncoding&, EncodingSource);
const WTF::TextEncoding& encoding() const { return m_encoding; }
- bool encodingWasDetectedHeuristically() const
- {
- return m_source == AutoDetectedEncoding
- || m_source == EncodingFromContentSniffing;
- }
String decode(const char* data, size_t length);
String flush();
@@ -68,6 +64,7 @@ public:
void useLenientXMLDecoding() { m_useLenientXMLDecoding = true; }
bool sawError() const { return m_sawError; }
+ void getEncodingData(DocumentEncodingData&) const;
eseidel 2013/11/18 22:32:07 "get" methods are uncommon in Blink. Is there a r
oystein (OOO til 10th of July) 2013/11/18 22:36:46 It's copyable, it'd just add the need for the full
private:
TextResourceDecoder(const String& mimeType, const WTF::TextEncoding& defaultEncoding, bool usesEncodingDetector);
@@ -83,6 +80,13 @@ private:
void detectJapaneseEncoding(const char*, size_t);
bool shouldAutoDetect() const;
+ bool encodingWasDetectedHeuristically() const
+ {
+ return m_source == AutoDetectedEncoding
+ || m_source == EncodingFromContentSniffing;
+ }
+
+
ContentType m_contentType;
WTF::TextEncoding m_encoding;
OwnPtr<TextCodec> m_codec;

Powered by Google App Engine
This is Rietveld 408576698