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

Issue 996253002: [Fallback Icons] Refactor FallbackIconService to be a BrowserContext-level singleton (Closed)

Created:
5 years, 9 months ago by huangs
Modified:
5 years, 9 months ago
CC:
chromium-reviews, dbeam+watch-ntp_chromium.org, skanuj+watch_chromium.org, melevin+watch_chromium.org, dhollowa+watch_chromium.org, dougw+watch_chromium.org, donnd+watch_chromium.org, browser-components-watch_chromium.org, jfweitz+watch_chromium.org, David Black, samarth+watch_chromium.org, estade+watch_chromium.org, kmadhusu+watch_chromium.org, Jered, pedrosimonetti+watch_chromium.org, beaudoin, sdefresne
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Fallback Icons] Refactor FallbackIconService to be a BrowserContext-level singleton - FallbackIconServiceFactory now get sFallbackIconService singleton from BrowserContext. - FallbackIconClient & ChromeFallbackIconClient: wrap external code so the Favicon component won't have to include them. Specifically: - Choosing fonts: also removed duplicate code. - Extracting letter from URL to render Fallback. BUG=455063 Committed: https://crrev.com/f16444b34b44d6e9de555756e24017ff7670d73a Cr-Commit-Position: refs/heads/master@{#322653}

Patch Set 1 #

Total comments: 5

Patch Set 2 : Cleanups, and passing FallbackIconClient to FallbackIconSource. #

Patch Set 3 : Sync and reverting small unneeded change. #

Total comments: 16

Patch Set 4 : Making FallbackIconSource take FallbackIconService directly. #

Total comments: 14

Patch Set 5 : Sync, merge, and cleanup #

Patch Set 6 : Attempt to fix test problems. #

Patch Set 7 : Fixing by null checks instead. #

Patch Set 8 : Sync and merge. #

Total comments: 16

Patch Set 9 : Cleanup; moving defensive code into FallbackIconSource and LargeIconSource. #

Total comments: 20

Patch Set 10 : Comment fix; removing usage of Profile in factories. #

Total comments: 6

Patch Set 11 : Comment fixes; remove useless code. #

Total comments: 6

Patch Set 12 : Removing FallbackIconSource::SendNotFoundResponse(). #

Unified diffs Side-by-side diffs Delta from patch set Stats (+324 lines, -149 lines) Patch
M chrome/browser/favicon/DEPS View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A chrome/browser/favicon/chrome_fallback_icon_client.h View 1 2 3 4 5 6 7 1 chunk +34 lines, -0 lines 0 comments Download
A chrome/browser/favicon/chrome_fallback_icon_client.cc View 1 2 3 4 5 6 7 8 9 1 chunk +41 lines, -0 lines 0 comments Download
A + chrome/browser/favicon/chrome_fallback_icon_client_factory.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +21 lines, -22 lines 0 comments Download
A + chrome/browser/favicon/chrome_fallback_icon_client_factory.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +16 lines, -12 lines 0 comments Download
A + chrome/browser/favicon/fallback_icon_service_factory.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +20 lines, -13 lines 0 comments Download
A + chrome/browser/favicon/fallback_icon_service_factory.cc View 1 2 3 4 5 6 7 8 9 1 chunk +23 lines, -21 lines 0 comments Download
M chrome/browser/favicon/favicon_service_factory.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/search/instant_service.cc View 1 2 3 4 5 6 7 8 9 3 chunks +14 lines, -2 lines 0 comments Download
M chrome/browser/ui/webui/fallback_icon_source.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +18 lines, -3 lines 0 comments Download
M chrome/browser/ui/webui/fallback_icon_source.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +24 lines, -19 lines 0 comments Download
M chrome/browser/ui/webui/large_icon_source.h View 1 2 3 4 5 6 7 8 3 chunks +11 lines, -5 lines 0 comments Download
M chrome/browser/ui/webui/large_icon_source.cc View 1 2 3 4 5 6 7 8 9 5 chunks +16 lines, -23 lines 0 comments Download
M chrome/browser/ui/webui/ntp/most_visited_handler.cc View 1 2 3 4 5 6 7 8 9 3 chunks +14 lines, -4 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/test/base/testing_profile.h View 1 2 3 4 5 6 7 8 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/test/base/testing_profile.cc View 1 2 3 4 5 6 7 8 9 4 chunks +14 lines, -0 lines 0 comments Download
M components/favicon.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M components/favicon/core/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M components/favicon/core/DEPS View 1 2 3 4 5 6 7 1 chunk +0 lines, -1 line 0 comments Download
A components/favicon/core/fallback_icon_client.h View 1 2 3 4 5 6 7 8 9 1 chunk +30 lines, -0 lines 0 comments Download
M components/favicon/core/fallback_icon_service.h View 1 2 3 4 5 6 7 3 chunks +6 lines, -5 lines 0 comments Download
M components/favicon/core/fallback_icon_service.cc View 1 2 3 4 5 6 7 8 9 3 chunks +7 lines, -18 lines 0 comments Download

