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

Unified Diff: net/base/host_mapping_rules.cc

Issue 1215933004: New new versions of Starts/EndsWith and SplitString in net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@starts_with
Patch Set: 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: net/base/host_mapping_rules.cc
diff --git a/net/base/host_mapping_rules.cc b/net/base/host_mapping_rules.cc
index 179a0dc89d25de5d5e266482576f10559b66b01e..d3da243a13eed51977671499438dbcc18e64fb34 100644
--- a/net/base/host_mapping_rules.cc
+++ b/net/base/host_mapping_rules.cc
@@ -66,10 +66,9 @@ bool HostMappingRules::RewriteHost(HostPortPair* host_port) const {
}
bool HostMappingRules::AddRuleFromString(const std::string& rule_string) {
- std::string trimmed;
- base::TrimWhitespaceASCII(rule_string, base::TRIM_ALL, &trimmed);
- std::vector<std::string> parts;
- base::SplitString(trimmed, ' ', &parts);
+ std::vector<std::string> parts =
+ base::SplitString(base::TrimWhitespaceASCII(rule_string, base::TRIM_ALL),
+ " ", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
// Test for EXCLUSION rule.
if (parts.size() == 2 && base::LowerCaseEqualsASCII(parts[0], "exclude")) {
« no previous file with comments | « net/base/data_url.cc ('k') | net/base/host_port_pair.cc » ('j') | net/base/ip_address_number.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698