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

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

Issue 498373002: Refactor pooling logic into a helper method Disable pooling when there are cert errors. Disable poo… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2125
Patch Set: Created 6 years, 3 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
« no previous file with comments | « net/spdy/spdy_session.cc ('k') | net/spdy/spdy_session_pool.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_POOL_H_ 5 #ifndef NET_SPDY_SPDY_SESSION_POOL_H_
6 #define NET_SPDY_SPDY_SESSION_POOL_H_ 6 #define NET_SPDY_SPDY_SESSION_POOL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 16 matching lines...) Expand all
27 #include "net/ssl/ssl_config_service.h" 27 #include "net/ssl/ssl_config_service.h"
28 28
29 namespace net { 29 namespace net {
30 30
31 class AddressList; 31 class AddressList;
32 class BoundNetLog; 32 class BoundNetLog;
33 class ClientSocketHandle; 33 class ClientSocketHandle;
34 class HostResolver; 34 class HostResolver;
35 class HttpServerProperties; 35 class HttpServerProperties;
36 class SpdySession; 36 class SpdySession;
37 class TransportSecurityState;
37 38
38 // This is a very simple pool for open SpdySessions. 39 // This is a very simple pool for open SpdySessions.
39 class NET_EXPORT SpdySessionPool 40 class NET_EXPORT SpdySessionPool
40 : public NetworkChangeNotifier::IPAddressObserver, 41 : public NetworkChangeNotifier::IPAddressObserver,
41 public SSLConfigService::Observer, 42 public SSLConfigService::Observer,
42 public CertDatabase::Observer { 43 public CertDatabase::Observer {
43 public: 44 public:
44 typedef base::TimeTicks (*TimeFunc)(void); 45 typedef base::TimeTicks (*TimeFunc)(void);
45 46
46 // |default_protocol| may be kProtoUnknown (e.g., if SPDY is 47 // |default_protocol| may be kProtoUnknown (e.g., if SPDY is
47 // disabled), in which case it's set to a default value. Otherwise, 48 // disabled), in which case it's set to a default value. Otherwise,
48 // it must be a SPDY protocol. 49 // it must be a SPDY protocol.
49 SpdySessionPool( 50 SpdySessionPool(
50 HostResolver* host_resolver, 51 HostResolver* host_resolver,
51 SSLConfigService* ssl_config_service, 52 SSLConfigService* ssl_config_service,
52 const base::WeakPtr<HttpServerProperties>& http_server_properties, 53 const base::WeakPtr<HttpServerProperties>& http_server_properties,
54 TransportSecurityState* transport_security_state,
53 bool force_single_domain, 55 bool force_single_domain,
54 bool enable_compression, 56 bool enable_compression,
55 bool enable_ping_based_connection_checking, 57 bool enable_ping_based_connection_checking,
56 NextProto default_protocol, 58 NextProto default_protocol,
57 size_t stream_initial_recv_window_size, 59 size_t stream_initial_recv_window_size,
58 size_t initial_max_concurrent_streams, 60 size_t initial_max_concurrent_streams,
59 size_t max_concurrent_streams_limit, 61 size_t max_concurrent_streams_limit,
60 SpdySessionPool::TimeFunc time_func, 62 SpdySessionPool::TimeFunc time_func,
61 const std::string& trusted_spdy_proxy); 63 const std::string& trusted_spdy_proxy);
62 virtual ~SpdySessionPool(); 64 virtual ~SpdySessionPool();
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 // Close only the currently existing SpdySessions with |error|. Let 186 // Close only the currently existing SpdySessions with |error|. Let
185 // any new ones created while this method is running continue to 187 // any new ones created while this method is running continue to
186 // live. If |idle_only| is true only idle sessions are closed. 188 // live. If |idle_only| is true only idle sessions are closed.
187 void CloseCurrentSessionsHelper( 189 void CloseCurrentSessionsHelper(
188 Error error, 190 Error error,
189 const std::string& description, 191 const std::string& description,
190 bool idle_only); 192 bool idle_only);
191 193
192 const base::WeakPtr<HttpServerProperties> http_server_properties_; 194 const base::WeakPtr<HttpServerProperties> http_server_properties_;
193 195
196 TransportSecurityState* transport_security_state_;
197
194 // The set of all sessions. This is a superset of the sessions in 198 // The set of all sessions. This is a superset of the sessions in
195 // |available_sessions_|. 199 // |available_sessions_|.
196 // 200 //
197 // |sessions_| owns all its SpdySession objects. 201 // |sessions_| owns all its SpdySession objects.
198 SessionSet sessions_; 202 SessionSet sessions_;
199 203
200 // This is a map of available sessions by key. A session may appear 204 // This is a map of available sessions by key. A session may appear
201 // more than once in this map if it has aliases. 205 // more than once in this map if it has aliases.
202 AvailableSessionMap available_sessions_; 206 AvailableSessionMap available_sessions_;
203 207
(...skipping 20 matching lines...) Expand all
224 // This SPDY proxy is allowed to push resources from origins that are 228 // This SPDY proxy is allowed to push resources from origins that are
225 // different from those of their associated streams. 229 // different from those of their associated streams.
226 HostPortPair trusted_spdy_proxy_; 230 HostPortPair trusted_spdy_proxy_;
227 231
228 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); 232 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool);
229 }; 233 };
230 234
231 } // namespace net 235 } // namespace net
232 236
233 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ 237 #endif // NET_SPDY_SPDY_SESSION_POOL_H_
OLDNEW
« no previous file with comments | « net/spdy/spdy_session.cc ('k') | net/spdy/spdy_session_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698