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

Unified Diff: third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp

Issue 2834013002: PlzNavigate: make MHTML iframe load working. (Closed)
Patch Set: rebase Created 3 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: third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
index 448a4f1b3ed22cfc431f99d7a0508f2cb8d99763..a57e09cc17f765bd5cede7f5d3dd2082683914c1 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
@@ -417,7 +417,7 @@ Resource* ResourceFetcher::ResourceForStaticData(
} else {
ArchiveResource* archive_resource =
archive_->SubresourceForURL(params.Url());
- // Fall back to the network if the archive doesn't contain the resource.
+ // The archive doesn't contain the resource, the request must be aborted.
if (!archive_resource)
return nullptr;
data = archive_resource->Data();
@@ -597,13 +597,19 @@ Resource* ResourceFetcher::RequestResource(
params.Options().initiator_info.name);
}
+ // An URL with the "cid" scheme can only be handled by an MHTML Archive.
+ // Abort the request when there is none.
+ if (resource_request.Url().ProtocolIs(kContentIdScheme) && !archive_) {
+ return nullptr;
+ }
+
bool is_data_url = resource_request.Url().ProtocolIsData();
bool is_static_data = is_data_url || substitute_data.IsValid() || archive_;
if (is_static_data) {
resource = ResourceForStaticData(params, factory, substitute_data);
// 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
+ // to be decoded only on demand. These data URLs are allowed to be
// processed using the normal ResourceFetcher machinery.
if (!resource && !is_data_url && archive_)
return nullptr;
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameFetchContext.cpp ('k') | third_party/WebKit/Source/platform/mhtml/MHTMLArchive.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698