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

Issue 1413903008: Add LargeIconCache and LargeIconServiceFactory for iOS. (Closed)

Created:
5 years, 1 month ago by justincohen
Modified:
5 years, 1 month ago
CC:
browser-components-watch_chromium.org, chromium-reviews, sdefresne+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add LargeIconCache and LargeIconServiceFactory for iOS. Also adds a secondary cache that holds on to a reference to the favicon RefCountedMemory because the LargeIconService returns icons too slowly iOS new tab page animations. BUG=543738 Committed: https://crrev.com/af62fafc5f695c806ae5696d66f78643e082dc37 Cr-Commit-Position: refs/heads/master@{#357203}

Patch Set 1 #

Total comments: 22

Patch Set 2 : Address missing files #

Patch Set 3 : Using wrong thread pool #

Total comments: 34

Patch Set 4 : Address Sylvain comments. #

Total comments: 16

Patch Set 5 : Better skia utils locations #

Patch Set 6 : broken sort #

Total comments: 14

Patch Set 7 : Address skia comments #

Patch Set 8 : Address Sylvain comments #

Patch Set 9 : Add a test #

Total comments: 1

Patch Set 10 : Fix nits for unit test #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+308 lines, -18 lines) Patch
M ios/chrome/browser/browser_state/browser_state_keyed_service_factories.mm View 1 2 3 4 5 7 2 chunks +4 lines, -0 lines 0 comments Download
A + ios/chrome/browser/favicon/ios_chrome_large_icon_cache_factory.h View 1 2 3 4 2 chunks +16 lines, -18 lines 0 comments Download
A ios/chrome/browser/favicon/ios_chrome_large_icon_cache_factory.cc View 1 2 3 4 1 chunk +41 lines, -0 lines 0 comments Download
A ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h View 1 2 3 4 5 6 7 1 chunk +52 lines, -0 lines 0 comments Download
A ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.cc View 1 2 3 4 1 chunk +52 lines, -0 lines 0 comments Download
A ios/chrome/browser/favicon/large_icon_cache.h View 1 2 3 4 5 6 7 1 chunk +55 lines, -0 lines 4 comments Download
A ios/chrome/browser/favicon/large_icon_cache.cc View 1 2 3 4 5 6 7 1 chunk +58 lines, -0 lines 2 comments Download
M ios/chrome/ios_chrome.gyp View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M skia/ext/skia_utils_ios.h View 1 2 3 4 5 6 7 2 chunks +6 lines, -0 lines 0 comments Download
M skia/ext/skia_utils_ios.mm View 1 2 3 4 5 6 1 chunk +7 lines, -0 lines 0 comments Download
M skia/ext/skia_utils_ios_unittest.mm View 1 2 3 4 5 6 7 8 9 1 chunk +11 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (6 generated)
justincohen
PTAL!
5 years, 1 month ago (2015-10-29 15:37:51 UTC) #2
sdefresne
https://codereview.chromium.org/1413903008/diff/1/ios/chrome/browser/favicon/large_icon_cache.h File ios/chrome/browser/favicon/large_icon_cache.h (right): https://codereview.chromium.org/1413903008/diff/1/ios/chrome/browser/favicon/large_icon_cache.h#newcode23 ios/chrome/browser/favicon/large_icon_cache.h:23: // Provides a cache of most recently used LargeIconResult. ...
5 years, 1 month ago (2015-10-29 16:45:25 UTC) #3
justincohen
Thanks, PTAL! https://codereview.chromium.org/1413903008/diff/1/ios/chrome/browser/favicon/large_icon_cache.h File ios/chrome/browser/favicon/large_icon_cache.h (right): https://codereview.chromium.org/1413903008/diff/1/ios/chrome/browser/favicon/large_icon_cache.h#newcode23 ios/chrome/browser/favicon/large_icon_cache.h:23: // Provides a cache of most recently ...
5 years, 1 month ago (2015-10-29 20:32:17 UTC) #4
sdefresne
Could your reword your description to not use GCL acronym (I don't know what it ...
5 years, 1 month ago (2015-10-30 09:27:19 UTC) #5
justincohen
Done, thanks for the comments. PTAL! https://codereview.chromium.org/1413903008/diff/40001/ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h File ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h (right): https://codereview.chromium.org/1413903008/diff/40001/ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h#newcode23 ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h:23: class KeyedService; On ...
5 years, 1 month ago (2015-10-30 11:59:21 UTC) #7
sdefresne
https://codereview.chromium.org/1413903008/diff/60001/ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.mm File ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.mm (right): https://codereview.chromium.org/1413903008/diff/60001/ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.mm#newcode1 ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.mm:1: // Copyright 2015 The Chromium Authors. All rights reserved. ...
5 years, 1 month ago (2015-10-30 14:19:38 UTC) #8
justincohen
+junov@ for skia changes PTAL! https://codereview.chromium.org/1413903008/diff/60001/ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.mm File ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.mm (right): https://codereview.chromium.org/1413903008/diff/60001/ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.mm#newcode1 ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.mm:1: // Copyright 2015 The ...
5 years, 1 month ago (2015-10-30 15:25:16 UTC) #10
sdefresne
lgtm with nits https://codereview.chromium.org/1413903008/diff/100001/ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h File ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h (right): https://codereview.chromium.org/1413903008/diff/100001/ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h#newcode9 ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h:9: #include "base/memory/ref_counted.h" nit: Unused :-) https://codereview.chromium.org/1413903008/diff/100001/ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h#newcode18 ...
5 years, 1 month ago (2015-10-30 17:20:15 UTC) #11
Justin Novosad
https://codereview.chromium.org/1413903008/diff/100001/skia/ext/skia_utils_ios.h File skia/ext/skia_utils_ios.h (right): https://codereview.chromium.org/1413903008/diff/100001/skia/ext/skia_utils_ios.h#newcode42 skia/ext/skia_utils_ios.h:42: SK_API UIColor* ColorFromSkColor(SkColor color, CGFloat alpha); Name: UIColorFromSkColor If ...
5 years, 1 month ago (2015-10-30 18:18:13 UTC) #12
justincohen
Done, PTAL! https://codereview.chromium.org/1413903008/diff/100001/ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h File ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h (right): https://codereview.chromium.org/1413903008/diff/100001/ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h#newcode9 ios/chrome/browser/favicon/ios_chrome_large_icon_service_factory.h:9: #include "base/memory/ref_counted.h" On 2015/10/30 17:20:14, sdefresne wrote: ...
5 years, 1 month ago (2015-10-30 19:43:24 UTC) #13
justincohen
Added a test to skia_utils_ios_unittest
5 years, 1 month ago (2015-10-30 20:17:22 UTC) #14
Justin Novosad
lgtm with nit https://codereview.chromium.org/1413903008/diff/150001/skia/ext/skia_utils_ios_unittest.mm File skia/ext/skia_utils_ios_unittest.mm (right): https://codereview.chromium.org/1413903008/diff/150001/skia/ext/skia_utils_ios_unittest.mm#newcode757 skia/ext/skia_utils_ios_unittest.mm:757: EXPECT_EQ(50, (int)(alpha * 255)); To be ...
5 years, 1 month ago (2015-10-30 20:22:05 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1413903008/170001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1413903008/170001
5 years, 1 month ago (2015-10-30 21:52:22 UTC) #18
commit-bot: I haz the power
Committed patchset #10 (id:170001)
5 years, 1 month ago (2015-10-30 22:35:34 UTC) #19
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/af62fafc5f695c806ae5696d66f78643e082dc37 Cr-Commit-Position: refs/heads/master@{#357203}
5 years, 1 month ago (2015-10-30 22:36:23 UTC) #20
noyau (Ping after 24h)
https://codereview.chromium.org/1413903008/diff/170001/ios/chrome/browser/favicon/large_icon_cache.cc File ios/chrome/browser/favicon/large_icon_cache.cc (right): https://codereview.chromium.org/1413903008/diff/170001/ios/chrome/browser/favicon/large_icon_cache.cc#newcode13 ios/chrome/browser/favicon/large_icon_cache.cc:13: const int kMaxCacheSize = 12; Do you need to ...
5 years, 1 month ago (2015-10-30 23:22:31 UTC) #22
justincohen
5 years, 1 month ago (2015-10-31 03:54:21 UTC) #23
Message was sent while issue was closed.
https://codereview.chromium.org/1413903008/diff/170001/ios/chrome/browser/fav...
File ios/chrome/browser/favicon/large_icon_cache.cc (right):

https://codereview.chromium.org/1413903008/diff/170001/ios/chrome/browser/fav...
ios/chrome/browser/favicon/large_icon_cache.cc:13: const int kMaxCacheSize = 12;
On 2015/10/30 23:22:31, noyau wrote:
> Do you need to cache 12 of them on all platforms? Should this number be
smaller
> on devices with a smaller form factor?

Right now smaller form factors still load 12 favicons.  Even if they load less,
the cache only fills up if 12 unique GURLs are loaded.

https://codereview.chromium.org/1413903008/diff/170001/ios/chrome/browser/fav...
File ios/chrome/browser/favicon/large_icon_cache.h (right):

https://codereview.chromium.org/1413903008/diff/170001/ios/chrome/browser/fav...
ios/chrome/browser/favicon/large_icon_cache.h:32: class LargeIconCache : public
KeyedService {
On 2015/10/30 23:22:31, noyau wrote:
> I would expect some tests for this class.

I will add this in a followup CL.

https://codereview.chromium.org/1413903008/diff/170001/ios/chrome/browser/fav...
ios/chrome/browser/favicon/large_icon_cache.h:50: base::OwningMRUCache<GURL,
LargeIconCacheEntry*> cache_;
On 2015/10/30 23:22:31, noyau wrote:
> You cache all those images in memory? From our experience doing tiled image on
> bookmarks, keeping the cache on disk was sufficient: The costly bits where the
> image manipulations (resizes, filters...). Once it is a bitmap of the right
size
> loading asynchronously is barely perceptible by the user.

The NTP slide-in animation needs the images loaded synchronously.  Also, it took
upwards of 200ms to load all the favicons on an iPhone 6s.

Powered by Google App Engine
This is Rietveld 408576698