| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 enable_tcp_fast_open_for_ssl(false), | 91 enable_tcp_fast_open_for_ssl(false), |
| 92 enable_spdy_ping_based_connection_checking(true), | 92 enable_spdy_ping_based_connection_checking(true), |
| 93 spdy_default_protocol(kProtoUnknown), | 93 spdy_default_protocol(kProtoUnknown), |
| 94 enable_spdy31(true), | 94 enable_spdy31(true), |
| 95 enable_http2(true), | 95 enable_http2(true), |
| 96 spdy_session_max_recv_window_size(kSpdySessionMaxRecvWindowSize), | 96 spdy_session_max_recv_window_size(kSpdySessionMaxRecvWindowSize), |
| 97 spdy_stream_max_recv_window_size(kSpdyStreamMaxRecvWindowSize), | 97 spdy_stream_max_recv_window_size(kSpdyStreamMaxRecvWindowSize), |
| 98 time_func(&base::TimeTicks::Now), | 98 time_func(&base::TimeTicks::Now), |
| 99 parse_alternative_services(false), | 99 parse_alternative_services(false), |
| 100 enable_alternative_service_with_different_host(false), | 100 enable_alternative_service_with_different_host(false), |
| 101 alternative_service_probability_threshold(1), |
| 101 enable_npn(true), | 102 enable_npn(true), |
| 102 enable_brotli(false), | 103 enable_brotli(false), |
| 103 enable_quic(false), | 104 enable_quic(false), |
| 104 disable_quic_on_timeout_with_open_streams(false), | 105 disable_quic_on_timeout_with_open_streams(false), |
| 105 enable_quic_for_proxies(false), | 106 enable_quic_for_proxies(false), |
| 106 enable_quic_port_selection(true), | 107 enable_quic_port_selection(true), |
| 107 quic_always_require_handshake_confirmation(false), | 108 quic_always_require_handshake_confirmation(false), |
| 108 quic_disable_connection_pooling(false), | 109 quic_disable_connection_pooling(false), |
| 109 quic_load_server_info_timeout_srtt_multiplier(0.25f), | 110 quic_load_server_info_timeout_srtt_multiplier(0.25f), |
| 110 quic_enable_connection_racing(false), | 111 quic_enable_connection_racing(false), |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 | 237 |
| 237 if (params_.enable_quic) { | 238 if (params_.enable_quic) { |
| 238 AlternateProtocol alternate = | 239 AlternateProtocol alternate = |
| 239 AlternateProtocolFromNextProto(kProtoQUIC1SPDY3); | 240 AlternateProtocolFromNextProto(kProtoQUIC1SPDY3); |
| 240 enabled_protocols_[alternate - ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION] = | 241 enabled_protocols_[alternate - ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION] = |
| 241 true; | 242 true; |
| 242 } | 243 } |
| 243 | 244 |
| 244 next_protos_.push_back(kProtoHTTP11); | 245 next_protos_.push_back(kProtoHTTP11); |
| 245 | 246 |
| 247 http_server_properties_->SetAlternativeServiceProbabilityThreshold( |
| 248 params.alternative_service_probability_threshold); |
| 246 http_server_properties_->SetMaxServerConfigsStoredInProperties( | 249 http_server_properties_->SetMaxServerConfigsStoredInProperties( |
| 247 params.quic_max_server_configs_stored_in_properties); | 250 params.quic_max_server_configs_stored_in_properties); |
| 248 } | 251 } |
| 249 | 252 |
| 250 HttpNetworkSession::~HttpNetworkSession() { | 253 HttpNetworkSession::~HttpNetworkSession() { |
| 251 STLDeleteElements(&response_drainers_); | 254 STLDeleteElements(&response_drainers_); |
| 252 spdy_session_pool_.CloseAllSessions(); | 255 spdy_session_pool_.CloseAllSessions(); |
| 253 } | 256 } |
| 254 | 257 |
| 255 void HttpNetworkSession::AddResponseDrainer(HttpResponseBodyDrainer* drainer) { | 258 void HttpNetworkSession::AddResponseDrainer(HttpResponseBodyDrainer* drainer) { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 params_.enable_quic_port_selection); | 314 params_.enable_quic_port_selection); |
| 312 scoped_ptr<base::ListValue> connection_options(new base::ListValue); | 315 scoped_ptr<base::ListValue> connection_options(new base::ListValue); |
| 313 for (QuicTagVector::const_iterator it = | 316 for (QuicTagVector::const_iterator it = |
| 314 params_.quic_connection_options.begin(); | 317 params_.quic_connection_options.begin(); |
| 315 it != params_.quic_connection_options.end(); ++it) { | 318 it != params_.quic_connection_options.end(); ++it) { |
| 316 connection_options->AppendString("'" + QuicUtils::TagToString(*it) + "'"); | 319 connection_options->AppendString("'" + QuicUtils::TagToString(*it) + "'"); |
| 317 } | 320 } |
| 318 dict->Set("connection_options", std::move(connection_options)); | 321 dict->Set("connection_options", std::move(connection_options)); |
| 319 dict->SetString("origin_to_force_quic_on", | 322 dict->SetString("origin_to_force_quic_on", |
| 320 params_.origin_to_force_quic_on.ToString()); | 323 params_.origin_to_force_quic_on.ToString()); |
| 324 dict->SetDouble("alternative_service_probability_threshold", |
| 325 params_.alternative_service_probability_threshold); |
| 321 dict->SetDouble("load_server_info_timeout_srtt_multiplier", | 326 dict->SetDouble("load_server_info_timeout_srtt_multiplier", |
| 322 params_.quic_load_server_info_timeout_srtt_multiplier); | 327 params_.quic_load_server_info_timeout_srtt_multiplier); |
| 323 dict->SetBoolean("enable_connection_racing", | 328 dict->SetBoolean("enable_connection_racing", |
| 324 params_.quic_enable_connection_racing); | 329 params_.quic_enable_connection_racing); |
| 325 dict->SetBoolean("disable_disk_cache", params_.quic_disable_disk_cache); | 330 dict->SetBoolean("disable_disk_cache", params_.quic_disable_disk_cache); |
| 326 dict->SetBoolean("prefer_aes", params_.quic_prefer_aes); | 331 dict->SetBoolean("prefer_aes", params_.quic_prefer_aes); |
| 327 dict->SetInteger("max_number_of_lossy_connections", | 332 dict->SetInteger("max_number_of_lossy_connections", |
| 328 params_.quic_max_number_of_lossy_connections); | 333 params_.quic_max_number_of_lossy_connections); |
| 329 dict->SetDouble("packet_loss_threshold", params_.quic_packet_loss_threshold); | 334 dict->SetDouble("packet_loss_threshold", params_.quic_packet_loss_threshold); |
| 330 dict->SetBoolean("delay_tcp_race", params_.quic_delay_tcp_race); | 335 dict->SetBoolean("delay_tcp_race", params_.quic_delay_tcp_race); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 case WEBSOCKET_SOCKET_POOL: | 387 case WEBSOCKET_SOCKET_POOL: |
| 383 return websocket_socket_pool_manager_.get(); | 388 return websocket_socket_pool_manager_.get(); |
| 384 default: | 389 default: |
| 385 NOTREACHED(); | 390 NOTREACHED(); |
| 386 break; | 391 break; |
| 387 } | 392 } |
| 388 return NULL; | 393 return NULL; |
| 389 } | 394 } |
| 390 | 395 |
| 391 } // namespace net | 396 } // namespace net |
| OLD | NEW |