| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_SPDY_SPDY_SESSION_H_ | 5 #ifndef NET_SPDY_SPDY_SESSION_H_ |
| 6 #define NET_SPDY_SPDY_SESSION_H_ | 6 #define NET_SPDY_SPDY_SESSION_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 void SendPrefacePingIfNoneInFlight(); | 718 void SendPrefacePingIfNoneInFlight(); |
| 719 | 719 |
| 720 // Send PING if there are no PINGs in flight and we haven't heard from server. | 720 // Send PING if there are no PINGs in flight and we haven't heard from server. |
| 721 void SendPrefacePing(); | 721 void SendPrefacePing(); |
| 722 | 722 |
| 723 // Send a single WINDOW_UPDATE frame. | 723 // Send a single WINDOW_UPDATE frame. |
| 724 void SendWindowUpdateFrame(SpdyStreamId stream_id, uint32 delta_window_size, | 724 void SendWindowUpdateFrame(SpdyStreamId stream_id, uint32 delta_window_size, |
| 725 RequestPriority priority); | 725 RequestPriority priority); |
| 726 | 726 |
| 727 // Send the PING frame. | 727 // Send the PING frame. |
| 728 void WritePingFrame(uint32 unique_id, bool is_ack); | 728 void WritePingFrame(SpdyPingId unique_id, bool is_ack); |
| 729 | 729 |
| 730 // Post a CheckPingStatus call after delay. Don't post if there is already | 730 // Post a CheckPingStatus call after delay. Don't post if there is already |
| 731 // CheckPingStatus running. | 731 // CheckPingStatus running. |
| 732 void PlanToCheckPingStatus(); | 732 void PlanToCheckPingStatus(); |
| 733 | 733 |
| 734 // Check the status of the connection. It calls |CloseSessionOnError| if we | 734 // Check the status of the connection. It calls |CloseSessionOnError| if we |
| 735 // haven't received any data in |kHungInterval| time period. | 735 // haven't received any data in |kHungInterval| time period. |
| 736 void CheckPingStatus(base::TimeTicks last_check_time); | 736 void CheckPingStatus(base::TimeTicks last_check_time); |
| 737 | 737 |
| 738 // Get a new stream id. | 738 // Get a new stream id. |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 void set_hung_interval(base::TimeDelta duration) { | 937 void set_hung_interval(base::TimeDelta duration) { |
| 938 hung_interval_ = duration; | 938 hung_interval_ = duration; |
| 939 } | 939 } |
| 940 | 940 |
| 941 void set_max_concurrent_pushed_streams(size_t value) { | 941 void set_max_concurrent_pushed_streams(size_t value) { |
| 942 max_concurrent_pushed_streams_ = value; | 942 max_concurrent_pushed_streams_ = value; |
| 943 } | 943 } |
| 944 | 944 |
| 945 int64 pings_in_flight() const { return pings_in_flight_; } | 945 int64 pings_in_flight() const { return pings_in_flight_; } |
| 946 | 946 |
| 947 uint32 next_ping_id() const { return next_ping_id_; } | 947 SpdyPingId next_ping_id() const { return next_ping_id_; } |
| 948 | 948 |
| 949 base::TimeTicks last_activity_time() const { return last_activity_time_; } | 949 base::TimeTicks last_activity_time() const { return last_activity_time_; } |
| 950 | 950 |
| 951 bool check_ping_status_pending() const { return check_ping_status_pending_; } | 951 bool check_ping_status_pending() const { return check_ping_status_pending_; } |
| 952 | 952 |
| 953 size_t max_concurrent_streams() const { return max_concurrent_streams_; } | 953 size_t max_concurrent_streams() const { return max_concurrent_streams_; } |
| 954 | 954 |
| 955 // Returns the SSLClientSocket that this SPDY session sits on top of, | 955 // Returns the SSLClientSocket that this SPDY session sits on top of, |
| 956 // or NULL, if the transport is not SSL. | 956 // or NULL, if the transport is not SSL. |
| 957 SSLClientSocket* GetSSLClientSocket() const; | 957 SSLClientSocket* GetSSLClientSocket() const; |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1074 | 1074 |
| 1075 bool sent_settings_; // Did this session send settings when it started. | 1075 bool sent_settings_; // Did this session send settings when it started. |
| 1076 bool received_settings_; // Did this session receive at least one settings | 1076 bool received_settings_; // Did this session receive at least one settings |
| 1077 // frame. | 1077 // frame. |
| 1078 int stalled_streams_; // Count of streams that were ever stalled. | 1078 int stalled_streams_; // Count of streams that were ever stalled. |
| 1079 | 1079 |
| 1080 // Count of all pings on the wire, for which we have not gotten a response. | 1080 // Count of all pings on the wire, for which we have not gotten a response. |
| 1081 int64 pings_in_flight_; | 1081 int64 pings_in_flight_; |
| 1082 | 1082 |
| 1083 // This is the next ping_id (unique_id) to be sent in PING frame. | 1083 // This is the next ping_id (unique_id) to be sent in PING frame. |
| 1084 uint32 next_ping_id_; | 1084 SpdyPingId next_ping_id_; |
| 1085 | 1085 |
| 1086 // This is the last time we have sent a PING. | 1086 // This is the last time we have sent a PING. |
| 1087 base::TimeTicks last_ping_sent_time_; | 1087 base::TimeTicks last_ping_sent_time_; |
| 1088 | 1088 |
| 1089 // This is the last time we had activity in the session. | 1089 // This is the last time we had activity in the session. |
| 1090 base::TimeTicks last_activity_time_; | 1090 base::TimeTicks last_activity_time_; |
| 1091 | 1091 |
| 1092 // This is the length of the last compressed frame. | 1092 // This is the length of the last compressed frame. |
| 1093 size_t last_compressed_frame_len_; | 1093 size_t last_compressed_frame_len_; |
| 1094 | 1094 |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1171 // Used for posting asynchronous IO tasks. We use this even though | 1171 // Used for posting asynchronous IO tasks. We use this even though |
| 1172 // SpdySession is refcounted because we don't need to keep the SpdySession | 1172 // SpdySession is refcounted because we don't need to keep the SpdySession |
| 1173 // alive if the last reference is within a RunnableMethod. Just revoke the | 1173 // alive if the last reference is within a RunnableMethod. Just revoke the |
| 1174 // method. | 1174 // method. |
| 1175 base::WeakPtrFactory<SpdySession> weak_factory_; | 1175 base::WeakPtrFactory<SpdySession> weak_factory_; |
| 1176 }; | 1176 }; |
| 1177 | 1177 |
| 1178 } // namespace net | 1178 } // namespace net |
| 1179 | 1179 |
| 1180 #endif // NET_SPDY_SPDY_SESSION_H_ | 1180 #endif // NET_SPDY_SPDY_SESSION_H_ |
| OLD | NEW |