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

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

Issue 2359963003: MHTML: Allows 'data:' URLs to be processed using normal request processing. (Closed)
Patch Set: Created 4 years, 3 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/LayoutTests/platform/linux/mhtml/data-uri-font-expected.txt ('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/ResourceFetcher.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
index 9766e241d7248b3f7e9239d87c45176df3c85d47..0fcd890a93b05b98f9fdc73aff9044f4f9a0e7bf 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
@@ -443,12 +443,16 @@ Resource* ResourceFetcher::requestResource(FetchRequest& request, const Resource
}
}
- bool isStaticData = request.resourceRequest().url().protocolIsData() || substituteData.isValid() || m_archive;
+ bool isDataUrl = request.resourceRequest().url().protocolIsData();
+ bool isStaticData = isDataUrl || substituteData.isValid() || m_archive;
Resource* resource(nullptr);
if (isStaticData) {
resource = resourceForStaticData(request, factory, substituteData);
- // Abort the request if the archive doesn't contain the resource.
- if (!resource && m_archive)
+ // Abort the request if the archive doesn't contain the resource, except
+ // in the case of data URLs which might have resources such as fonts
+ // that need to be decoded only on demand. These data URLs are allowed
+ // to be processed using the normal ResourceFetcher machinery.
+ if (!resource && !isDataUrl && m_archive)
return nullptr;
}
if (!resource)
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/linux/mhtml/data-uri-font-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698