| Index: net/proxy/proxy_bypass_rules.cc
|
| diff --git a/net/proxy/proxy_bypass_rules.cc b/net/proxy/proxy_bypass_rules.cc
|
| index e402db835c4c0165760a2350b07cda2b4e7fb608..741991735ea0eb6bb69e758c9651b3f1afff8505 100644
|
| --- a/net/proxy/proxy_bypass_rules.cc
|
| +++ b/net/proxy/proxy_bypass_rules.cc
|
| @@ -23,8 +23,7 @@ class HostnamePatternRule : public ProxyBypassRules::Rule {
|
| int optional_port)
|
| : optional_scheme_(StringToLowerASCII(optional_scheme)),
|
| hostname_pattern_(StringToLowerASCII(hostname_pattern)),
|
| - optional_port_(optional_port) {
|
| - }
|
| + optional_port_(optional_port) {}
|
|
|
| virtual bool Matches(const GURL& url) const OVERRIDE {
|
| if (optional_port_ != -1 && url.EffectiveIntPort() != optional_port_)
|
| @@ -49,9 +48,8 @@ class HostnamePatternRule : public ProxyBypassRules::Rule {
|
| }
|
|
|
| virtual Rule* Clone() const OVERRIDE {
|
| - return new HostnamePatternRule(optional_scheme_,
|
| - hostname_pattern_,
|
| - optional_port_);
|
| + return new HostnamePatternRule(
|
| + optional_scheme_, hostname_pattern_, optional_port_);
|
| }
|
|
|
| private:
|
| @@ -69,13 +67,9 @@ class BypassLocalRule : public ProxyBypassRules::Rule {
|
| return host.find('.') == std::string::npos;
|
| }
|
|
|
| - virtual std::string ToString() const OVERRIDE {
|
| - return "<local>";
|
| - }
|
| + virtual std::string ToString() const OVERRIDE { return "<local>"; }
|
|
|
| - virtual Rule* Clone() const OVERRIDE {
|
| - return new BypassLocalRule();
|
| - }
|
| + virtual Rule* Clone() const OVERRIDE { return new BypassLocalRule(); }
|
| };
|
|
|
| // Rule for matching a URL that is an IP address, if that IP address falls
|
| @@ -91,8 +85,7 @@ class BypassIPBlockRule : public ProxyBypassRules::Rule {
|
| : description_(description),
|
| optional_scheme_(optional_scheme),
|
| ip_prefix_(ip_prefix),
|
| - prefix_length_in_bits_(prefix_length_in_bits) {
|
| - }
|
| + prefix_length_in_bits_(prefix_length_in_bits) {}
|
|
|
| virtual bool Matches(const GURL& url) const OVERRIDE {
|
| if (!url.HostIsIPAddress())
|
| @@ -107,19 +100,14 @@ class BypassIPBlockRule : public ProxyBypassRules::Rule {
|
| return false;
|
|
|
| // Test if it has the expected prefix.
|
| - return IPNumberMatchesPrefix(ip_number, ip_prefix_,
|
| - prefix_length_in_bits_);
|
| + return IPNumberMatchesPrefix(ip_number, ip_prefix_, prefix_length_in_bits_);
|
| }
|
|
|
| - virtual std::string ToString() const OVERRIDE {
|
| - return description_;
|
| - }
|
| + virtual std::string ToString() const OVERRIDE { return description_; }
|
|
|
| virtual Rule* Clone() const OVERRIDE {
|
| - return new BypassIPBlockRule(description_,
|
| - optional_scheme_,
|
| - ip_prefix_,
|
| - prefix_length_in_bits_);
|
| + return new BypassIPBlockRule(
|
| + description_, optional_scheme_, ip_prefix_, prefix_length_in_bits_);
|
| }
|
|
|
| private:
|
| @@ -135,8 +123,8 @@ bool IsIPAddress(const std::string& domain) {
|
| url::RawCanonOutputT<char, 128> ignored_output;
|
| url::CanonHostInfo host_info;
|
| url::Component domain_comp(0, domain.size());
|
| - url::CanonicalizeIPAddress(domain.c_str(), domain_comp, &ignored_output,
|
| - &host_info);
|
| + url::CanonicalizeIPAddress(
|
| + domain.c_str(), domain_comp, &ignored_output, &host_info);
|
| return host_info.IsIPAddress();
|
| }
|
|
|
| @@ -202,9 +190,8 @@ bool ProxyBypassRules::AddRuleForHostname(const std::string& optional_scheme,
|
| if (hostname_pattern.empty())
|
| return false;
|
|
|
| - rules_.push_back(new HostnamePatternRule(optional_scheme,
|
| - hostname_pattern,
|
| - optional_port));
|
| + rules_.push_back(new HostnamePatternRule(
|
| + optional_scheme, hostname_pattern, optional_port));
|
| return true;
|
| }
|
|
|
| @@ -223,8 +210,7 @@ bool ProxyBypassRules::AddRuleFromStringUsingSuffixMatching(
|
|
|
| std::string ProxyBypassRules::ToString() const {
|
| std::string result;
|
| - for (RuleList::const_iterator rule(rules_.begin());
|
| - rule != rules_.end();
|
| + for (RuleList::const_iterator rule(rules_.begin()); rule != rules_.end();
|
| ++rule) {
|
| result += (*rule)->ToString();
|
| result += ";";
|
| @@ -241,7 +227,8 @@ void ProxyBypassRules::AssignFrom(const ProxyBypassRules& other) {
|
|
|
| // Make a copy of the rules list.
|
| for (RuleList::const_iterator it = other.rules_.begin();
|
| - it != other.rules_.end(); ++it) {
|
| + it != other.rules_.end();
|
| + ++it) {
|
| rules_.push_back((*it)->Clone());
|
| }
|
| }
|
| @@ -316,9 +303,8 @@ bool ProxyBypassRules::AddRuleFromStringInternal(
|
| host = raw;
|
| port = -1;
|
| if (pos_colon != std::string::npos) {
|
| - if (!base::StringToInt(base::StringPiece(raw.begin() + pos_colon + 1,
|
| - raw.end()),
|
| - &port) ||
|
| + if (!base::StringToInt(
|
| + base::StringPiece(raw.begin() + pos_colon + 1, raw.end()), &port) ||
|
| (port < 0 || port > 0xFFFF)) {
|
| return false; // Port was invalid.
|
| }
|
|
|