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

Unified Diff: Source/core/loader/TextResourceDecoderBuilder.cpp

Issue 69823002: Move ownership of the TextResourceDecoder to DecodedDataDocumentParser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Moved DocumentEncodingData to its own header 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/loader/TextResourceDecoderBuilder.cpp
diff --git a/Source/core/loader/TextResourceDecoderBuilder.cpp b/Source/core/loader/TextResourceDecoderBuilder.cpp
index 0076f613656644a2427fa2b6ff18ed842f85317d..fe7278fec92e4f22e4e9daeabe3811f3c3f5b7ba 100644
--- a/Source/core/loader/TextResourceDecoderBuilder.cpp
+++ b/Source/core/loader/TextResourceDecoderBuilder.cpp
@@ -84,7 +84,9 @@ inline void TextResourceDecoderBuilder::setupEncoding(TextResourceDecoder* decod
// FIXME: This might be too cautious for non-7bit-encodings and
// we may consider relaxing this later after testing.
if (frame && canReferToParentFrameEncoding(frame, parentFrame)) {
- decoder->setHintEncoding(parentFrame->document()->decoder());
+ if (parentFrame->document()->encodingWasDetectedHeuristically())
+ decoder->setHintEncoding(parentFrame->document()->encoding());
+
if (m_encoding.isEmpty())
decoder->setEncoding(parentFrame->document()->inputEncoding(), TextResourceDecoder::EncodingFromParentFrame);
}
@@ -94,7 +96,6 @@ PassRefPtr<TextResourceDecoder> TextResourceDecoderBuilder::buildFor(Document* d
{
RefPtr<TextResourceDecoder> decoder = createDecoderInstance(document);
setupEncoding(decoder.get(), document);
- document->setDecoder(decoder);
return decoder.release();
}

Powered by Google App Engine
This is Rietveld 408576698