| OLD | NEW |
| 1 // Copyright (c) 2011 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.h" | 7 #include "base/stl_util.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 while (entries.GetNext()) { | 255 while (entries.GetNext()) { |
| 256 AddRuleFromStringInternalWithLogging(entries.token(), | 256 AddRuleFromStringInternalWithLogging(entries.token(), |
| 257 use_hostname_suffix_matching); | 257 use_hostname_suffix_matching); |
| 258 } | 258 } |
| 259 } | 259 } |
| 260 | 260 |
| 261 bool ProxyBypassRules::AddRuleFromStringInternal( | 261 bool ProxyBypassRules::AddRuleFromStringInternal( |
| 262 const std::string& raw_untrimmed, | 262 const std::string& raw_untrimmed, |
| 263 bool use_hostname_suffix_matching) { | 263 bool use_hostname_suffix_matching) { |
| 264 std::string raw; | 264 std::string raw; |
| 265 TrimWhitespaceASCII(raw_untrimmed, TRIM_ALL, &raw); | 265 base::TrimWhitespaceASCII(raw_untrimmed, base::TRIM_ALL, &raw); |
| 266 | 266 |
| 267 // This is the special syntax used by WinInet's bypass list -- we allow it | 267 // This is the special syntax used by WinInet's bypass list -- we allow it |
| 268 // on all platforms and interpret it the same way. | 268 // on all platforms and interpret it the same way. |
| 269 if (LowerCaseEqualsASCII(raw, "<local>")) { | 269 if (LowerCaseEqualsASCII(raw, "<local>")) { |
| 270 AddRuleToBypassLocal(); | 270 AddRuleToBypassLocal(); |
| 271 return true; | 271 return true; |
| 272 } | 272 } |
| 273 | 273 |
| 274 // Extract any scheme-restriction. | 274 // Extract any scheme-restriction. |
| 275 std::string::size_type scheme_pos = raw.find("://"); | 275 std::string::size_type scheme_pos = raw.find("://"); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 return AddRuleForHostname(scheme, raw, port); | 338 return AddRuleForHostname(scheme, raw, port); |
| 339 } | 339 } |
| 340 | 340 |
| 341 bool ProxyBypassRules::AddRuleFromStringInternalWithLogging( | 341 bool ProxyBypassRules::AddRuleFromStringInternalWithLogging( |
| 342 const std::string& raw, | 342 const std::string& raw, |
| 343 bool use_hostname_suffix_matching) { | 343 bool use_hostname_suffix_matching) { |
| 344 return AddRuleFromStringInternal(raw, use_hostname_suffix_matching); | 344 return AddRuleFromStringInternal(raw, use_hostname_suffix_matching); |
| 345 } | 345 } |
| 346 | 346 |
| 347 } // namespace net | 347 } // namespace net |
| OLD | NEW |