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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 enable_spdy_ip_pooling(true), | 75 enable_spdy_ip_pooling(true), |
76 enable_spdy_compression(true), | 76 enable_spdy_compression(true), |
77 enable_spdy_ping_based_connection_checking(true), | 77 enable_spdy_ping_based_connection_checking(true), |
78 spdy_default_protocol(kProtoUnknown), | 78 spdy_default_protocol(kProtoUnknown), |
79 spdy_stream_initial_recv_window_size(0), | 79 spdy_stream_initial_recv_window_size(0), |
80 spdy_initial_max_concurrent_streams(0), | 80 spdy_initial_max_concurrent_streams(0), |
81 spdy_max_concurrent_streams_limit(0), | 81 spdy_max_concurrent_streams_limit(0), |
82 time_func(&base::TimeTicks::Now), | 82 time_func(&base::TimeTicks::Now), |
83 enable_quic(false), | 83 enable_quic(false), |
84 enable_quic_https(false), | 84 enable_quic_https(false), |
| 85 enable_quic_port_selection(true), |
85 quic_clock(NULL), | 86 quic_clock(NULL), |
86 quic_random(NULL), | 87 quic_random(NULL), |
87 quic_max_packet_length(kDefaultMaxPacketSize), | 88 quic_max_packet_length(kDefaultMaxPacketSize), |
88 enable_user_alternate_protocol_ports(false), | 89 enable_user_alternate_protocol_ports(false), |
89 quic_crypto_client_stream_factory(NULL) { | 90 quic_crypto_client_stream_factory(NULL) { |
90 quic_supported_versions.push_back(QUIC_VERSION_12); | 91 quic_supported_versions.push_back(QUIC_VERSION_12); |
91 } | 92 } |
92 | 93 |
93 HttpNetworkSession::Params::~Params() {} | 94 HttpNetworkSession::Params::~Params() {} |
94 | 95 |
(...skipping 15 matching lines...) Expand all Loading... |
110 params.client_socket_factory ? | 111 params.client_socket_factory ? |
111 params.client_socket_factory : | 112 params.client_socket_factory : |
112 net::ClientSocketFactory::GetDefaultFactory(), | 113 net::ClientSocketFactory::GetDefaultFactory(), |
113 params.http_server_properties, | 114 params.http_server_properties, |
114 params.quic_crypto_client_stream_factory, | 115 params.quic_crypto_client_stream_factory, |
115 params.quic_random ? params.quic_random : | 116 params.quic_random ? params.quic_random : |
116 QuicRandom::GetInstance(), | 117 QuicRandom::GetInstance(), |
117 params.quic_clock ? params. quic_clock : | 118 params.quic_clock ? params. quic_clock : |
118 new QuicClock(), | 119 new QuicClock(), |
119 params.quic_max_packet_length, | 120 params.quic_max_packet_length, |
120 params.quic_supported_versions), | 121 params.quic_supported_versions, |
| 122 params.enable_quic_port_selection), |
121 spdy_session_pool_(params.host_resolver, | 123 spdy_session_pool_(params.host_resolver, |
122 params.ssl_config_service, | 124 params.ssl_config_service, |
123 params.http_server_properties, | 125 params.http_server_properties, |
124 params.force_spdy_single_domain, | 126 params.force_spdy_single_domain, |
125 params.enable_spdy_ip_pooling, | 127 params.enable_spdy_ip_pooling, |
126 params.enable_spdy_compression, | 128 params.enable_spdy_compression, |
127 params.enable_spdy_ping_based_connection_checking, | 129 params.enable_spdy_ping_based_connection_checking, |
128 params.spdy_default_protocol, | 130 params.spdy_default_protocol, |
129 params.spdy_stream_initial_recv_window_size, | 131 params.spdy_stream_initial_recv_window_size, |
130 params.spdy_initial_max_concurrent_streams, | 132 params.spdy_initial_max_concurrent_streams, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 195 |
194 base::Value* HttpNetworkSession::SpdySessionPoolInfoToValue() const { | 196 base::Value* HttpNetworkSession::SpdySessionPoolInfoToValue() const { |
195 return spdy_session_pool_.SpdySessionPoolInfoToValue(); | 197 return spdy_session_pool_.SpdySessionPoolInfoToValue(); |
196 } | 198 } |
197 | 199 |
198 base::Value* HttpNetworkSession::QuicInfoToValue() const { | 200 base::Value* HttpNetworkSession::QuicInfoToValue() const { |
199 base::DictionaryValue* dict = new base::DictionaryValue(); | 201 base::DictionaryValue* dict = new base::DictionaryValue(); |
200 dict->Set("sessions", quic_stream_factory_.QuicStreamFactoryInfoToValue()); | 202 dict->Set("sessions", quic_stream_factory_.QuicStreamFactoryInfoToValue()); |
201 dict->SetBoolean("quic_enabled", params_.enable_quic); | 203 dict->SetBoolean("quic_enabled", params_.enable_quic); |
202 dict->SetBoolean("quic_enabled_https", params_.enable_quic_https); | 204 dict->SetBoolean("quic_enabled_https", params_.enable_quic_https); |
| 205 dict->SetBoolean("enable_quic_port_selection", |
| 206 params_.enable_quic_port_selection); |
203 dict->SetString("origin_to_force_quic_on", | 207 dict->SetString("origin_to_force_quic_on", |
204 params_.origin_to_force_quic_on.ToString()); | 208 params_.origin_to_force_quic_on.ToString()); |
205 return dict; | 209 return dict; |
206 } | 210 } |
207 | 211 |
208 void HttpNetworkSession::CloseAllConnections() { | 212 void HttpNetworkSession::CloseAllConnections() { |
209 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); | 213 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); |
210 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); | 214 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); |
211 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED); | 215 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED); |
212 quic_stream_factory_.CloseAllSessions(ERR_ABORTED); | 216 quic_stream_factory_.CloseAllSessions(ERR_ABORTED); |
(...skipping 13 matching lines...) Expand all Loading... |
226 case WEBSOCKET_SOCKET_POOL: | 230 case WEBSOCKET_SOCKET_POOL: |
227 return websocket_socket_pool_manager_.get(); | 231 return websocket_socket_pool_manager_.get(); |
228 default: | 232 default: |
229 NOTREACHED(); | 233 NOTREACHED(); |
230 break; | 234 break; |
231 } | 235 } |
232 return NULL; | 236 return NULL; |
233 } | 237 } |
234 | 238 |
235 } // namespace net | 239 } // namespace net |
OLD | NEW |