OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/base/net_util.h" | 5 #include "net/base/net_util.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <string.h> | 8 #include <string.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 if (!IsPortValid(port)) | 283 if (!IsPortValid(port)) |
284 return false; | 284 return false; |
285 | 285 |
286 // Allow explitly allowed ports for any scheme. | 286 // Allow explitly allowed ports for any scheme. |
287 if (port_override_mode == PORT_OVERRIDES_ALLOWED && | 287 if (port_override_mode == PORT_OVERRIDES_ALLOWED && |
288 g_explicitly_allowed_ports.Get().count(port) > 0) { | 288 g_explicitly_allowed_ports.Get().count(port) > 0) { |
289 return true; | 289 return true; |
290 } | 290 } |
291 | 291 |
292 // FTP requests have an extra set of whitelisted schemes. | 292 // FTP requests have an extra set of whitelisted schemes. |
293 if (LowerCaseEqualsASCII(url_scheme, url::kFtpScheme)) { | 293 if (base::LowerCaseEqualsASCII(url_scheme, url::kFtpScheme)) { |
294 for (int allowed_ftp_port : kAllowedFtpPorts) { | 294 for (int allowed_ftp_port : kAllowedFtpPorts) { |
295 if (allowed_ftp_port == port) | 295 if (allowed_ftp_port == port) |
296 return true; | 296 return true; |
297 } | 297 } |
298 } | 298 } |
299 | 299 |
300 // Finally check against the generic list of restricted ports for all | 300 // Finally check against the generic list of restricted ports for all |
301 // schemes. | 301 // schemes. |
302 for (int restricted_port : kRestrictedPorts) { | 302 for (int restricted_port : kRestrictedPorts) { |
303 if (restricted_port == port) | 303 if (restricted_port == port) |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 }; | 798 }; |
799 const std::string& host = url.host(); | 799 const std::string& host = url.host(); |
800 for (const char* suffix : kGoogleHostSuffixes) { | 800 for (const char* suffix : kGoogleHostSuffixes) { |
801 if (EndsWith(host, suffix, false)) | 801 if (EndsWith(host, suffix, false)) |
802 return true; | 802 return true; |
803 } | 803 } |
804 return false; | 804 return false; |
805 } | 805 } |
806 | 806 |
807 } // namespace net | 807 } // namespace net |
OLD | NEW |