Fix FaviconHandler when it has multiple icon URLs and one of them is invalid
commit8c6d0c6cc37a13f830d3422930a5f2f96674f046
authorpkotwicz <pkotwicz@chromium.org>
Tue, 28 Apr 2015 18:50:15 +0000 (28 11:50 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 28 Apr 2015 18:51:45 +0000 (28 18:51 +0000)
tree5d62642e21bfed014b732fd6da21b1e19ff2f9c7
parent02bd8efdccb0646159c046a6ab0de5a38cbe3f62
Fix FaviconHandler when it has multiple icon URLs and one of them is invalid

This CL prevents FaviconHandler from stopping iteration over a page's icon URLs
if a download for one of the icon URLs previously returned a 404. In particular,
this CL makes FaviconHandler::ScheduleDownload() call the download callback
when FaviconDriver::StartDownload() does not start a download. This is important
because the download callback is responsible for initiating the fetch for the
data for the next favicon candidate.

Sample scenario:
  Page HTML snippet:
  <link rel="icon" href="www.google.com/nothingtoseehere.png" />
  <link rel="icon" href="www.google.com/favicon.ico" />

  A previous download for "www.google.com/nothingtoseehere.png" returned a 404
  (e.g. the user previously visited a different page which also makes use of
  www.google.com/nothingtoseehere.png)

  This CL makes FaviconHandler fetch data for "www.google.com/favicon.ico"
  despite the download for the first favicon candidate
  ("www.google.com/nothingtoseehere.png") having previously failed.

BUG=474429
TEST=FaviconHandlerTest.MultipleFavicons404,
     FaviconHandlerTest.MultipleFaviconsAll404

Review URL: https://codereview.chromium.org/1079523005

Cr-Commit-Position: refs/heads/master@{#327339}
components/favicon/core/favicon_handler.cc
components/favicon/core/favicon_handler_unittest.cc