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

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

Issue 2678353003: Close idle H2 sockets when SpdySession is initialized. (Closed)
Patch Set: Self Created 3 years, 10 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
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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 22 matching lines...) Expand all
33 namespace trace_event { 33 namespace trace_event {
34 class ProcessMemoryDump; 34 class ProcessMemoryDump;
35 } 35 }
36 } 36 }
37 37
38 namespace net { 38 namespace net {
39 39
40 class ClientSocketHandle; 40 class ClientSocketHandle;
41 class HostResolver; 41 class HostResolver;
42 class HttpServerProperties; 42 class HttpServerProperties;
43 class HttpNetworkSession;
43 class NetLogWithSource; 44 class NetLogWithSource;
44 class ProxyDelegate; 45 class ProxyDelegate;
45 class SpdySession; 46 class SpdySession;
46 class TransportSecurityState; 47 class TransportSecurityState;
47 48
48 // This is a very simple pool for open SpdySessions. 49 // This is a very simple pool for open SpdySessions.
49 class NET_EXPORT SpdySessionPool 50 class NET_EXPORT SpdySessionPool
50 : public NetworkChangeNotifier::IPAddressObserver, 51 : public NetworkChangeNotifier::IPAddressObserver,
51 public SSLConfigService::Observer, 52 public SSLConfigService::Observer,
52 public CertDatabase::Observer { 53 public CertDatabase::Observer {
53 public: 54 public:
54 typedef base::TimeTicks (*TimeFunc)(void); 55 typedef base::TimeTicks (*TimeFunc)(void);
55 56
56 SpdySessionPool(HostResolver* host_resolver, 57 SpdySessionPool(HostResolver* host_resolver,
57 SSLConfigService* ssl_config_service, 58 SSLConfigService* ssl_config_service,
58 HttpServerProperties* http_server_properties, 59 HttpServerProperties* http_server_properties,
59 TransportSecurityState* transport_security_state, 60 TransportSecurityState* transport_security_state,
61 HttpNetworkSession* http_network_session,
60 bool enable_ping_based_connection_checking, 62 bool enable_ping_based_connection_checking,
61 size_t session_max_recv_window_size, 63 size_t session_max_recv_window_size,
62 const SettingsMap& initial_settings, 64 const SettingsMap& initial_settings,
63 SpdySessionPool::TimeFunc time_func, 65 SpdySessionPool::TimeFunc time_func,
64 ProxyDelegate* proxy_delegate); 66 ProxyDelegate* proxy_delegate);
65 ~SpdySessionPool() override; 67 ~SpdySessionPool() override;
66 68
67 // In the functions below, a session is "available" if this pool has 69 // In the functions below, a session is "available" if this pool has
68 // a reference to it and there is some SpdySessionKey for which 70 // a reference to it and there is some SpdySessionKey for which
69 // FindAvailableSession() will return it. A session is "unavailable" 71 // FindAvailableSession() will return it. A session is "unavailable"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 // live. If |idle_only| is true only idle sessions are closed. 199 // live. If |idle_only| is true only idle sessions are closed.
198 void CloseCurrentSessionsHelper( 200 void CloseCurrentSessionsHelper(
199 Error error, 201 Error error,
200 const std::string& description, 202 const std::string& description,
201 bool idle_only); 203 bool idle_only);
202 204
203 HttpServerProperties* http_server_properties_; 205 HttpServerProperties* http_server_properties_;
204 206
205 TransportSecurityState* transport_security_state_; 207 TransportSecurityState* transport_security_state_;
206 208
209 HttpNetworkSession* http_network_session_;
210
207 // The set of all sessions. This is a superset of the sessions in 211 // The set of all sessions. This is a superset of the sessions in
208 // |available_sessions_|. 212 // |available_sessions_|.
209 // 213 //
210 // |sessions_| owns all its SpdySession objects. 214 // |sessions_| owns all its SpdySession objects.
211 SessionSet sessions_; 215 SessionSet sessions_;
212 216
213 // This is a map of available sessions by key. A session may appear 217 // This is a map of available sessions by key. A session may appear
214 // more than once in this map if it has aliases. 218 // more than once in this map if it has aliases.
215 AvailableSessionMap available_sessions_; 219 AvailableSessionMap available_sessions_;
216 220
(...skipping 29 matching lines...) Expand all
246 // resources from origins that are different from those of their associated 250 // resources from origins that are different from those of their associated
247 // streams. May be nullptr. 251 // streams. May be nullptr.
248 ProxyDelegate* proxy_delegate_; 252 ProxyDelegate* proxy_delegate_;
249 253
250 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool); 254 DISALLOW_COPY_AND_ASSIGN(SpdySessionPool);
251 }; 255 };
252 256
253 } // namespace net 257 } // namespace net
254 258
255 #endif // NET_SPDY_SPDY_SESSION_POOL_H_ 259 #endif // NET_SPDY_SPDY_SESSION_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698