summaryrefslogtreecommitdiffstats
path: root/net/spdy/spdy_stream.h
diff options
context:
space:
mode:
authorerikchen@google.com <erikchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-28 18:47:49 +0000
committererikchen@google.com <erikchen@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-28 18:47:49 +0000
commit52a69186b43c61c0f3c96abd583dc9a9e3cf447d (patch)
tree0ea5ffe8c030e3532af8b2faae98c8361c7287a7 /net/spdy/spdy_stream.h
parent2535e637b7da1d6f530bf8f0a6c482c703d2c1f7 (diff)
downloadchromium_src-52a69186b43c61c0f3c96abd583dc9a9e3cf447d.zip
chromium_src-52a69186b43c61c0f3c96abd583dc9a9e3cf447d.tar.gz
chromium_src-52a69186b43c61c0f3c96abd583dc9a9e3cf447d.tar.bz2
Streams send a Rst frame upon being closed by client. Some minor editorial fixes.
TEST=net_unittests BUG=46589 Review URL: http://codereview.chromium.org/2804008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51007 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_stream.h')
-rw-r--r--net/spdy/spdy_stream.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/net/spdy/spdy_stream.h b/net/spdy/spdy_stream.h
index 6183be2..88b3e04 100644
--- a/net/spdy/spdy_stream.h
+++ b/net/spdy/spdy_stream.h
@@ -109,8 +109,7 @@ class SpdyStream : public base::RefCounted<SpdyStream> {
void SetRequestTime(base::Time t);
// Called by the SpdySession when a response (e.g. a SYN_REPLY) has been
- // received for this stream. |path| is the path of the URL for a server
- // initiated stream, otherwise is empty.
+ // received for this stream.
// Returns a status code.
int OnResponseReceived(const spdy::SpdyHeaderBlock& response);
@@ -120,7 +119,7 @@ class SpdyStream : public base::RefCounted<SpdyStream> {
// |buffer| contains the data received. The stream must copy any data
// from this buffer before returning from this callback.
// |length| is the number of bytes received or an error.
- // A zero-length count does not indicate end-of-stream.
+ // A length of zero indicates end-of-stream.
void OnDataReceived(const char* buffer, int bytes);
// Called by the SpdySession when a write has completed. This callback
@@ -160,6 +159,20 @@ class SpdyStream : public base::RefCounted<SpdyStream> {
bool response_complete() const { return response_complete_; }
int response_status() const { return response_status_; }
+ // If this function returns true, then the spdy_session is guaranteeing that
+ // this spdy_stream has been removed from active_streams.
+ bool half_closed_client_side() const { return half_closed_client_side_; }
+
+ bool half_closed_server_side() const { return half_closed_server_side_; }
+ bool half_closed_both_sides() const {
+ return half_closed_client_side_ && half_closed_server_side_;
+ }
+
+ // These two functions should only ever be called by spdy_session, and should
+ // only be called once.
+ void HalfCloseClientSide() { half_closed_client_side_ = true; }
+ void HalfCloseServerSide() { half_closed_server_side_ = true; }
+
private:
enum State {
STATE_NONE,
@@ -235,6 +248,8 @@ class SpdyStream : public base::RefCounted<SpdyStream> {
bool histograms_recorded_;
// Data received before delegate is attached.
std::vector<scoped_refptr<IOBufferWithSize> > pending_buffers_;
+ bool half_closed_client_side_;
+ bool half_closed_server_side_;
DISALLOW_COPY_AND_ASSIGN(SpdyStream);
};