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

Unified Diff: net/spdy/spdy_session.h

Issue 11644088: SPDY - implement greedy approach to read all the data and process it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years 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
« no previous file with comments | « no previous file | net/spdy/spdy_session.cc » ('j') | net/spdy/spdy_session.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | net/spdy/spdy_session.cc » ('j') | net/spdy/spdy_session.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698