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

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: 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/loader/DocumentWriter.cpp ('k') | Source/core/xml/XSLTProcessor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/TextResourceDecoderBuilder.cpp
diff --git a/Source/core/loader/TextResourceDecoderBuilder.cpp b/Source/core/loader/TextResourceDecoderBuilder.cpp
index 0a48c75b715eda54504a32430c412acb1b6135bf..7ba05d879c39bf8cae31fdaea4d0ed9bdcef1658 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();
}
« no previous file with comments | « Source/core/loader/DocumentWriter.cpp ('k') | Source/core/xml/XSLTProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698