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

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

Issue 23455024: Move ownership of the TextResourceDecoder to DecodedDataDocumentParser (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased 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/rendering/RenderText.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 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();
}
« no previous file with comments | « Source/core/loader/DocumentWriter.cpp ('k') | Source/core/rendering/RenderText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698