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

Issue 2558393004: Refactoring: Moves image fetching and caching into CachedImageFetcher (Closed)

Created:
4 years ago by tschumann
Modified:
4 years ago
Reviewers:
Marc Treib, jkrcal
CC:
chromium-reviews, ntp-dev+reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactoring: Moves the image fetching and caching logic out of the RemoteSuggestionsProvider into a CachedImageFetcher class. There's a small functional change: After fetching an image from the network, the old version used to verify the suggestion still exist before storing it into the database. This is extremely unlikely to happen and even if it happens not as bad as we clear orphaned images on start-up. BUG= Committed: https://crrev.com/8e18ae99daecab970828838db34f8e40df344f89 Cr-Commit-Position: refs/heads/master@{#438818}

Patch Set 1 #

Total comments: 7

Patch Set 2 : comments and lint warnings (primarily missing utility include for std::move) #

Total comments: 1

Patch Set 3 : fixed indentation #

Total comments: 2

Patch Set 4 : rebase #

Patch Set 5 : extend test error message #

Unified diffs Side-by-side diffs Delta from patch set Stats (+220 lines, -149 lines) Patch
M components/ntp_snippets/remote/remote_suggestions_provider.h View 1 2 3 7 chunks +62 lines, -36 lines 0 comments Download
M components/ntp_snippets/remote/remote_suggestions_provider.cc View 1 2 3 7 chunks +114 lines, -105 lines 0 comments Download
M components/ntp_snippets/remote/remote_suggestions_provider_unittest.cc View 1 2 3 4 10 chunks +44 lines, -8 lines 0 comments Download

Messages

Total messages: 23 (8 generated)
tschumann
your last CL reminded me of a clean-up a planned some time ago :-)
4 years ago (2016-12-09 19:34:01 UTC) #2
jkrcal
Nice! Much better, thanks! lgtm / nits below. https://codereview.chromium.org/2558393004/diff/1/components/ntp_snippets/remote/remote_suggestions_provider.cc File components/ntp_snippets/remote/remote_suggestions_provider.cc (right): https://codereview.chromium.org/2558393004/diff/1/components/ntp_snippets/remote/remote_suggestions_provider.cc#newcode1021 components/ntp_snippets/remote/remote_suggestions_provider.cc:1021: GURL ...
4 years ago (2016-12-12 09:01:11 UTC) #3
Marc Treib
Nice! One more drive-by nit :) https://codereview.chromium.org/2558393004/diff/1/components/ntp_snippets/remote/remote_suggestions_provider.h File components/ntp_snippets/remote/remote_suggestions_provider.h (right): https://codereview.chromium.org/2558393004/diff/1/components/ntp_snippets/remote/remote_suggestions_provider.h#newcode428 components/ntp_snippets/remote/remote_suggestions_provider.h:428: CachedImageFetcher image_fetcher_; nit2: ...
4 years ago (2016-12-12 10:01:03 UTC) #5
tschumann
+treib: there's one question for you in the comments i'd like your input on. https://codereview.chromium.org/2558393004/diff/1/components/ntp_snippets/remote/remote_suggestions_provider.cc ...
4 years ago (2016-12-13 20:59:09 UTC) #6
jkrcal
https://codereview.chromium.org/2558393004/diff/1/components/ntp_snippets/remote/remote_suggestions_provider.h File components/ntp_snippets/remote/remote_suggestions_provider.h (right): https://codereview.chromium.org/2558393004/diff/1/components/ntp_snippets/remote/remote_suggestions_provider.h#newcode428 components/ntp_snippets/remote/remote_suggestions_provider.h:428: CachedImageFetcher image_fetcher_; On 2016/12/13 20:59:09, tschumann wrote: > On ...
4 years ago (2016-12-13 21:43:00 UTC) #7
vitaliii
On 2016/12/09 19:34:01, tschumann wrote: > your last CL reminded me of a clean-up a ...
4 years ago (2016-12-14 09:02:00 UTC) #8
Marc Treib
https://codereview.chromium.org/2558393004/diff/1/components/ntp_snippets/remote/remote_suggestions_provider.cc File components/ntp_snippets/remote/remote_suggestions_provider.cc (right): https://codereview.chromium.org/2558393004/diff/1/components/ntp_snippets/remote/remote_suggestions_provider.cc#newcode1021 components/ntp_snippets/remote/remote_suggestions_provider.cc:1021: GURL image_url = FindSnippetImageUrl(suggestion_id); On 2016/12/13 20:59:09, tschumann wrote: ...
4 years ago (2016-12-14 09:02:15 UTC) #9
tschumann
Marc, wanna LGTM or removed from reviewers? Jan, want to have another look?
4 years ago (2016-12-15 10:39:26 UTC) #10
jkrcal
Still lgtm https://codereview.chromium.org/2558393004/diff/40001/components/ntp_snippets/remote/remote_suggestions_provider_unittest.cc File components/ntp_snippets/remote/remote_suggestions_provider_unittest.cc (right): https://codereview.chromium.org/2558393004/diff/40001/components/ntp_snippets/remote/remote_suggestions_provider_unittest.cc#newcode1534 components/ntp_snippets/remote/remote_suggestions_provider_unittest.cc:1534: gfx::Image image = gfx::test::CreateImage(2, 2); A test-readability ...
4 years ago (2016-12-15 10:51:24 UTC) #11
Marc Treib
On 2016/12/15 10:39:26, tschumann wrote: > Marc, wanna LGTM or removed from reviewers? > Jan, ...
4 years ago (2016-12-15 11:01:09 UTC) #12
tschumann
https://codereview.chromium.org/2558393004/diff/40001/components/ntp_snippets/remote/remote_suggestions_provider_unittest.cc File components/ntp_snippets/remote/remote_suggestions_provider_unittest.cc (right): https://codereview.chromium.org/2558393004/diff/40001/components/ntp_snippets/remote/remote_suggestions_provider_unittest.cc#newcode1534 components/ntp_snippets/remote/remote_suggestions_provider_unittest.cc:1534: gfx::Image image = gfx::test::CreateImage(2, 2); On 2016/12/15 10:51:24, jkrcal ...
4 years ago (2016-12-15 11:58:08 UTC) #13
jkrcal
Now it makes sense to me, thanks!
4 years ago (2016-12-15 12:31:43 UTC) #14
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/2558393004/80001
4 years ago (2016-12-15 12:55:13 UTC) #18
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years ago (2016-12-15 13:36:04 UTC) #21
commit-bot: I haz the power
4 years ago (2016-12-15 13:38:11 UTC) #23
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/8e18ae99daecab970828838db34f8e40df344f89
Cr-Commit-Position: refs/heads/master@{#438818}

Powered by Google App Engine
This is Rietveld 408576698