Index: net/spdy/spdy_session.h |
=================================================================== |
--- net/spdy/spdy_session.h (revision 174489) |
+++ net/spdy/spdy_session.h (working copy) |
@@ -411,6 +411,12 @@ |
CLOSED |
}; |
+ enum IoState { |
+ STATE_NONE, |
+ STATE_DO_READ, |
+ STATE_DO_READ_COMPLETE |
+ }; |
+ |
virtual ~SpdySession(); |
void ProcessPendingCreateStreams(); |
@@ -420,6 +426,12 @@ |
scoped_refptr<SpdyStream>* spdy_stream, |
const BoundNetLog& stream_net_log); |
+ // Try to make progress by reading and processing data. |
+ int DoLoop(int rv); |
+ // The implementations of each io_state_ of the IoState machine. |
+ int DoRead(); |
+ int DoReadComplete(int bytes_read); |
+ |
// IO Callbacks |
void OnReadComplete(int result); |
void OnWriteComplete(int result); |
@@ -454,10 +466,6 @@ |
// haven't received any data in |kHungInterval| time period. |
void CheckPingStatus(base::TimeTicks last_check_time); |
- // Start reading from the socket. |
- // Returns OK on success, or an error on failure. |
- net::Error ReadSocket(); |
- |
// Write current data to the socket. |
void WriteSocketLater(); |
void WriteSocket(); |
@@ -645,6 +653,7 @@ |
// be OK. |
net::Error error_; |
State state_; |
+ IoState io_state_; |
// Limits |
size_t max_concurrent_streams_; // 0 if no limit |
@@ -656,6 +665,7 @@ |
int streams_pushed_and_claimed_count_; |
int streams_abandoned_count_; |
int bytes_received_; |
+ int bytes_read_; |
bool sent_settings_; // Did this session send settings when it started. |
bool received_settings_; // Did this session receive at least one settings |
// frame. |