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

Issue 2205233002: Combine all suggestions factories into ContentSuggestionsServiceFactory (Closed)

Created:
4 years, 4 months ago by Philipp Keck
Modified:
4 years, 4 months ago
CC:
chromium-reviews, Dirk Pranke, ntp-dev+reviews_chromium.org, rginda+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Combine all suggestions factories into ContentSuggestionsServiceFactory Remove the NTPSnippetsServiceObserver and its uses. Change ContentSuggestionsProviders to be owned by the ContentSuggestionsService instead of having their own lifecycle as a KeyedService. Change RegisterProvider() and Shutdown() behavior for the service and the providers. Remove NTPSnippetsServiceFactory and its uses in the SnippetsBridge. Remove OfflinePageSuggestionsProviderFactory. Expose the NTPSnippetsService to the snippets-internals through the ContentSuggestionsService. Adjust unit tests. BUG=633139 Committed: https://crrev.com/5728f0895e82f74b307d39db57099a5197ebfeb0 Cr-Commit-Position: refs/heads/master@{#409556}

Patch Set 1 #

Patch Set 2 : Remove two obsolete TODO comments #

Total comments: 37

Patch Set 3 : Marc's comments #

Patch Set 4 : Rename ERROR to ERROR_OCCURRED for the Windows compiler #

Patch Set 5 : ASCII art redesign for the Linux Android compiler #

Patch Set 6 : Added DependsOn entries #

Patch Set 7 : Don't reschedule fetching on provider shutdown #

Patch Set 8 : Put OfflinePage things into the #if #

Total comments: 4

