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

Issue 2702223004: [Remote suggestions] Move all decisions to fetch to the scheduler (Closed)

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

Description

[Remote suggestions] Move all decisions to fetch to the scheduler This change will clarify responsibilities between the scheduler and the provider. On top of that, it eliminates the need to fetch snippets upon creating the provider (which is dangerous w.r.t. fetches in unexpected situations). This change needs the new types of notifications from the provider to the scheduler: - suggestions have been cleared (we should fetch on any later trigger), - history has been cleared (we should NOT fetch for a while). Thus, the provider is now given a pointer to the scheduler interface. (the interface now mixes internal and external signals but I think it is this way easier to understand then with two separate interfaces). BUG=694324 Review-Url: https://codereview.chromium.org/2702223004 Cr-Commit-Position: refs/heads/master@{#454240} Committed: https://chromium.googlesource.com/chromium/src/+/6dd692b945fc8599a4c7db22854d19c9b27d0d4c

Patch Set 1 #

Total comments: 4

Patch Set 2 : Tim's comments #1 #

Patch Set 3 : Add unit-tests #

Patch Set 4 : More unit-tests #

Total comments: 6

Patch Set 5 : Tim's comments #2 #

Total comments: 8

Patch Set 6 : Tim's comments #3 #

Total comments: 16

Patch Set 7 : Marc's comments #

Total comments: 3

Patch Set 8 : Tim's comments #4 #

Patch Set 9 : Fix unit-tests #

Patch Set 10 : Rebase #

