| Index: chrome/browser/predictors/resource_prefetch_common.cc
|
| diff --git a/chrome/browser/predictors/resource_prefetch_common.cc b/chrome/browser/predictors/resource_prefetch_common.cc
|
| index 1ec32e1870ce69b8805eafc9a8859051653c1386..1fd2c097e909bf2e41fc05f9cb41227dfbe01bec 100644
|
| --- a/chrome/browser/predictors/resource_prefetch_common.cc
|
| +++ b/chrome/browser/predictors/resource_prefetch_common.cc
|
| @@ -34,17 +34,15 @@ const char kSpeculativePrefetchingTrialName[] =
|
| * The function below extracts the value corresponding to a key provided from
|
| * the SpeculativeResourcePrefetching field trial.
|
| */
|
| -string GetFiledTrialSpecValue(string key) {
|
| - vector<string> elements;
|
| - base::SplitString(
|
| - FieldTrialList::FindFullName(kSpeculativePrefetchingTrialName),
|
| - ':',
|
| - &elements);
|
| - for (int i = 0; i < static_cast<int>(elements.size()); i++) {
|
| - vector<string> key_value;
|
| - base::SplitString(elements[i], '=', &key_value);
|
| +std::string GetFiledTrialSpecValue(string key) {
|
| + std::string trial_name =
|
| + FieldTrialList::FindFullName(kSpeculativePrefetchingTrialName);
|
| + for (const base::StringPiece& element : base::SplitStringPiece(
|
| + trial_name, ":", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
|
| + std::vector<base::StringPiece> key_value = base::SplitStringPiece(
|
| + element, "=", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
|
| if (key_value.size() == 2 && key_value[0] == key)
|
| - return key_value[1];
|
| + return key_value[1].as_string();
|
| }
|
| return string();
|
| }
|
|
|