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/quic/quic_stream_factory.h" | 5 #include "net/quic/quic_stream_factory.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 bool prefer_aes, | 561 bool prefer_aes, |
562 int max_number_of_lossy_connections, | 562 int max_number_of_lossy_connections, |
563 float packet_loss_threshold, | 563 float packet_loss_threshold, |
564 int max_disabled_reasons, | 564 int max_disabled_reasons, |
565 int threshold_public_resets_post_handshake, | 565 int threshold_public_resets_post_handshake, |
566 int threshold_timeouts_with_open_streams, | 566 int threshold_timeouts_with_open_streams, |
567 int socket_receive_buffer_size, | 567 int socket_receive_buffer_size, |
568 bool delay_tcp_race, | 568 bool delay_tcp_race, |
569 int max_server_configs_stored_in_properties, | 569 int max_server_configs_stored_in_properties, |
570 bool close_sessions_on_ip_change, | 570 bool close_sessions_on_ip_change, |
| 571 bool disable_quic_when_connection_times_out_with_open_streams, |
571 int idle_connection_timeout_seconds, | 572 int idle_connection_timeout_seconds, |
572 bool migrate_sessions_on_network_change, | 573 bool migrate_sessions_on_network_change, |
573 const QuicTagVector& connection_options) | 574 const QuicTagVector& connection_options) |
574 : require_confirmation_(true), | 575 : require_confirmation_(true), |
575 host_resolver_(host_resolver), | 576 host_resolver_(host_resolver), |
576 client_socket_factory_(client_socket_factory), | 577 client_socket_factory_(client_socket_factory), |
577 http_server_properties_(http_server_properties), | 578 http_server_properties_(http_server_properties), |
578 transport_security_state_(transport_security_state), | 579 transport_security_state_(transport_security_state), |
579 cert_transparency_verifier_(cert_transparency_verifier), | 580 cert_transparency_verifier_(cert_transparency_verifier), |
580 quic_crypto_client_stream_factory_(quic_crypto_client_stream_factory), | 581 quic_crypto_client_stream_factory_(quic_crypto_client_stream_factory), |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 kQuicYieldAfterDurationMilliseconds)), | 618 kQuicYieldAfterDurationMilliseconds)), |
618 close_sessions_on_ip_change_(close_sessions_on_ip_change), | 619 close_sessions_on_ip_change_(close_sessions_on_ip_change), |
619 migrate_sessions_on_network_change_( | 620 migrate_sessions_on_network_change_( |
620 migrate_sessions_on_network_change && | 621 migrate_sessions_on_network_change && |
621 NetworkChangeNotifier::AreNetworkHandlesSupported()), | 622 NetworkChangeNotifier::AreNetworkHandlesSupported()), |
622 port_seed_(random_generator_->RandUint64()), | 623 port_seed_(random_generator_->RandUint64()), |
623 check_persisted_supports_quic_(true), | 624 check_persisted_supports_quic_(true), |
624 has_initialized_data_(false), | 625 has_initialized_data_(false), |
625 task_runner_(nullptr), | 626 task_runner_(nullptr), |
626 weak_factory_(this) { | 627 weak_factory_(this) { |
| 628 if (disable_quic_when_connection_times_out_with_open_streams) |
| 629 threshold_timeouts_with_open_streams_ = 1; |
627 DCHECK(transport_security_state_); | 630 DCHECK(transport_security_state_); |
628 DCHECK(http_server_properties_); | 631 DCHECK(http_server_properties_); |
629 crypto_config_.set_user_agent_id(user_agent_id); | 632 crypto_config_.set_user_agent_id(user_agent_id); |
630 crypto_config_.AddCanonicalSuffix(".c.youtube.com"); | 633 crypto_config_.AddCanonicalSuffix(".c.youtube.com"); |
631 crypto_config_.AddCanonicalSuffix(".googlevideo.com"); | 634 crypto_config_.AddCanonicalSuffix(".googlevideo.com"); |
632 crypto_config_.AddCanonicalSuffix(".googleusercontent.com"); | 635 crypto_config_.AddCanonicalSuffix(".googleusercontent.com"); |
633 // TODO(rtenneti): http://crbug.com/487355. Temporary fix for b/20760730 until | 636 // TODO(rtenneti): http://crbug.com/487355. Temporary fix for b/20760730 until |
634 // channel_id_service is supported in cronet. | 637 // channel_id_service is supported in cronet. |
635 if (channel_id_service) { | 638 if (channel_id_service) { |
636 crypto_config_.SetChannelIDSource( | 639 crypto_config_.SetChannelIDSource( |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1598 // Since the session was active, there's no longer an | 1601 // Since the session was active, there's no longer an |
1599 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP | 1602 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP |
1600 // job also fails. So to avoid not using QUIC when we otherwise could, we mark | 1603 // job also fails. So to avoid not using QUIC when we otherwise could, we mark |
1601 // it as recently broken, which means that 0-RTT will be disabled but we'll | 1604 // it as recently broken, which means that 0-RTT will be disabled but we'll |
1602 // still race. | 1605 // still race. |
1603 http_server_properties_->MarkAlternativeServiceRecentlyBroken( | 1606 http_server_properties_->MarkAlternativeServiceRecentlyBroken( |
1604 alternative_service); | 1607 alternative_service); |
1605 } | 1608 } |
1606 | 1609 |
1607 } // namespace net | 1610 } // namespace net |
OLD | NEW |