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

Unified Diff: components/ntp_snippets/content_suggestions_service.cc

Issue 2158883002: Change NTPSnippetsBridge to read from ContentSuggestionsService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@offlinepagesprovider
Patch Set: Marc's comments Created 4 years, 5 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
Index: components/ntp_snippets/content_suggestions_service.cc
diff --git a/components/ntp_snippets/content_suggestions_service.cc b/components/ntp_snippets/content_suggestions_service.cc
index 3ce179f48df90fd5b6e6555960d86e1302e6e683..aaf2e80b5cf8cdc5a535313d2636003cfc5e0ff1 100644
--- a/components/ntp_snippets/content_suggestions_service.cc
+++ b/components/ntp_snippets/content_suggestions_service.cc
@@ -106,7 +106,10 @@ void ContentSuggestionsService::DiscardSuggestion(
[&suggestion_id](const ContentSuggestion& suggestion) {
return suggestion_id == suggestion.id();
});
- DCHECK(position != suggestions->end());
+ DCHECK(position != suggestions->end())
+ << "The discarded suggestion " << suggestion_id
+ << " has already been removed. Providers must not call OnNewSuggestions"
+ " in response to DiscardSuggestion.";
suggestions->erase(position);
}

Powered by Google App Engine
This is Rietveld 408576698