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

Issue 2355393002: New snippets now replace old snippets and do not merge (Closed)

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

Description

New snippets now replace old snippets and do not merge Previously, the provider of remote content suggestions used a complicated logic to merge suggestions across fetches and to expire them. After this CL, - new (non-empty) list of suggestions for a category always replaces the previous content of the category, - we never expire current suggestions, only dismissed suggestions are removed after expiry date (we do not need a timer, this can happen before we use dismissed suggestions for filtering newly fetched suggestions), - we keep an archive of older suggestions in memory to support previously opened NTPs (these are never stored to DB and thus cleared upon restart; we trim the list after 200 suggestions to address users that never close Chrome). This CL does not deal with clearing orphaned suggestion thumbnails from the DB which is necessary for the current design. This is left for a follow-up CL. As additional technical steps: - The suggestions->category map was removed from the ContentSuggestionService. This blocked image fetching queries for archived suggestions to get to the provider (as the service does not know about the archive). We now rely on the category being encoded into the suggestion_id string. To this end the CL moved the functions that build and parse suggestion_id strings into CategoryFactory to be accessible both from the service and the providers. BUG=649009 Committed: https://crrev.com/928ed3fef6431a8815e32bb2d905fc3bd21f5024 Cr-Commit-Position: refs/heads/master@{#420677}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Minor polish #

Total comments: 44

Patch Set 3 : Marc's comments #

Total comments: 16

Patch Set 4 : Rebase #

Patch Set 5 : Marc's comments #2 #

Total comments: 4

Patch Set 6 : Marc's comments #3 #

Patch Set 7 : Rebase #

Patch Set 8 : Unittest fix #

Total comments: 6

Patch Set 9 : Marc's comments + further changes to make unittests happy #

Total comments: 4

Patch Set 10 : Marc's comments #5 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+388 lines, -273 lines) Patch
M components/ntp_snippets/category_factory.h View 1 2 3 4 2 chunks +18 lines, -0 lines 0 comments Download
M components/ntp_snippets/category_factory.cc View 2 chunks +35 lines, -0 lines 0 comments Download
M components/ntp_snippets/content_suggestions_provider.cc View 2 chunks +3 lines, -22 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service.h View 2 chunks +2 lines, -8 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service.cc View 1 2 3 8 chunks +3 lines, -33 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service_unittest.cc View 1 2 3 4 5 6 7 8 14 chunks +67 lines, -45 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_database.h View 1 2 3 chunks +5 lines, -2 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_database.cc View 3 chunks +9 lines, -3 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_database_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +33 lines, -1 line 0 comments Download
M components/ntp_snippets/ntp_snippets_service.h View 1 2 3 4 5 6 7 8 9 chunks +35 lines, -12 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_service.cc View 1 2 3 4 5 6 19 chunks +155 lines, -118 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_service_unittest.cc View 1 2 3 4 5 6 7 8 9 3 chunks +23 lines, -29 lines 0 comments Download

Messages