Patch Set 9 : Bernhard's comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+315 lines, -728 lines) Patch
M chrome/browser/android/ntp/ntp_snippets_bridge.cc View 3 chunks +6 lines, -4 lines 0 comments Download
D chrome/browser/android/ntp/offline_page_suggestions_provider_factory.h View 1 chunk +0 lines, -46 lines 0 comments Download
D chrome/browser/android/ntp/offline_page_suggestions_provider_factory.cc View 1 chunk +0 lines, -76 lines 0 comments Download
M chrome/browser/ntp_snippets/content_suggestions_service_factory.cc View 1 2 3 4 5 6 7 2 chunks +116 lines, -10 lines 0 comments Download
D chrome/browser/ntp_snippets/ntp_snippets_service_factory.h View 1 chunk +0 lines, -44 lines 0 comments Download
D chrome/browser/ntp_snippets/ntp_snippets_service_factory.cc View 1 chunk +0 lines, -139 lines 0 comments Download
M chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/profiles/profile_manager.cc View 2 chunks +0 lines, -4 lines 0 comments Download
M chrome/browser/ui/webui/snippets_internals_message_handler.h View 3 chunks +0 lines, -11 lines 0 comments Download
M chrome/browser/ui/webui/snippets_internals_message_handler.cc View 4 chunks +7 lines, -23 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 chunks +0 lines, -4 lines 0 comments Download
M components/ntp_snippets/content_suggestions_provider.h View 4 chunks +8 lines, -12 lines 0 comments Download
M components/ntp_snippets/content_suggestions_provider.cc View 1 chunk +2 lines, -1 line 0 comments Download
M components/ntp_snippets/content_suggestions_service.h View 1 2 7 chunks +24 lines, -6 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service.cc View 1 2 3 chunks +10 lines, -28 lines 0 comments Download
M components/ntp_snippets/content_suggestions_service_unittest.cc View 15 chunks +44 lines, -103 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_service.h View 1 2 3 4 5 6 7 8 9 chunks +22 lines, -61 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_service.cc View 1 2 3 4 5 6 13 chunks +15 lines, -58 lines 0 comments Download
M components/ntp_snippets/ntp_snippets_service_unittest.cc View 1 2 3 13 chunks +50 lines, -67 lines 0 comments Download
M components/ntp_snippets/offline_pages/offline_page_suggestions_provider.h View 3 chunks +2 lines, -9 lines 0 comments Download
M components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc View 5 chunks +7 lines, -20 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 22 (6 generated)
Philipp Keck
PTAL Corresponding iOS factory will follow later.
4 years, 4 months ago (2016-08-03 11:14:17 UTC) #2
Marc Treib
https://codereview.chromium.org/2205233002/diff/20001/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc File chrome/browser/ntp_snippets/content_suggestions_service_factory.cc (right): https://codereview.chromium.org/2205233002/diff/20001/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc#newcode50 chrome/browser/ntp_snippets/content_suggestions_service_factory.cc:50: using suggestions::ImageDecoderImpl; nit: keep these alphabetical https://codereview.chromium.org/2205233002/diff/20001/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc#newcode145 chrome/browser/ntp_snippets/content_suggestions_service_factory.cc:145: base::MakeUnique<ntp_snippets::NTPSnippetsStatusService>( ...
4 years, 4 months ago (2016-08-03 11:53:23 UTC) #3
Philipp Keck
Thank you. All fixed except for the RescheduleFetching() on Shutdown/Destroy, where I'm not sure. https://codereview.chromium.org/2205233002/diff/20001/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc ...
4 years, 4 months ago (2016-08-03 12:28:25 UTC) #4
Philipp Keck
bauerb@chromium.org: Please review changes in chrome/browser/ui/webui/snippets_internals_message_handler.*
4 years, 4 months ago (2016-08-03 12:31:14 UTC) #6
Philipp Keck
anthonyvd@chromium.org: Please review changes in chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc chrome/browser/profiles/profile_manager.cc We now use one factory for all the ...
4 years, 4 months ago (2016-08-03 12:33:22 UTC) #8
Marc Treib
https://codereview.chromium.org/2205233002/diff/20001/components/ntp_snippets/ntp_snippets_service.cc File components/ntp_snippets/ntp_snippets_service.cc (right): https://codereview.chromium.org/2205233002/diff/20001/components/ntp_snippets/ntp_snippets_service.cc#newcode231 components/ntp_snippets/ntp_snippets_service.cc:231: RescheduleFetching(); On 2016/08/03 12:28:24, Philipp Keck wrote: > On ...
4 years, 4 months ago (2016-08-03 12:37:56 UTC) #9
Philipp Keck
https://codereview.chromium.org/2205233002/diff/20001/components/ntp_snippets/ntp_snippets_service.cc File components/ntp_snippets/ntp_snippets_service.cc (right): https://codereview.chromium.org/2205233002/diff/20001/components/ntp_snippets/ntp_snippets_service.cc#newcode231 components/ntp_snippets/ntp_snippets_service.cc:231: RescheduleFetching(); On 2016/08/03 12:37:56, Marc Treib wrote: > On ...
4 years, 4 months ago (2016-08-03 12:57:23 UTC) #10
Marc Treib
https://codereview.chromium.org/2205233002/diff/20001/components/ntp_snippets/ntp_snippets_service.cc File components/ntp_snippets/ntp_snippets_service.cc (right): https://codereview.chromium.org/2205233002/diff/20001/components/ntp_snippets/ntp_snippets_service.cc#newcode231 components/ntp_snippets/ntp_snippets_service.cc:231: RescheduleFetching(); On 2016/08/03 12:57:23, Philipp Keck wrote: > On ...
4 years, 4 months ago (2016-08-03 13:01:18 UTC) #11
Philipp Keck
On 2016/08/03 13:01:18, Marc Treib wrote: > https://codereview.chromium.org/2205233002/diff/20001/components/ntp_snippets/ntp_snippets_service.cc > File components/ntp_snippets/ntp_snippets_service.cc (right): > > https://codereview.chromium.org/2205233002/diff/20001/components/ntp_snippets/ntp_snippets_service.cc#newcode231 ...
4 years, 4 months ago (2016-08-03 15:35:00 UTC) #12
anthonyvd
c/b/profiles/* lgtm
4 years, 4 months ago (2016-08-03 15:40:15 UTC) #13
Marc Treib
lgtm
4 years, 4 months ago (2016-08-03 15:41:25 UTC) #14
Bernhard Bauer
LGTM https://codereview.chromium.org/2205233002/diff/140001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/2205233002/diff/140001/chrome/browser/profiles/profile_manager.cc#newcode1229 chrome/browser/profiles/profile_manager.cc:1229: ContentSuggestionsServiceFactory::GetForProfile(profile); We could even get rid of this ...
4 years, 4 months ago (2016-08-03 16:30:51 UTC) #15
Philipp Keck
Thank you. https://codereview.chromium.org/2205233002/diff/140001/chrome/browser/profiles/profile_manager.cc File chrome/browser/profiles/profile_manager.cc (right): https://codereview.chromium.org/2205233002/diff/140001/chrome/browser/profiles/profile_manager.cc#newcode1229 chrome/browser/profiles/profile_manager.cc:1229: ContentSuggestionsServiceFactory::GetForProfile(profile); On 2016/08/03 16:30:51, Bernhard Bauer wrote: ...
4 years, 4 months ago (2016-08-03 16:45:16 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/2205233002/160001
4 years, 4 months ago (2016-08-03 16:46:02 UTC) #19
commit-bot: I haz the power
Committed patchset #9 (id:160001)
4 years, 4 months ago (2016-08-03 17:27:51 UTC) #20
commit-bot: I haz the power
4 years, 4 months ago (2016-08-03 17:29:50 UTC) #22
Message was sent while issue was closed.
Patchset 9 (id:??) landed as
https://crrev.com/5728f0895e82f74b307d39db57099a5197ebfeb0
Cr-Commit-Position: refs/heads/master@{#409556}

Powered by Google App Engine
This is Rietveld 408576698