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

Unified Diff: components/content_settings/core/common/content_settings_pattern.cc

Issue 1234973004: Update SplitString calls in components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 5 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/content_settings/core/common/content_settings_pattern.cc
diff --git a/components/content_settings/core/common/content_settings_pattern.cc b/components/content_settings/core/common/content_settings_pattern.cc
index b02cbee5dac6dad2f2e967507e0f079643f003ff..634e487b8f927dc46749f956f1cb2c7109f21e6f 100644
--- a/components/content_settings/core/common/content_settings_pattern.cc
+++ b/components/content_settings/core/common/content_settings_pattern.cc
@@ -47,17 +47,16 @@ bool IsSubDomainOrEqual(const std::string& sub_domain,
// Compares two domain names.
int CompareDomainNames(const std::string& str1, const std::string& str2) {
- std::vector<std::string> domain_name1;
- std::vector<std::string> domain_name2;
-
- base::SplitString(str1, '.', &domain_name1);
- base::SplitString(str2, '.', &domain_name2);
+ std::vector<base::StringPiece> domain_name1 = base::SplitStringPiece(
+ str1, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
+ std::vector<base::StringPiece> domain_name2 = base::SplitStringPiece(
+ str2, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
int i1 = static_cast<int>(domain_name1.size()) - 1;
int i2 = static_cast<int>(domain_name2.size()) - 1;
int rv;
while (i1 >= 0 && i2 >= 0) {
- // domain names are stored in puny code. So it's fine to use the compare
+ // Domain names are stored in puny code. So it's fine to use the compare
// method.
rv = domain_name1[i1].compare(domain_name2[i2]);
if (rv != 0)

Powered by Google App Engine
This is Rietveld 408576698