Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 |
| 11 #include <deque> | 11 #include <deque> |
| 12 #include <map> | 12 #include <map> |
| 13 #include <set> | 13 #include <set> |
| 14 #include <string> | 14 #include <string> |
| 15 | 15 |
| 16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
| 20 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
| 21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 22 #include "net/base/host_port_pair.h" | |
| 22 #include "net/base/io_buffer.h" | 23 #include "net/base/io_buffer.h" |
| 23 #include "net/base/load_states.h" | 24 #include "net/base/load_states.h" |
| 24 #include "net/base/net_errors.h" | 25 #include "net/base/net_errors.h" |
| 25 #include "net/base/net_export.h" | 26 #include "net/base/net_export.h" |
| 26 #include "net/base/request_priority.h" | 27 #include "net/base/request_priority.h" |
| 27 #include "net/socket/client_socket_handle.h" | 28 #include "net/socket/client_socket_handle.h" |
| 28 #include "net/socket/client_socket_pool.h" | 29 #include "net/socket/client_socket_pool.h" |
| 29 #include "net/socket/next_proto.h" | 30 #include "net/socket/next_proto.h" |
| 30 #include "net/socket/ssl_client_socket.h" | 31 #include "net/socket/ssl_client_socket.h" |
| 31 #include "net/socket/stream_socket.h" | 32 #include "net/socket/stream_socket.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 66 const int kYieldAfterBytesRead = 32 * 1024; | 67 const int kYieldAfterBytesRead = 32 * 1024; |
| 67 const int kYieldAfterDurationMilliseconds = 20; | 68 const int kYieldAfterDurationMilliseconds = 20; |
| 68 | 69 |
| 69 // First and last valid stream IDs. As we always act as the client, | 70 // First and last valid stream IDs. As we always act as the client, |
| 70 // start at 1 for the first stream id. | 71 // start at 1 for the first stream id. |
| 71 const SpdyStreamId kFirstStreamId = 1; | 72 const SpdyStreamId kFirstStreamId = 1; |
| 72 const SpdyStreamId kLastStreamId = 0x7fffffff; | 73 const SpdyStreamId kLastStreamId = 0x7fffffff; |
| 73 | 74 |
| 74 class BoundNetLog; | 75 class BoundNetLog; |
| 75 struct LoadTimingInfo; | 76 struct LoadTimingInfo; |
| 77 class ProxyDelegate; | |
| 76 class SpdyStream; | 78 class SpdyStream; |
| 77 class SSLInfo; | 79 class SSLInfo; |
| 78 class TransportSecurityState; | 80 class TransportSecurityState; |
| 79 | 81 |
| 80 // NOTE: There's an enum of the same name (also with numeric suffixes) | 82 // NOTE: There's an enum of the same name (also with numeric suffixes) |
| 81 // in histograms.xml. Be sure to add new values there also. | 83 // in histograms.xml. Be sure to add new values there also. |
| 82 enum SpdyProtocolErrorDetails { | 84 enum SpdyProtocolErrorDetails { |
| 83 // SpdyFramer::SpdyError mappings. | 85 // SpdyFramer::SpdyError mappings. |
| 84 SPDY_ERROR_NO_ERROR = 0, | 86 SPDY_ERROR_NO_ERROR = 0, |
| 85 SPDY_ERROR_INVALID_CONTROL_FRAME = 1, | 87 SPDY_ERROR_INVALID_CONTROL_FRAME = 1, |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 TransportSecurityState* transport_security_state, | 240 TransportSecurityState* transport_security_state, |
| 239 bool verify_domain_authentication, | 241 bool verify_domain_authentication, |
| 240 bool enable_sending_initial_data, | 242 bool enable_sending_initial_data, |
| 241 bool enable_compression, | 243 bool enable_compression, |
| 242 bool enable_ping_based_connection_checking, | 244 bool enable_ping_based_connection_checking, |
| 243 NextProto default_protocol, | 245 NextProto default_protocol, |
| 244 size_t session_max_recv_window_size, | 246 size_t session_max_recv_window_size, |
| 245 size_t stream_max_recv_window_size, | 247 size_t stream_max_recv_window_size, |
| 246 size_t initial_max_concurrent_streams, | 248 size_t initial_max_concurrent_streams, |
| 247 TimeFunc time_func, | 249 TimeFunc time_func, |
| 248 const HostPortPair& trusted_spdy_proxy, | 250 const ProxyDelegate* proxy_delegate, |
| 249 NetLog* net_log); | 251 NetLog* net_log); |
| 250 | 252 |
| 251 ~SpdySession() override; | 253 ~SpdySession() override; |
| 252 | 254 |
| 253 const HostPortPair& host_port_pair() const { | 255 const HostPortPair& host_port_pair() const { |
| 254 return spdy_session_key_.host_port_proxy_pair().first; | 256 return spdy_session_key_.host_port_proxy_pair().first; |
| 255 } | 257 } |
| 256 const HostPortProxyPair& host_port_proxy_pair() const { | 258 const HostPortProxyPair& host_port_proxy_pair() const { |
| 257 return spdy_session_key_.host_port_proxy_pair(); | 259 return spdy_session_key_.host_port_proxy_pair(); |
| 258 } | 260 } |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1175 // we could adjust it to send fewer pings perhaps. | 1177 // we could adjust it to send fewer pings perhaps. |
| 1176 base::TimeDelta connection_at_risk_of_loss_time_; | 1178 base::TimeDelta connection_at_risk_of_loss_time_; |
| 1177 | 1179 |
| 1178 // The amount of time that we are willing to tolerate with no activity (of any | 1180 // The amount of time that we are willing to tolerate with no activity (of any |
| 1179 // form), while there is a ping in flight, before we declare the connection to | 1181 // form), while there is a ping in flight, before we declare the connection to |
| 1180 // be hung. TODO(rtenneti): When hung, instead of resetting connection, race | 1182 // be hung. TODO(rtenneti): When hung, instead of resetting connection, race |
| 1181 // to build a new connection, and see if that completes before we (finally) | 1183 // to build a new connection, and see if that completes before we (finally) |
| 1182 // get a PING response (http://crbug.com/127812). | 1184 // get a PING response (http://crbug.com/127812). |
| 1183 base::TimeDelta hung_interval_; | 1185 base::TimeDelta hung_interval_; |
| 1184 | 1186 |
| 1185 // This SPDY proxy is allowed to push resources from origins that are | 1187 // proxy_delegate_ verifies if a given proxy is a trusted SPDY proxy that is |
|
bengr
2016/01/26 23:23:26
proxy_delegate_ -> The proxy_delegate_
if -> that
tbansal1
2016/01/27 00:13:34
Done.
| |
| 1186 // different from those of their associated streams. | 1188 // allowed to push resources from origins that are different from those of |
| 1187 HostPortPair trusted_spdy_proxy_; | 1189 // their associated streams. May be NULL. |
| 1190 const ProxyDelegate* proxy_delegate_; | |
| 1188 | 1191 |
| 1189 TimeFunc time_func_; | 1192 TimeFunc time_func_; |
| 1190 | 1193 |
| 1191 // Should priority-based dependency information be sent in stream header | 1194 // Should priority-based dependency information be sent in stream header |
| 1192 // frames. | 1195 // frames. |
| 1193 bool send_priority_dependency_; | 1196 bool send_priority_dependency_; |
| 1194 | 1197 |
| 1195 // Used for posting asynchronous IO tasks. We use this even though | 1198 // Used for posting asynchronous IO tasks. We use this even though |
| 1196 // SpdySession is refcounted because we don't need to keep the SpdySession | 1199 // SpdySession is refcounted because we don't need to keep the SpdySession |
| 1197 // alive if the last reference is within a RunnableMethod. Just revoke the | 1200 // alive if the last reference is within a RunnableMethod. Just revoke the |
| 1198 // method. | 1201 // method. |
| 1199 base::WeakPtrFactory<SpdySession> weak_factory_; | 1202 base::WeakPtrFactory<SpdySession> weak_factory_; |
| 1200 }; | 1203 }; |
| 1201 | 1204 |
| 1202 } // namespace net | 1205 } // namespace net |
| 1203 | 1206 |
| 1204 #endif // NET_SPDY_SPDY_SESSION_H_ | 1207 #endif // NET_SPDY_SPDY_SESSION_H_ |
| OLD | NEW |