diff options
-rw-r--r-- | net/base/net_log_event_type_list.h | 10 | ||||
-rw-r--r-- | net/dns/host_resolver_impl.cc | 17 | ||||
-rw-r--r-- | net/dns/host_resolver_impl.h | 3 | ||||
-rw-r--r-- | net/udp/udp_socket_libevent.cc | 2 | ||||
-rw-r--r-- | net/udp/udp_socket_win.cc | 2 |
5 files changed, 26 insertions, 8 deletions
diff --git a/net/base/net_log_event_type_list.h b/net/base/net_log_event_type_list.h index 2647e4c..2f4b052 100644 --- a/net/base/net_log_event_type_list.h +++ b/net/base/net_log_event_type_list.h @@ -59,6 +59,9 @@ EVENT_TYPE(HOST_RESOLVER_IMPL) // } EVENT_TYPE(HOST_RESOLVER_IMPL_REQUEST) +// This event is logged when IPv6 support is determined via IPv6 connect probe. +EVENT_TYPE(HOST_RESOLVER_IMPL_IPV6_SUPPORTED) + // This event is logged when a request is handled by a cache entry. EVENT_TYPE(HOST_RESOLVER_IMPL_CACHE_HIT) @@ -569,6 +572,13 @@ EVENT_TYPE(SSL_CERTIFICATES_RECEIVED) // } EVENT_TYPE(UDP_CONNECT) +// The local address of the UDP socket, retrieved via getsockname. +// The following parameters are attached: +// { +// "address": <Local address bound to the socket>, +// } +EVENT_TYPE(UDP_LOCAL_ADDRESS) + // The specified number of bytes were transferred on the socket. // The following parameters are attached: // { diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc index c86f963..92694af 100644 --- a/net/dns/host_resolver_impl.cc +++ b/net/dns/host_resolver_impl.cc @@ -171,13 +171,14 @@ bool ResemblesMulticastDNSName(const std::string& hostname) { } // Attempts to connect a UDP socket to |dest|:80. -bool IsGloballyReachable(const IPAddressNumber& dest) { +bool IsGloballyReachable(const IPAddressNumber& dest, + const BoundNetLog& net_log) { scoped_ptr<DatagramClientSocket> socket( ClientSocketFactory::GetDefaultFactory()->CreateDatagramClientSocket( DatagramSocket::DEFAULT_BIND, RandIntCallback(), - NULL, - NetLog::Source())); + net_log.net_log(), + net_log.source())); int rv = socket->Connect(IPEndPoint(dest, 80)); if (rv != OK) return false; @@ -1750,7 +1751,7 @@ int HostResolverImpl::Resolve(const RequestInfo& info, // Build a key that identifies the request in the cache and in the // outstanding jobs map. - Key key = GetEffectiveKeyForRequest(info); + Key key = GetEffectiveKeyForRequest(info, request_net_log); int rv = ResolveHelper(key, info, addresses, request_net_log); if (rv != ERR_DNS_CACHE_MISS) { @@ -1838,7 +1839,7 @@ int HostResolverImpl::ResolveFromCache(const RequestInfo& info, // Update the net log and notify registered observers. LogStartRequest(source_net_log, request_net_log, info); - Key key = GetEffectiveKeyForRequest(info); + Key key = GetEffectiveKeyForRequest(info, request_net_log); int rv = ResolveHelper(key, info, addresses, request_net_log); LogFinishRequest(source_net_log, request_net_log, info, rv); @@ -2014,7 +2015,7 @@ void HostResolverImpl::SetHaveOnlyLoopbackAddresses(bool result) { } HostResolverImpl::Key HostResolverImpl::GetEffectiveKeyForRequest( - const RequestInfo& info) const { + const RequestInfo& info, const BoundNetLog& net_log) const { HostResolverFlags effective_flags = info.host_resolver_flags() | additional_resolver_flags_; AddressFamily effective_address_family = info.address_family(); @@ -2028,7 +2029,9 @@ HostResolverImpl::Key HostResolverImpl::GetEffectiveKeyForRequest( 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88 }; IPAddressNumber address(kIPv6Address, kIPv6Address + arraysize(kIPv6Address)); - bool rv6 = IsGloballyReachable(address); + bool rv6 = IsGloballyReachable(address, net_log); + if (rv6) + net_log.AddEvent(NetLog::TYPE_HOST_RESOLVER_IMPL_IPV6_SUPPORTED); UMA_HISTOGRAM_TIMES("Net.IPv6ConnectDuration", base::TimeTicks::Now() - start_time); diff --git a/net/dns/host_resolver_impl.h b/net/dns/host_resolver_impl.h index 468d80e..928d07a 100644 --- a/net/dns/host_resolver_impl.h +++ b/net/dns/host_resolver_impl.h @@ -192,7 +192,8 @@ class NET_EXPORT HostResolverImpl // Returns the (hostname, address_family) key to use for |info|, choosing an // "effective" address family by inheriting the resolver's default address // family when the request leaves it unspecified. - Key GetEffectiveKeyForRequest(const RequestInfo& info) const; + Key GetEffectiveKeyForRequest(const RequestInfo& info, + const BoundNetLog& net_log) const; // Records the result in cache if cache is present. void CacheResult(const Key& key, diff --git a/net/udp/udp_socket_libevent.cc b/net/udp/udp_socket_libevent.cc index 7785446..90c7da6 100644 --- a/net/udp/udp_socket_libevent.cc +++ b/net/udp/udp_socket_libevent.cc @@ -123,6 +123,8 @@ int UDPSocketLibevent::GetLocalAddress(IPEndPoint* address) const { if (!address->FromSockAddr(storage.addr, storage.addr_len)) return ERR_FAILED; local_address_.reset(address.release()); + net_log_.AddEvent(NetLog::TYPE_UDP_LOCAL_ADDRESS, + CreateNetLogUDPConnectCallback(local_address_.get())); } *address = *local_address_; diff --git a/net/udp/udp_socket_win.cc b/net/udp/udp_socket_win.cc index 13fbe6c..1f0c337 100644 --- a/net/udp/udp_socket_win.cc +++ b/net/udp/udp_socket_win.cc @@ -240,6 +240,8 @@ int UDPSocketWin::GetLocalAddress(IPEndPoint* address) const { if (!address->FromSockAddr(storage.addr, storage.addr_len)) return ERR_ADDRESS_INVALID; local_address_.reset(address.release()); + net_log_.AddEvent(NetLog::TYPE_UDP_LOCAL_ADDRESS, + CreateNetLogUDPConnectCallback(local_address_.get())); } *address = *local_address_; |