OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <list> | 10 #include <list> |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 bool GetSSLInfo(SSLInfo* ssl_info, bool* was_npn_negotiated); | 142 bool GetSSLInfo(SSLInfo* ssl_info, bool* was_npn_negotiated); |
143 | 143 |
144 // Fills SSL Certificate Request info |cert_request_info| and returns | 144 // Fills SSL Certificate Request info |cert_request_info| and returns |
145 // true when SSL is in use. | 145 // true when SSL is in use. |
146 bool GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); | 146 bool GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); |
147 | 147 |
148 // Enable or disable SSL. | 148 // Enable or disable SSL. |
149 static void SetSSLMode(bool enable) { use_ssl_ = enable; } | 149 static void SetSSLMode(bool enable) { use_ssl_ = enable; } |
150 static bool SSLMode() { return use_ssl_; } | 150 static bool SSLMode() { return use_ssl_; } |
151 | 151 |
152 // Enable or disable flow control. | 152 // Enable or disable flow control used by unit tests. This only applies for |
153 static void set_flow_control(bool enable) { use_flow_control_ = enable; } | 153 // new SpdySessions. |
154 static bool flow_control() { return use_flow_control_; } | 154 static void set_use_flow_control(bool enable) { use_flow_control_ = enable; } |
155 | 155 |
156 // Sets the max concurrent streams per session, as a ceiling on any server | 156 // Sets the max concurrent streams per session, as a ceiling on any server |
157 // specific SETTINGS value. | 157 // specific SETTINGS value. |
158 static void set_max_concurrent_streams(size_t value) { | 158 static void set_max_concurrent_streams(size_t value) { |
159 max_concurrent_stream_limit_ = value; | 159 max_concurrent_stream_limit_ = value; |
160 } | 160 } |
161 static size_t max_concurrent_streams() { | 161 static size_t max_concurrent_streams() { |
162 return max_concurrent_stream_limit_; | 162 return max_concurrent_stream_limit_; |
163 } | 163 } |
164 | 164 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 return !active_streams_.empty(); | 217 return !active_streams_.empty(); |
218 } | 218 } |
219 | 219 |
220 // Access to the number of active and pending streams. These are primarily | 220 // Access to the number of active and pending streams. These are primarily |
221 // available for testing and diagnostics. | 221 // available for testing and diagnostics. |
222 size_t num_active_streams() const { return active_streams_.size(); } | 222 size_t num_active_streams() const { return active_streams_.size(); } |
223 size_t num_unclaimed_pushed_streams() const { | 223 size_t num_unclaimed_pushed_streams() const { |
224 return unclaimed_pushed_streams_.size(); | 224 return unclaimed_pushed_streams_.size(); |
225 } | 225 } |
226 | 226 |
| 227 // Returns true if flow control is enabled for the session. |
| 228 bool is_flow_control_enabled() const { |
| 229 return flow_control_; |
| 230 } |
| 231 |
227 const BoundNetLog& net_log() const { return net_log_; } | 232 const BoundNetLog& net_log() const { return net_log_; } |
228 | 233 |
229 int GetPeerAddress(AddressList* address) const; | 234 int GetPeerAddress(AddressList* address) const; |
230 int GetLocalAddress(IPEndPoint* address) const; | 235 int GetLocalAddress(IPEndPoint* address) const; |
231 | 236 |
232 // LayeredPool methods: | 237 // LayeredPool methods: |
233 virtual bool CloseOneIdleConnection() OVERRIDE; | 238 virtual bool CloseOneIdleConnection() OVERRIDE; |
234 | 239 |
235 private: | 240 private: |
236 friend class base::RefCounted<SpdySession>; | 241 friend class base::RefCounted<SpdySession>; |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 | 538 |
534 // Indicate if we have already scheduled a delayed task to check the ping | 539 // Indicate if we have already scheduled a delayed task to check the ping |
535 // status. | 540 // status. |
536 bool check_ping_status_pending_; | 541 bool check_ping_status_pending_; |
537 | 542 |
538 // Indicate if we need to send a ping (generally, a trailing ping). This helps | 543 // Indicate if we need to send a ping (generally, a trailing ping). This helps |
539 // us to decide if we need yet another trailing ping, or if it would be a | 544 // us to decide if we need yet another trailing ping, or if it would be a |
540 // waste of effort (and MUST not be done). | 545 // waste of effort (and MUST not be done). |
541 bool need_to_send_ping_; | 546 bool need_to_send_ping_; |
542 | 547 |
| 548 // Indicate if flow control is enabled or not. |
| 549 bool flow_control_; |
| 550 |
543 // Initial send window size for the session; can be changed by an | 551 // Initial send window size for the session; can be changed by an |
544 // arriving SETTINGS frame; newly created streams use this value for the | 552 // arriving SETTINGS frame; newly created streams use this value for the |
545 // initial send window size. | 553 // initial send window size. |
546 int initial_send_window_size_; | 554 int initial_send_window_size_; |
547 | 555 |
548 // Initial receive window size for the session; there are plans to add a | 556 // Initial receive window size for the session; there are plans to add a |
549 // command line switch that would cause a SETTINGS frame with window size | 557 // command line switch that would cause a SETTINGS frame with window size |
550 // announcement to be sent on startup; newly created streams will use | 558 // announcement to be sent on startup; newly created streams will use |
551 // this value for the initial receive window size. | 559 // this value for the initial receive window size. |
552 int initial_recv_window_size_; | 560 int initial_recv_window_size_; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
612 const spdy::SpdyControlFlags flags_; | 620 const spdy::SpdyControlFlags flags_; |
613 const spdy::SpdyStreamId id_; | 621 const spdy::SpdyStreamId id_; |
614 const spdy::SpdyStreamId associated_stream_; | 622 const spdy::SpdyStreamId associated_stream_; |
615 | 623 |
616 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySynParameter); | 624 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySynParameter); |
617 }; | 625 }; |
618 | 626 |
619 } // namespace net | 627 } // namespace net |
620 | 628 |
621 #endif // NET_SPDY_SPDY_SESSION_H_ | 629 #endif // NET_SPDY_SPDY_SESSION_H_ |
OLD | NEW |