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

Unified Diff: net/socket/tcp_client_socket.cc

Issue 1376473003: Notify NQE of TCP RTT values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More plumbing Created 4 years, 10 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: net/socket/tcp_client_socket.cc
diff --git a/net/socket/tcp_client_socket.cc b/net/socket/tcp_client_socket.cc
index d52f08c4166362cbbb4b51139e54c3c65b59d1f5..0aa3367fe4e5fc2c6b18f4f5ce1b95601db7672b 100644
--- a/net/socket/tcp_client_socket.cc
+++ b/net/socket/tcp_client_socket.cc
@@ -14,13 +14,19 @@
#include "net/base/io_buffer.h"
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
+#include "net/base/socket_performance_watcher.h"
namespace net {
-TCPClientSocket::TCPClientSocket(const AddressList& addresses,
- net::NetLog* net_log,
- const net::NetLog::Source& source)
- : socket_(new TCPSocket(net_log, source)),
+TCPClientSocket::TCPClientSocket(
+ const AddressList& addresses,
+ scoped_ptr<SocketPerformanceWatcher> socket_performance_watcher,
+ net::NetLog* net_log,
+ const net::NetLog::Source& source)
+ : socket_performance_watcher_(socket_performance_watcher.get()),
+ socket_(new TCPSocket(std::move(socket_performance_watcher),
+ net_log,
+ source)),
addresses_(addresses),
current_address_index_(-1),
next_connect_state_(CONNECT_STATE_NONE),
@@ -29,7 +35,8 @@ TCPClientSocket::TCPClientSocket(const AddressList& addresses,
TCPClientSocket::TCPClientSocket(scoped_ptr<TCPSocket> connected_socket,
const IPEndPoint& peer_address)
- : socket_(std::move(connected_socket)),
+ : socket_performance_watcher_(nullptr),
+ socket_(std::move(connected_socket)),
addresses_(AddressList(peer_address)),
current_address_index_(0),
next_connect_state_(CONNECT_STATE_NONE),
@@ -195,6 +202,8 @@ void TCPClientSocket::DoDisconnect() {
// disconnected.
previously_disconnected_ = socket_->IsValid() && current_address_index_ >= 0;
socket_->Close();
+ if (socket_performance_watcher_)
+ socket_performance_watcher_->Reset();
}
bool TCPClientSocket::IsConnected() const {

Powered by Google App Engine
This is Rietveld 408576698