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

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

Issue 74493002: Removed refcounting from TextResourceDecoder (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@parserthread_step2
Patch Set: Compile fix 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/inspector/NetworkResourcesData.cpp ('k') | Source/core/loader/TextResourceDecoderBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/DocumentWriter.cpp
diff --git a/Source/core/loader/DocumentWriter.cpp b/Source/core/loader/DocumentWriter.cpp
index 567889a50b66cee430346cf23e60ef645496357c..9767ca8078e952b51d34f8a2653cd7803c65df60 100644
--- a/Source/core/loader/DocumentWriter.cpp
+++ b/Source/core/loader/DocumentWriter.cpp
@@ -86,8 +86,8 @@ void DocumentWriter::addData(const char* bytes, size_t length)
{
ASSERT(m_parser);
if (m_parser->needsDecoder() && 0 < length) {
- RefPtr<TextResourceDecoder> decoder = m_decoderBuilder.buildFor(m_document);
- m_parser->setDecoder(decoder);
+ OwnPtr<TextResourceDecoder> decoder = m_decoderBuilder.buildFor(m_document);
+ m_parser->setDecoder(decoder.release());
}
// appendBytes() can result replacing DocumentLoader::m_writer.
RefPtr<DocumentWriter> protectingThis(this);
@@ -107,8 +107,8 @@ void DocumentWriter::end()
return;
if (m_parser->needsDecoder()) {
- RefPtr<TextResourceDecoder> decoder = m_decoderBuilder.buildFor(m_document);
- m_parser->setDecoder(decoder);
+ OwnPtr<TextResourceDecoder> decoder = m_decoderBuilder.buildFor(m_document);
+ m_parser->setDecoder(decoder.release());
}
// flush() can result replacing DocumentLoader::m_writer.
RefPtr<DocumentWriter> protectingThis(this);
@@ -124,7 +124,7 @@ void DocumentWriter::end()
void DocumentWriter::setUserChosenEncoding(const String& charset)
{
- RefPtr<TextResourceDecoder> decoder = m_parser->decoder();
+ TextResourceDecoder* decoder = m_parser->decoder();
if (decoder)
decoder->setEncoding(charset, TextResourceDecoder::UserChosenEncoding);
}
« no previous file with comments | « Source/core/inspector/NetworkResourcesData.cpp ('k') | Source/core/loader/TextResourceDecoderBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698