Messages

Total messages: 43 (8 generated)
sdefresne
drive-by-comments, hope you don't mind ... https://codereview.chromium.org/996253002/diff/1/components/favicon/core/browser/fallback_icon_client.h File components/favicon/core/browser/fallback_icon_client.h (right): https://codereview.chromium.org/996253002/diff/1/components/favicon/core/browser/fallback_icon_client.h#newcode21 components/favicon/core/browser/fallback_icon_client.h:21: ~FallbackIconClient() override{}; nit: ...
5 years, 9 months ago (2015-03-11 16:22:06 UTC) #2
huangs
Thanks. Updated with some refactoring. https://codereview.chromium.org/996253002/diff/1/components/favicon/core/browser/fallback_icon_client.h File components/favicon/core/browser/fallback_icon_client.h (right): https://codereview.chromium.org/996253002/diff/1/components/favicon/core/browser/fallback_icon_client.h#newcode21 components/favicon/core/browser/fallback_icon_client.h:21: ~FallbackIconClient() override{}; Done. This ...
5 years, 9 months ago (2015-03-11 18:00:25 UTC) #3
sdefresne
https://codereview.chromium.org/996253002/diff/1/components/favicon/core/browser/fallback_icon_client.h File components/favicon/core/browser/fallback_icon_client.h (right): https://codereview.chromium.org/996253002/diff/1/components/favicon/core/browser/fallback_icon_client.h#newcode21 components/favicon/core/browser/fallback_icon_client.h:21: ~FallbackIconClient() override{}; On 2015/03/11 18:00:25, huangs wrote: > Done. ...
5 years, 9 months ago (2015-03-11 18:06:20 UTC) #4
huangs
Waiting on crrev.com/983043003 and may to merge , but advanced reviewing would be appreciated.
5 years, 9 months ago (2015-03-14 02:00:09 UTC) #5
sdefresne
https://codereview.chromium.org/996253002/diff/40001/chrome/browser/favicon/chrome_fallback_icon_client.cc File chrome/browser/favicon/chrome_fallback_icon_client.cc (right): https://codereview.chromium.org/996253002/diff/40001/chrome/browser/favicon/chrome_fallback_icon_client.cc#newcode27 chrome/browser/favicon/chrome_fallback_icon_client.cc:27: return FallbackIconServiceFactory::GetForProfile( As I'll say later, please remove this ...
5 years, 9 months ago (2015-03-16 09:11:29 UTC) #6
huangs
Updated, PTAL. Also, I'm wondering I should move fallback_icon_service.* to where favicon_service.* is? Thanks. https://codereview.chromium.org/996253002/diff/40001/chrome/browser/favicon/chrome_fallback_icon_client.cc ...
5 years, 9 months ago (2015-03-16 22:06:11 UTC) #7
sdefresne
https://codereview.chromium.org/996253002/diff/60001/chrome/browser/favicon/chrome_fallback_icon_client.h File chrome/browser/favicon/chrome_fallback_icon_client.h (right): https://codereview.chromium.org/996253002/diff/60001/chrome/browser/favicon/chrome_fallback_icon_client.h#newcode22 chrome/browser/favicon/chrome_fallback_icon_client.h:22: // ChromeFallbackIconClient implements the the FallbackIconClient interface. nit: s/the ...
5 years, 9 months ago (2015-03-17 09:41:52 UTC) #8
huangs
sdefresne@: Merged with your cleanup CL crrev.com/983043003 , and included my recent addition of LargeIcon ...
5 years, 9 months ago (2015-03-23 03:28:35 UTC) #9
huangs
sdefresne@: PTAL. Thanks!
5 years, 9 months ago (2015-03-24 05:11:06 UTC) #10
chromium-reviews
I'm OOO this week and won't be able to give a look before next Monday. ...
5 years, 9 months ago (2015-03-24 10:49:13 UTC) #11
huangs
On 2015/03/24 10:49:13, chromium-reviews wrote: > I'm OOO this week and won't be able to ...
5 years, 9 months ago (2015-03-24 12:46:47 UTC) #12
huangs
Pulled movement of FallbackIconService to https://crrev.com/1032683002/. Requesting review from sky@, PTAL
5 years, 9 months ago (2015-03-25 21:56:39 UTC) #14
sky
On 2015/03/25 21:56:39, huangs wrote: > Pulled movement of FallbackIconService to https://crrev.com/1032683002/. > > Requesting ...
5 years, 9 months ago (2015-03-25 23:19:36 UTC) #15
huangs
On 2015/03/25 23:19:36, sky wrote: > On 2015/03/25 21:56:39, huangs wrote: > > Pulled movement ...
5 years, 9 months ago (2015-03-26 00:49:13 UTC) #16
huangs
Breaking the CL seems rather counter-productive at this point. I'll invite more reviewers. sky@: components\favicon.gypi ...
5 years, 9 months ago (2015-03-26 03:30:25 UTC) #18
huangs
Also +rsleevi@ for DEPS change: moving "+net/base/registry_controlled_domains/registry_controlled_domain.h" from components/favicon/core/DEPS to chrome/browser/favicon.
5 years, 9 months ago (2015-03-26 03:35:29 UTC) #20
Jay Civelli
https://chromiumcodereview.appspot.com/996253002/diff/140001/chrome/test/base/testing_profile.h File chrome/test/base/testing_profile.h (right): https://chromiumcodereview.appspot.com/996253002/diff/140001/chrome/test/base/testing_profile.h#newcode10 chrome/test/base/testing_profile.h:10: #include <vector> Do you need these includes? https://chromiumcodereview.appspot.com/996253002/diff/140001/chrome/test/base/testing_profile.h#newcode170 chrome/test/base/testing_profile.h:170: ...
5 years, 9 months ago (2015-03-26 05:14:56 UTC) #21
beaudoin
Drive-by LGTM with a couple of nits. Nice clean-up! Thanks! https://chromiumcodereview.appspot.com/996253002/diff/140001/chrome/browser/favicon/chrome_fallback_icon_client.cc File chrome/browser/favicon/chrome_fallback_icon_client.cc (right): https://chromiumcodereview.appspot.com/996253002/diff/140001/chrome/browser/favicon/chrome_fallback_icon_client.cc#newcode38 ...
5 years, 9 months ago (2015-03-26 12:53:55 UTC) #23
sky
components LGTM https://chromiumcodereview.appspot.com/996253002/diff/140001/components/favicon/core/fallback_icon_client.h File components/favicon/core/fallback_icon_client.h (right): https://chromiumcodereview.appspot.com/996253002/diff/140001/components/favicon/core/fallback_icon_client.h#newcode24 components/favicon/core/fallback_icon_client.h:24: ~FallbackIconClient() override {} Make this protected so ...
5 years, 9 months ago (2015-03-26 14:09:37 UTC) #24
huangs
Updated, PTAL. https://chromiumcodereview.appspot.com/996253002/diff/140001/chrome/browser/favicon/chrome_fallback_icon_client.cc File chrome/browser/favicon/chrome_fallback_icon_client.cc (right): https://chromiumcodereview.appspot.com/996253002/diff/140001/chrome/browser/favicon/chrome_fallback_icon_client.cc#newcode38 chrome/browser/favicon/chrome_fallback_icon_client.cc:38: url, net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); On 2015/03/26 12:53:55, beaudoin wrote: ...
5 years, 9 months ago (2015-03-26 18:26:07 UTC) #25
Ryan Sleevi
DEP LGTM
5 years, 9 months ago (2015-03-26 18:36:01 UTC) #26
huangs
Thanks! Ping pkotwicz@, samarth@, and dbeam@, PTAL.
5 years, 9 months ago (2015-03-26 19:12:42 UTC) #27
pkotwicz
Just nits https://codereview.chromium.org/996253002/diff/160001/chrome/browser/favicon/chrome_fallback_icon_client.cc File chrome/browser/favicon/chrome_fallback_icon_client.cc (right): https://codereview.chromium.org/996253002/diff/160001/chrome/browser/favicon/chrome_fallback_icon_client.cc#newcode34 chrome/browser/favicon/chrome_fallback_icon_client.cc:34: // TODO(huangs): Handle non-ASCII ("xn--") domain names. ...
5 years, 9 months ago (2015-03-27 03:52:09 UTC) #28
huangs
PTAL, did a bit more cleanup, and 25% similarity match so branched files don't look ...
5 years, 9 months ago (2015-03-27 17:33:07 UTC) #29
pkotwicz
LGTM with nits https://codereview.chromium.org/996253002/diff/180001/chrome/browser/favicon/chrome_fallback_icon_client_factory.h File chrome/browser/favicon/chrome_fallback_icon_client_factory.h (right): https://codereview.chromium.org/996253002/diff/180001/chrome/browser/favicon/chrome_fallback_icon_client_factory.h#newcode39 chrome/browser/favicon/chrome_fallback_icon_client_factory.h:39: content::BrowserContext* /* context */) const override; ...
5 years, 9 months ago (2015-03-27 18:47:58 UTC) #30
pkotwicz
https://codereview.chromium.org/996253002/diff/180001/chrome/browser/favicon/chrome_fallback_icon_client_factory.cc File chrome/browser/favicon/chrome_fallback_icon_client_factory.cc (right): https://codereview.chromium.org/996253002/diff/180001/chrome/browser/favicon/chrome_fallback_icon_client_factory.cc#newcode43 chrome/browser/favicon/chrome_fallback_icon_client_factory.cc:43: return chrome::GetBrowserContextRedirectedInIncognito(context); Nit: Remove this method. The factories for ...
5 years, 9 months ago (2015-03-27 18:52:31 UTC) #31
huangs
Thanks! Updated. https://chromiumcodereview.appspot.com/996253002/diff/180001/chrome/browser/favicon/chrome_fallback_icon_client_factory.cc File chrome/browser/favicon/chrome_fallback_icon_client_factory.cc (right): https://chromiumcodereview.appspot.com/996253002/diff/180001/chrome/browser/favicon/chrome_fallback_icon_client_factory.cc#newcode43 chrome/browser/favicon/chrome_fallback_icon_client_factory.cc:43: return chrome::GetBrowserContextRedirectedInIncognito(context); On 2015/03/27 18:52:31, pkotwicz wrote: ...
5 years, 9 months ago (2015-03-27 19:01:51 UTC) #33
huangs
Ping smarth@ and dbeam@ for remaining OWNER reviews: samarth@: chrome\browser\search\instant_service.cc dbeam@: chrome\browser\ui\webui\fallback_icon_source.cc chrome\browser\ui\webui\fallback_icon_source.h chrome\browser\ui\webui\large_icon_source.cc chrome\browser\ui\webui\large_icon_source.h ...
5 years, 9 months ago (2015-03-27 19:02:37 UTC) #34
Dan Beam
lgtm w/nits https://chromiumcodereview.appspot.com/996253002/diff/220001/chrome/browser/ui/webui/fallback_icon_source.cc File chrome/browser/ui/webui/fallback_icon_source.cc (right): https://chromiumcodereview.appspot.com/996253002/diff/220001/chrome/browser/ui/webui/fallback_icon_source.cc#newcode77 chrome/browser/ui/webui/fallback_icon_source.cc:77: if (!fallback_icon_service_) { maybe document when this ...
5 years, 9 months ago (2015-03-27 19:21:38 UTC) #35
huangs
Updated. https://chromiumcodereview.appspot.com/996253002/diff/220001/chrome/browser/ui/webui/fallback_icon_source.cc File chrome/browser/ui/webui/fallback_icon_source.cc (right): https://chromiumcodereview.appspot.com/996253002/diff/220001/chrome/browser/ui/webui/fallback_icon_source.cc#newcode77 chrome/browser/ui/webui/fallback_icon_source.cc:77: if (!fallback_icon_service_) { On 2015/03/27 19:21:38, Dan Beam ...
5 years, 9 months ago (2015-03-27 20:09:30 UTC) #36
samarth
lgtm
5 years, 9 months ago (2015-03-27 20:18:03 UTC) #37
huangs
Thanks everyone! Will commit soon.
5 years, 9 months ago (2015-03-27 20:19:55 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/996253002/240001
5 years, 9 months ago (2015-03-27 20:34:26 UTC) #41
commit-bot: I haz the power
Committed patchset #12 (id:240001)
5 years, 9 months ago (2015-03-27 21:59:27 UTC) #42
commit-bot: I haz the power
5 years, 9 months ago (2015-03-27 22:00:22 UTC) #43
Message was sent while issue was closed.
Patchset 12 (id:??) landed as
https://crrev.com/f16444b34b44d6e9de555756e24017ff7670d73a
Cr-Commit-Position: refs/heads/master@{#322653}

Powered by Google App Engine
This is Rietveld 408576698