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

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

Issue 2678353003: Close idle H2 sockets when SpdySession is initialized. (Closed)
Patch Set: 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_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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 }; 281 };
282 282
283 // Returns true if |new_hostname| can be pooled into an existing connection to 283 // Returns true if |new_hostname| can be pooled into an existing connection to
284 // |old_hostname| associated with |ssl_info|. 284 // |old_hostname| associated with |ssl_info|.
285 static bool CanPool(TransportSecurityState* transport_security_state, 285 static bool CanPool(TransportSecurityState* transport_security_state,
286 const SSLInfo& ssl_info, 286 const SSLInfo& ssl_info,
287 const std::string& old_hostname, 287 const std::string& old_hostname,
288 const std::string& new_hostname); 288 const std::string& new_hostname);
289 289
290 // Create a new SpdySession. 290 // Create a new SpdySession.
291 // |spdy_session_key| is the host/port that this session connects to, privacy 291 // |spdy_session_key| is the host/port that this session connects to, privacy
Bence 2017/02/08 00:18:52 Optional: remove lines 291--294, because they real
xunjieli 2017/02/08 14:15:40 Done.
292 // and proxy configuration settings that it's using. 292 // and proxy configuration settings that it's using.
293 // |session| is the HttpNetworkSession. |net_log| is the NetLog that we log 293 // |http_network_session| is the HttpNetworkSession. |net_log| is the NetLog
294 // network events to. 294 // that we log network events to.
295 SpdySession(const SpdySessionKey& spdy_session_key, 295 SpdySession(const SpdySessionKey& spdy_session_key,
296 HttpServerProperties* http_server_properties, 296 HttpServerProperties* http_server_properties,
297 TransportSecurityState* transport_security_state, 297 TransportSecurityState* transport_security_state,
298 HttpNetworkSession* http_network_session,
298 bool enable_sending_initial_data, 299 bool enable_sending_initial_data,
299 bool enable_ping_based_connection_checking, 300 bool enable_ping_based_connection_checking,
300 size_t session_max_recv_window_size, 301 size_t session_max_recv_window_size,
301 const SettingsMap& initial_settings, 302 const SettingsMap& initial_settings,
302 TimeFunc time_func, 303 TimeFunc time_func,
303 ServerPushDelegate* push_delegate, 304 ServerPushDelegate* push_delegate,
304 ProxyDelegate* proxy_delegate, 305 ProxyDelegate* proxy_delegate,
305 NetLog* net_log); 306 NetLog* net_log);
306 307
307 ~SpdySession() override; 308 ~SpdySession() override;
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 // Set set of SpdySessionKeys for which this session has serviced 1001 // Set set of SpdySessionKeys for which this session has serviced
1001 // requests. 1002 // requests.
1002 std::set<SpdySessionKey> pooled_aliases_; 1003 std::set<SpdySessionKey> pooled_aliases_;
1003 1004
1004 // |pool_| owns us, therefore its lifetime must exceed ours. 1005 // |pool_| owns us, therefore its lifetime must exceed ours.
1005 SpdySessionPool* pool_; 1006 SpdySessionPool* pool_;
1006 HttpServerProperties* http_server_properties_; 1007 HttpServerProperties* http_server_properties_;
1007 1008
1008 TransportSecurityState* transport_security_state_; 1009 TransportSecurityState* transport_security_state_;
1009 1010
1011 HttpNetworkSession* http_network_session_;
1012
1010 // The socket handle for this session. 1013 // The socket handle for this session.
1011 std::unique_ptr<ClientSocketHandle> connection_; 1014 std::unique_ptr<ClientSocketHandle> connection_;
1012 1015
1013 // The read buffer used to read data from the socket. 1016 // The read buffer used to read data from the socket.
1014 scoped_refptr<IOBuffer> read_buffer_; 1017 scoped_refptr<IOBuffer> read_buffer_;
1015 1018
1016 SpdyStreamId stream_hi_water_mark_; // The next stream id to use. 1019 SpdyStreamId stream_hi_water_mark_; // The next stream id to use.
1017 1020
1018 // Used to ensure the server increments push stream ids correctly. 1021 // Used to ensure the server increments push stream ids correctly.
1019 SpdyStreamId last_accepted_push_stream_id_; 1022 SpdyStreamId last_accepted_push_stream_id_;
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 // Used for posting asynchronous IO tasks. We use this even though 1214 // Used for posting asynchronous IO tasks. We use this even though
1212 // SpdySession is refcounted because we don't need to keep the SpdySession 1215 // SpdySession is refcounted because we don't need to keep the SpdySession
1213 // alive if the last reference is within a RunnableMethod. Just revoke the 1216 // alive if the last reference is within a RunnableMethod. Just revoke the
1214 // method. 1217 // method.
1215 base::WeakPtrFactory<SpdySession> weak_factory_; 1218 base::WeakPtrFactory<SpdySession> weak_factory_;
1216 }; 1219 };
1217 1220
1218 } // namespace net 1221 } // namespace net
1219 1222
1220 #endif // NET_SPDY_SPDY_SESSION_H_ 1223 #endif // NET_SPDY_SPDY_SESSION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698