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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 } | 260 } |
261 | 261 |
262 bool ProxyBypassRules::AddRuleFromStringInternal( | 262 bool ProxyBypassRules::AddRuleFromStringInternal( |
263 const std::string& raw_untrimmed, | 263 const std::string& raw_untrimmed, |
264 bool use_hostname_suffix_matching) { | 264 bool use_hostname_suffix_matching) { |
265 std::string raw; | 265 std::string raw; |
266 base::TrimWhitespaceASCII(raw_untrimmed, base::TRIM_ALL, &raw); | 266 base::TrimWhitespaceASCII(raw_untrimmed, base::TRIM_ALL, &raw); |
267 | 267 |
268 // This is the special syntax used by WinInet's bypass list -- we allow it | 268 // This is the special syntax used by WinInet's bypass list -- we allow it |
269 // on all platforms and interpret it the same way. | 269 // on all platforms and interpret it the same way. |
270 if (base::LowerCaseEqualsASCII(raw, "<local>")) { | 270 if (LowerCaseEqualsASCII(raw, "<local>")) { |
271 AddRuleToBypassLocal(); | 271 AddRuleToBypassLocal(); |
272 return true; | 272 return true; |
273 } | 273 } |
274 | 274 |
275 // Extract any scheme-restriction. | 275 // Extract any scheme-restriction. |
276 std::string::size_type scheme_pos = raw.find("://"); | 276 std::string::size_type scheme_pos = raw.find("://"); |
277 std::string scheme; | 277 std::string scheme; |
278 if (scheme_pos != std::string::npos) { | 278 if (scheme_pos != std::string::npos) { |
279 scheme = raw.substr(0, scheme_pos); | 279 scheme = raw.substr(0, scheme_pos); |
280 raw = raw.substr(scheme_pos + 3); | 280 raw = raw.substr(scheme_pos + 3); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 return AddRuleForHostname(scheme, raw, port); | 339 return AddRuleForHostname(scheme, raw, port); |
340 } | 340 } |
341 | 341 |
342 bool ProxyBypassRules::AddRuleFromStringInternalWithLogging( | 342 bool ProxyBypassRules::AddRuleFromStringInternalWithLogging( |
343 const std::string& raw, | 343 const std::string& raw, |
344 bool use_hostname_suffix_matching) { | 344 bool use_hostname_suffix_matching) { |
345 return AddRuleFromStringInternal(raw, use_hostname_suffix_matching); | 345 return AddRuleFromStringInternal(raw, use_hostname_suffix_matching); |
346 } | 346 } |
347 | 347 |
348 } // namespace net | 348 } // namespace net |
OLD | NEW |