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

Unified Diff: Source/core/fetch/ResourceLoader.cpp

Issue 1154413002: Make multipart image documents work again. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix excessive clumsiness Created 5 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
« no previous file with comments | « Source/core/fetch/ResourceLoader.h ('k') | Source/core/html/ImageDocument.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/ResourceLoader.cpp
diff --git a/Source/core/fetch/ResourceLoader.cpp b/Source/core/fetch/ResourceLoader.cpp
index fb7885554d7722e62d4dc0493e331982c14f287e..56c35977a7ac034db5ee070fc5229410edf24dcf 100644
--- a/Source/core/fetch/ResourceLoader.cpp
+++ b/Source/core/fetch/ResourceLoader.cpp
@@ -62,6 +62,7 @@ ResourceLoader::ResourceLoader(ResourceFetcher* fetcher, Resource* resource, con
: m_fetcher(fetcher)
, m_notifiedLoadComplete(false)
, m_defersLoading(fetcher->defersLoading())
+ , m_loadingMultipartContent(false)
, m_options(options)
, m_resource(resource)
, m_state(Initialized)
@@ -376,10 +377,13 @@ void ResourceLoader::didReceiveResponse(WebURLLoader*, const WebURLResponse& res
return;
if (response.toResourceResponse().isMultipart()) {
- if (!m_resource->isImage()) {
+ // We only support multipart for images, though the image may be loaded
+ // as a main resource that we end up displaying through an ImageDocument.
+ if (!m_resource->isImage() && m_resource->type() != Resource::MainResource) {
cancel();
return;
}
+ m_loadingMultipartContent = true;
} else if (isMultipartPayload) {
// Since a subresource loader does not load multipart sections progressively, data was delivered to the loader all at once.
// After the first multipart section is complete, signal to delegates that this load is "finished"
« no previous file with comments | « Source/core/fetch/ResourceLoader.h ('k') | Source/core/html/ImageDocument.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698