diff options
author | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 08:18:46 +0000 |
---|---|---|
committer | mnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 08:18:46 +0000 |
commit | 4493574d71becba0ad1cbb74ce600466cc4f33e0 (patch) | |
tree | f50e1a49a49043de9e134087cb98f3b337fdf3b1 /net | |
parent | a15cbd47814d62163e2d66e64e7cb9e144fa5ca1 (diff) | |
download | chromium_src-4493574d71becba0ad1cbb74ce600466cc4f33e0.zip chromium_src-4493574d71becba0ad1cbb74ce600466cc4f33e0.tar.gz chromium_src-4493574d71becba0ad1cbb74ce600466cc4f33e0.tar.bz2 |
Make the glob matcher support UTF8 strings.
This generalizes the existing pattern matching code to support UTF8 strings.
BUG=53158
TEST=string_util_unittests.cc
Review URL: http://codereview.chromium.org/3295018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59071 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/host_mapping_rules.cc | 6 | ||||
-rw-r--r-- | net/base/mock_host_resolver.cc | 2 | ||||
-rw-r--r-- | net/proxy/proxy_bypass_rules.cc | 3 |
3 files changed, 5 insertions, 6 deletions
diff --git a/net/base/host_mapping_rules.cc b/net/base/host_mapping_rules.cc index 56b9694..a535d14 100644 --- a/net/base/host_mapping_rules.cc +++ b/net/base/host_mapping_rules.cc @@ -19,7 +19,7 @@ bool HostMappingRules::RewriteHost(HostPortPair* host_port) const { for (ExclusionRuleList::const_iterator it = exclusion_rules_.begin(); it != exclusion_rules_.end(); ++it) { const ExclusionRule& rule = *it; - if (MatchPatternASCII(host_port->host(), rule.hostname_pattern)) + if (MatchPattern(host_port->host(), rule.hostname_pattern)) return false; } @@ -35,9 +35,9 @@ bool HostMappingRules::RewriteHost(HostPortPair* host_port) const { // *.foo.com:1234 // First, we'll check for a match just on hostname. // If that fails, we'll check for a match with both hostname and port. - if (!MatchPatternASCII(host_port->host(), rule.hostname_pattern)) { + if (!MatchPattern(host_port->host(), rule.hostname_pattern)) { std::string host_port_string = host_port->ToString(); - if (!MatchPatternASCII(host_port_string, rule.hostname_pattern)) + if (!MatchPattern(host_port_string, rule.hostname_pattern)) continue; // This rule doesn't apply. } diff --git a/net/base/mock_host_resolver.cc b/net/base/mock_host_resolver.cc index 8c2a9a4..f8c53a6 100644 --- a/net/base/mock_host_resolver.cc +++ b/net/base/mock_host_resolver.cc @@ -227,7 +227,7 @@ int RuleBasedHostResolverProc::Resolve(const std::string& host, bool matches_flags = (r->host_resolver_flags & host_resolver_flags) == host_resolver_flags; if (matches_flags && matches_address_family && - MatchPatternASCII(host, r->host_pattern)) { + MatchPattern(host, r->host_pattern)) { if (r->latency_ms != 0) PlatformThread::Sleep(r->latency_ms); diff --git a/net/proxy/proxy_bypass_rules.cc b/net/proxy/proxy_bypass_rules.cc index 987543a..757d817 100644 --- a/net/proxy/proxy_bypass_rules.cc +++ b/net/proxy/proxy_bypass_rules.cc @@ -32,8 +32,7 @@ class HostnamePatternRule : public ProxyBypassRules::Rule { // Note it is necessary to lower-case the host, since GURL uses capital // letters for percent-escaped characters. - return MatchPatternASCII(StringToLowerASCII(url.host()), - hostname_pattern_); + return MatchPattern(StringToLowerASCII(url.host()), hostname_pattern_); } virtual std::string ToString() const { |