diff options
Diffstat (limited to 'net/spdy/spdy_session.h')
-rw-r--r-- | net/spdy/spdy_session.h | 51 |
1 files changed, 34 insertions, 17 deletions
diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h index a0642548..af9f6ec 100644 --- a/net/spdy/spdy_session.h +++ b/net/spdy/spdy_session.h @@ -288,24 +288,20 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, int len, SpdyDataFlags flags); - // Close the active stream with the given ID (if it's not already - // deleted). Note that that stream may hold the last reference to - // the session. + // Close the stream with the given ID, which must exist and be + // active. Note that that stream may hold the last reference to the + // session. void CloseActiveStream(SpdyStreamId stream_id, int status); - // Close the given created stream, which must not yet be + // Close the given created stream, which must exist but not yet be // active. Note that |stream| may hold the last reference to the // session. void CloseCreatedStream(const base::WeakPtr<SpdyStream>& stream, int status); - // If there is an active stream with the given ID, reset it by by - // sending a RST_STREAM frame with the given status code at the - // given priority, which should be the stream's priority, and - // deleting it. There must be no external references to that active - // stream. Was not piggybacked to CloseStream since not all of the - // calls to CloseStream necessitate sending a RST_STREAM. + // Send a RST_STREAM frame with the given status code and close the + // stream with the given ID, which must exist and be active. Note + // that that stream may hold the last reference to the session. void ResetStream(SpdyStreamId stream_id, - RequestPriority priority, SpdyRstStreamStatus status, const std::string& description); @@ -538,6 +534,26 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, // possible. void ProcessPendingStreamRequests(); + // Close the stream pointed to by the given iterator. Note that that + // stream may hold the last reference to the session. + void CloseActiveStreamIterator(ActiveStreamMap::iterator it, int status); + + // Close the stream pointed to by the given iterator. Note that that + // stream may hold the last reference to the session. + void CloseCreatedStreamIterator(CreatedStreamSet::iterator it, int status); + + // Calls CloseActiveStreamIterator() and then SendResetStreamFrame(). + void ResetStreamIterator(ActiveStreamMap::iterator it, + SpdyRstStreamStatus status, + const std::string& description); + + // Send a RST_STREAM frame with the given parameters. There must be + // no active stream with the given ID. + void SendResetStreamFrame(SpdyStreamId stream_id, + RequestPriority priority, + SpdyRstStreamStatus status, + const std::string& description); + // Start the DoLoop to read data from socket. void StartRead(); @@ -634,12 +650,13 @@ class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, // list), returns NULL otherwise. base::WeakPtr<SpdyStream> GetActivePushStream(const std::string& url); - // Calls OnResponseReceived(). - // Returns true if successful. - bool Respond(const SpdyHeaderBlock& response_headers, - base::Time response_time, - base::TimeTicks recv_first_byte_time, - SpdyStream* stream); + // Delegates to |stream->OnInitialResponseHeadersReceived()|. If an + // error is returned, the last reference to |this| may have been + // released. + int OnInitialResponseHeadersReceived(const SpdyHeaderBlock& response_headers, + base::Time response_time, + base::TimeTicks recv_first_byte_time, + SpdyStream* stream); void RecordPingRTTHistogram(base::TimeDelta duration); void RecordHistograms(); |