| 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/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/debug/stack_trace.h" | 10 #include "base/debug/stack_trace.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 enable_tcp_fast_open_for_ssl(false), | 76 enable_tcp_fast_open_for_ssl(false), |
| 77 enable_spdy_compression(true), | 77 enable_spdy_compression(true), |
| 78 enable_spdy_ping_based_connection_checking(true), | 78 enable_spdy_ping_based_connection_checking(true), |
| 79 spdy_default_protocol(kProtoUnknown), | 79 spdy_default_protocol(kProtoUnknown), |
| 80 spdy_session_max_recv_window_size(kSpdySessionMaxRecvWindowSize), | 80 spdy_session_max_recv_window_size(kSpdySessionMaxRecvWindowSize), |
| 81 spdy_stream_max_recv_window_size(kSpdyStreamMaxRecvWindowSize), | 81 spdy_stream_max_recv_window_size(kSpdyStreamMaxRecvWindowSize), |
| 82 spdy_initial_max_concurrent_streams(0), | 82 spdy_initial_max_concurrent_streams(0), |
| 83 spdy_max_concurrent_streams_limit(0), | 83 spdy_max_concurrent_streams_limit(0), |
| 84 time_func(&base::TimeTicks::Now), | 84 time_func(&base::TimeTicks::Now), |
| 85 use_alternate_protocols(false), | 85 use_alternate_protocols(false), |
| 86 alternate_protocol_probability_threshold(1), | 86 alternative_service_probability_threshold(1), |
| 87 enable_quic(false), | 87 enable_quic(false), |
| 88 enable_quic_for_proxies(false), | 88 enable_quic_for_proxies(false), |
| 89 enable_quic_port_selection(true), | 89 enable_quic_port_selection(true), |
| 90 quic_always_require_handshake_confirmation(false), | 90 quic_always_require_handshake_confirmation(false), |
| 91 quic_disable_connection_pooling(false), | 91 quic_disable_connection_pooling(false), |
| 92 quic_load_server_info_timeout_srtt_multiplier(0.25f), | 92 quic_load_server_info_timeout_srtt_multiplier(0.25f), |
| 93 quic_enable_connection_racing(false), | 93 quic_enable_connection_racing(false), |
| 94 quic_enable_non_blocking_io(false), | 94 quic_enable_non_blocking_io(false), |
| 95 quic_disable_disk_cache(false), | 95 quic_disable_disk_cache(false), |
| 96 quic_max_number_of_lossy_connections(0), | 96 quic_max_number_of_lossy_connections(0), |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 AlternateProtocol alternate = AlternateProtocolFromNextProto(proto); | 189 AlternateProtocol alternate = AlternateProtocolFromNextProto(proto); |
| 190 if (!IsAlternateProtocolValid(alternate)) { | 190 if (!IsAlternateProtocolValid(alternate)) { |
| 191 NOTREACHED() << "Invalid next proto: " << proto; | 191 NOTREACHED() << "Invalid next proto: " << proto; |
| 192 continue; | 192 continue; |
| 193 } | 193 } |
| 194 enabled_protocols_[alternate - ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION] = | 194 enabled_protocols_[alternate - ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION] = |
| 195 true; | 195 true; |
| 196 } | 196 } |
| 197 } | 197 } |
| 198 | 198 |
| 199 http_server_properties_->SetAlternateProtocolProbabilityThreshold( | 199 http_server_properties_->SetAlternativeServiceProbabilityThreshold( |
| 200 params.alternate_protocol_probability_threshold); | 200 params.alternative_service_probability_threshold); |
| 201 } | 201 } |
| 202 | 202 |
| 203 HttpNetworkSession::~HttpNetworkSession() { | 203 HttpNetworkSession::~HttpNetworkSession() { |
| 204 STLDeleteElements(&response_drainers_); | 204 STLDeleteElements(&response_drainers_); |
| 205 spdy_session_pool_.CloseAllSessions(); | 205 spdy_session_pool_.CloseAllSessions(); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void HttpNetworkSession::AddResponseDrainer(HttpResponseBodyDrainer* drainer) { | 208 void HttpNetworkSession::AddResponseDrainer(HttpResponseBodyDrainer* drainer) { |
| 209 DCHECK(!ContainsKey(response_drainers_, drainer)); | 209 DCHECK(!ContainsKey(response_drainers_, drainer)); |
| 210 response_drainers_.insert(drainer); | 210 response_drainers_.insert(drainer); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 params_.enable_quic_port_selection); | 264 params_.enable_quic_port_selection); |
| 265 base::ListValue* connection_options = new base::ListValue; | 265 base::ListValue* connection_options = new base::ListValue; |
| 266 for (QuicTagVector::const_iterator it = | 266 for (QuicTagVector::const_iterator it = |
| 267 params_.quic_connection_options.begin(); | 267 params_.quic_connection_options.begin(); |
| 268 it != params_.quic_connection_options.end(); ++it) { | 268 it != params_.quic_connection_options.end(); ++it) { |
| 269 connection_options->AppendString("'" + QuicUtils::TagToString(*it) + "'"); | 269 connection_options->AppendString("'" + QuicUtils::TagToString(*it) + "'"); |
| 270 } | 270 } |
| 271 dict->Set("connection_options", connection_options); | 271 dict->Set("connection_options", connection_options); |
| 272 dict->SetString("origin_to_force_quic_on", | 272 dict->SetString("origin_to_force_quic_on", |
| 273 params_.origin_to_force_quic_on.ToString()); | 273 params_.origin_to_force_quic_on.ToString()); |
| 274 dict->SetDouble("alternate_protocol_probability_threshold", | 274 dict->SetDouble("alternative_service_probability_threshold", |
| 275 params_.alternate_protocol_probability_threshold); | 275 params_.alternative_service_probability_threshold); |
| 276 return dict; | 276 return dict; |
| 277 } | 277 } |
| 278 | 278 |
| 279 void HttpNetworkSession::CloseAllConnections() { | 279 void HttpNetworkSession::CloseAllConnections() { |
| 280 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); | 280 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); |
| 281 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); | 281 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); |
| 282 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED); | 282 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED); |
| 283 quic_stream_factory_.CloseAllSessions(ERR_ABORTED); | 283 quic_stream_factory_.CloseAllSessions(ERR_ABORTED); |
| 284 } | 284 } |
| 285 | 285 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 317 case WEBSOCKET_SOCKET_POOL: | 317 case WEBSOCKET_SOCKET_POOL: |
| 318 return websocket_socket_pool_manager_.get(); | 318 return websocket_socket_pool_manager_.get(); |
| 319 default: | 319 default: |
| 320 NOTREACHED(); | 320 NOTREACHED(); |
| 321 break; | 321 break; |
| 322 } | 322 } |
| 323 return NULL; | 323 return NULL; |
| 324 } | 324 } |
| 325 | 325 |
| 326 } // namespace net | 326 } // namespace net |
| OLD | NEW |