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

Side by Side Diff: net/base/net_util.cc

Issue 1172753003: Move LowerCaseEqualsASCII to base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@string_util
Patch Set: Created 5 years, 6 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
« no previous file with comments | « net/base/host_mapping_rules.cc ('k') | net/filter/filter.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) 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
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
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
OLDNEW
« no previous file with comments | « net/base/host_mapping_rules.cc ('k') | net/filter/filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698