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

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

Issue 9252029: SPDY - default to SPDY/2.1 protocol in unittests (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: SPDY - changes to make SPDY/2.1 as default protocol Created 8 years, 11 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 | Annotate | Revision Log
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 #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
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 unittests to change |flow_control_|.
wtc 2012/01/26 00:13:26 It would be nice to document the three enumeration
ramant (doing other things) 2012/01/26 18:58:48 Done.
52 enum FlowControl {
53 kFlowControlBasedOnNPN = 0,
54 kDisableFlowControl = 1,
55 kEnableFlowControl = 2,
56 };
57
51 // Create a new SpdySession. 58 // Create a new SpdySession.
52 // |host_port_proxy_pair| is the host/port that this session connects to, and 59 // |host_port_proxy_pair| is the host/port that this session connects to, and
53 // the proxy configuration settings that it's using. 60 // the proxy configuration settings that it's using.
54 // |spdy_session_pool| is the SpdySessionPool that owns us. Its lifetime must 61 // |spdy_session_pool| is the SpdySessionPool that owns us. Its lifetime must
55 // strictly be greater than |this|. 62 // strictly be greater than |this|.
56 // |session| is the HttpNetworkSession. |net_log| is the NetLog that we log 63 // |session| is the HttpNetworkSession. |net_log| is the NetLog that we log
57 // network events to. 64 // network events to.
58 SpdySession(const HostPortProxyPair& host_port_proxy_pair, 65 SpdySession(const HostPortProxyPair& host_port_proxy_pair,
59 SpdySessionPool* spdy_session_pool, 66 SpdySessionPool* spdy_session_pool,
60 HttpServerProperties* http_server_properties, 67 HttpServerProperties* http_server_properties,
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 // Fills SSL Certificate Request info |cert_request_info| and returns 153 // Fills SSL Certificate Request info |cert_request_info| and returns
147 // true when SSL is in use. 154 // true when SSL is in use.
148 bool GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info); 155 bool GetSSLCertRequestInfo(SSLCertRequestInfo* cert_request_info);
149 156
150 // Enable or disable SSL. 157 // Enable or disable SSL.
151 static void SetSSLMode(bool enable) { use_ssl_ = enable; } 158 static void SetSSLMode(bool enable) { use_ssl_ = enable; }
152 static bool SSLMode() { return use_ssl_; } 159 static bool SSLMode() { return use_ssl_; }
153 160
154 // Enable or disable flow control used by unit tests. This only applies for 161 // Enable or disable flow control used by unit tests. This only applies for
155 // new SpdySessions. 162 // new SpdySessions.
156 static void set_use_flow_control(bool enable) { use_flow_control_ = enable; } 163 static void set_use_flow_control(FlowControl flow_control) {
164 use_flow_control_ = flow_control;
165 }
157 166
158 // Sets the max concurrent streams per session, as a ceiling on any server 167 // Sets the max concurrent streams per session, as a ceiling on any server
159 // specific SETTINGS value. 168 // specific SETTINGS value.
160 static void set_max_concurrent_streams(size_t value) { 169 static void set_max_concurrent_streams(size_t value) {
161 max_concurrent_stream_limit_ = value; 170 max_concurrent_stream_limit_ = value;
162 } 171 }
163 static size_t max_concurrent_streams() { 172 static size_t max_concurrent_streams() {
164 return max_concurrent_stream_limit_; 173 return max_concurrent_stream_limit_;
165 } 174 }
166 175
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 // announcement to be sent on startup; newly created streams will use 581 // announcement to be sent on startup; newly created streams will use
573 // this value for the initial receive window size. 582 // this value for the initial receive window size.
574 int initial_recv_window_size_; 583 int initial_recv_window_size_;
575 584
576 BoundNetLog net_log_; 585 BoundNetLog net_log_;
577 586
578 // Outside of tests, this should always be true. 587 // Outside of tests, this should always be true.
579 bool verify_domain_authentication_; 588 bool verify_domain_authentication_;
580 589
581 static bool use_ssl_; 590 static bool use_ssl_;
582 static bool use_flow_control_; 591 static FlowControl use_flow_control_;
583 static size_t init_max_concurrent_streams_; 592 static size_t init_max_concurrent_streams_;
584 static size_t max_concurrent_stream_limit_; 593 static size_t max_concurrent_stream_limit_;
585 594
586 // This enables or disables connection health checking system. 595 // This enables or disables connection health checking system.
587 static bool enable_ping_based_connection_checking_; 596 static bool enable_ping_based_connection_checking_;
588 597
589 // |connection_at_risk_of_loss_seconds_| is an optimization to avoid sending 598 // |connection_at_risk_of_loss_seconds_| is an optimization to avoid sending
590 // wasteful preface pings (when we just got some data). 599 // wasteful preface pings (when we just got some data).
591 // 600 //
592 // If it is zero (the most conservative figure), then we always send the 601 // 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
634 const spdy::SpdyControlFlags flags_; 643 const spdy::SpdyControlFlags flags_;
635 const spdy::SpdyStreamId id_; 644 const spdy::SpdyStreamId id_;
636 const spdy::SpdyStreamId associated_stream_; 645 const spdy::SpdyStreamId associated_stream_;
637 646
638 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySynParameter); 647 DISALLOW_COPY_AND_ASSIGN(NetLogSpdySynParameter);
639 }; 648 };
640 649
641 } // namespace net 650 } // namespace net
642 651
643 #endif // NET_SPDY_SPDY_SESSION_H_ 652 #endif // NET_SPDY_SPDY_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698