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

Unified Diff: components/ntp_snippets/ntp_snippets_service.cc

Issue 2342673004: Clear browsing data from ContentSuggestionService only if exists. (Closed)
Patch Set: Last comment of Bernhard Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ntp_snippets/content_suggestions_service_factory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/ntp_snippets_service.cc
diff --git a/components/ntp_snippets/ntp_snippets_service.cc b/components/ntp_snippets/ntp_snippets_service.cc
index aa715ef1d9a16f4a47f68872fcd310614405e70f..503a13b25692b52715ca5e8061fc5f65c736b4dc 100644
--- a/components/ntp_snippets/ntp_snippets_service.cc
+++ b/components/ntp_snippets/ntp_snippets_service.cc
@@ -978,6 +978,12 @@ void NTPSnippetsService::EnterState(State state) {
case State::READY: {
DCHECK(state_ == State::NOT_INITED || state_ == State::DISABLED);
+ // TODO(jkrcal): fetching snippets automatically upon creation of this
+ // lazily created service can cause troubles, e.g. in unittests where
+ // network I/O is not allowed.
+ // Either add a DCHECK here that we actually are allowed to do network I/O
+ // or change the logic so that some explicit call is always needed for the
+ // network request.
bool fetch_snippets =
categories_[articles_category_].snippets.empty() || fetch_after_load_;
DVLOG(1) << "Entering state: READY";
« no previous file with comments | « chrome/browser/ntp_snippets/content_suggestions_service_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698