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

Side by Side Diff: net/proxy/proxy_bypass_rules.cc

Issue 6549007: Make CrOS proxy configuration write prefs directly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove default request context proxy config service patch. Created 9 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/proxy/proxy_bypass_rules.h" 5 #include "net/proxy/proxy_bypass_rules.h"
6 6
7 #include "base/stl_util-inl.h" 7 #include "base/stl_util-inl.h"
8 #include "base/string_number_conversions.h" 8 #include "base/string_number_conversions.h"
9 #include "base/string_tokenizer.h" 9 #include "base/string_tokenizer.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
11 #include "net/base/net_util.h" 11 #include "net/base/net_util.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 212
213 bool ProxyBypassRules::AddRuleFromString(const std::string& raw) { 213 bool ProxyBypassRules::AddRuleFromString(const std::string& raw) {
214 return AddRuleFromStringInternalWithLogging(raw, false); 214 return AddRuleFromStringInternalWithLogging(raw, false);
215 } 215 }
216 216
217 bool ProxyBypassRules::AddRuleFromStringUsingSuffixMatching( 217 bool ProxyBypassRules::AddRuleFromStringUsingSuffixMatching(
218 const std::string& raw) { 218 const std::string& raw) {
219 return AddRuleFromStringInternalWithLogging(raw, true); 219 return AddRuleFromStringInternalWithLogging(raw, true);
220 } 220 }
221 221
222 std::string ProxyBypassRules::ToString() const {
223 std::string result;
224 for (RuleList::const_iterator rule(rules_.begin());
225 rule != rules_.end();
226 ++rule) {
227 result += (*rule)->ToString();
228 result += ";";
229 }
230 return result;
231 }
232
222 void ProxyBypassRules::Clear() { 233 void ProxyBypassRules::Clear() {
223 STLDeleteElements(&rules_); 234 STLDeleteElements(&rules_);
224 } 235 }
225 236
226 void ProxyBypassRules::AssignFrom(const ProxyBypassRules& other) { 237 void ProxyBypassRules::AssignFrom(const ProxyBypassRules& other) {
227 Clear(); 238 Clear();
228 239
229 // Make a copy of the rules list. 240 // Make a copy of the rules list.
230 for (RuleList::const_iterator it = other.rules_.begin(); 241 for (RuleList::const_iterator it = other.rules_.begin();
231 it != other.rules_.end(); ++it) { 242 it != other.rules_.end(); ++it) {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 return AddRuleForHostname(scheme, raw, port); 334 return AddRuleForHostname(scheme, raw, port);
324 } 335 }
325 336
326 bool ProxyBypassRules::AddRuleFromStringInternalWithLogging( 337 bool ProxyBypassRules::AddRuleFromStringInternalWithLogging(
327 const std::string& raw, 338 const std::string& raw,
328 bool use_hostname_suffix_matching) { 339 bool use_hostname_suffix_matching) {
329 return AddRuleFromStringInternal(raw, use_hostname_suffix_matching); 340 return AddRuleFromStringInternal(raw, use_hostname_suffix_matching);
330 } 341 }
331 342
332 } // namespace net 343 } // namespace net
OLDNEW
« chrome/browser/profiles/profile_io_data.cc ('K') | « net/proxy/proxy_bypass_rules.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698