summaryrefslogtreecommitdiffstats
path: root/extensions/common/features
diff options
context:
space:
mode:
authorbrettw <brettw@chromium.org>2015-08-06 17:11:28 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-07 00:12:13 +0000
commit0aa7c64253cca8b636d52d1d01d94f96ab9c13fa (patch)
tree29b825a84dffc4d7310c69b22da0cfd7b1228277 /extensions/common/features
parent924597ba8b5def174aebdc96368545f51df1bee2 (diff)
downloadchromium_src-0aa7c64253cca8b636d52d1d01d94f96ab9c13fa.zip
chromium_src-0aa7c64253cca8b636d52d1d01d94f96ab9c13fa.tar.gz
chromium_src-0aa7c64253cca8b636d52d1d01d94f96ab9c13fa.tar.bz2
Update SplitString calls to new form
Uses the new form for most (but not quite all) of the remaining users of the old form. Changes media mime util codec list parsing to expect no result from the string "," rather than two empty strings. The old SplitString call had a special case where if the input was empty, it would return empty, but if it had one split character, it would return two empty strings as results. The new one lets you choose but the options are either (1) empty string -> one empty string and "," -> two empty strings, or (2) map both to no results for when you don't want empty results. I'm pretty sure media codec parsing actually wants the latter behavior, so I updated the call to discard empty results and MimeUtilTest.ParseCodecString is updated. Review URL: https://codereview.chromium.org/1272823003 Cr-Commit-Position: refs/heads/master@{#342238}
Diffstat (limited to 'extensions/common/features')
-rw-r--r--extensions/common/features/base_feature_provider.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/extensions/common/features/base_feature_provider.cc b/extensions/common/features/base_feature_provider.cc
index 472e1f55..cae08d6 100644
--- a/extensions/common/features/base_feature_provider.cc
+++ b/extensions/common/features/base_feature_provider.cc
@@ -52,8 +52,8 @@ BaseFeatureProvider::BaseFeatureProvider(const base::DictionaryValue& root,
if (iter.value().GetType() == base::Value::TYPE_DICTIONARY) {
linked_ptr<SimpleFeature> feature((*factory_)());
- std::vector<std::string> split;
- base::SplitString(iter.key(), '.', &split);
+ std::vector<std::string> split = base::SplitString(
+ iter.key(), ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
// Push parent features on the stack, starting with the current feature.
// If one of the features has "noparent" set, stop pushing features on
@@ -171,8 +171,8 @@ Feature* BaseFeatureProvider::GetParent(Feature* feature) const {
if (feature->no_parent())
return nullptr;
- std::vector<std::string> split;
- base::SplitString(feature->name(), '.', &split);
+ std::vector<std::string> split = base::SplitString(
+ feature->name(), ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
if (split.size() < 2)
return nullptr;
split.pop_back();