Patch Set 11 : Fixing an embarassing bug :) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+313 lines, -297 lines) Patch
M chrome/browser/ntp_snippets/content_suggestions_service_factory.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M components/ntp_snippets/remote/remote_suggestions_provider.h View 1 2 3 4 5 6 7 2 chunks +0 lines, -16 lines 0 comments Download
M components/ntp_snippets/remote/remote_suggestions_provider_impl.h View 1 2 3 4 5 6 7 6 chunks +28 lines, -16 lines 0 comments Download
M components/ntp_snippets/remote/remote_suggestions_provider_impl.cc View 1 2 3 4 5 6 12 chunks +47 lines, -43 lines 0 comments Download
M components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc View 1 2 3 4 5 6 8 chunks +81 lines, -101 lines 0 comments Download
M components/ntp_snippets/remote/remote_suggestions_scheduler.h View 1 2 3 4 5 6 1 chunk +17 lines, -0 lines 0 comments Download
M components/ntp_snippets/remote/scheduling_remote_suggestions_provider.h View 1 2 3 4 5 6 7 6 chunks +13 lines, -6 lines 0 comments Download
M components/ntp_snippets/remote/scheduling_remote_suggestions_provider.cc View 1 2 3 4 5 6 7 8 9 7 chunks +34 lines, -25 lines 0 comments Download
M components/ntp_snippets/remote/scheduling_remote_suggestions_provider_unittest.cc View 1 2 3 4 5 6 7 8 28 chunks +87 lines, -90 lines 0 comments Download
M ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 64 (34 generated)
jkrcal
Tim, could you please take a quick look? The CL is not complete (I haven't ...
3 years, 10 months ago (2017-02-20 19:53:13 UTC) #2
tschumann
some quick comments, overall the direction looks good to me! https://codereview.chromium.org/2702223004/diff/1/components/ntp_snippets/remote/remote_suggestions_provider.h File components/ntp_snippets/remote/remote_suggestions_provider.h (right): https://codereview.chromium.org/2702223004/diff/1/components/ntp_snippets/remote/remote_suggestions_provider.h#newcode35 ...
3 years, 10 months ago (2017-02-21 11:57:32 UTC) #3
jkrcal
Addressed one of the comments, working on unit-tests now. https://codereview.chromium.org/2702223004/diff/1/components/ntp_snippets/remote/remote_suggestions_provider.h File components/ntp_snippets/remote/remote_suggestions_provider.h (right): https://codereview.chromium.org/2702223004/diff/1/components/ntp_snippets/remote/remote_suggestions_provider.h#newcode35 components/ntp_snippets/remote/remote_suggestions_provider.h:35: ...
3 years, 10 months ago (2017-02-21 15:19:00 UTC) #4
jkrcal
Uploaded unit-test changes, PTAL!
3 years, 10 months ago (2017-02-21 17:56:30 UTC) #5
jkrcal
On 2017/02/21 17:56:30, jkrcal wrote: > Uploaded unit-test changes, PTAL! Tim, I've added some more ...
3 years, 10 months ago (2017-02-22 11:12:52 UTC) #10
tschumann
didn't have a close look at the scheduler yet, though. https://codereview.chromium.org/2702223004/diff/60001/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc File components/ntp_snippets/remote/remote_suggestions_provider_impl.cc (right): https://codereview.chromium.org/2702223004/diff/60001/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc#newcode1090 ...
3 years, 10 months ago (2017-02-22 11:31:34 UTC) #11
jkrcal
Thanks, PTAL again! https://codereview.chromium.org/2702223004/diff/60001/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc File components/ntp_snippets/remote/remote_suggestions_provider_impl.cc (right): https://codereview.chromium.org/2702223004/diff/60001/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc#newcode1090 components/ntp_snippets/remote/remote_suggestions_provider_impl.cc:1090: remote_suggestions_scheduler_->OnProviderInactivated(); On 2017/02/22 11:31:34, tschumann wrote: ...
3 years, 10 months ago (2017-02-22 13:17:03 UTC) #12
tschumann
lgtm Some more nits. Once addressed feel free to submit. https://codereview.chromium.org/2702223004/diff/80001/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc File components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc (right): https://codereview.chromium.org/2702223004/diff/80001/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc#newcode720 ...
3 years, 10 months ago (2017-02-22 20:46:04 UTC) #13
jkrcal
Thanks! https://codereview.chromium.org/2702223004/diff/80001/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc File components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc (right): https://codereview.chromium.org/2702223004/diff/80001/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc#newcode720 components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc:720: LoadFromJSONString(service.get(), json_str); On 2017/02/22 20:46:04, tschumann wrote: > ...
3 years, 10 months ago (2017-02-23 12:20:14 UTC) #16
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/2702223004/100001
3 years, 10 months ago (2017-02-23 13:05:47 UTC) #21
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. CQ run can only be started by full ...
3 years, 10 months ago (2017-02-23 13:05:49 UTC) #23
jkrcal
Marc, is it even possible that Tim is not a committer? Could you please approve ...
3 years, 10 months ago (2017-02-23 13:20:14 UTC) #25
Marc Treib
Some comments/questions. I'm starting to seriously doubt the design of RemoteSuggestionsProviderImpl and SchedulingRemoteSuggestionsProvider implementing the ...
3 years, 10 months ago (2017-02-23 13:52:24 UTC) #26
jkrcal
Thanks, Marc, PTAL! https://codereview.chromium.org/2702223004/diff/100001/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc File components/ntp_snippets/remote/remote_suggestions_provider_impl.cc (right): https://codereview.chromium.org/2702223004/diff/100001/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc#newcode892 components/ntp_snippets/remote/remote_suggestions_provider_impl.cc:892: NukeAllSuggestions(); On 2017/02/23 13:52:24, Marc Treib ...
3 years, 10 months ago (2017-02-24 09:21:43 UTC) #27
tschumann
Once that issue is addressed, the CL looks good to me. Thanks marc for calling ...
3 years, 10 months ago (2017-02-24 09:37:12 UTC) #28
jkrcal
https://codereview.chromium.org/2702223004/diff/120001/components/ntp_snippets/remote/remote_suggestions_provider.h File components/ntp_snippets/remote/remote_suggestions_provider.h (right): https://codereview.chromium.org/2702223004/diff/120001/components/ntp_snippets/remote/remote_suggestions_provider.h#newcode34 components/ntp_snippets/remote/remote_suggestions_provider.h:34: virtual void SetRemoteSuggestionsScheduler( On 2017/02/24 09:37:12, tschumann wrote: > ...
3 years, 10 months ago (2017-02-24 09:47:05 UTC) #29
tschumann
https://codereview.chromium.org/2702223004/diff/120001/components/ntp_snippets/remote/remote_suggestions_provider.h File components/ntp_snippets/remote/remote_suggestions_provider.h (right): https://codereview.chromium.org/2702223004/diff/120001/components/ntp_snippets/remote/remote_suggestions_provider.h#newcode34 components/ntp_snippets/remote/remote_suggestions_provider.h:34: virtual void SetRemoteSuggestionsScheduler( On 2017/02/24 09:47:04, jkrcal wrote: > ...
3 years, 10 months ago (2017-02-24 10:22:59 UTC) #30
Marc Treib
Alright, LGTM since I don't want to further block this CL, assuming Tim is okay ...
3 years, 10 months ago (2017-02-24 14:32:27 UTC) #31
jkrcal
Tim, I moved out the dependency injection in the factories, PTAL! Éric, could you PTAL ...
3 years, 9 months ago (2017-02-27 08:32:47 UTC) #35
tschumann
lgtm
3 years, 9 months ago (2017-02-27 09:33:05 UTC) #38
jkrcal
Éric, friendly ping!
3 years, 9 months ago (2017-02-28 10:14:45 UTC) #43
noyau (Ping after 24h)
lgtm
3 years, 9 months ago (2017-03-01 16:54:55 UTC) #44
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/2702223004/160001
3 years, 9 months ago (2017-03-01 16:57:04 UTC) #47
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/128729)
3 years, 9 months ago (2017-03-01 18:22:09 UTC) #49
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/2702223004/160001
3 years, 9 months ago (2017-03-01 18:38:52 UTC) #51
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/128778)
3 years, 9 months ago (2017-03-01 20:01:37 UTC) #53
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/2702223004/160001
3 years, 9 months ago (2017-03-02 08:25:57 UTC) #55
commit-bot: I haz the power
Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_swarming_rel/builds/129604)
3 years, 9 months ago (2017-03-02 09:47:30 UTC) #57
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/2702223004/220001
3 years, 9 months ago (2017-03-02 12:06:02 UTC) #61
commit-bot: I haz the power
3 years, 9 months ago (2017-03-02 12:50:02 UTC) #64
Message was sent while issue was closed.
Committed patchset #11 (id:220001) as
https://chromium.googlesource.com/chromium/src/+/6dd692b945fc8599a4c7db22854d...

Powered by Google App Engine
This is Rietveld 408576698