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

Unified Diff: net/socket/tcp_client_socket_libevent.cc

Issue 6990036: Deciding best connection to schedule requests on based on cwnd and idle time (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 6 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_libevent.cc
===================================================================
--- net/socket/tcp_client_socket_libevent.cc (revision 86260)
+++ net/socket/tcp_client_socket_libevent.cc (working copy)
@@ -219,6 +219,7 @@
// Connect the socket.
if (!use_tcp_fastopen_) {
+ connect_start_time_ = base::Time::Now();
if (!HANDLE_EINTR(connect(socket_, current_ai_->ai_addr,
static_cast<int>(current_ai_->ai_addrlen)))) {
// Connected without waiting!
@@ -260,6 +261,9 @@
write_socket_watcher_.StopWatchingFileDescriptor();
if (result == OK) {
+ rtt_ms_ = static_cast<double>((base::Time::Now() -
+ connect_start_time_).InMicroseconds())
+ / 1000.0;
use_history_.set_was_ever_connected();
return OK; // Done!
}
@@ -349,6 +353,7 @@
if (nread >= 0) {
base::StatsCounter read_bytes("tcp.read_bytes");
read_bytes.Add(nread);
+ num_bytes_read_ += nread;
if (nread > 0)
use_history_.set_was_used_to_convey_data();
LogByteTransfer(

Powered by Google App Engine
This is Rietveld 408576698