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

Unified Diff: third_party/WebKit/Source/core/fetch/DocumentResource.cpp

Issue 2133153002: Make DocumentResource to be a subclass of TextResource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months 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 | « third_party/WebKit/Source/core/fetch/DocumentResource.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/fetch/DocumentResource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/DocumentResource.cpp b/third_party/WebKit/Source/core/fetch/DocumentResource.cpp
index bd7a5481e39ad43afd30f37e19f43fb261ae83e0..f6b8b51e664bc1c2c67dc98fb619f533dc3d4a75 100644
--- a/third_party/WebKit/Source/core/fetch/DocumentResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/DocumentResource.cpp
@@ -38,8 +38,7 @@ DocumentResource* DocumentResource::fetchSVGDocument(FetchRequest& request, Reso
}
DocumentResource::DocumentResource(const ResourceRequest& request, Type type, const ResourceLoaderOptions& options)
- : Resource(request, type, options)
- , m_decoder(TextResourceDecoder::create("application/xml"))
+ : TextResource(request, type, options, "application/xml", String())
{
// FIXME: We'll support more types to support HTMLImports.
ASSERT(type == SVGDocument);
@@ -55,25 +54,12 @@ DEFINE_TRACE(DocumentResource)
Resource::trace(visitor);
}
-void DocumentResource::setEncoding(const String& chs)
-{
- m_decoder->setEncoding(chs, TextResourceDecoder::EncodingFromHTTPHeader);
-}
-
-String DocumentResource::encoding() const
-{
- return m_decoder->encoding().name();
-}
-
void DocumentResource::checkNotify()
{
if (m_data && mimeTypeAllowed()) {
- StringBuilder decodedText;
- decodedText.append(m_decoder->decode(m_data->data(), m_data->size()));
- decodedText.append(m_decoder->flush());
// We don't need to create a new frame because the new document belongs to the parent UseElement.
m_document = createDocument(response().url());
- m_document->setContent(decodedText.toString());
+ m_document->setContent(decodedText());
}
Resource::checkNotify();
}
« no previous file with comments | « third_party/WebKit/Source/core/fetch/DocumentResource.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698