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

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

Issue 938093003: Always treat .localhost as loopback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move constants, add a test case, style fix Created 5 years, 9 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 | « no previous file | net/base/net_util.cc » ('j') | net/base/net_util.cc » ('J')
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 #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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 socklen_t address_len); 434 socklen_t address_len);
435 435
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);
445
444 // A subset of IP address attributes which are actionable by the 446 // A subset of IP address attributes which are actionable by the
445 // application layer. Currently unimplemented for all hosts; 447 // application layer. Currently unimplemented for all hosts;
446 // IP_ADDRESS_ATTRIBUTE_NONE is always returned. 448 // IP_ADDRESS_ATTRIBUTE_NONE is always returned.
447 enum IPAddressAttributes { 449 enum IPAddressAttributes {
448 IP_ADDRESS_ATTRIBUTE_NONE = 0, 450 IP_ADDRESS_ATTRIBUTE_NONE = 0,
449 451
450 // A temporary address is dynamic by nature and will not contain MAC 452 // A temporary address is dynamic by nature and will not contain MAC
451 // address. Presence of MAC address in IPv6 addresses can be used to 453 // address. Presence of MAC address in IPv6 addresses can be used to
452 // track an endpoint and cause privacy concern. Please refer to 454 // track an endpoint and cause privacy concern. Please refer to
453 // RFC4941. 455 // RFC4941.
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 DSCP_CS5 = 40, // Video 580 DSCP_CS5 = 40, // Video
579 DSCP_EF = 46, // Voice 581 DSCP_EF = 46, // Voice
580 DSCP_CS6 = 48, // Voice 582 DSCP_CS6 = 48, // Voice
581 DSCP_CS7 = 56, // Control messages 583 DSCP_CS7 = 56, // Control messages
582 DSCP_LAST = DSCP_CS7 584 DSCP_LAST = DSCP_CS7
583 }; 585 };
584 586
585 } // namespace net 587 } // namespace net
586 588
587 #endif // NET_BASE_NET_UTIL_H_ 589 #endif // NET_BASE_NET_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | net/base/net_util.cc » ('j') | net/base/net_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698