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

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

Issue 2975623002: Fix: Loading cid: resources in WebView. (Closed)
Patch Set: Rebase. Created 3 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 | « no previous file | third_party/WebKit/Source/platform/loader/fetch/ResourceFetcherTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 57ae8dea3348a3cfbe41ae484093189103aced6d..2622ea588061ab9126ebf9ca2e47252448f757be 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
@@ -644,10 +644,15 @@ 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 (!archive_ && resource_request.Url().ProtocolIs(kContentIdScheme))
+ // A main resource request with the "cid" scheme can only be handled by an
+ // MHTML Archive. Abort the request when there is none.
+ // Note: There are some embedders of WebView that are using Content-ID
+ // URLs for sub-resources, even without any MHTMLArchive. Please see
Torne 2017/07/14 13:55:47 Just a note (don't expect you to change this CL fo
arthursonzogni 2017/07/17 10:58:15 Thanks for this information. Without this check,
+ // https://crbug.com/739658.
+ if (!archive_ && factory.GetType() == Resource::kMainResource &&
+ resource_request.Url().ProtocolIs(kContentIdScheme)) {
return nullptr;
+ }
bool is_data_url = resource_request.Url().ProtocolIsData();
bool is_static_data = is_data_url || substitute_data.IsValid() || archive_;
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/loader/fetch/ResourceFetcherTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698