Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: net/spdy/spdy_session.h

Issue 1061853002: Emit session-level WINDOW_UPDATEs less frequently. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test and loads of plumbing. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 // |session| is the HttpNetworkSession. |net_log| is the NetLog that we log 238 // |session| is the HttpNetworkSession. |net_log| is the NetLog that we log
239 // network events to. 239 // network events to.
240 SpdySession(const SpdySessionKey& spdy_session_key, 240 SpdySession(const SpdySessionKey& spdy_session_key,
241 const base::WeakPtr<HttpServerProperties>& http_server_properties, 241 const base::WeakPtr<HttpServerProperties>& http_server_properties,
242 TransportSecurityState* transport_security_state, 242 TransportSecurityState* transport_security_state,
243 bool verify_domain_authentication, 243 bool verify_domain_authentication,
244 bool enable_sending_initial_data, 244 bool enable_sending_initial_data,
245 bool enable_compression, 245 bool enable_compression,
246 bool enable_ping_based_connection_checking, 246 bool enable_ping_based_connection_checking,
247 NextProto default_protocol, 247 NextProto default_protocol,
248 size_t session_max_recv_window_size,
248 size_t stream_initial_recv_window_size, 249 size_t stream_initial_recv_window_size,
249 size_t initial_max_concurrent_streams, 250 size_t initial_max_concurrent_streams,
250 size_t max_concurrent_streams_limit, 251 size_t max_concurrent_streams_limit,
251 TimeFunc time_func, 252 TimeFunc time_func,
252 const HostPortPair& trusted_spdy_proxy, 253 const HostPortPair& trusted_spdy_proxy,
253 NetLog* net_log); 254 NetLog* net_log);
254 255
255 ~SpdySession() override; 256 ~SpdySession() override;
256 257
257 const HostPortPair& host_port_pair() const { 258 const HostPortPair& host_port_pair() const {
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 // Indicate if we have already scheduled a delayed task to check the ping 1106 // Indicate if we have already scheduled a delayed task to check the ping
1106 // status. 1107 // status.
1107 bool check_ping_status_pending_; 1108 bool check_ping_status_pending_;
1108 1109
1109 // Whether to send the (HTTP/2) connection header prefix. 1110 // Whether to send the (HTTP/2) connection header prefix.
1110 bool send_connection_header_prefix_; 1111 bool send_connection_header_prefix_;
1111 1112
1112 // The (version-dependent) flow control state. 1113 // The (version-dependent) flow control state.
1113 FlowControlState flow_control_state_; 1114 FlowControlState flow_control_state_;
1114 1115
1116 // Current send window size. Zero unless session flow control is turned on.
1117 int32 session_send_window_size_;
1118
1119 // Maximum receive window size. Each time a WINDOW_UPDATE is sent, it
1120 // restores the receive window size to this value. Zero unless session flow
1121 // control is turned on.
1122 int32 session_max_recv_window_size_;
1123
1124 // Sum of |session_unacked_recv_window_bytes_| and current receive window
1125 // size. Zero unless session flow control is turned on.
1126 // TODO(bnc): Rename or change semantics so that |window_size_| is actual
1127 // window size.
1128 int32 session_recv_window_size_;
1129
1130 // Number of octets that are consumed and thus not stored in a buffer owned by
Ryan Hamilton 2015/04/07 14:56:40 s/octets/bytes/
Bence 2015/04/07 20:21:38 Done.
1131 // SpdySession any more, but for which no corresponding WINDOW_UPDATEs have
1132 // been sent yet. Zero unless session flow control is turned on.
Ryan Hamilton 2015/04/07 14:56:40 Can you explain where these bytes are living and h
Bence 2015/04/07 20:21:38 Done.
Ryan Hamilton 2015/04/08 03:51:10 Nice! Looks great.
1133 int32 session_unacked_recv_window_bytes_;
1134
1115 // Initial send window size for this session's streams. Can be 1135 // Initial send window size for this session's streams. Can be
1116 // changed by an arriving SETTINGS frame. Newly created streams use 1136 // changed by an arriving SETTINGS frame. Newly created streams use
1117 // this value for the initial send window size. 1137 // this value for the initial send window size.
1118 int32 stream_initial_send_window_size_; 1138 int32 stream_initial_send_window_size_;
1119 1139
1120 // Initial receive window size for this session's streams. There are 1140 // Initial receive window size for this session's streams. There are
1121 // plans to add a command line switch that would cause a SETTINGS 1141 // plans to add a command line switch that would cause a SETTINGS
1122 // frame with window size announcement to be sent on startup. Newly 1142 // frame with window size announcement to be sent on startup. Newly
1123 // created streams will use this value for the initial receive 1143 // created streams will use this value for the initial receive
1124 // window size. 1144 // window size.
1125 int32 stream_initial_recv_window_size_; 1145 int32 stream_initial_recv_window_size_;
1126 1146
1127 // Session flow control variables. All zero unless session flow
1128 // control is turned on.
1129 int32 session_send_window_size_;
1130 int32 session_recv_window_size_;
1131 int32 session_unacked_recv_window_bytes_;
1132
1133 // A queue of stream IDs that have been send-stalled at some point 1147 // A queue of stream IDs that have been send-stalled at some point
1134 // in the past. 1148 // in the past.
1135 std::deque<SpdyStreamId> stream_send_unstall_queue_[NUM_PRIORITIES]; 1149 std::deque<SpdyStreamId> stream_send_unstall_queue_[NUM_PRIORITIES];
1136 1150
1137 BoundNetLog net_log_; 1151 BoundNetLog net_log_;
1138 1152
1139 // Outside of tests, these should always be true. 1153 // Outside of tests, these should always be true.
1140 bool verify_domain_authentication_; 1154 bool verify_domain_authentication_;
1141 bool enable_sending_initial_data_; 1155 bool enable_sending_initial_data_;
1142 bool enable_compression_; 1156 bool enable_compression_;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 // Used for posting asynchronous IO tasks. We use this even though 1191 // Used for posting asynchronous IO tasks. We use this even though
1178 // SpdySession is refcounted because we don't need to keep the SpdySession 1192 // SpdySession is refcounted because we don't need to keep the SpdySession
1179 // alive if the last reference is within a RunnableMethod. Just revoke the 1193 // alive if the last reference is within a RunnableMethod. Just revoke the
1180 // method. 1194 // method.
1181 base::WeakPtrFactory<SpdySession> weak_factory_; 1195 base::WeakPtrFactory<SpdySession> weak_factory_;
1182 }; 1196 };
1183 1197
1184 } // namespace net 1198 } // namespace net
1185 1199
1186 #endif // NET_SPDY_SPDY_SESSION_H_ 1200 #endif // NET_SPDY_SPDY_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698