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

Unified Diff: components/search_engines/template_url_service.cc

Issue 2016463003: [sync] DCHECK from UTF16ToASCII from TemplateURLService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/search_engines/template_url_service_sync_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/search_engines/template_url_service.cc
diff --git a/components/search_engines/template_url_service.cc b/components/search_engines/template_url_service.cc
index f89aa3c10e6a40b37eb68c61cd689aa6a09a36bd..65a7581695de8fc197a9cda0a25a8e6655f70d18 100644
--- a/components/search_engines/template_url_service.cc
+++ b/components/search_engines/template_url_service.cc
@@ -131,18 +131,18 @@ bool IsFromSync(const TemplateURL* turl, const SyncDataMap& sync_data) {
// underscores, which could occur as the result of conflict resolution.
void LogDuplicatesHistogram(
const TemplateURLService::TemplateURLVector& template_urls) {
- std::map<std::string, int> duplicates;
+ std::map<base::string16, int> duplicates;
for (TemplateURLService::TemplateURLVector::const_iterator it =
template_urls.begin(); it != template_urls.end(); ++it) {
- std::string keyword = base::UTF16ToASCII((*it)->keyword());
- base::TrimString(keyword, "_", &keyword);
+ base::string16 keyword = (*it)->keyword();
+ base::TrimString(keyword, base::ASCIIToUTF16("_"), &keyword);
duplicates[keyword]++;
}
// Count the keywords with duplicates.
int num_dupes = 0;
- for (std::map<std::string, int>::const_iterator it = duplicates.begin();
- it != duplicates.end(); ++it) {
+ for (std::map<base::string16, int>::const_iterator it = duplicates.begin();
+ it != duplicates.end(); ++it) {
if (it->second > 1)
num_dupes++;
}
« no previous file with comments | « chrome/browser/search_engines/template_url_service_sync_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698