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

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

Issue 2683393002: [iOS Reading List] Skip invalid images in distillation. (Closed)
Patch Set: Created 3 years, 10 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 eea31e57c0f468b03934a84e8ed29b931664be3f..b73616bcc1e8a1187e46e655922139f960e9d0cd 100644
--- a/ios/chrome/browser/reading_list/url_downloader.cc
+++ b/ios/chrome/browser/reading_list/url_downloader.cc
@@ -333,8 +333,9 @@ std::string URLDownloader::SaveAndReplaceImagesInHTML(
// 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) {
+ // Only save images if it is not mixed content and image data is valid.
+ if (!image_is_mixed_content && images[i].url.is_valid() &&
+ !images[i].data.empty()) {
if (!SaveImage(url, images[i].url, images[i].data, &local_image_name)) {
return std::string();
}
« 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