diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-16 21:34:00 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-16 21:34:00 +0000 |
commit | 63cf10d7652388b9dd9d45f5648cbfaaa63f2232 (patch) | |
tree | 3d747f622ea8322ddecbe3eb99af9948a76c2e26 /net/spdy/spdy_write_queue.h | |
parent | 3699af9fae872b8b9deee04cc7ccd862b82d464e (diff) | |
download | chromium_src-63cf10d7652388b9dd9d45f5648cbfaaa63f2232.zip chromium_src-63cf10d7652388b9dd9d45f5648cbfaaa63f2232.tar.gz chromium_src-63cf10d7652388b9dd9d45f5648cbfaaa63f2232.tar.bz2 |
[SPDY] Refactor SpdySession state machine
Represent a SpdySession's state by three variables of type:
AvailabilityState, ReadState (the old State type), and WriteState.
Make some important functions, including the BufferedSpdyWriter
callbacks, do nothing if availability_state_ == STATE_CLOSED.
Rename the current state machine from DoLoop etc. to DoReadLoop.
Refactor the write state machine to be parallel to the read state machine.
Keep track of the number of bytes read without yielding in DoReadLoop
itself. This fixes a slight bug where the counter isn't reset if the loop
yields due to ERR_IO_PENDING being returned.
The new write state machine (DoWriteLoop, etc.) has almost the same
behavior as the old one, except if a write completes asynchronously
the write loop is immediately re-entered instead of via a posted task.
Fix tests to match new write loop behavior.
BUG=255701
R=rch@chromium.org, rtenneti@chromium.org
Review URL: https://codereview.chromium.org/18143005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211852 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_write_queue.h')
-rw-r--r-- | net/spdy/spdy_write_queue.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/net/spdy/spdy_write_queue.h b/net/spdy/spdy_write_queue.h index fa194ef..3bceb29 100644 --- a/net/spdy/spdy_write_queue.h +++ b/net/spdy/spdy_write_queue.h @@ -27,6 +27,10 @@ class NET_EXPORT_PRIVATE SpdyWriteQueue { SpdyWriteQueue(); ~SpdyWriteQueue(); + // Returns whether there is anything in the write queue, + // i.e. whether the next call to Dequeue will return true. + bool IsEmpty() const; + // Enqueues the given frame producer of the given type at the given // priority associated with the given stream, which may be NULL if // the frame producer is not associated with a stream. If |stream| |