Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(509)

Side by Side Diff: net/http/http_network_session.cc

Issue 2318053004: Remove obsolete QUIC disabling code. (Closed)
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/http/http_network_session.h ('k') | net/http/http_stream_factory_impl_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 // The maximum receive window sizes for HTTP/2 sessions and streams. 60 // The maximum receive window sizes for HTTP/2 sessions and streams.
61 const int32_t kSpdySessionMaxRecvWindowSize = 15 * 1024 * 1024; // 15 MB 61 const int32_t kSpdySessionMaxRecvWindowSize = 15 * 1024 * 1024; // 15 MB
62 const int32_t kSpdyStreamMaxRecvWindowSize = 6 * 1024 * 1024; // 6 MB 62 const int32_t kSpdyStreamMaxRecvWindowSize = 6 * 1024 * 1024; // 6 MB
63 // QUIC's socket receive buffer size. 63 // QUIC's socket receive buffer size.
64 // We should adaptively set this buffer size, but for now, we'll use a size 64 // We should adaptively set this buffer size, but for now, we'll use a size
65 // that seems large enough to receive data at line rate for most connections, 65 // that seems large enough to receive data at line rate for most connections,
66 // and does not consume "too much" memory. 66 // and does not consume "too much" memory.
67 const int32_t kQuicSocketReceiveBufferSize = 1024 * 1024; // 1MB 67 const int32_t kQuicSocketReceiveBufferSize = 1024 * 1024; // 1MB
68 68
69 // Number of recent connections to consider for certain thresholds
70 // that trigger disabling QUIC. E.g. disable QUIC if PUBLIC_RESET was
71 // received post handshake for at least 2 of 20 recent connections.
72 const int32_t kQuicMaxRecentDisabledReasons = 20;
73
74 HttpNetworkSession::Params::Params() 69 HttpNetworkSession::Params::Params()
75 : client_socket_factory(NULL), 70 : client_socket_factory(NULL),
76 host_resolver(NULL), 71 host_resolver(NULL),
77 cert_verifier(NULL), 72 cert_verifier(NULL),
78 channel_id_service(NULL), 73 channel_id_service(NULL),
79 transport_security_state(NULL), 74 transport_security_state(NULL),
80 cert_transparency_verifier(NULL), 75 cert_transparency_verifier(NULL),
81 ct_policy_enforcer(NULL), 76 ct_policy_enforcer(NULL),
82 proxy_service(NULL), 77 proxy_service(NULL),
83 ssl_config_service(NULL), 78 ssl_config_service(NULL),
(...skipping 15 matching lines...) Expand all
99 enable_quic(false), 94 enable_quic(false),
100 disable_quic_on_timeout_with_open_streams(false), 95 disable_quic_on_timeout_with_open_streams(false),
101 enable_quic_port_selection(true), 96 enable_quic_port_selection(true),
102 quic_always_require_handshake_confirmation(false), 97 quic_always_require_handshake_confirmation(false),
103 quic_disable_connection_pooling(false), 98 quic_disable_connection_pooling(false),
104 quic_load_server_info_timeout_srtt_multiplier(0.25f), 99 quic_load_server_info_timeout_srtt_multiplier(0.25f),
105 quic_enable_connection_racing(false), 100 quic_enable_connection_racing(false),
106 quic_enable_non_blocking_io(false), 101 quic_enable_non_blocking_io(false),
107 quic_disable_disk_cache(false), 102 quic_disable_disk_cache(false),
108 quic_prefer_aes(false), 103 quic_prefer_aes(false),
109 quic_max_number_of_lossy_connections(0),
110 quic_packet_loss_threshold(1.0f),
111 quic_socket_receive_buffer_size(kQuicSocketReceiveBufferSize), 104 quic_socket_receive_buffer_size(kQuicSocketReceiveBufferSize),
112 quic_delay_tcp_race(true), 105 quic_delay_tcp_race(true),
113 quic_max_server_configs_stored_in_properties(0u), 106 quic_max_server_configs_stored_in_properties(0u),
114 quic_clock(NULL), 107 quic_clock(NULL),
115 quic_random(NULL), 108 quic_random(NULL),
116 quic_max_packet_length(kDefaultMaxPacketSize), 109 quic_max_packet_length(kDefaultMaxPacketSize),
117 enable_user_alternate_protocol_ports(false), 110 enable_user_alternate_protocol_ports(false),
118 quic_crypto_client_stream_factory( 111 quic_crypto_client_stream_factory(
119 QuicCryptoClientStreamFactory::GetDefaultFactory()), 112 QuicCryptoClientStreamFactory::GetDefaultFactory()),
120 quic_max_recent_disabled_reasons(kQuicMaxRecentDisabledReasons),
121 quic_threshold_public_resets_post_handshake(0),
122 quic_threshold_timeouts_streams_open(0),
123 quic_close_sessions_on_ip_change(false), 113 quic_close_sessions_on_ip_change(false),
124 quic_idle_connection_timeout_seconds(kIdleConnectionTimeoutSeconds), 114 quic_idle_connection_timeout_seconds(kIdleConnectionTimeoutSeconds),
125 quic_reduced_ping_timeout_seconds(kPingTimeoutSecs), 115 quic_reduced_ping_timeout_seconds(kPingTimeoutSecs),
126 quic_packet_reader_yield_after_duration_milliseconds( 116 quic_packet_reader_yield_after_duration_milliseconds(
127 kQuicYieldAfterDurationMilliseconds), 117 kQuicYieldAfterDurationMilliseconds),
128 quic_disable_preconnect_if_0rtt(false), 118 quic_disable_preconnect_if_0rtt(false),
129 quic_migrate_sessions_on_network_change(false), 119 quic_migrate_sessions_on_network_change(false),
130 quic_migrate_sessions_early(false), 120 quic_migrate_sessions_early(false),
131 quic_allow_server_migration(false), 121 quic_allow_server_migration(false),
132 quic_disable_bidirectional_streams(false), 122 quic_disable_bidirectional_streams(false),
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 params.quic_user_agent_id, 162 params.quic_user_agent_id,
173 params.quic_supported_versions, 163 params.quic_supported_versions,
174 params.enable_quic_port_selection, 164 params.enable_quic_port_selection,
175 params.quic_always_require_handshake_confirmation, 165 params.quic_always_require_handshake_confirmation,
176 params.quic_disable_connection_pooling, 166 params.quic_disable_connection_pooling,
177 params.quic_load_server_info_timeout_srtt_multiplier, 167 params.quic_load_server_info_timeout_srtt_multiplier,
178 params.quic_enable_connection_racing, 168 params.quic_enable_connection_racing,
179 params.quic_enable_non_blocking_io, 169 params.quic_enable_non_blocking_io,
180 params.quic_disable_disk_cache, 170 params.quic_disable_disk_cache,
181 params.quic_prefer_aes, 171 params.quic_prefer_aes,
182 params.quic_max_number_of_lossy_connections,
183 params.quic_packet_loss_threshold,
184 params.quic_max_recent_disabled_reasons,
185 params.quic_threshold_public_resets_post_handshake,
186 params.quic_threshold_timeouts_streams_open,
187 params.quic_socket_receive_buffer_size, 172 params.quic_socket_receive_buffer_size,
188 params.quic_delay_tcp_race, 173 params.quic_delay_tcp_race,
189 params.quic_max_server_configs_stored_in_properties, 174 params.quic_max_server_configs_stored_in_properties,
190 params.quic_close_sessions_on_ip_change, 175 params.quic_close_sessions_on_ip_change,
191 params.disable_quic_on_timeout_with_open_streams, 176 params.disable_quic_on_timeout_with_open_streams,
192 params.quic_idle_connection_timeout_seconds, 177 params.quic_idle_connection_timeout_seconds,
193 params.quic_reduced_ping_timeout_seconds, 178 params.quic_reduced_ping_timeout_seconds,
194 params.quic_packet_reader_yield_after_duration_milliseconds, 179 params.quic_packet_reader_yield_after_duration_milliseconds,
195 params.quic_migrate_sessions_on_network_change, 180 params.quic_migrate_sessions_on_network_change,
196 params.quic_migrate_sessions_early, 181 params.quic_migrate_sessions_early,
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 origins_to_force_quic_on->AppendString("'" + origin.ToString() + "'"); 317 origins_to_force_quic_on->AppendString("'" + origin.ToString() + "'");
333 } 318 }
334 dict->Set("origins_to_force_quic_on", std::move(origins_to_force_quic_on)); 319 dict->Set("origins_to_force_quic_on", std::move(origins_to_force_quic_on));
335 320
336 dict->SetDouble("load_server_info_timeout_srtt_multiplier", 321 dict->SetDouble("load_server_info_timeout_srtt_multiplier",
337 params_.quic_load_server_info_timeout_srtt_multiplier); 322 params_.quic_load_server_info_timeout_srtt_multiplier);
338 dict->SetBoolean("enable_connection_racing", 323 dict->SetBoolean("enable_connection_racing",
339 params_.quic_enable_connection_racing); 324 params_.quic_enable_connection_racing);
340 dict->SetBoolean("disable_disk_cache", params_.quic_disable_disk_cache); 325 dict->SetBoolean("disable_disk_cache", params_.quic_disable_disk_cache);
341 dict->SetBoolean("prefer_aes", params_.quic_prefer_aes); 326 dict->SetBoolean("prefer_aes", params_.quic_prefer_aes);
342 dict->SetInteger("max_number_of_lossy_connections",
343 params_.quic_max_number_of_lossy_connections);
344 dict->SetDouble("packet_loss_threshold", params_.quic_packet_loss_threshold);
345 dict->SetBoolean("delay_tcp_race", params_.quic_delay_tcp_race); 327 dict->SetBoolean("delay_tcp_race", params_.quic_delay_tcp_race);
346 dict->SetInteger("max_server_configs_stored_in_properties", 328 dict->SetInteger("max_server_configs_stored_in_properties",
347 params_.quic_max_server_configs_stored_in_properties); 329 params_.quic_max_server_configs_stored_in_properties);
348 dict->SetInteger("idle_connection_timeout_seconds", 330 dict->SetInteger("idle_connection_timeout_seconds",
349 params_.quic_idle_connection_timeout_seconds); 331 params_.quic_idle_connection_timeout_seconds);
350 dict->SetInteger("reduced_ping_timeout_seconds", 332 dict->SetInteger("reduced_ping_timeout_seconds",
351 params_.quic_reduced_ping_timeout_seconds); 333 params_.quic_reduced_ping_timeout_seconds);
352 dict->SetInteger( 334 dict->SetInteger(
353 "packet_reader_yield_after_duration_milliseconds", 335 "packet_reader_yield_after_duration_milliseconds",
354 params_.quic_packet_reader_yield_after_duration_milliseconds); 336 params_.quic_packet_reader_yield_after_duration_milliseconds);
355 dict->SetBoolean("disable_preconnect_if_0rtt", 337 dict->SetBoolean("disable_preconnect_if_0rtt",
356 params_.quic_disable_preconnect_if_0rtt); 338 params_.quic_disable_preconnect_if_0rtt);
357 dict->SetBoolean("disable_quic_on_timeout_with_open_streams", 339 dict->SetBoolean("disable_quic_on_timeout_with_open_streams",
358 params_.disable_quic_on_timeout_with_open_streams); 340 params_.disable_quic_on_timeout_with_open_streams);
359 dict->SetString("disabled_reason", 341 dict->SetBoolean("is_quic_disabled", quic_stream_factory_.IsQuicDisabled());
360 quic_stream_factory_.QuicDisabledReasonString());
361 dict->SetBoolean("force_hol_blocking", params_.quic_force_hol_blocking); 342 dict->SetBoolean("force_hol_blocking", params_.quic_force_hol_blocking);
362 dict->SetBoolean("race_cert_verification", 343 dict->SetBoolean("race_cert_verification",
363 params_.quic_race_cert_verification); 344 params_.quic_race_cert_verification);
364 return std::move(dict); 345 return std::move(dict);
365 } 346 }
366 347
367 void HttpNetworkSession::CloseAllConnections() { 348 void HttpNetworkSession::CloseAllConnections() {
368 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); 349 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED);
369 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); 350 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED);
370 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED); 351 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE: 406 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE:
426 break; 407 break;
427 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE: 408 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE:
428 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL: 409 case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL:
429 CloseIdleConnections(); 410 CloseIdleConnections();
430 break; 411 break;
431 } 412 }
432 } 413 }
433 414
434 } // namespace net 415 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_session.h ('k') | net/http/http_stream_factory_impl_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698