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

Unified Diff: chrome/browser/net/network_stats.cc

Issue 10309002: Reimplements net::AddressList without struct addrinfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make inheritance private in AddressList. Fix: MockTCPClientSocket, redefined symbols on MSVS2010. Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/net/network_stats.cc
diff --git a/chrome/browser/net/network_stats.cc b/chrome/browser/net/network_stats.cc
index 897b8cb718074a063d7f1fec2db78ca1ab8dc3bb..293c25ffb420fe6f410e1375c78dec033ae6ed95 100644
--- a/chrome/browser/net/network_stats.cc
+++ b/chrome/browser/net/network_stats.cc
@@ -19,7 +19,6 @@
#include "net/base/net_errors.h"
#include "net/base/net_util.h"
#include "net/base/network_change_notifier.h"
-#include "net/base/sys_addrinfo.h"
#include "net/base/test_completion_callback.h"
#include "net/socket/tcp_client_socket.h"
#include "net/udp/udp_client_socket.h"
@@ -622,14 +621,12 @@ bool UDPStatsClient::DoConnect(int result) {
}
set_socket(udp_socket);
- const addrinfo* address = GetAddressList().head();
- if (!address) {
+ if (get_address_list().empty()) {
Finish(RESOLVE_FAILED, net::ERR_INVALID_ARGUMENT);
return false;
}
- net::IPEndPoint endpoint;
- endpoint.FromSockAddr(address->ai_addr, address->ai_addrlen);
+ const net::IPEndPoint& endpoint = get_address_list().front();
int rv = udp_socket->Connect(endpoint);
if (rv < 0) {
Finish(CONNECT_FAILED, rv);
@@ -675,7 +672,7 @@ bool TCPStatsClient::DoConnect(int result) {
}
net::TCPClientSocket* tcp_socket =
- new net::TCPClientSocket(GetAddressList(), NULL, net::NetLog::Source());
+ new net::TCPClientSocket(get_address_list(), NULL, net::NetLog::Source());
if (!tcp_socket) {
Finish(SOCKET_CREATE_FAILED, net::ERR_INVALID_ARGUMENT);
return false;

Powered by Google App Engine
This is Rietveld 408576698