| 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 #ifndef NET_BASE_NET_UTIL_H_ | 5 #ifndef NET_BASE_NET_UTIL_H_ |
| 6 #define NET_BASE_NET_UTIL_H_ | 6 #define NET_BASE_NET_UTIL_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 bool is_dir, int64 size, | 241 bool is_dir, int64 size, |
| 242 base::Time modified); | 242 base::Time modified); |
| 243 | 243 |
| 244 // If text starts with "www." it is removed, otherwise text is returned | 244 // If text starts with "www." it is removed, otherwise text is returned |
| 245 // unmodified. | 245 // unmodified. |
| 246 NET_EXPORT base::string16 StripWWW(const base::string16& text); | 246 NET_EXPORT base::string16 StripWWW(const base::string16& text); |
| 247 | 247 |
| 248 // Runs |url|'s host through StripWWW(). |url| must be valid. | 248 // Runs |url|'s host through StripWWW(). |url| must be valid. |
| 249 NET_EXPORT base::string16 StripWWWFromHost(const GURL& url); | 249 NET_EXPORT base::string16 StripWWWFromHost(const GURL& url); |
| 250 | 250 |
| 251 // Checks if |port| is in the valid range (0 to 65535, though 0 is technically |
| 252 // reserved). Should be used before casting a port to a uint16. |
| 253 NET_EXPORT bool IsPortValid(int port); |
| 254 |
| 251 // Checks |port| against a list of ports which are restricted by default. | 255 // Checks |port| against a list of ports which are restricted by default. |
| 252 // Returns true if |port| is allowed, false if it is restricted. | 256 // Returns true if |port| is allowed, false if it is restricted. |
| 253 NET_EXPORT bool IsPortAllowedByDefault(int port); | 257 NET_EXPORT bool IsPortAllowedByDefault(int port); |
| 254 | 258 |
| 255 // Checks |port| against a list of ports which are restricted by the FTP | 259 // Checks |port| against a list of ports which are restricted by the FTP |
| 256 // protocol. Returns true if |port| is allowed, false if it is restricted. | 260 // protocol. Returns true if |port| is allowed, false if it is restricted. |
| 257 NET_EXPORT_PRIVATE bool IsPortAllowedByFtp(int port); | 261 NET_EXPORT_PRIVATE bool IsPortAllowedByFtp(int port); |
| 258 | 262 |
| 259 // Check if banned |port| has been overriden by an entry in | 263 // Check if banned |port| has been overriden by an entry in |
| 260 // |explicitly_allowed_ports_|. | 264 // |explicitly_allowed_ports_|. |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 DSCP_CS5 = 40, // Video | 576 DSCP_CS5 = 40, // Video |
| 573 DSCP_EF = 46, // Voice | 577 DSCP_EF = 46, // Voice |
| 574 DSCP_CS6 = 48, // Voice | 578 DSCP_CS6 = 48, // Voice |
| 575 DSCP_CS7 = 56, // Control messages | 579 DSCP_CS7 = 56, // Control messages |
| 576 DSCP_LAST = DSCP_CS7 | 580 DSCP_LAST = DSCP_CS7 |
| 577 }; | 581 }; |
| 578 | 582 |
| 579 } // namespace net | 583 } // namespace net |
| 580 | 584 |
| 581 #endif // NET_BASE_NET_UTIL_H_ | 585 #endif // NET_BASE_NET_UTIL_H_ |
| OLD | NEW |