| Index: components/variations/net/variations_http_header_provider.cc
|
| diff --git a/components/variations/net/variations_http_header_provider.cc b/components/variations/net/variations_http_header_provider.cc
|
| index f94ad2c953a126c38368cb6195b860ae94a7e988..9f86ea0417386a42ec0918fb5bfbd271b7c22a8b 100644
|
| --- a/components/variations/net/variations_http_header_provider.cc
|
| +++ b/components/variations/net/variations_http_header_provider.cc
|
| @@ -88,21 +88,20 @@ bool VariationsHttpHeaderProvider::SetDefaultVariationIds(
|
| const std::string& variation_ids) {
|
| default_variation_ids_set_.clear();
|
| default_trigger_id_set_.clear();
|
| - std::vector<std::string> entries;
|
| - base::SplitString(variation_ids, ',', &entries);
|
| - for (std::vector<std::string>::const_iterator it = entries.begin();
|
| - it != entries.end(); ++it) {
|
| - if (it->empty()) {
|
| + for (const base::StringPiece& entry : base::SplitStringPiece(
|
| + variation_ids, ",", base::KEEP_WHITESPACE, base::SPLIT_WANT_ALL)) {
|
| + if (entry.empty()) {
|
| default_variation_ids_set_.clear();
|
| default_trigger_id_set_.clear();
|
| return false;
|
| }
|
| - bool trigger_id = base::StartsWith(*it, "t", base::CompareCase::SENSITIVE);
|
| + bool trigger_id =
|
| + base::StartsWith(entry, "t", base::CompareCase::SENSITIVE);
|
| // Remove the "t" prefix if it's there.
|
| - std::string entry = trigger_id ? it->substr(1) : *it;
|
| + base::StringPiece trimmed_entry = trigger_id ? entry.substr(1) : entry;
|
|
|
| int variation_id = 0;
|
| - if (!base::StringToInt(entry, &variation_id)) {
|
| + if (!base::StringToInt(trimmed_entry, &variation_id)) {
|
| default_variation_ids_set_.clear();
|
| default_trigger_id_set_.clear();
|
| return false;
|
|
|