summaryrefslogtreecommitdiffstats
path: root/components/content_settings
diff options
context:
space:
mode:
Diffstat (limited to 'components/content_settings')
-rw-r--r--components/content_settings/core/browser/content_settings_utils.cc5
-rw-r--r--components/content_settings/core/common/content_settings_pattern.cc11
2 files changed, 8 insertions, 8 deletions
diff --git a/components/content_settings/core/browser/content_settings_utils.cc b/components/content_settings/core/browser/content_settings_utils.cc
index eb91f0b..5c48e9b 100644
--- a/components/content_settings/core/browser/content_settings_utils.cc
+++ b/components/content_settings/core/browser/content_settings_utils.cc
@@ -112,8 +112,9 @@ std::string CreatePatternString(
}
PatternPair ParsePatternString(const std::string& pattern_str) {
- std::vector<std::string> pattern_str_list;
- base::SplitString(pattern_str, kPatternSeparator[0], &pattern_str_list);
+ std::vector<std::string> pattern_str_list = base::SplitString(
+ pattern_str, std::string(1, kPatternSeparator[0]),
+ base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
// If the |pattern_str| is an empty string then the |pattern_string_list|
// contains a single empty string. In this case the empty string will be
diff --git a/components/content_settings/core/common/content_settings_pattern.cc b/components/content_settings/core/common/content_settings_pattern.cc
index b02cbee..634e487 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)