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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 params.quic_force_hol_blocking, | 218 params.quic_force_hol_blocking, |
219 params.quic_race_cert_verification, | 219 params.quic_race_cert_verification, |
220 params.quic_do_not_fragment, | 220 params.quic_do_not_fragment, |
221 params.quic_estimate_initial_rtt, | 221 params.quic_estimate_initial_rtt, |
222 params.quic_connection_options, | 222 params.quic_connection_options, |
223 params.enable_token_binding), | 223 params.enable_token_binding), |
224 spdy_session_pool_(params.host_resolver, | 224 spdy_session_pool_(params.host_resolver, |
225 params.ssl_config_service, | 225 params.ssl_config_service, |
226 params.http_server_properties, | 226 params.http_server_properties, |
227 params.transport_security_state, | 227 params.transport_security_state, |
| 228 this, |
228 params.enable_spdy_ping_based_connection_checking, | 229 params.enable_spdy_ping_based_connection_checking, |
229 params.spdy_session_max_recv_window_size, | 230 params.spdy_session_max_recv_window_size, |
230 AddDefaultHttp2Settings(params.http2_settings), | 231 AddDefaultHttp2Settings(params.http2_settings), |
231 params.time_func, | 232 params.time_func, |
232 params.proxy_delegate), | 233 params.proxy_delegate), |
233 http_stream_factory_(new HttpStreamFactoryImpl(this, false)), | 234 http_stream_factory_(new HttpStreamFactoryImpl(this, false)), |
234 http_stream_factory_for_websocket_(new HttpStreamFactoryImpl(this, true)), | 235 http_stream_factory_for_websocket_(new HttpStreamFactoryImpl(this, true)), |
235 network_stream_throttler_(new NetworkThrottleManagerImpl()), | 236 network_stream_throttler_(new NetworkThrottleManagerImpl()), |
236 params_(params) { | 237 params_(params) { |
237 DCHECK(proxy_service_); | 238 DCHECK(proxy_service_); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED); | 372 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED); |
372 quic_stream_factory_.CloseAllSessions(ERR_ABORTED, QUIC_INTERNAL_ERROR); | 373 quic_stream_factory_.CloseAllSessions(ERR_ABORTED, QUIC_INTERNAL_ERROR); |
373 } | 374 } |
374 | 375 |
375 void HttpNetworkSession::CloseIdleConnections() { | 376 void HttpNetworkSession::CloseIdleConnections() { |
376 normal_socket_pool_manager_->CloseIdleSockets(); | 377 normal_socket_pool_manager_->CloseIdleSockets(); |
377 websocket_socket_pool_manager_->CloseIdleSockets(); | 378 websocket_socket_pool_manager_->CloseIdleSockets(); |
378 spdy_session_pool_.CloseCurrentIdleSessions(); | 379 spdy_session_pool_.CloseCurrentIdleSessions(); |
379 } | 380 } |
380 | 381 |
| 382 void HttpNetworkSession::CloseIdleConnectionsInGroup( |
| 383 const std::string& group_name) { |
| 384 normal_socket_pool_manager_->CloseIdleSocketsInGroup(group_name); |
| 385 } |
| 386 |
381 bool HttpNetworkSession::IsProtocolEnabled(NextProto protocol) const { | 387 bool HttpNetworkSession::IsProtocolEnabled(NextProto protocol) const { |
382 switch (protocol) { | 388 switch (protocol) { |
383 case kProtoUnknown: | 389 case kProtoUnknown: |
384 NOTREACHED(); | 390 NOTREACHED(); |
385 return false; | 391 return false; |
386 case kProtoHTTP11: | 392 case kProtoHTTP11: |
387 return true; | 393 return true; |
388 case kProtoHTTP2: | 394 case kProtoHTTP2: |
389 return params_.enable_http2; | 395 return params_.enable_http2; |
390 case kProtoQUIC: | 396 case kProtoQUIC: |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 break; | 500 break; |
495 case base::MemoryState::SUSPENDED: | 501 case base::MemoryState::SUSPENDED: |
496 // Note: Not supported at present. Fall through. | 502 // Note: Not supported at present. Fall through. |
497 case base::MemoryState::UNKNOWN: | 503 case base::MemoryState::UNKNOWN: |
498 NOTREACHED(); | 504 NOTREACHED(); |
499 break; | 505 break; |
500 } | 506 } |
501 } | 507 } |
502 | 508 |
503 } // namespace net | 509 } // namespace net |
OLD | NEW |