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 <openssl/aead.h> | 7 #include <openssl/aead.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <tuple> | 10 #include <tuple> |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 int threshold_public_resets_post_handshake, | 625 int threshold_public_resets_post_handshake, |
626 int threshold_timeouts_with_open_streams, | 626 int threshold_timeouts_with_open_streams, |
627 int socket_receive_buffer_size, | 627 int socket_receive_buffer_size, |
628 bool delay_tcp_race, | 628 bool delay_tcp_race, |
629 int max_server_configs_stored_in_properties, | 629 int max_server_configs_stored_in_properties, |
630 bool close_sessions_on_ip_change, | 630 bool close_sessions_on_ip_change, |
631 bool disable_quic_on_timeout_with_open_streams, | 631 bool disable_quic_on_timeout_with_open_streams, |
632 int idle_connection_timeout_seconds, | 632 int idle_connection_timeout_seconds, |
633 bool migrate_sessions_on_network_change, | 633 bool migrate_sessions_on_network_change, |
634 bool migrate_sessions_early, | 634 bool migrate_sessions_early, |
| 635 bool force_hol_blocking, |
635 const QuicTagVector& connection_options, | 636 const QuicTagVector& connection_options, |
636 bool enable_token_binding) | 637 bool enable_token_binding) |
637 : require_confirmation_(true), | 638 : require_confirmation_(true), |
638 net_log_(net_log), | 639 net_log_(net_log), |
639 host_resolver_(host_resolver), | 640 host_resolver_(host_resolver), |
640 client_socket_factory_(client_socket_factory), | 641 client_socket_factory_(client_socket_factory), |
641 http_server_properties_(http_server_properties), | 642 http_server_properties_(http_server_properties), |
642 transport_security_state_(transport_security_state), | 643 transport_security_state_(transport_security_state), |
643 cert_transparency_verifier_(cert_transparency_verifier), | 644 cert_transparency_verifier_(cert_transparency_verifier), |
644 quic_crypto_client_stream_factory_(quic_crypto_client_stream_factory), | 645 quic_crypto_client_stream_factory_(quic_crypto_client_stream_factory), |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 delay_tcp_race_(delay_tcp_race), | 679 delay_tcp_race_(delay_tcp_race), |
679 yield_after_packets_(kQuicYieldAfterPacketsRead), | 680 yield_after_packets_(kQuicYieldAfterPacketsRead), |
680 yield_after_duration_(QuicTime::Delta::FromMilliseconds( | 681 yield_after_duration_(QuicTime::Delta::FromMilliseconds( |
681 kQuicYieldAfterDurationMilliseconds)), | 682 kQuicYieldAfterDurationMilliseconds)), |
682 close_sessions_on_ip_change_(close_sessions_on_ip_change), | 683 close_sessions_on_ip_change_(close_sessions_on_ip_change), |
683 migrate_sessions_on_network_change_( | 684 migrate_sessions_on_network_change_( |
684 migrate_sessions_on_network_change && | 685 migrate_sessions_on_network_change && |
685 NetworkChangeNotifier::AreNetworkHandlesSupported()), | 686 NetworkChangeNotifier::AreNetworkHandlesSupported()), |
686 migrate_sessions_early_(migrate_sessions_early && | 687 migrate_sessions_early_(migrate_sessions_early && |
687 migrate_sessions_on_network_change_), | 688 migrate_sessions_on_network_change_), |
| 689 force_hol_blocking_(force_hol_blocking), |
688 port_seed_(random_generator_->RandUint64()), | 690 port_seed_(random_generator_->RandUint64()), |
689 check_persisted_supports_quic_(true), | 691 check_persisted_supports_quic_(true), |
690 has_initialized_data_(false), | 692 has_initialized_data_(false), |
691 num_push_streams_created_(0), | 693 num_push_streams_created_(0), |
692 status_(OPEN), | 694 status_(OPEN), |
693 task_runner_(nullptr), | 695 task_runner_(nullptr), |
694 ssl_config_service_(ssl_config_service), | 696 ssl_config_service_(ssl_config_service), |
695 weak_factory_(this) { | 697 weak_factory_(this) { |
696 if (ssl_config_service_.get()) | 698 if (ssl_config_service_.get()) |
697 ssl_config_service_->AddObserver(this); | 699 ssl_config_service_->AddObserver(this); |
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1675 config.SetSocketReceiveBufferToSend(socket_receive_buffer_size_); | 1677 config.SetSocketReceiveBufferToSend(socket_receive_buffer_size_); |
1676 config.set_max_undecryptable_packets(kMaxUndecryptablePackets); | 1678 config.set_max_undecryptable_packets(kMaxUndecryptablePackets); |
1677 config.SetInitialSessionFlowControlWindowToSend( | 1679 config.SetInitialSessionFlowControlWindowToSend( |
1678 kQuicSessionMaxRecvWindowSize); | 1680 kQuicSessionMaxRecvWindowSize); |
1679 config.SetInitialStreamFlowControlWindowToSend(kQuicStreamMaxRecvWindowSize); | 1681 config.SetInitialStreamFlowControlWindowToSend(kQuicStreamMaxRecvWindowSize); |
1680 int64_t srtt = GetServerNetworkStatsSmoothedRttInMicroseconds(server_id); | 1682 int64_t srtt = GetServerNetworkStatsSmoothedRttInMicroseconds(server_id); |
1681 if (srtt > 0) | 1683 if (srtt > 0) |
1682 config.SetInitialRoundTripTimeUsToSend(static_cast<uint32_t>(srtt)); | 1684 config.SetInitialRoundTripTimeUsToSend(static_cast<uint32_t>(srtt)); |
1683 config.SetBytesForConnectionIdToSend(0); | 1685 config.SetBytesForConnectionIdToSend(0); |
1684 | 1686 |
| 1687 if (force_hol_blocking_) |
| 1688 config.SetForceHolBlocking(); |
| 1689 |
1685 if (quic_server_info_factory_.get() && !server_info) { | 1690 if (quic_server_info_factory_.get() && !server_info) { |
1686 // Start the disk cache loading so that we can persist the newer QUIC server | 1691 // Start the disk cache loading so that we can persist the newer QUIC server |
1687 // information and/or inform the disk cache that we have reused | 1692 // information and/or inform the disk cache that we have reused |
1688 // |server_info|. | 1693 // |server_info|. |
1689 server_info.reset(quic_server_info_factory_->GetForServer(server_id)); | 1694 server_info.reset(quic_server_info_factory_->GetForServer(server_id)); |
1690 server_info->Start(); | 1695 server_info->Start(); |
1691 } | 1696 } |
1692 | 1697 |
1693 // Use the factory to create a new socket performance watcher, and pass the | 1698 // Use the factory to create a new socket performance watcher, and pass the |
1694 // ownership to QuicChromiumClientSession. | 1699 // ownership to QuicChromiumClientSession. |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1876 // Since the session was active, there's no longer an | 1881 // Since the session was active, there's no longer an |
1877 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP | 1882 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP |
1878 // job also fails. So to avoid not using QUIC when we otherwise could, we mark | 1883 // job also fails. So to avoid not using QUIC when we otherwise could, we mark |
1879 // it as recently broken, which means that 0-RTT will be disabled but we'll | 1884 // it as recently broken, which means that 0-RTT will be disabled but we'll |
1880 // still race. | 1885 // still race. |
1881 http_server_properties_->MarkAlternativeServiceRecentlyBroken( | 1886 http_server_properties_->MarkAlternativeServiceRecentlyBroken( |
1882 alternative_service); | 1887 alternative_service); |
1883 } | 1888 } |
1884 | 1889 |
1885 } // namespace net | 1890 } // namespace net |
OLD | NEW |