| Index: net/base/host_port_pair.cc
|
| diff --git a/net/base/host_port_pair.cc b/net/base/host_port_pair.cc
|
| index 1c4406f4b7fb3952f4cac0beff25cb910bba36e5..5164fcf0c2b910408d247555e599434c7b48a42d 100644
|
| --- a/net/base/host_port_pair.cc
|
| +++ b/net/base/host_port_pair.cc
|
| @@ -7,6 +7,8 @@
|
| #include "base/string_util.h"
|
| #include "base/stringprintf.h"
|
| #include "googleurl/src/gurl.h"
|
| +#include "net/base/net_util.h"
|
| +#include "net/base/sys_addrinfo.h"
|
|
|
| namespace net {
|
|
|
| @@ -19,6 +21,12 @@ HostPortPair HostPortPair::FromURL(const GURL& url) {
|
| return HostPortPair(url.HostNoBrackets(), url.EffectiveIntPort());
|
| }
|
|
|
| +// static
|
| +HostPortPair HostPortPair::FromAddrInfo(const struct addrinfo* ai) {
|
| + return HostPortPair(NetAddressToString(ai),
|
| + GetPortFromSockaddr(ai->ai_addr, ai->ai_addrlen));
|
| +}
|
| +
|
| std::string HostPortPair::ToString() const {
|
| return base::StringPrintf("%s:%u", HostForURL().c_str(), port_);
|
| }
|
|
|