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

Unified Diff: Source/core/dom/DecodedDataDocumentParser.cpp

Issue 22909053: Store the Document's encoding on the Document (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months 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 | « no previous file | Source/core/dom/Document.h » ('j') | Source/core/dom/Document.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/DecodedDataDocumentParser.cpp
diff --git a/Source/core/dom/DecodedDataDocumentParser.cpp b/Source/core/dom/DecodedDataDocumentParser.cpp
index 7ceaabe6d582fc797f5350d51b1ba5743c7f734d..1e4e06b7525ea222434e020f11ae34a4c23bb8c5 100644
--- a/Source/core/dom/DecodedDataDocumentParser.cpp
+++ b/Source/core/dom/DecodedDataDocumentParser.cpp
@@ -40,7 +40,7 @@ class TitleEncodingFixer {
public:
explicit TitleEncodingFixer(Document* document)
: m_document(document)
- , m_firstEncoding(document->decoder()->encoding())
+ , m_firstEncoding(document->encoding())
{
}
@@ -52,7 +52,7 @@ public:
// in the title bar.
inline void fixTitleEncodingIfNeeded()
{
- if (m_firstEncoding == m_document->decoder()->encoding())
+ if (m_firstEncoding == m_document->encoding())
return; // In the common case, the encoding doesn't change and there isn't any work to do.
fixTitleEncoding();
}
@@ -73,7 +73,7 @@ void TitleEncodingFixer::fixTitleEncoding()
|| !titleElement->textContent().containsOnlyLatin1())
return; // Either we don't have a title yet or something bizzare as happened and we give up.
CString originalBytes = titleElement->textContent().latin1();
- OwnPtr<TextCodec> codec = newTextCodec(m_document->decoder()->encoding());
+ OwnPtr<TextCodec> codec = newTextCodec(m_document->encoding());
String correctlyDecodedTitle = codec->decode(originalBytes.data(), originalBytes.length(), true);
titleElement->setTextContent(correctlyDecodedTitle, IGNORE_EXCEPTION);
}
« no previous file with comments | « no previous file | Source/core/dom/Document.h » ('j') | Source/core/dom/Document.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698