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

Unified Diff: Source/core/loader/cache/CachedDocument.cpp

Issue 15856002: First step of HTMLImports (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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
Index: Source/core/loader/cache/CachedDocument.cpp
diff --git a/Source/core/loader/cache/CachedDocument.cpp b/Source/core/loader/cache/CachedDocument.cpp
index ea724499c9fb54d5ba10864010752746875150b3..a34e225761acb88a37b655c1230edd05fd1cace2 100644
--- a/Source/core/loader/cache/CachedDocument.cpp
+++ b/Source/core/loader/cache/CachedDocument.cpp
@@ -24,6 +24,7 @@
#include "core/loader/cache/CachedDocument.h"
+#include "core/html/HTMLDocument.h"
#include "core/loader/cache/CachedResourceClient.h"
#include "core/loader/cache/CachedResourceHandle.h"
#include "core/platform/SharedBuffer.h"
@@ -34,10 +35,17 @@ namespace WebCore {
CachedDocument::CachedDocument(const ResourceRequest& request, Type type)
: CachedResource(request, type)
- , m_decoder(TextResourceDecoder::create("application/xml"))
{
- // FIXME: We'll support more types to support HTMLImports.
- ASSERT(type == SVGDocumentResource);
+ switch (type) {
+ case SVGDocumentResource:
+ m_decoder = TextResourceDecoder::create("application/xml");
+ break;
+ case HTMLDocumentResource:
+ m_decoder = TextResourceDecoder::create("text/html");
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
}
CachedDocument::~CachedDocument()
@@ -72,6 +80,8 @@ PassRefPtr<Document> CachedDocument::createDocument(const KURL& url)
switch (type()) {
case SVGDocumentResource:
return SVGDocument::create(0, url);
+ case HTMLDocumentResource:
+ return HTMLDocument::create(0, url);
default:
// FIXME: We'll add more types to support HTMLImports.
ASSERT_NOT_REACHED();

Powered by Google App Engine
This is Rietveld 408576698