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

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: 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 | « no previous file | 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..7fb822716a75f62cbef81488a5093699ba60d0ff 100644
--- a/ios/chrome/browser/reading_list/url_downloader.cc
+++ b/ios/chrome/browser/reading_list/url_downloader.cc
@@ -248,10 +248,14 @@ 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();
+ std::string local_image_name = "";
jif 2017/01/20 10:45:26 afaik you don't need to initialize local_image_nam
Olivier 2017/01/20 10:54:44 Done.
+ if (!(distilled_url_.SchemeIsCryptographic() &&
jif 2017/01/20 10:45:26 Because it confused me a bit, can you rewrite it a
Olivier 2017/01/20 10:54:44 Done.
+ !images[i].url.SchemeIsCryptographic())) {
+ // Only save images if it is not mixed content.
+ // Mixed content is HTTP imaged on HTTPS pages.
jif 2017/01/20 10:45:26 s/imaged/images/ I appreciate the reminder of wha
Olivier 2017/01/20 10:54:44 Done.
+ if (!SaveImage(url, images[i].url, images[i].data, &local_image_name)) {
+ return std::string();
jif 2017/01/20 10:45:26 Optional nit (because not introduced by your CL, a
Olivier 2017/01/20 10:54:44 Returning the html empty will result in a distilla
+ }
}
std::string image_url = net::EscapeForHTML(images[i].url.spec());
size_t image_url_size = image_url.size();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698