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

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

Issue 425803014: Refactor pooling logic into a helper method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Working Created 6 years, 4 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 7
8 #include <deque> 8 #include <deque>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 // First and last valid stream IDs. As we always act as the client, 64 // First and last valid stream IDs. As we always act as the client,
65 // start at 1 for the first stream id. 65 // start at 1 for the first stream id.
66 const SpdyStreamId kFirstStreamId = 1; 66 const SpdyStreamId kFirstStreamId = 1;
67 const SpdyStreamId kLastStreamId = 0x7fffffff; 67 const SpdyStreamId kLastStreamId = 0x7fffffff;
68 68
69 class BoundNetLog; 69 class BoundNetLog;
70 struct LoadTimingInfo; 70 struct LoadTimingInfo;
71 class SpdyStream; 71 class SpdyStream;
72 class SSLInfo; 72 class SSLInfo;
73 class TransportSecurityState;
73 74
74 // NOTE: There's an enum of the same name (also with numeric suffixes) 75 // NOTE: There's an enum of the same name (also with numeric suffixes)
75 // in histograms.xml. Be sure to add new values there also. 76 // in histograms.xml. Be sure to add new values there also.
76 enum SpdyProtocolErrorDetails { 77 enum SpdyProtocolErrorDetails {
77 // SpdyFramer::SpdyError mappings. 78 // SpdyFramer::SpdyError mappings.
78 SPDY_ERROR_NO_ERROR = 0, 79 SPDY_ERROR_NO_ERROR = 0,
79 SPDY_ERROR_INVALID_CONTROL_FRAME = 1, 80 SPDY_ERROR_INVALID_CONTROL_FRAME = 1,
80 SPDY_ERROR_CONTROL_PAYLOAD_TOO_LARGE = 2, 81 SPDY_ERROR_CONTROL_PAYLOAD_TOO_LARGE = 2,
81 SPDY_ERROR_ZLIB_INIT_FAILURE = 3, 82 SPDY_ERROR_ZLIB_INIT_FAILURE = 3,
82 SPDY_ERROR_UNSUPPORTED_VERSION = 4, 83 SPDY_ERROR_UNSUPPORTED_VERSION = 4,
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 FLOW_CONTROL_STREAM_AND_SESSION 223 FLOW_CONTROL_STREAM_AND_SESSION
223 }; 224 };
224 225
225 // Create a new SpdySession. 226 // Create a new SpdySession.
226 // |spdy_session_key| is the host/port that this session connects to, privacy 227 // |spdy_session_key| is the host/port that this session connects to, privacy
227 // and proxy configuration settings that it's using. 228 // and proxy configuration settings that it's using.
228 // |session| is the HttpNetworkSession. |net_log| is the NetLog that we log 229 // |session| is the HttpNetworkSession. |net_log| is the NetLog that we log
229 // network events to. 230 // network events to.
230 SpdySession(const SpdySessionKey& spdy_session_key, 231 SpdySession(const SpdySessionKey& spdy_session_key,
231 const base::WeakPtr<HttpServerProperties>& http_server_properties, 232 const base::WeakPtr<HttpServerProperties>& http_server_properties,
233 TransportSecurityState* transport_security_state,
232 bool verify_domain_authentication, 234 bool verify_domain_authentication,
233 bool enable_sending_initial_data, 235 bool enable_sending_initial_data,
234 bool enable_compression, 236 bool enable_compression,
235 bool enable_ping_based_connection_checking, 237 bool enable_ping_based_connection_checking,
236 NextProto default_protocol, 238 NextProto default_protocol,
237 size_t stream_initial_recv_window_size, 239 size_t stream_initial_recv_window_size,
238 size_t initial_max_concurrent_streams, 240 size_t initial_max_concurrent_streams,
239 size_t max_concurrent_streams_limit, 241 size_t max_concurrent_streams_limit,
240 TimeFunc time_func, 242 TimeFunc time_func,
241 const HostPortPair& trusted_spdy_proxy, 243 const HostPortPair& trusted_spdy_proxy,
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 958
957 // Set set of SpdySessionKeys for which this session has serviced 959 // Set set of SpdySessionKeys for which this session has serviced
958 // requests. 960 // requests.
959 std::set<SpdySessionKey> pooled_aliases_; 961 std::set<SpdySessionKey> pooled_aliases_;
960 962
961 // |pool_| owns us, therefore its lifetime must exceed ours. We set 963 // |pool_| owns us, therefore its lifetime must exceed ours. We set
962 // this to NULL after we are removed from the pool. 964 // this to NULL after we are removed from the pool.
963 SpdySessionPool* pool_; 965 SpdySessionPool* pool_;
964 const base::WeakPtr<HttpServerProperties> http_server_properties_; 966 const base::WeakPtr<HttpServerProperties> http_server_properties_;
965 967
968 TransportSecurityState* transport_security_state_;
969
966 // The socket handle for this session. 970 // The socket handle for this session.
967 scoped_ptr<ClientSocketHandle> connection_; 971 scoped_ptr<ClientSocketHandle> connection_;
968 972
969 // The read buffer used to read data from the socket. 973 // The read buffer used to read data from the socket.
970 scoped_refptr<IOBuffer> read_buffer_; 974 scoped_refptr<IOBuffer> read_buffer_;
971 975
972 SpdyStreamId stream_hi_water_mark_; // The next stream id to use. 976 SpdyStreamId stream_hi_water_mark_; // The next stream id to use.
973 977
974 // Queue, for each priority, of pending stream requests that have 978 // Queue, for each priority, of pending stream requests that have
975 // not yet been satisfied. 979 // not yet been satisfied.
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 // Used for posting asynchronous IO tasks. We use this even though 1161 // Used for posting asynchronous IO tasks. We use this even though
1158 // SpdySession is refcounted because we don't need to keep the SpdySession 1162 // SpdySession is refcounted because we don't need to keep the SpdySession
1159 // alive if the last reference is within a RunnableMethod. Just revoke the 1163 // alive if the last reference is within a RunnableMethod. Just revoke the
1160 // method. 1164 // method.
1161 base::WeakPtrFactory<SpdySession> weak_factory_; 1165 base::WeakPtrFactory<SpdySession> weak_factory_;
1162 }; 1166 };
1163 1167
1164 } // namespace net 1168 } // namespace net
1165 1169
1166 #endif // NET_SPDY_SPDY_SESSION_H_ 1170 #endif // NET_SPDY_SPDY_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698