Index: net/spdy/spdy_session.h |
=================================================================== |
--- net/spdy/spdy_session.h (revision 174489) |
+++ net/spdy/spdy_session.h (working copy) |
@@ -264,7 +264,7 @@ |
void SendWindowUpdate(SpdyStreamId stream_id, int32 delta_window_size); |
// If session is closed, no new streams/transactions should be created. |
- bool IsClosed() const { return state_ == CLOSED; } |
+ bool IsClosed() const { return state_ == STATE_CLOSED; } |
// Closes this session. This will close all active streams and mark |
// the session as permanently closed. |
@@ -405,10 +405,11 @@ |
PendingCallbackMap; |
enum State { |
- IDLE, |
- CONNECTING, |
- CONNECTED, |
- CLOSED |
+ STATE_IDLE, |
+ STATE_CONNECTING, |
+ STATE_DO_READ, |
+ STATE_DO_READ_COMPLETE, |
+ STATE_CLOSED |
}; |
virtual ~SpdySession(); |
@@ -420,6 +421,21 @@ |
scoped_refptr<SpdyStream>* spdy_stream, |
const BoundNetLog& stream_net_log); |
+ // Start the DoLoop to read data from socket. |
+ void StartRead(); |
+ |
+ // Try to make progress by reading and processing data. |
+ int DoLoop(int result); |
+ // The implementations of STATE_DO_READ/STATE_DO_READ_COMPLETE state changes |
+ // of the state machine. |
+ int DoRead(); |
+ int DoReadComplete(int bytes_read); |
+ |
+ // Check if session is connected or not. |
+ bool IsConnected() const { |
+ return state_ == STATE_DO_READ || state_ == STATE_DO_READ_COMPLETE; |
+ } |
+ |
// IO Callbacks |
void OnReadComplete(int result); |
void OnWriteComplete(int result); |
@@ -454,10 +470,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(); |
@@ -655,7 +667,8 @@ |
int streams_pushed_count_; |
int streams_pushed_and_claimed_count_; |
int streams_abandoned_count_; |
- int bytes_received_; |
+ int total_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. |