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

Side by Side Diff: net/base/host_mapping_rules.cc

Issue 12087091: Move string tokenizer to base/strings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sort Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gpu/command_buffer/service/test_helper.cc ('k') | net/base/mapped_host_resolver.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/base/host_mapping_rules.h" 5 #include "net/base/host_mapping_rules.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/string_split.h" 8 #include "base/string_split.h"
9 #include "base/string_tokenizer.h"
10 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/strings/string_tokenizer.h"
11 #include "net/base/host_port_pair.h" 11 #include "net/base/host_port_pair.h"
12 #include "net/base/net_util.h" 12 #include "net/base/net_util.h"
13 13
14 namespace net { 14 namespace net {
15 15
16 struct HostMappingRules::MapRule { 16 struct HostMappingRules::MapRule {
17 MapRule() : replacement_port(-1) {} 17 MapRule() : replacement_port(-1) {}
18 18
19 std::string hostname_pattern; 19 std::string hostname_pattern;
20 std::string replacement_hostname; 20 std::string replacement_hostname;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 return true; 93 return true;
94 } 94 }
95 95
96 return false; 96 return false;
97 } 97 }
98 98
99 void HostMappingRules::SetRulesFromString(const std::string& rules_string) { 99 void HostMappingRules::SetRulesFromString(const std::string& rules_string) {
100 exclusion_rules_.clear(); 100 exclusion_rules_.clear();
101 map_rules_.clear(); 101 map_rules_.clear();
102 102
103 StringTokenizer rules(rules_string, ","); 103 base::StringTokenizer rules(rules_string, ",");
104 while (rules.GetNext()) { 104 while (rules.GetNext()) {
105 bool ok = AddRuleFromString(rules.token()); 105 bool ok = AddRuleFromString(rules.token());
106 LOG_IF(ERROR, !ok) << "Failed parsing rule: " << rules.token(); 106 LOG_IF(ERROR, !ok) << "Failed parsing rule: " << rules.token();
107 } 107 }
108 } 108 }
109 109
110 } // namespace net 110 } // namespace net
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/test_helper.cc ('k') | net/base/mapped_host_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698