Total messages: 41 (22 generated)
jkrcal
Marc, could you PTAL? https://codereview.chromium.org/2355393002/diff/1/components/ntp_snippets/content_suggestions_provider.cc File components/ntp_snippets/content_suggestions_provider.cc (right): https://codereview.chromium.org/2355393002/diff/1/components/ntp_snippets/content_suggestions_provider.cc#newcode21 components/ntp_snippets/content_suggestions_provider.cc:21: return category_factory()->MakeUniqueID(category, within_category_id); I did ...
4 years, 3 months ago (2016-09-21 17:05:13 UTC) #2
Marc Treib
I'm slightly worried about this intermediate state where we (almost) never delete images. We really ...
4 years, 3 months ago (2016-09-21 19:10:17 UTC) #3
jkrcal
Thanks! PTAL, again. To address your worries, I now delete the image from the DB ...
4 years, 3 months ago (2016-09-22 09:12:42 UTC) #4
Marc Treib
https://codereview.chromium.org/2355393002/diff/20001/components/ntp_snippets/ntp_snippets_service.cc File components/ntp_snippets/ntp_snippets_service.cc (right): https://codereview.chromium.org/2355393002/diff/20001/components/ntp_snippets/ntp_snippets_service.cc#newcode682 components/ntp_snippets/ntp_snippets_service.cc:682: return; On 2016/09/22 09:12:42, jkrcal wrote: > On 2016/09/21 ...
4 years, 3 months ago (2016-09-22 11:27:06 UTC) #5
jkrcal
Thanks a lot, Marc! PTAL, again. https://codereview.chromium.org/2355393002/diff/20001/components/ntp_snippets/ntp_snippets_service.cc File components/ntp_snippets/ntp_snippets_service.cc (right): https://codereview.chromium.org/2355393002/diff/20001/components/ntp_snippets/ntp_snippets_service.cc#newcode682 components/ntp_snippets/ntp_snippets_service.cc:682: return; On 2016/09/22 ...
4 years, 3 months ago (2016-09-22 12:50:05 UTC) #6
Marc Treib
lgtm Thanks! https://codereview.chromium.org/2355393002/diff/80001/components/ntp_snippets/ntp_snippets_service.cc File components/ntp_snippets/ntp_snippets_service.cc (right): https://codereview.chromium.org/2355393002/diff/80001/components/ntp_snippets/ntp_snippets_service.cc#newcode206 components/ntp_snippets/ntp_snippets_service.cc:206: const std::set<std::string>& matching_ids, optional: You could also ...
4 years, 3 months ago (2016-09-22 13:05:29 UTC) #7
jkrcal
Thanks! https://codereview.chromium.org/2355393002/diff/80001/components/ntp_snippets/ntp_snippets_service.cc File components/ntp_snippets/ntp_snippets_service.cc (right): https://codereview.chromium.org/2355393002/diff/80001/components/ntp_snippets/ntp_snippets_service.cc#newcode206 components/ntp_snippets/ntp_snippets_service.cc:206: const std::set<std::string>& matching_ids, On 2016/09/22 13:05:29, Marc Treib ...
4 years, 2 months ago (2016-09-22 14:07:58 UTC) #8
jkrcal
Marc, I had to update the unittest, quite a bit. Does it still LGTY?
4 years, 2 months ago (2016-09-23 13:26:23 UTC) #19
Marc Treib
lgtm https://codereview.chromium.org/2355393002/diff/140001/components/ntp_snippets/content_suggestions_service_unittest.cc File components/ntp_snippets/content_suggestions_service_unittest.cc (right): https://codereview.chromium.org/2355393002/diff/140001/components/ntp_snippets/content_suggestions_service_unittest.cc#newcode145 components/ntp_snippets/content_suggestions_service_unittest.cc:145: std::string id_string = within_category_id ? https://codereview.chromium.org/2355393002/diff/140001/components/ntp_snippets/content_suggestions_service_unittest.cc#newcode217 components/ntp_snippets/content_suggestions_service_unittest.cc:217: result.emplace_back(CreateSuggestion(category, ...
4 years, 2 months ago (2016-09-23 13:31:29 UTC) #20
jkrcal
Thanks, Marc! I was a bit lazy in running unit-test which backfired on me. I ...
4 years, 2 months ago (2016-09-23 16:11:48 UTC) #25
Marc Treib
On 2016/09/23 16:11:48, jkrcal wrote: > Thanks, Marc! > > I was a bit lazy ...
4 years, 2 months ago (2016-09-23 16:16:49 UTC) #26
jkrcal
On 2016/09/23 16:16:49, Marc Treib wrote: > On 2016/09/23 16:11:48, jkrcal wrote: > > Thanks, ...
4 years, 2 months ago (2016-09-23 16:20:31 UTC) #27
Marc Treib
Ah indeed, I missed that. Anyway, still lgtm! https://codereview.chromium.org/2355393002/diff/160001/components/ntp_snippets/ntp_snippets_service_unittest.cc File components/ntp_snippets/ntp_snippets_service_unittest.cc (right): https://codereview.chromium.org/2355393002/diff/160001/components/ntp_snippets/ntp_snippets_service_unittest.cc#newcode653 components/ntp_snippets/ntp_snippets_service_unittest.cc:653: // ...
4 years, 2 months ago (2016-09-23 16:36:07 UTC) #28
jkrcal
Thanks, Marc! https://codereview.chromium.org/2355393002/diff/160001/components/ntp_snippets/ntp_snippets_service_unittest.cc File components/ntp_snippets/ntp_snippets_service_unittest.cc (right): https://codereview.chromium.org/2355393002/diff/160001/components/ntp_snippets/ntp_snippets_service_unittest.cc#newcode653 components/ntp_snippets/ntp_snippets_service_unittest.cc:653: // The snippet loaded last should be ...
4 years, 2 months ago (2016-09-23 17:34:32 UTC) #31
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/2355393002/180001
4 years, 2 months ago (2016-09-23 17:35:22 UTC) #34
commit-bot: I haz the power
Try jobs failed on following builders: android_clang_dbg_recipe on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_clang_dbg_recipe/builds/134025) cast_shell_linux on master.tryserver.chromium.linux (JOB_FAILED, ...
4 years, 2 months ago (2016-09-23 17:47:59 UTC) #36
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/2355393002/180001
4 years, 2 months ago (2016-09-23 17:51:00 UTC) #38
commit-bot: I haz the power
Committed patchset #10 (id:180001)
4 years, 2 months ago (2016-09-23 18:47:30 UTC) #39
commit-bot: I haz the power
4 years, 2 months ago (2016-09-23 18:49:47 UTC) #41
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/928ed3fef6431a8815e32bb2d905fc3bd21f5024
Cr-Commit-Position: refs/heads/master@{#420677}

Powered by Google App Engine
This is Rietveld 408576698