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

Unified Diff: net/base/host_mapping_rules.cc

Issue 1226673003: Move MatchPattern to its own header and the base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/filters/stream_parser_factory.cc ('k') | net/cert/mock_cert_verifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/host_mapping_rules.cc
diff --git a/net/base/host_mapping_rules.cc b/net/base/host_mapping_rules.cc
index 179a0dc89d25de5d5e266482576f10559b66b01e..a0bbf6e60881cc9cb32657743de0ba7c74606c17 100644
--- a/net/base/host_mapping_rules.cc
+++ b/net/base/host_mapping_rules.cc
@@ -5,6 +5,7 @@
#include "net/base/host_mapping_rules.h"
#include "base/logging.h"
+#include "base/strings/pattern.h"
#include "base/strings/string_split.h"
#include "base/strings/string_tokenizer.h"
#include "base/strings/string_util.h"
@@ -34,7 +35,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 (MatchPattern(host_port->host(), rule.hostname_pattern))
+ if (base::MatchPattern(host_port->host(), rule.hostname_pattern))
return false;
}
@@ -50,9 +51,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 (!MatchPattern(host_port->host(), rule.hostname_pattern)) {
+ if (!base::MatchPattern(host_port->host(), rule.hostname_pattern)) {
std::string host_port_string = host_port->ToString();
- if (!MatchPattern(host_port_string, rule.hostname_pattern))
+ if (!base::MatchPattern(host_port_string, rule.hostname_pattern))
continue; // This rule doesn't apply.
}
« no previous file with comments | « media/filters/stream_parser_factory.cc ('k') | net/cert/mock_cert_verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698