diff options
Diffstat (limited to 'net/base/host_port_pair.h')
-rw-r--r-- | net/base/host_port_pair.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/net/base/host_port_pair.h b/net/base/host_port_pair.h index ab7f312..547e898 100644 --- a/net/base/host_port_pair.h +++ b/net/base/host_port_pair.h @@ -11,9 +11,9 @@ namespace net { struct HostPortPair { - HostPortPair() {} - HostPortPair(const std::string& in_host, uint16 in_port) - : host(in_host), port(in_port) {} + HostPortPair(); + // If |in_host| represents an IPv6 address, it should not bracket the address. + HostPortPair(const std::string& in_host, uint16 in_port); // Comparator function so this can be placed in a std::map. bool operator<(const HostPortPair& other) const { @@ -22,8 +22,12 @@ struct HostPortPair { return port < other.port; } + // ToString() will convert the HostPortPair to "host:port". If |host| is an + // IPv6 literal, it will add brackets around |host|. std::string ToString() const; + // If |host| represents an IPv6 address, this string will not contain brackets + // around the address. std::string host; uint16 port; }; |