Index: Source/core/dom/DecodedDataDocumentParser.cpp |
diff --git a/Source/core/dom/DecodedDataDocumentParser.cpp b/Source/core/dom/DecodedDataDocumentParser.cpp |
index 7f3c01f23d888588788284487ead384a0f4ef704..fb6ade991c253936de8b4732269082a40e08f758 100644 |
--- a/Source/core/dom/DecodedDataDocumentParser.cpp |
+++ b/Source/core/dom/DecodedDataDocumentParser.cpp |
@@ -35,6 +35,7 @@ namespace WebCore { |
DecodedDataDocumentParser::DecodedDataDocumentParser(Document* document) |
: DocumentParser(document) |
, m_hasAppendedData(false) |
+ , m_needsDecoder(true) |
{ |
} |
@@ -44,6 +45,7 @@ DecodedDataDocumentParser::~DecodedDataDocumentParser() |
void DecodedDataDocumentParser::setDecoder(PassOwnPtr<TextResourceDecoder> decoder) |
{ |
+ m_needsDecoder = false; |
m_decoder = decoder; |
} |
@@ -52,6 +54,11 @@ TextResourceDecoder* DecodedDataDocumentParser::decoder() |
return m_decoder.get(); |
} |
+PassOwnPtr<TextResourceDecoder> DecodedDataDocumentParser::takeDecoder() |
+{ |
+ return m_decoder.release(); |
+} |
+ |
void DecodedDataDocumentParser::setHasAppendedData() |
{ |
m_hasAppendedData = true; |
@@ -91,11 +98,7 @@ void DecodedDataDocumentParser::flush() |
void DecodedDataDocumentParser::updateDocument(String& decodedData) |
{ |
- DocumentEncodingData encodingData; |
- encodingData.encoding = m_decoder->encoding(); |
- encodingData.wasDetectedHeuristically = m_decoder->encodingWasDetectedHeuristically(); |
- encodingData.sawDecodingError = m_decoder->sawError(); |
- document()->setEncodingData(encodingData); |
+ document()->setEncodingData(DocumentEncodingData(*m_decoder.get())); |
if (decodedData.isEmpty()) |
return; |