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

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

Issue 69823002: Move ownership of the TextResourceDecoder to DecodedDataDocumentParser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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
« no previous file with comments | « Source/core/dom/DocumentParser.cpp ('k') | Source/core/loader/DocumentLoader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/TextResourceDecoder.h
diff --git a/Source/core/fetch/TextResourceDecoder.h b/Source/core/fetch/TextResourceDecoder.h
index 14baa35edd29b99ba11644e30af9fe2fcd985427..3823c61904062d8c4fcb73b8a5a013a4c2d4dcdc 100644
--- a/Source/core/fetch/TextResourceDecoder.h
+++ b/Source/core/fetch/TextResourceDecoder.h
@@ -52,16 +52,18 @@ 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();
- void setHintEncoding(const TextResourceDecoder* hintDecoder)
+ void setHintEncoding(const WTF::TextEncoding& encoding)
{
- // hintEncoding is for use with autodetection, which should be
- // only invoked when hintEncoding comes from auto-detection.
- if (hintDecoder && hintDecoder->wasDetectedHueristically())
- m_hintEncoding = hintDecoder->encoding().name();
+ m_hintEncoding = encoding.name();
}
void useLenientXMLDecoding() { m_useLenientXMLDecoding = true; }
@@ -74,8 +76,6 @@ private:
static ContentType determineContentType(const String& mimeType);
static const WTF::TextEncoding& defaultEncoding(ContentType, const WTF::TextEncoding& defaultEncoding);
- bool wasDetectedHueristically() const { return m_source == AutoDetectedEncoding || m_source == EncodingFromContentSniffing; }
-
size_t checkForBOM(const char*, size_t);
bool checkForCSSCharset(const char*, size_t, bool& movedDataToBuffer);
bool checkForXMLCharset(const char*, size_t, bool& movedDataToBuffer);
« no previous file with comments | « Source/core/dom/DocumentParser.cpp ('k') | Source/core/loader/DocumentLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698