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

Issue 14322023: Don't request missing favicon on every page request. (Closed)

Created:
7 years, 7 months ago by mef
Modified:
7 years, 7 months ago
CC:
chromium-reviews, browser-components-watch_chromium.org, cbentzel
Visibility:
Public.

Description

Don't request missing favicon on every page request. Mark Favicon as 'Unable to Download' if server returns HTTP status 404 and don't try to download it again until user closes the browser or clicks 'Shift-Reload' (RELOAD_IGNORING_CACHE). Firefox 20 and IE 10 don't request missing favicon.ico on every page request. Propagated HTTP Status Code from MultiResolutionImageResourceFetcher all the way up to FaviconTabHelper, which required extension of 3 interfaces. BUG=39402 TEST=FaviconHandlerTest.UnableToDownloadFavicon Reviewers: sky@chromium.org - Overall CL, chrome/browser/*, content/browser/* palmer@chromium.org - content/common/image_messages.h joi@chromium.org - content/public/browser/web_contents.h jamesr@chromium.org - content/renderer/*, webkit/glue/* mnaganov@chromium.org - android_webview/browser/icon_helper.* Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=200194

Patch Set 1 #

Patch Set 2 : fix lint errors #

Total comments: 12

Patch Set 3 : Addressed codereview comments, fixed crash in Incognito mode. #

Total comments: 2

Patch Set 4 : Propagate HTTP Status Code to FaviconTabHelper::DidDownloadFavicon, Clear Missing Favicons on RELOA… #

Total comments: 18

Patch Set 5 : Address code review comments #

Patch Set 6 : Fixed compilation errors on windows #

Patch Set 7 : Added TEST_F(FaviconHandlerTest, UnableToDownloadFavicon) #

Total comments: 5

Patch Set 8 : Address code review comments. #

Patch Set 9 : Fixed punctuation in comments. #

Total comments: 4

Patch Set 10 : Sync up to r199791 #

Patch Set 11 : Fix Android and CROS compilation errors. #

