Chromium Code Reviews| 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" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "net/http/http_auth_handler_factory.h" | 15 #include "net/http/http_auth_handler_factory.h" |
| 16 #include "net/http/http_response_body_drainer.h" | 16 #include "net/http/http_response_body_drainer.h" |
| 17 #include "net/http/http_stream_factory_impl.h" | 17 #include "net/http/http_stream_factory_impl.h" |
| 18 #include "net/http/url_security_manager.h" | 18 #include "net/http/url_security_manager.h" |
| 19 #include "net/proxy/proxy_service.h" | 19 #include "net/proxy/proxy_service.h" |
| 20 #include "net/quic/crypto/quic_random.h" | 20 #include "net/quic/crypto/quic_random.h" |
| 21 #include "net/quic/quic_clock.h" | 21 #include "net/quic/quic_clock.h" |
| 22 #include "net/quic/quic_crypto_client_stream_factory.h" | 22 #include "net/quic/quic_crypto_client_stream_factory.h" |
| 23 #include "net/quic/quic_protocol.h" | |
| 23 #include "net/quic/quic_stream_factory.h" | 24 #include "net/quic/quic_stream_factory.h" |
| 24 #include "net/socket/client_socket_factory.h" | 25 #include "net/socket/client_socket_factory.h" |
| 25 #include "net/socket/client_socket_pool_manager_impl.h" | 26 #include "net/socket/client_socket_pool_manager_impl.h" |
| 26 #include "net/socket/next_proto.h" | 27 #include "net/socket/next_proto.h" |
| 27 #include "net/spdy/hpack_huffman_aggregator.h" | 28 #include "net/spdy/hpack_huffman_aggregator.h" |
| 28 #include "net/spdy/spdy_session_pool.h" | 29 #include "net/spdy/spdy_session_pool.h" |
| 29 | 30 |
| 30 namespace { | 31 namespace { |
| 31 | 32 |
| 32 net::ClientSocketPoolManager* CreateSocketPoolManager( | 33 net::ClientSocketPoolManager* CreateSocketPoolManager( |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 80 spdy_initial_max_concurrent_streams(0), | 81 spdy_initial_max_concurrent_streams(0), |
| 81 spdy_max_concurrent_streams_limit(0), | 82 spdy_max_concurrent_streams_limit(0), |
| 82 time_func(&base::TimeTicks::Now), | 83 time_func(&base::TimeTicks::Now), |
| 83 force_spdy_over_ssl(true), | 84 force_spdy_over_ssl(true), |
| 84 force_spdy_always(false), | 85 force_spdy_always(false), |
| 85 use_alternate_protocols(false), | 86 use_alternate_protocols(false), |
| 86 alternate_protocol_probability_threshold(1), | 87 alternate_protocol_probability_threshold(1), |
| 87 enable_websocket_over_spdy(false), | 88 enable_websocket_over_spdy(false), |
| 88 enable_quic(false), | 89 enable_quic(false), |
| 89 enable_quic_port_selection(true), | 90 enable_quic_port_selection(true), |
| 90 enable_quic_pacing(false), | |
| 91 enable_quic_time_based_loss_detection(false), | 91 enable_quic_time_based_loss_detection(false), |
| 92 quic_clock(NULL), | 92 quic_clock(NULL), |
| 93 quic_random(NULL), | 93 quic_random(NULL), |
| 94 quic_max_packet_length(kDefaultMaxPacketSize), | 94 quic_max_packet_length(kDefaultMaxPacketSize), |
| 95 enable_user_alternate_protocol_ports(false), | 95 enable_user_alternate_protocol_ports(false), |
| 96 quic_crypto_client_stream_factory(NULL) { | 96 quic_crypto_client_stream_factory(NULL) { |
| 97 quic_supported_versions.push_back(QUIC_VERSION_21); | 97 quic_supported_versions.push_back(QUIC_VERSION_21); |
| 98 } | 98 } |
| 99 | 99 |
| 100 HttpNetworkSession::Params::~Params() {} | 100 HttpNetworkSession::Params::~Params() {} |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 122 params.transport_security_state, | 122 params.transport_security_state, |
| 123 params.quic_crypto_client_stream_factory, | 123 params.quic_crypto_client_stream_factory, |
| 124 params.quic_random ? params.quic_random : | 124 params.quic_random ? params.quic_random : |
| 125 QuicRandom::GetInstance(), | 125 QuicRandom::GetInstance(), |
| 126 params.quic_clock ? params. quic_clock : | 126 params.quic_clock ? params. quic_clock : |
| 127 new QuicClock(), | 127 new QuicClock(), |
| 128 params.quic_max_packet_length, | 128 params.quic_max_packet_length, |
| 129 params.quic_user_agent_id, | 129 params.quic_user_agent_id, |
| 130 params.quic_supported_versions, | 130 params.quic_supported_versions, |
| 131 params.enable_quic_port_selection, | 131 params.enable_quic_port_selection, |
| 132 params.enable_quic_pacing, | |
| 133 params.enable_quic_time_based_loss_detection, | 132 params.enable_quic_time_based_loss_detection, |
| 134 params.quic_connection_options), | 133 params.quic_connection_options), |
| 135 spdy_session_pool_(params.host_resolver, | 134 spdy_session_pool_(params.host_resolver, |
| 136 params.ssl_config_service, | 135 params.ssl_config_service, |
| 137 params.http_server_properties, | 136 params.http_server_properties, |
| 138 params.force_spdy_single_domain, | 137 params.force_spdy_single_domain, |
| 139 params.enable_spdy_compression, | 138 params.enable_spdy_compression, |
| 140 params.enable_spdy_ping_based_connection_checking, | 139 params.enable_spdy_ping_based_connection_checking, |
| 141 params.spdy_default_protocol, | 140 params.spdy_default_protocol, |
| 142 params.spdy_stream_initial_recv_window_size, | 141 params.spdy_stream_initial_recv_window_size, |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 245 return spdy_session_pool_.SpdySessionPoolInfoToValue(); | 244 return spdy_session_pool_.SpdySessionPoolInfoToValue(); |
| 246 } | 245 } |
| 247 | 246 |
| 248 base::Value* HttpNetworkSession::QuicInfoToValue() const { | 247 base::Value* HttpNetworkSession::QuicInfoToValue() const { |
| 249 base::DictionaryValue* dict = new base::DictionaryValue(); | 248 base::DictionaryValue* dict = new base::DictionaryValue(); |
| 250 dict->Set("sessions", quic_stream_factory_.QuicStreamFactoryInfoToValue()); | 249 dict->Set("sessions", quic_stream_factory_.QuicStreamFactoryInfoToValue()); |
| 251 dict->SetBoolean("quic_enabled", params_.enable_quic); | 250 dict->SetBoolean("quic_enabled", params_.enable_quic); |
| 252 dict->SetBoolean("enable_quic_port_selection", | 251 dict->SetBoolean("enable_quic_port_selection", |
| 253 params_.enable_quic_port_selection); | 252 params_.enable_quic_port_selection); |
| 254 dict->SetBoolean("enable_quic_pacing", | 253 dict->SetBoolean("enable_quic_pacing", |
| 255 params_.enable_quic_pacing); | 254 ContainsQuicTag(params_.quic_connection_options, kPACE)); |
|
Ryan Hamilton
2014/08/13 16:33:40
Consider removing "enable_quic_pacing" and replaci
ramant (doing other things)
2014/08/14 02:45:48
Fixed it in CL: https://chromiumcodereview.appspot
| |
| 256 dict->SetBoolean("enable_quic_time_based_loss_detection", | 255 dict->SetBoolean("enable_quic_time_based_loss_detection", |
| 257 params_.enable_quic_time_based_loss_detection); | 256 params_.enable_quic_time_based_loss_detection); |
| 258 dict->SetString("origin_to_force_quic_on", | 257 dict->SetString("origin_to_force_quic_on", |
| 259 params_.origin_to_force_quic_on.ToString()); | 258 params_.origin_to_force_quic_on.ToString()); |
| 260 return dict; | 259 return dict; |
| 261 } | 260 } |
| 262 | 261 |
| 263 void HttpNetworkSession::CloseAllConnections() { | 262 void HttpNetworkSession::CloseAllConnections() { |
| 264 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); | 263 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); |
| 265 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); | 264 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 302 case WEBSOCKET_SOCKET_POOL: | 301 case WEBSOCKET_SOCKET_POOL: |
| 303 return websocket_socket_pool_manager_.get(); | 302 return websocket_socket_pool_manager_.get(); |
| 304 default: | 303 default: |
| 305 NOTREACHED(); | 304 NOTREACHED(); |
| 306 break; | 305 break; |
| 307 } | 306 } |
| 308 return NULL; | 307 return NULL; |
| 309 } | 308 } |
| 310 | 309 |
| 311 } // namespace net | 310 } // namespace net |
| OLD | NEW |