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

Unified Diff: ios/chrome/browser/reading_list/url_downloader.cc

Issue 2644073005: [ReadingList iOS] Do not store HTTP images when distilling HTTPS pages (Closed)
Patch Set: feedback Created 3 years, 11 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 | « ios/chrome/browser/reading_list/url_downloader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/reading_list/url_downloader.cc
diff --git a/ios/chrome/browser/reading_list/url_downloader.cc b/ios/chrome/browser/reading_list/url_downloader.cc
index 93afe9b1f05c3ae1798f94bbfc4740e80127747f..d279f3243a2452b516ee09bf4e0c43b1d0b95f69 100644
--- a/ios/chrome/browser/reading_list/url_downloader.cc
+++ b/ios/chrome/browser/reading_list/url_downloader.cc
@@ -248,10 +248,15 @@ std::string URLDownloader::SaveAndReplaceImagesInHTML(
// Data URI, the data part of the image is empty, no need to store it.
continue;
}
- base::FilePath local_image_path;
std::string local_image_name;
- if (!SaveImage(url, images[i].url, images[i].data, &local_image_name)) {
- return std::string();
+ // Mixed content is HTTP images on HTTPS pages.
+ bool image_is_mixed_content = distilled_url_.SchemeIsCryptographic() &&
+ !images[i].url.SchemeIsCryptographic();
+ // Only save images if it is not mixed content.
+ if (!image_is_mixed_content) {
+ if (!SaveImage(url, images[i].url, images[i].data, &local_image_name)) {
+ return std::string();
+ }
}
std::string image_url = net::EscapeForHTML(images[i].url.spec());
size_t image_url_size = image_url.size();
« no previous file with comments | « ios/chrome/browser/reading_list/url_downloader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698