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

Unified Diff: net/socket/stream_socket.h

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/stream_socket.h
===================================================================
--- net/socket/stream_socket.h (revision 86260)
+++ net/socket/stream_socket.h (working copy)
@@ -16,6 +16,8 @@
class NET_TEST StreamSocket : public Socket {
public:
+ StreamSocket() : num_bytes_read_(0) {}
+
virtual ~StreamSocket() {}
// Called to establish a connection. Returns OK if the connection could be
@@ -79,6 +81,12 @@
// TCP FastOpen is an experiment with sending data in the TCP SYN packet.
virtual bool UsingTCPFastOpen() const = 0;
+ // Returns the number of bytes successfully written to this socket.
willchan no longer on Chromium 2011/06/06 10:57:36 This should be virtual int NumBytesRead() const =
Gagan 2011/06/06 20:27:10 Done.
+ virtual int NumBytesRead() const { return num_bytes_read_; }
+
+ // Returns the RTT of this socket.
+ virtual double GetRTTMs() const { return rtt_ms_; }
willchan no longer on Chromium 2011/06/06 10:57:36 virtual double GetRTTInMs() const = 0;
Gagan 2011/06/06 20:27:10 Done.
+
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
@@ -126,6 +134,9 @@
// logging level.
void LogByteTransfer(const BoundNetLog& net_log, NetLog::EventType event_type,
int byte_count, char* bytes) const;
+
+ int num_bytes_read_;
willchan no longer on Chromium 2011/06/06 10:57:36 Don't add any concrete member variables into this
Gagan 2011/06/06 20:27:10 Done.
+ double rtt_ms_;
};
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698