The scheduler is the central place to make all decisions when to (and when not to) fetch snippets. In a few corner cases now, the decision is now taken in RemoteSuggestionsProviderImpl. This should be moved to SchedulingRemoteSuggestionsProvider.
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6dd692b945fc8599a4c7db22854d19c9b27d0d4c commit 6dd692b945fc8599a4c7db22854d19c9b27d0d4c Author: jkrcal <jkrcal@chromium.org> Date: Thu Mar 02 12:49:19 2017 [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} [modify] https://crrev.com/6dd692b945fc8599a4c7db22854d19c9b27d0d4c/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc [modify] https://crrev.com/6dd692b945fc8599a4c7db22854d19c9b27d0d4c/components/ntp_snippets/content_suggestions_service.h [modify] https://crrev.com/6dd692b945fc8599a4c7db22854d19c9b27d0d4c/components/ntp_snippets/remote/remote_suggestions_provider.h [modify] https://crrev.com/6dd692b945fc8599a4c7db22854d19c9b27d0d4c/components/ntp_snippets/remote/remote_suggestions_provider_impl.cc [modify] https://crrev.com/6dd692b945fc8599a4c7db22854d19c9b27d0d4c/components/ntp_snippets/remote/remote_suggestions_provider_impl.h [modify] https://crrev.com/6dd692b945fc8599a4c7db22854d19c9b27d0d4c/components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc [modify] https://crrev.com/6dd692b945fc8599a4c7db22854d19c9b27d0d4c/components/ntp_snippets/remote/remote_suggestions_scheduler.h [modify] https://crrev.com/6dd692b945fc8599a4c7db22854d19c9b27d0d4c/components/ntp_snippets/remote/scheduling_remote_suggestions_provider.cc [modify] https://crrev.com/6dd692b945fc8599a4c7db22854d19c9b27d0d4c/components/ntp_snippets/remote/scheduling_remote_suggestions_provider.h [modify] https://crrev.com/6dd692b945fc8599a4c7db22854d19c9b27d0d4c/components/ntp_snippets/remote/scheduling_remote_suggestions_provider_unittest.cc [modify] https://crrev.com/6dd692b945fc8599a4c7db22854d19c9b27d0d4c/ios/chrome/browser/ntp_snippets/ios_chrome_content_suggestions_service_factory.cc
Comment 1 by jkrcal@chromium.org
, Feb 20 2017