summaryrefslogtreecommitdiffstats
path: root/net/socket/stream_socket.h
diff options
context:
space:
mode:
authorgagansingh@google.com <gagansingh@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-27 17:26:41 +0000
committergagansingh@google.com <gagansingh@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-27 17:26:41 +0000
commit5e6efa537dc4c06912f0bb42f16991c7ee7eafbc (patch)
treebd1336ab3629d3afd20c57c2c9d6de04603e1a10 /net/socket/stream_socket.h
parent0d1293040f1f79e3cddc52ba18fc6ec85f140800 (diff)
downloadchromium_src-5e6efa537dc4c06912f0bb42f16991c7ee7eafbc.zip
chromium_src-5e6efa537dc4c06912f0bb42f16991c7ee7eafbc.tar.gz
chromium_src-5e6efa537dc4c06912f0bb42f16991c7ee7eafbc.tar.bz2
Warmth of a connection (cwnd) is estimated by the amount of data written to the socket.
Choosing the warmest connection would mean faster resource load times. idle time is the time a socket has remained idle (no http requests being served on it). Probability of server resetting a connection increases with idle time duration. Using a cost function that takes into account bytes transferred and idle time to pick best connection to schedule http requests on. CODEREVIEW done in http://codereview.chromium.org/6990036/ Contributed by gagansingh@google.com Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=90373 Reverted: http://codereview.chromium.org/7255002 :( Have fixed 2 things since: 1. Removed LOG(ERROR) from http_basic_stream.cc that was causing layout tests to fail. 2. Initialized class variables in http_basic_stream.cc that was causing uninitialized memory bugs in valgrind: http://code.google.com/p/chromium/issues/detail?id=87423 Review URL: http://codereview.chromium.org/7251004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90601 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/socket/stream_socket.h')
-rw-r--r--net/socket/stream_socket.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/socket/stream_socket.h b/net/socket/stream_socket.h
index 544fbcd..ef2f698 100644
--- a/net/socket/stream_socket.h
+++ b/net/socket/stream_socket.h
@@ -6,6 +6,7 @@
#define NET_SOCKET_STREAM_SOCKET_H_
#pragma once
+#include "base/time.h"
#include "net/base/net_log.h"
#include "net/socket/socket.h"
@@ -79,6 +80,12 @@ class NET_TEST StreamSocket : public Socket {
// TCP FastOpen is an experiment with sending data in the TCP SYN packet.
virtual bool UsingTCPFastOpen() const = 0;
+ // Returns the number of bytes successfully read from this socket.
+ virtual int64 NumBytesRead() const = 0;
+
+ // Returns the connection setup time of this socket.
+ virtual base::TimeDelta GetConnectTimeMicros() const = 0;
+
protected:
// The following class is only used to gather statistics about the history of
// a socket. It is only instantiated and used in basic sockets, such as