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

Side by Side Diff: net/proxy/proxy_bypass_rules.cc

Issue 255333003: Renamed namespaces in src/net. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tue 04/29/2014 19:22:06.75 Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/http/http_stream_factory.cc ('k') | net/proxy/proxy_config_service_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 private: 125 private:
126 const std::string description_; 126 const std::string description_;
127 const std::string optional_scheme_; 127 const std::string optional_scheme_;
128 const IPAddressNumber ip_prefix_; 128 const IPAddressNumber ip_prefix_;
129 const size_t prefix_length_in_bits_; 129 const size_t prefix_length_in_bits_;
130 }; 130 };
131 131
132 // Returns true if the given string represents an IP address. 132 // Returns true if the given string represents an IP address.
133 bool IsIPAddress(const std::string& domain) { 133 bool IsIPAddress(const std::string& domain) {
134 // From GURL::HostIsIPAddress() 134 // From GURL::HostIsIPAddress()
135 url_canon::RawCanonOutputT<char, 128> ignored_output; 135 url::RawCanonOutputT<char, 128> ignored_output;
136 url_canon::CanonHostInfo host_info; 136 url::CanonHostInfo host_info;
137 url_parse::Component domain_comp(0, domain.size()); 137 url::Component domain_comp(0, domain.size());
138 url_canon::CanonicalizeIPAddress(domain.c_str(), domain_comp, 138 url::CanonicalizeIPAddress(domain.c_str(), domain_comp, &ignored_output,
139 &ignored_output, &host_info); 139 &host_info);
140 return host_info.IsIPAddress(); 140 return host_info.IsIPAddress();
141 } 141 }
142 142
143 } // namespace 143 } // namespace
144 144
145 ProxyBypassRules::Rule::Rule() { 145 ProxyBypassRules::Rule::Rule() {
146 } 146 }
147 147
148 ProxyBypassRules::Rule::~Rule() { 148 ProxyBypassRules::Rule::~Rule() {
149 } 149 }
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « net/http/http_stream_factory.cc ('k') | net/proxy/proxy_config_service_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698