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

Unified Diff: components/search_engines/template_url.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
« no previous file with comments | « components/search_engines/keyword_table.cc ('k') | components/search_engines/template_url_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/search_engines/template_url.cc
diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc
index 6ad91e97c780a5114e8b7bb4532196a8f138d70d..3ca7188a5fac03546d6e6686620fc26c15b9053c 100644
--- a/components/search_engines/template_url.cc
+++ b/components/search_engines/template_url.cc
@@ -711,15 +711,12 @@ std::string TemplateURLRef::ParseURL(const std::string& url,
// Handles the post parameters.
const std::string& post_params_string = GetPostParamsString();
if (!post_params_string.empty()) {
- typedef std::vector<std::string> Strings;
- Strings param_list;
- base::SplitString(post_params_string, ',', &param_list);
-
- for (Strings::const_iterator iterator = param_list.begin();
- iterator != param_list.end(); ++iterator) {
- Strings parts;
+ for (const base::StringPiece& cur : base::SplitStringPiece(
+ post_params_string, ",",
+ base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
// The '=' delimiter is required and the name must be not empty.
- base::SplitString(*iterator, '=', &parts);
+ std::vector<std::string> parts = base::SplitString(
+ cur, "=", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
if ((parts.size() != 2U) || parts[0].empty())
return std::string();
« no previous file with comments | « components/search_engines/keyword_table.cc ('k') | components/search_engines/template_url_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698