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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.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
Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc
index eff059e8817da2db2593c7442a4b810a57277a7b..24be61b0998bdf0d2ccf1d351a23bc011451d626 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_request_options.cc
@@ -87,11 +87,11 @@ bool DataReductionProxyRequestOptions::ParseLocalSessionKey(
const std::string& session_key,
std::string* session,
std::string* credentials) {
- std::vector<std::string> auth_values;
- base::SplitString(session_key, '|', &auth_values);
+ std::vector<base::StringPiece> auth_values = base::SplitStringPiece(
+ session_key, "|", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
if (auth_values.size() == 2) {
- *session = auth_values[0];
- *credentials = auth_values[1];
+ auth_values[0].CopyToString(session);
+ auth_values[1].CopyToString(credentials);
return true;
}
@@ -145,12 +145,12 @@ void DataReductionProxyRequestOptions::GetChromiumBuildAndPatch(
const std::string& version,
std::string* build,
std::string* patch) const {
- std::vector<std::string> version_parts;
- base::SplitString(version, '.', &version_parts);
+ std::vector<base::StringPiece> version_parts = base::SplitStringPiece(
+ version, ".", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
if (version_parts.size() != 4)
return;
- *build = version_parts[2];
- *patch = version_parts[3];
+ version_parts[2].CopyToString(build);
+ version_parts[3].CopyToString(patch);
}
void DataReductionProxyRequestOptions::UpdateVersion() {

Powered by Google App Engine
This is Rietveld 408576698