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

Unified Diff: net/socket/tcp_client_socket_win.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: Fixing flag name 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_win.cc
===================================================================
--- net/socket/tcp_client_socket_win.cc (revision 88319)
+++ net/socket/tcp_client_socket_win.cc (working copy)
@@ -487,6 +487,7 @@
core_->write_overlapped_.hEvent = WSACreateEvent();
+ connect_start_time_ = base::Time::Now();
if (!connect(socket_, ai->ai_addr, static_cast<int>(ai->ai_addrlen))) {
// Connected without waiting!
//
@@ -525,6 +526,9 @@
net_log_.EndEvent(NetLog::TYPE_TCP_CONNECT_ATTEMPT, params);
if (result == OK) {
+ rtt_ms_ = static_cast<double>((base::Time::Now() -
+ connect_start_time_).InMicroseconds())
+ / 1000.0;
willchan no longer on Chromium 2011/06/09 15:08:54 same comments as in the libevent socket
Gagan 2011/06/09 19:49:26 please let me know if you prefer rtt in microsecon
willchan no longer on Chromium 2011/06/10 15:05:55 milliseconds makes sense to me.
Gagan 2011/06/10 17:44:17 I changed it to micros in the last patch. It allow
use_history_.set_was_ever_connected();
return OK; // Done!
}
@@ -691,6 +695,7 @@
base::MemoryDebug::MarkAsInitialized(core_->read_buffer_.buf, num);
base::StatsCounter read_bytes("tcp.read_bytes");
read_bytes.Add(num);
+ num_bytes_read_ += num;
if (num > 0)
use_history_.set_was_used_to_convey_data();
net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_RECEIVED, num,
@@ -861,6 +866,7 @@
if (ok) {
base::StatsCounter read_bytes("tcp.read_bytes");
read_bytes.Add(num_bytes);
+ num_bytes_read_ += num_bytes;
if (num_bytes > 0)
use_history_.set_was_used_to_convey_data();
net_log_.AddByteTransferEvent(NetLog::TYPE_SOCKET_BYTES_RECEIVED,

Powered by Google App Engine
This is Rietveld 408576698