Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Issue 2659633002: [Popular Sites] Fix loading latency noticeable on iOS (again) (Closed)

Created:
3 years, 11 months ago by mastiz
Modified:
3 years, 10 months ago
CC:
chromium-reviews, noyau+watch_chromium.org, ntp-dev+reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Popular Sites] Fix loading latency noticeable on iOS (again) Cached Popular Sites are now read synchronously (via tiles()) instead of waiting for the callback. The callback is expected to be almost immediate, but it turns out that the latency is easily noticeable on iOS. Since we have cached and parsed JSON, the list of sites can be built before returning from StartFetch (now renamed to MaybeStartFetch()) and hence MostVisitedSites is able to expose PopularSites in its first notification to observers. The fix has been verified on an iOS device. BUG=662397 Review-Url: https://codereview.chromium.org/2659633002 Cr-Commit-Position: refs/heads/master@{#446736} Committed: https://chromium.googlesource.com/chromium/src/+/fd2c7ab348ff8ec60fe8609410da9cc02a769402

Patch Set 1 #

Total comments: 4

Patch Set 2 : Rename to MaybeStartFetch. #

Patch Set 3 : Rename to MaybeStartFetch. #

Patch Set 4 : Minor fixes. #

Patch Set 5 : Addressed comments. #

Total comments: 15

Patch Set 6 : Fix tests. #

Total comments: 4

Patch Set 7 : Use nullopt. #

Patch Set 8 : Improve comment. #

Patch Set 9 : Revert usage of MockCallback. #

Total comments: 4

Patch Set 10 : Rebased. #

Patch Set 11 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+121 lines, -129 lines) Patch
M components/ntp_tiles/most_visited_sites.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M components/ntp_tiles/most_visited_sites.cc View 1 2 3 4 5 2 chunks +3 lines, -3 lines 0 comments Download
M components/ntp_tiles/most_visited_sites_unittest.cc View 1 2 3 4 5 6 7 8 6 chunks +19 lines, -40 lines 0 comments Download
M components/ntp_tiles/popular_sites.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +10 lines, -7 lines 0 comments Download
M components/ntp_tiles/popular_sites_impl.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +3 lines, -4 lines 0 comments Download
M components/ntp_tiles/popular_sites_impl.cc View 1 2 3 4 5 6 7 8 9 10 7 chunks +33 lines, -37 lines 0 comments Download
M components/ntp_tiles/popular_sites_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 14 chunks +47 lines, -27 lines 0 comments Download
M components/ntp_tiles/webui/popular_sites_internals_message_handler.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M components/ntp_tiles/webui/popular_sites_internals_message_handler.cc View 1 2 3 3 chunks +4 lines, -9 lines 0 comments Download

Messages

Total messages: 31 (18 generated)
mastiz
3 years, 11 months ago (2017-01-26 16:36:58 UTC) #3
Marc Treib
drive-by comments :) https://codereview.chromium.org/2659633002/diff/1/components/ntp_tiles/popular_sites.h File components/ntp_tiles/popular_sites.h (right): https://codereview.chromium.org/2659633002/diff/1/components/ntp_tiles/popular_sites.h#newcode56 components/ntp_tiles/popular_sites.h:56: virtual void StartFetch(bool force_download, MaybeStartFetch, per ...
3 years, 11 months ago (2017-01-26 16:42:05 UTC) #5
mastiz
PTAL treib@ (since sfiera@ is OOO today). https://codereview.chromium.org/2659633002/diff/1/components/ntp_tiles/popular_sites.h File components/ntp_tiles/popular_sites.h (right): https://codereview.chromium.org/2659633002/diff/1/components/ntp_tiles/popular_sites.h#newcode56 components/ntp_tiles/popular_sites.h:56: virtual void ...
3 years, 11 months ago (2017-01-27 08:57:19 UTC) #6
Marc Treib
Looks like you accidentally uploaded some sort of temp file? https://codereview.chromium.org/2659633002/diff/80001/components/ntp_tiles/most_visited_sites.cc File components/ntp_tiles/most_visited_sites.cc (right): https://codereview.chromium.org/2659633002/diff/80001/components/ntp_tiles/most_visited_sites.cc#newcode92 ...
3 years, 11 months ago (2017-01-27 09:25:21 UTC) #9
mastiz
PTAL! https://codereview.chromium.org/2659633002/diff/80001/components/ntp_tiles/most_visited_sites.cc File components/ntp_tiles/most_visited_sites.cc (right): https://codereview.chromium.org/2659633002/diff/80001/components/ntp_tiles/most_visited_sites.cc#newcode92 components/ntp_tiles/most_visited_sites.cc:92: false, base::Bind(&MostVisitedSites::OnPopularSitesAvailable, On 2017/01/27 09:25:21, Marc Treib wrote: ...
3 years, 10 months ago (2017-01-27 13:26:37 UTC) #12
Marc Treib
lgtm Thanks! https://codereview.chromium.org/2659633002/diff/80001/components/ntp_tiles/most_visited_sites_unittest.cc File components/ntp_tiles/most_visited_sites_unittest.cc (right): https://codereview.chromium.org/2659633002/diff/80001/components/ntp_tiles/most_visited_sites_unittest.cc#newcode362 components/ntp_tiles/most_visited_sites_unittest.cc:362: if (IsPopularSitesEnabledViaFinch()) { On 2017/01/27 13:26:36, mastiz ...
3 years, 10 months ago (2017-01-27 14:04:26 UTC) #13
mastiz
https://codereview.chromium.org/2659633002/diff/100001/components/ntp_tiles/popular_sites_impl_unittest.cc File components/ntp_tiles/popular_sites_impl_unittest.cc (right): https://codereview.chromium.org/2659633002/diff/100001/components/ntp_tiles/popular_sites_impl_unittest.cc#newcode132 components/ntp_tiles/popular_sites_impl_unittest.cc:132: base::RunLoop().RunUntilIdle(); On 2017/01/27 14:04:26, Marc Treib wrote: > Hah, ...
3 years, 10 months ago (2017-01-27 15:02:29 UTC) #14
mastiz
Adding bauerb@ since he reviewed the earlier patch and pointed out that RunUntilIdle() should be ...
3 years, 10 months ago (2017-01-27 15:05:22 UTC) #16
mastiz
FYI: I reverted one small part of the patch to avoid one occurrence of RunUntilIdle().
3 years, 10 months ago (2017-01-27 15:17:05 UTC) #17
Bernhard Bauer
https://codereview.chromium.org/2659633002/diff/160001/components/ntp_tiles/popular_sites.h File components/ntp_tiles/popular_sites.h (right): https://codereview.chromium.org/2659633002/diff/160001/components/ntp_tiles/popular_sites.h#newcode61 components/ntp_tiles/popular_sites.h:61: virtual void MaybeStartFetch(bool force_download, Honestly, I would just return ...
3 years, 10 months ago (2017-01-27 16:27:31 UTC) #18
mastiz
I'll land after a grace period for the sake of having the fix asap: if ...
3 years, 10 months ago (2017-01-27 16:40:29 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2659633002/150010
3 years, 10 months ago (2017-01-27 19:26:56 UTC) #28
commit-bot: I haz the power
3 years, 10 months ago (2017-01-27 19:35:40 UTC) #31

Powered by Google App Engine
This is Rietveld 408576698