Chromium Code Reviews| Index: components/favicon/core/favicon_handler.cc |
| diff --git a/components/favicon/core/favicon_handler.cc b/components/favicon/core/favicon_handler.cc |
| index adbb5df8e2a4b4c769f4cca819fc95f424a78fda..57e196ab2a6b0a24b9dcf0769dfd54a5f0158a42 100644 |
| --- a/components/favicon/core/favicon_handler.cc |
| +++ b/components/favicon/core/favicon_handler.cc |
| @@ -475,9 +475,8 @@ void FaviconHandler::OnDidDownloadFavicon( |
| } |
| } |
| - if (request_next_icon && current_candidate_index_ + 1 < image_urls_.size()) { |
| + if (request_next_icon && IncrementCurrentCandidateIndex()) { |
| // Process the next candidate. |
| - ++current_candidate_index_; |
| DownloadCurrentCandidateOrAskFaviconService(); |
| } else { |
| // We have either found the ideal candidate or run out of candidates. |
| @@ -599,6 +598,13 @@ void FaviconHandler::OnFaviconDataForInitialURLFromFaviconService( |
| OnGotInitialHistoryDataAndIconURLCandidates(); |
| } |
| +bool FaviconHandler::IncrementCurrentCandidateIndex() { |
| + if (current_candidate_index_ + 1 >= image_urls_.size()) |
| + return false; |
| + ++current_candidate_index_; |
| + return true; |
| +} |
| + |
| void FaviconHandler::DownloadCurrentCandidateOrAskFaviconService() { |
| GURL icon_url = current_candidate()->icon_url; |
| favicon_base::IconType icon_type = current_candidate()->icon_type; |
| @@ -661,6 +667,14 @@ void FaviconHandler::OnFaviconData(const std::vector< |
| void FaviconHandler::ScheduleDownload(const GURL& image_url, |
| favicon_base::IconType icon_type) { |
| DCHECK(image_url.is_valid()); |
| + if (service_ && service_->WasUnableToDownloadFavicon(image_url)) { |
|
pkotwicz
2017/03/02 21:20:26
Won't this cause a regression? In particular if a
mastiz
2017/03/03 14:21:14
I think you're right. I tried to add tests that wo
pkotwicz
2017/03/03 18:31:16
This bug is reproduceable on the desktop for a Fav
mastiz
2017/03/03 20:37:01
This seems so unlikely that I'd rather not add tes
pkotwicz
2017/03/03 20:56:14
Fair enough
|
| + DVLOG(1) << "Skip Failed FavIcon: " << image_url; |
| + // Process the next candidate. |
| + if (IncrementCurrentCandidateIndex()) { |
| + DownloadCurrentCandidateOrAskFaviconService(); |
| + } |
| + return; |
| + } |
| // A max bitmap size is specified to avoid receiving huge bitmaps in |
| // OnDidDownloadFavicon(). See FaviconDriver::StartDownload() |
| // for more details about the max bitmap size. |