Refactor SchedulingRemoteSuggestionsProvider not to be a wrapper around RemoteSuggestionsProviderImpl |
||||
Issue description(from an offline discussion with treib@) It does not make sense that it implements RemoteSuggestionsProvider interface. The only reason is because of this in content_suggestions_service: RemoteSuggestionsProvider* remote_suggestions_provider_for_debugging() Apart from the fact, we should try to remove such a method, this can happily live in the RemoteSuggestionsScheduler interface (who anyway needs to know of the RemoteSuggestionsProvider).
,
Feb 25 2017
let's discuss this in person. I think we can adapt the current design slightly to get a nice separation. Looking at the amount of code in the scheduling wrapper, i'm actually quite happy we have a separate class. It's not that the Impl shouldn't have to know about the existence of a scheduler -- it should just not care about the scheduling details. Like I mentioned in the CL, it's possible that we're missing another interface that allows the scheduler to observe events of the IMPL. However, the providers already have a listener/observer concept and that might be confusing, too.
,
Mar 9 2017
(notes to myself) After refactoring of Scheduling... and Remote...Impl: * the main service owns them both as this needs to get revealed externally * they know about each other via the interfaces * RemoteImpl asks the scheduler before interactive fetches * Scheduling triggers the RemoteImpl on triggers * (there are corner-cases when snippets internals does the background fetch, we probably do not need to count it into quota) As a next step, the status service could have power and control (similarly to the scheduler) what happens on sign-in / sign-out with no logic around that in Impl or Scheduler.
,
Mar 14 2017
,
Mar 29 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f996646c9b3b4c8027e693c5a48c7fab3adbfe8c commit f996646c9b3b4c8027e693c5a48c7fab3adbfe8c Author: jkrcal <jkrcal@chromium.org> Date: Wed Mar 29 16:25:21 2017 [Remote suggestions] Refactor the scheduler This CL cleans up the relation of the scheduler and the provider of remote suggestions. The previous wrapper pattern was not useful as there was too much two-way communication between these two. BUG= 695447 Review-Url: https://codereview.chromium.org/2774663002 Cr-Commit-Position: refs/heads/master@{#460414} [modify] https://crrev.com/f996646c9b3b4c8027e693c5a48c7fab3adbfe8c/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc [modify] https://crrev.com/f996646c9b3b4c8027e693c5a48c7fab3adbfe8c/chrome/browser/prefs/browser_prefs.cc [modify] https://crrev.com/f996646c9b3b4c8027e693c5a48c7fab3adbfe8c/components/ntp_snippets/BUILD.gn [modify] https://crrev.com/f996646c9b3b4c8027e693c5a48c7fab3adbfe8c/components/ntp_snippets/content_suggestions_service.cc [modify] https://crrev.com/f996646c9b3b4c8027e693c5a48c7fab3adbfe8c/components/ntp_snippets/content_suggestions_service.h [modify] https://crrev.com/f996646c9b3b4c8027e693c5a48c7fab3adbfe8c/components/ntp_snippets/content_suggestions_service_unittest.cc [modify] https://crrev.com/f996646c9b3b4c8027e693c5a48c7fab3adbfe8c/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc [modify] https://crrev.com/f996646c9b3b4c8027e693c5a48c7fab3adbfe8c/components/ntp_snippets/remote/remote_suggestions_provider_impl.h [modify] https://crrev.com/f996646c9b3b4c8027e693c5a48c7fab3adbfe8c/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc [modify] https://crrev.com/f996646c9b3b4c8027e693c5a48c7fab3adbfe8c/components/ntp_snippets/remote/remote_suggestions_scheduler.h [rename] https://crrev.com/f996646c9b3b4c8027e693c5a48c7fab3adbfe8c/components/ntp_snippets/remote/remote_suggestions_scheduler_impl.cc [add] https://crrev.com/f996646c9b3b4c8027e693c5a48c7fab3adbfe8c/components/ntp_snippets/remote/remote_suggestions_scheduler_impl.h [rename] https://crrev.com/f996646c9b3b4c8027e693c5a48c7fab3adbfe8c/components/ntp_snippets/remote/remote_suggestions_scheduler_impl_unittest.cc [delete] https://crrev.com/7a7a48cfbf8854d71104c5830403b1dab6830807/components/ntp_snippets/remote/scheduling_remote_suggestions_provider.h [modify] https://crrev.com/f996646c9b3b4c8027e693c5a48c7fab3adbfe8c/ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.cc [modify] https://crrev.com/f996646c9b3b4c8027e693c5a48c7fab3adbfe8c/ios/chrome/browser/prefs/browser_prefs.mm
,
Apr 10 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by treib@chromium.org
, Feb 24 2017