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

Unified Diff: components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc

Issue 2663183002: [NTP::Cleanup] Store tab id as int in SnippetArticle. (Closed)
Patch Set: clean rebase. Created 3 years, 11 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/offline_pages/recent_tab_suggestions_provider.cc
diff --git a/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc b/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc
index 760785e756839aa0aa2bb715814d5d3aa2bdb0c7..f8056d0f64215d24b6dbce9cb893877aac661673 100644
--- a/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc
+++ b/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc
@@ -291,7 +291,10 @@ ContentSuggestion RecentTabSuggestionsProvider::ConvertOfflinePage(
suggestion.set_publish_date(offline_page.creation_time);
suggestion.set_publisher_name(base::UTF8ToUTF16(offline_page.url.host()));
auto extra = base::MakeUnique<RecentTabSuggestionExtra>();
- extra->tab_id = offline_page.client_id.id;
+ int tab_id;
+ bool success = base::StringToInt(offline_page.client_id.id, &tab_id);
+ DCHECK(success);
+ extra->tab_id = tab_id;
jkrcal 2017/02/01 09:27:13 Wouldn't it make sense to filter out the suggestio
vitaliii 2017/02/01 09:34:29 There is a DCHECK for this. The assumption is that
extra->offline_page_id = offline_page.offline_id;
suggestion.set_recent_tab_suggestion_extra(std::move(extra));
return suggestion;

Powered by Google App Engine
This is Rietveld 408576698