Patch Set 12 : sync up to r199996 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+175 lines, -17 lines) Patch
M android_webview/browser/icon_helper.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -2 lines 0 comments Download
M android_webview/browser/icon_helper.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/favicon/favicon_handler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +84 lines, -0 lines 0 comments Download
M chrome/browser/favicon/favicon_service.h View 1 2 3 4 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/favicon/favicon_service.cc View 1 2 3 4 5 6 7 8 9 3 chunks +16 lines, -0 lines 0 comments Download
M chrome/browser/favicon/favicon_tab_helper.h View 1 2 3 4 5 6 2 chunks +8 lines, -7 lines 0 comments Download
M chrome/browser/favicon/favicon_tab_helper.cc View 1 2 3 4 3 chunks +21 lines, -1 line 0 comments Download
M chrome/browser/notifications/message_center_notification_manager.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/notifications/message_center_notification_manager.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/ash/launcher/launcher_favicon_loader.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/ui/extensions/shell_window.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/extensions/shell_window.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/metro_pin_tab_helper_win.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/metro_pin_tab_helper_win.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/create_application_shortcut_view.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/create_application_shortcut_view.cc View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/web_applications/web_app_ui.cc View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_impl.cc View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -1 line 0 comments Download
M content/common/image_messages.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M content/public/browser/web_contents.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/fetchers/multi_resolution_image_resource_fetcher.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +6 lines, -0 lines 0 comments Download
M content/renderer/fetchers/multi_resolution_image_resource_fetcher.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +8 lines, -4 lines 0 comments Download
M content/renderer/image_loading_helper.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 29 (0 generated)
mef
Paul, could you take a look? I've crafted a rough fix for favicon bug assigned ...
7 years, 7 months ago (2013-04-29 21:55:03 UTC) #1
pauljensen
How did you come to conclude this was the right solution? I scanned through the ...
7 years, 7 months ago (2013-04-30 14:38:04 UTC) #2
cbentzel
I took an initial look at other browsers and noticed that favicon requests were not ...
7 years, 7 months ago (2013-04-30 14:48:12 UTC) #3
mef
Hi Steven, I've recently joined the Chrome team and I'm working on the fix for ...
7 years, 7 months ago (2013-04-30 21:57:03 UTC) #4
stevenjb
It is not entirely clear to me that this is desired behavior; I suspect that ...
7 years, 7 months ago (2013-04-30 22:30:38 UTC) #5
sky
I agree with Thakis' comment 3, this should be a WontFix. Maybe I'm missing something? ...
7 years, 7 months ago (2013-05-01 00:39:57 UTC) #6
cbentzel
See my comments 24-26 on the bug. The primary goal is to stay compatible with ...
7 years, 7 months ago (2013-05-01 00:48:22 UTC) #7
sky
Ah, ok. I didn't make it that far down the bug. I'll take a look ...
7 years, 7 months ago (2013-05-01 13:57:23 UTC) #8
sky
https://codereview.chromium.org/14322023/diff/11001/chrome/browser/favicon/favicon_tab_helper.cc File chrome/browser/favicon/favicon_tab_helper.cc (right): https://codereview.chromium.org/14322023/diff/11001/chrome/browser/favicon/favicon_tab_helper.cc#newcode193 chrome/browser/favicon/favicon_tab_helper.cc:193: if (bitmaps.size() == 0) { Under what circumstances should ...
7 years, 7 months ago (2013-05-01 14:00:07 UTC) #9
mef
Scott, I've tried with Firefox 20 and IE 10 and they both don't request missing ...
7 years, 7 months ago (2013-05-01 15:20:15 UTC) #10
sky
Chris's comments indicated we should only do this for a 404. Is it not possible ...
7 years, 7 months ago (2013-05-01 16:17:51 UTC) #11
mef
FWIW I've looked at Firefox source and their nsIFaviconService class keeps in-memory cache (mFailedFavicons) of ...
7 years, 7 months ago (2013-05-01 16:24:15 UTC) #12
mef
The highest-level method that is aware of http response code is MultiResolutionImageResourceFetcher::OnURLFetchComplete, but unfortunately it ...
7 years, 7 months ago (2013-05-01 16:52:52 UTC) #13
sky
IMO it's worth only caching if get 404. Additionally a shift-reload, or whatever, should trigger ...
7 years, 7 months ago (2013-05-01 20:51:43 UTC) #14
mef
Hi Scott, PTAL. I've propagated HTTP Status Code from MultiResolutionImageResourceFetcher all the way up to ...
7 years, 7 months ago (2013-05-03 17:51:49 UTC) #15
sky
You're going to need more owners too (for webkit and content/public). https://codereview.chromium.org/14322023/diff/28001/chrome/browser/favicon/favicon_service.cc File chrome/browser/favicon/favicon_service.cc (right): ...
7 years, 7 months ago (2013-05-03 20:24:53 UTC) #16
mef
Hi Scott, thanks a lot for your comments! PTAL, I've addressed them. Should I reach ...
7 years, 7 months ago (2013-05-03 21:45:59 UTC) #17
sky
I think this looks fine, can you add test coverage?
7 years, 7 months ago (2013-05-03 22:49:16 UTC) #18
mef
Hi Scott, thanks again for your reviews! I've added a TEST_F(FaviconHandlerTest, UnableToDownloadFavicon). I didn't find ...
7 years, 7 months ago (2013-05-08 20:20:01 UTC) #19
sky
https://codereview.chromium.org/14322023/diff/60001/chrome/browser/favicon/favicon_handler_unittest.cc File chrome/browser/favicon/favicon_handler_unittest.cc (right): https://codereview.chromium.org/14322023/diff/60001/chrome/browser/favicon/favicon_handler_unittest.cc#newcode1029 chrome/browser/favicon/favicon_handler_unittest.cc:1029: TEST_F(FaviconHandlerTest, UnableToDownloadFavicon) { Add a description of what this ...
7 years, 7 months ago (2013-05-09 14:49:47 UTC) #20
mef
Hi Scott, PTAL. I've also added OWNERS to review their respective areas. thanks, -m https://codereview.chromium.org/14322023/diff/60001/chrome/browser/favicon/favicon_handler_unittest.cc ...
7 years, 7 months ago (2013-05-09 16:24:24 UTC) #21
sky
LGTM
7 years, 7 months ago (2013-05-09 16:25:09 UTC) #22
Jói
LGTM for content/public.
7 years, 7 months ago (2013-05-09 17:06:42 UTC) #23
jamesr
webkit/ and content/renderer/ lgtm
7 years, 7 months ago (2013-05-10 04:57:58 UTC) #24
palmer
IPC security LGTM. https://codereview.chromium.org/14322023/diff/74001/chrome/browser/favicon/favicon_service.cc File chrome/browser/favicon/favicon_service.cc (right): https://codereview.chromium.org/14322023/diff/74001/chrome/browser/favicon/favicon_service.cc#newcode264 chrome/browser/favicon/favicon_service.cc:264: MissingFaviconURLHash url_hash = base::Hash(icon_url.spec()); I don't ...
7 years, 7 months ago (2013-05-13 17:22:46 UTC) #25
mef
Hi, sorry for the spam. I've fixed errors on android and cros and that forced ...
7 years, 7 months ago (2013-05-14 18:47:08 UTC) #26
mnaganov (inactive)
android_webview LGTM
7 years, 7 months ago (2013-05-14 19:59:32 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mef@chromium.org/14322023/99001
7 years, 7 months ago (2013-05-14 20:29:17 UTC) #28
commit-bot: I haz the power
7 years, 7 months ago (2013-05-15 08:37:50 UTC) #29
Message was sent while issue was closed.
Change committed as 200194

Powered by Google App Engine
This is Rietveld 408576698