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 #include "net/http/http_network_session.h" | 5 #include "net/http/http_network_session.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 quic_max_packet_length(kDefaultMaxPacketSize), | 120 quic_max_packet_length(kDefaultMaxPacketSize), |
121 enable_user_alternate_protocol_ports(false), | 121 enable_user_alternate_protocol_ports(false), |
122 quic_crypto_client_stream_factory( | 122 quic_crypto_client_stream_factory( |
123 QuicCryptoClientStreamFactory::GetDefaultFactory()), | 123 QuicCryptoClientStreamFactory::GetDefaultFactory()), |
124 quic_max_recent_disabled_reasons(kQuicMaxRecentDisabledReasons), | 124 quic_max_recent_disabled_reasons(kQuicMaxRecentDisabledReasons), |
125 quic_threshold_public_resets_post_handshake(0), | 125 quic_threshold_public_resets_post_handshake(0), |
126 quic_threshold_timeouts_streams_open(0), | 126 quic_threshold_timeouts_streams_open(0), |
127 quic_close_sessions_on_ip_change(false), | 127 quic_close_sessions_on_ip_change(false), |
128 quic_idle_connection_timeout_seconds(kIdleConnectionTimeoutSeconds), | 128 quic_idle_connection_timeout_seconds(kIdleConnectionTimeoutSeconds), |
129 quic_disable_preconnect_if_0rtt(false), | 129 quic_disable_preconnect_if_0rtt(false), |
| 130 quic_migrate_sessions_on_network_change(false), |
130 proxy_delegate(NULL) { | 131 proxy_delegate(NULL) { |
131 quic_supported_versions.push_back(QUIC_VERSION_25); | 132 quic_supported_versions.push_back(QUIC_VERSION_25); |
132 } | 133 } |
133 | 134 |
134 HttpNetworkSession::Params::~Params() {} | 135 HttpNetworkSession::Params::~Params() {} |
135 | 136 |
136 // TODO(mbelshe): Move the socket factories into HttpStreamFactory. | 137 // TODO(mbelshe): Move the socket factories into HttpStreamFactory. |
137 HttpNetworkSession::HttpNetworkSession(const Params& params) | 138 HttpNetworkSession::HttpNetworkSession(const Params& params) |
138 : net_log_(params.net_log), | 139 : net_log_(params.net_log), |
139 network_delegate_(params.network_delegate), | 140 network_delegate_(params.network_delegate), |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 params.quic_max_number_of_lossy_connections, | 172 params.quic_max_number_of_lossy_connections, |
172 params.quic_packet_loss_threshold, | 173 params.quic_packet_loss_threshold, |
173 params.quic_max_recent_disabled_reasons, | 174 params.quic_max_recent_disabled_reasons, |
174 params.quic_threshold_public_resets_post_handshake, | 175 params.quic_threshold_public_resets_post_handshake, |
175 params.quic_threshold_timeouts_streams_open, | 176 params.quic_threshold_timeouts_streams_open, |
176 params.quic_socket_receive_buffer_size, | 177 params.quic_socket_receive_buffer_size, |
177 params.quic_delay_tcp_race, | 178 params.quic_delay_tcp_race, |
178 params.quic_store_server_configs_in_properties, | 179 params.quic_store_server_configs_in_properties, |
179 params.quic_close_sessions_on_ip_change, | 180 params.quic_close_sessions_on_ip_change, |
180 params.quic_idle_connection_timeout_seconds, | 181 params.quic_idle_connection_timeout_seconds, |
| 182 params.quic_migrate_sessions_on_network_change, |
181 params.quic_connection_options), | 183 params.quic_connection_options), |
182 spdy_session_pool_(params.host_resolver, | 184 spdy_session_pool_(params.host_resolver, |
183 params.ssl_config_service, | 185 params.ssl_config_service, |
184 params.http_server_properties, | 186 params.http_server_properties, |
185 params.transport_security_state, | 187 params.transport_security_state, |
186 params.enable_spdy_compression, | 188 params.enable_spdy_compression, |
187 params.enable_spdy_ping_based_connection_checking, | 189 params.enable_spdy_ping_based_connection_checking, |
188 params.spdy_default_protocol, | 190 params.spdy_default_protocol, |
189 params.spdy_session_max_recv_window_size, | 191 params.spdy_session_max_recv_window_size, |
190 params.spdy_stream_max_recv_window_size, | 192 params.spdy_stream_max_recv_window_size, |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 params_.quic_disable_preconnect_if_0rtt); | 332 params_.quic_disable_preconnect_if_0rtt); |
331 dict->SetString("disabled_reason", | 333 dict->SetString("disabled_reason", |
332 quic_stream_factory_.QuicDisabledReasonString()); | 334 quic_stream_factory_.QuicDisabledReasonString()); |
333 return std::move(dict); | 335 return std::move(dict); |
334 } | 336 } |
335 | 337 |
336 void HttpNetworkSession::CloseAllConnections() { | 338 void HttpNetworkSession::CloseAllConnections() { |
337 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); | 339 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); |
338 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); | 340 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); |
339 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED); | 341 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED); |
340 quic_stream_factory_.CloseAllSessions(ERR_ABORTED); | 342 quic_stream_factory_.CloseAllSessions(ERR_ABORTED, QUIC_INTERNAL_ERROR); |
341 } | 343 } |
342 | 344 |
343 void HttpNetworkSession::CloseIdleConnections() { | 345 void HttpNetworkSession::CloseIdleConnections() { |
344 normal_socket_pool_manager_->CloseIdleSockets(); | 346 normal_socket_pool_manager_->CloseIdleSockets(); |
345 websocket_socket_pool_manager_->CloseIdleSockets(); | 347 websocket_socket_pool_manager_->CloseIdleSockets(); |
346 spdy_session_pool_.CloseCurrentIdleSessions(); | 348 spdy_session_pool_.CloseCurrentIdleSessions(); |
347 } | 349 } |
348 | 350 |
349 bool HttpNetworkSession::IsProtocolEnabled(AlternateProtocol protocol) const { | 351 bool HttpNetworkSession::IsProtocolEnabled(AlternateProtocol protocol) const { |
350 DCHECK(IsAlternateProtocolValid(protocol)); | 352 DCHECK(IsAlternateProtocolValid(protocol)); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 case WEBSOCKET_SOCKET_POOL: | 384 case WEBSOCKET_SOCKET_POOL: |
383 return websocket_socket_pool_manager_.get(); | 385 return websocket_socket_pool_manager_.get(); |
384 default: | 386 default: |
385 NOTREACHED(); | 387 NOTREACHED(); |
386 break; | 388 break; |
387 } | 389 } |
388 return NULL; | 390 return NULL; |
389 } | 391 } |
390 | 392 |
391 } // namespace net | 393 } // namespace net |
OLD | NEW |