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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <deque> | 9 #include <deque> |
10 #include <list> | 10 #include <list> |
(...skipping 30 matching lines...) Expand all Loading... | |
41 const int kMaxSpdyFrameChunkSize = (2 * kMss) - spdy::SpdyFrame::kHeaderSize; | 41 const int kMaxSpdyFrameChunkSize = (2 * kMss) - spdy::SpdyFrame::kHeaderSize; |
42 | 42 |
43 class BoundNetLog; | 43 class BoundNetLog; |
44 class SpdySettingsStorage; | 44 class SpdySettingsStorage; |
45 class SpdyStream; | 45 class SpdyStream; |
46 class SSLInfo; | 46 class SSLInfo; |
47 | 47 |
48 class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, | 48 class NET_EXPORT SpdySession : public base::RefCounted<SpdySession>, |
49 public spdy::BufferedSpdyFramerVisitorInterface { | 49 public spdy::BufferedSpdyFramerVisitorInterface { |
50 public: | 50 public: |
51 // FlowControl provides the ability for unit tests to either enable or disable | |
52 // flow control (independent of NPN protocol negotiated). If | |
53 // |use_flow_control_| is set to kUninitialized then flow control is | |
54 // determined by the NPN protocol negotiated with the server. | |
55 enum FlowControl { | |
56 kUninitialized = 0, | |
wtc
2012/01/26 22:03:25
IMPORTANT: kUninitialized => kFlowControlUninitial
ramant (doing other things)
2012/01/26 22:39:21
Reverted to kFlowControlBasedOnNPN. Thanks wtc.
Do
| |
57 kDisableFlowControl = 1, | |
58 kEnableFlowControl = 2, | |
59 }; | |
60 | |
51 // Create a new SpdySession. | 61 // Create a new SpdySession. |
52 // |host_port_proxy_pair| is the host/port that this session connects to, and | 62 // |host_port_proxy_pair| is the host/port that this session connects to, and |
53 // the proxy configuration settings that it's using. | 63 // the proxy configuration settings that it's using. |
54 // |spdy_session_pool| is the SpdySessionPool that owns us. Its lifetime must | 64 // |spdy_session_pool| is the SpdySessionPool that owns us. Its lifetime must |
55 // strictly be greater than |this|. | 65 // strictly be greater than |this|. |
56 // |session| is the HttpNetworkSession. |net_log| is the NetLog that we log | 66 // |session| is the HttpNetworkSession. |net_log| is the NetLog that we log |
57 // network events to. | 67 // network events to. |
58 SpdySession(const HostPortProxyPair& host_port_proxy_pair, | 68 SpdySession(const HostPortProxyPair& host_port_proxy_pair, |
59 SpdySessionPool* spdy_session_pool, | 69 SpdySessionPool* spdy_session_pool, |
60 HttpServerProperties* http_server_properties, | 70 HttpServerProperties* http_server_properties, |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 // Fills SSL Certificate Request info |cert_request_info| and returns | 156 // Fills SSL Certificate Request info |cert_request_info| and returns |
147 // true when SSL is in use. | 157 // true when SSL is in use. |
148 bool GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); | 158 bool GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); |
149 | 159 |
150 // Enable or disable SSL. | 160 // Enable or disable SSL. |
151 static void SetSSLMode(bool enable) { use_ssl_ = enable; } | 161 static void SetSSLMode(bool enable) { use_ssl_ = enable; } |
152 static bool SSLMode() { return use_ssl_; } | 162 static bool SSLMode() { return use_ssl_; } |
153 | 163 |
154 // Enable or disable flow control used by unit tests. This only applies for | 164 // Enable or disable flow control used by unit tests. This only applies for |
155 // new SpdySessions. | 165 // new SpdySessions. |
156 static void set_use_flow_control(bool enable) { use_flow_control_ = enable; } | 166 static void set_use_flow_control(FlowControl flow_control) { |
167 use_flow_control_ = flow_control; | |
168 } | |
157 | 169 |
158 // Sets the max concurrent streams per session, as a ceiling on any server | 170 // Sets the max concurrent streams per session, as a ceiling on any server |
159 // specific SETTINGS value. | 171 // specific SETTINGS value. |
160 static void set_max_concurrent_streams(size_t value) { | 172 static void set_max_concurrent_streams(size_t value) { |
161 max_concurrent_stream_limit_ = value; | 173 max_concurrent_stream_limit_ = value; |
162 } | 174 } |
163 static size_t max_concurrent_streams() { | 175 static size_t max_concurrent_streams() { |
164 return max_concurrent_stream_limit_; | 176 return max_concurrent_stream_limit_; |
165 } | 177 } |
166 | 178 |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
572 // announcement to be sent on startup; newly created streams will use | 584 // announcement to be sent on startup; newly created streams will use |
573 // this value for the initial receive window size. | 585 // this value for the initial receive window size. |
574 int initial_recv_window_size_; | 586 int initial_recv_window_size_; |
575 | 587 |
576 BoundNetLog net_log_; | 588 BoundNetLog net_log_; |
577 | 589 |
578 // Outside of tests, this should always be true. | 590 // Outside of tests, this should always be true. |
579 bool verify_domain_authentication_; | 591 bool verify_domain_authentication_; |
580 | 592 |
581 static bool use_ssl_; | 593 static bool use_ssl_; |
582 static bool use_flow_control_; | 594 static FlowControl use_flow_control_; |
583 static size_t init_max_concurrent_streams_; | 595 static size_t init_max_concurrent_streams_; |
584 static size_t max_concurrent_stream_limit_; | 596 static size_t max_concurrent_stream_limit_; |
585 | 597 |
586 // This enables or disables connection health checking system. | 598 // This enables or disables connection health checking system. |
587 static bool enable_ping_based_connection_checking_; | 599 static bool enable_ping_based_connection_checking_; |
588 | 600 |
589 // |connection_at_risk_of_loss_seconds_| is an optimization to avoid sending | 601 // |connection_at_risk_of_loss_seconds_| is an optimization to avoid sending |
590 // wasteful preface pings (when we just got some data). | 602 // wasteful preface pings (when we just got some data). |
591 // | 603 // |
592 // If it is zero (the most conservative figure), then we always send the | 604 // If it is zero (the most conservative figure), then we always send the |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
634 const spdy::SpdyControlFlags flags_; | 646 const spdy::SpdyControlFlags flags_; |
635 const spdy::SpdyStreamId id_; | 647 const spdy::SpdyStreamId id_; |
636 const spdy::SpdyStreamId associated_stream_; | 648 const spdy::SpdyStreamId associated_stream_; |
637 | 649 |
638 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySynParameter); | 650 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySynParameter); |
639 }; | 651 }; |
640 | 652 |
641 } // namespace net | 653 } // namespace net |
642 | 654 |
643 #endif // NET_SPDY_SPDY_SESSION_H_ | 655 #endif // NET_SPDY_SPDY_SESSION_H_ |
OLD | NEW |