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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 // Returns true if |host| is one of the names (e.g. "localhost") or IP | 436 // Returns true if |host| is one of the names (e.g. "localhost") or IP |
437 // addresses (IPv4 127.0.0.0/8 or IPv6 ::1) that indicate a loopback. | 437 // addresses (IPv4 127.0.0.0/8 or IPv6 ::1) that indicate a loopback. |
438 // | 438 // |
439 // Note that this function does not check for IP addresses other than | 439 // Note that this function does not check for IP addresses other than |
440 // the above, although other IP addresses may point to the local | 440 // the above, although other IP addresses may point to the local |
441 // machine. | 441 // machine. |
442 NET_EXPORT_PRIVATE bool IsLocalhost(const std::string& host); | 442 NET_EXPORT_PRIVATE bool IsLocalhost(const std::string& host); |
443 | 443 |
444 NET_EXPORT_PRIVATE bool IsLocalhostTLD(const std::string& host); | 444 NET_EXPORT_PRIVATE bool IsLocalhostTLD(const std::string& host); |
445 | 445 |
| 446 // Returns true if the url's host is a Google server. This should only be used |
| 447 // for histograms and shouldn't be used to affect behavior. |
| 448 NET_EXPORT_PRIVATE bool HasGoogleHost(const GURL& url); |
| 449 |
446 // A subset of IP address attributes which are actionable by the | 450 // A subset of IP address attributes which are actionable by the |
447 // application layer. Currently unimplemented for all hosts; | 451 // application layer. Currently unimplemented for all hosts; |
448 // IP_ADDRESS_ATTRIBUTE_NONE is always returned. | 452 // IP_ADDRESS_ATTRIBUTE_NONE is always returned. |
449 enum IPAddressAttributes { | 453 enum IPAddressAttributes { |
450 IP_ADDRESS_ATTRIBUTE_NONE = 0, | 454 IP_ADDRESS_ATTRIBUTE_NONE = 0, |
451 | 455 |
452 // A temporary address is dynamic by nature and will not contain MAC | 456 // A temporary address is dynamic by nature and will not contain MAC |
453 // address. Presence of MAC address in IPv6 addresses can be used to | 457 // address. Presence of MAC address in IPv6 addresses can be used to |
454 // track an endpoint and cause privacy concern. Please refer to | 458 // track an endpoint and cause privacy concern. Please refer to |
455 // RFC4941. | 459 // RFC4941. |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 DSCP_CS5 = 40, // Video | 584 DSCP_CS5 = 40, // Video |
581 DSCP_EF = 46, // Voice | 585 DSCP_EF = 46, // Voice |
582 DSCP_CS6 = 48, // Voice | 586 DSCP_CS6 = 48, // Voice |
583 DSCP_CS7 = 56, // Control messages | 587 DSCP_CS7 = 56, // Control messages |
584 DSCP_LAST = DSCP_CS7 | 588 DSCP_LAST = DSCP_CS7 |
585 }; | 589 }; |
586 | 590 |
587 } // namespace net | 591 } // namespace net |
588 | 592 |
589 #endif // NET_BASE_NET_UTIL_H_ | 593 #endif // NET_BASE_NET_UTIL_H_ |
OLD | NEW |