Chromium Code Reviews| Index: net/spdy/spdy_session.h |
| =================================================================== |
| --- net/spdy/spdy_session.h (revision 105268) |
| +++ net/spdy/spdy_session.h (working copy) |
| @@ -104,7 +104,8 @@ |
| // NOTE: This function can have false negatives on some platforms. |
| bool VerifyDomainAuthentication(const std::string& domain); |
| - // Send the SYN frame for |stream_id|. |
| + // Send the SYN frame for |stream_id|. This also sends PING message to check |
| + // the status of the connection. |
| int WriteSynStream( |
| spdy::SpdyStreamId stream_id, |
| RequestPriority priority, |
| @@ -277,6 +278,7 @@ |
| const linked_ptr<spdy::SpdyHeaderBlock>& headers); |
| void OnRst(const spdy::SpdyRstStreamControlFrame& frame); |
| void OnGoAway(const spdy::SpdyGoAwayControlFrame& frame); |
| + void OnPing(const spdy::SpdyPingControlFrame& frame); |
| void OnSettings(const spdy::SpdySettingsControlFrame& frame); |
| void OnWindowUpdate(const spdy::SpdyWindowUpdateControlFrame& frame); |
| @@ -291,6 +293,24 @@ |
| // SETTINGS ontrol frame, update our SpdySession accordingly. |
| void HandleSettings(const spdy::SpdySettings& settings); |
| + // Send the PING (pre-PING and post-PING) frames for |stream_id|. |
| + int SendPing(spdy::SpdyStreamId stream_id); |
|
willchan no longer on Chromium
2011/10/13 15:47:17
SendPing() shouldn't be tied to a |stream_id|. It
ramant (doing other things)
2011/10/13 21:41:14
Dropped the stream_id argument. As you had suggest
|
| + |
| + // Send PING if there are no PINGs in flight and we haven't heard from server. |
| + int SendPrePing(spdy::SpdyStreamId stream_id); |
| + |
| + // Send a delayed PING if there is no |follower_ping_pending_|. This PING |
| + // makes sure the request has been received by the server. |
| + int SendPostPing(spdy::SpdyStreamId stream_id); |
| + |
| + // Send the PING frame for |stream_id|. |
| + int WritePingFrame(spdy::SpdyStreamId stream_id); |
| + |
| + // Check the status of the connection. It does |DeleteStream| if we haven't |
| + // received any data in |kHungInterval|. |
| + void CheckStatus(spdy::SpdyStreamId stream_id, |
| + base::TimeTicks last_check_time); |
| + |
| // Start reading from the socket. |
| // Returns OK on success, or an error on failure. |
| net::Error ReadSocket(); |
| @@ -437,6 +457,18 @@ |
| // frame. |
| int stalled_streams_; // Count of streams that were ever stalled. |
| + // This list keeps track of all pings (unique_ids) that are in flight. |
| + int64 pings_in_flight_; |
| + |
| + // This is the next unique_id to be sent in PING frame. |
| + uint32 unique_id_counter_; |
| + |
| + // This is the last time we had received data. |
| + base::TimeTicks received_data_time_; |
| + |
| + // Flag if we have a pending follower ping. |
| + bool follower_ping_pending_; |
| + |
| // Initial send window size for the session; can be changed by an |
| // arriving SETTINGS frame; newly created streams use this value for the |
| // initial send window size. |