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 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1669 config.SetSocketReceiveBufferToSend(socket_receive_buffer_size_); | 1671 config.SetSocketReceiveBufferToSend(socket_receive_buffer_size_); |
1670 config.set_max_undecryptable_packets(kMaxUndecryptablePackets); | 1672 config.set_max_undecryptable_packets(kMaxUndecryptablePackets); |
1671 config.SetInitialSessionFlowControlWindowToSend( | 1673 config.SetInitialSessionFlowControlWindowToSend( |
1672 kQuicSessionMaxRecvWindowSize); | 1674 kQuicSessionMaxRecvWindowSize); |
1673 config.SetInitialStreamFlowControlWindowToSend(kQuicStreamMaxRecvWindowSize); | 1675 config.SetInitialStreamFlowControlWindowToSend(kQuicStreamMaxRecvWindowSize); |
1674 int64_t srtt = GetServerNetworkStatsSmoothedRttInMicroseconds(server_id); | 1676 int64_t srtt = GetServerNetworkStatsSmoothedRttInMicroseconds(server_id); |
1675 if (srtt > 0) | 1677 if (srtt > 0) |
1676 config.SetInitialRoundTripTimeUsToSend(static_cast<uint32_t>(srtt)); | 1678 config.SetInitialRoundTripTimeUsToSend(static_cast<uint32_t>(srtt)); |
1677 config.SetBytesForConnectionIdToSend(0); | 1679 config.SetBytesForConnectionIdToSend(0); |
1678 | 1680 |
1681 if (force_hol_blocking_) { | |
1682 config.SetForceHolBlocking(); | |
Ryan Hamilton
2016/07/01 21:32:27
Can we add a test to quic_stream_factory_test that
Buck
2016/07/08 22:17:09
Done.
| |
1683 } | |
Ryan Hamilton
2016/07/01 21:32:27
nit: no {}s on 1-line ifs in net/ code.
Buck
2016/07/08 22:17:09
Done.
| |
1684 | |
1679 if (quic_server_info_factory_.get() && !server_info) { | 1685 if (quic_server_info_factory_.get() && !server_info) { |
1680 // Start the disk cache loading so that we can persist the newer QUIC server | 1686 // Start the disk cache loading so that we can persist the newer QUIC server |
1681 // information and/or inform the disk cache that we have reused | 1687 // information and/or inform the disk cache that we have reused |
1682 // |server_info|. | 1688 // |server_info|. |
1683 server_info.reset(quic_server_info_factory_->GetForServer(server_id)); | 1689 server_info.reset(quic_server_info_factory_->GetForServer(server_id)); |
1684 server_info->Start(); | 1690 server_info->Start(); |
1685 } | 1691 } |
1686 | 1692 |
1687 // Use the factory to create a new socket performance watcher, and pass the | 1693 // Use the factory to create a new socket performance watcher, and pass the |
1688 // ownership to QuicChromiumClientSession. | 1694 // ownership to QuicChromiumClientSession. |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1869 // Since the session was active, there's no longer an | 1875 // Since the session was active, there's no longer an |
1870 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP | 1876 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP |
1871 // job also fails. So to avoid not using QUIC when we otherwise could, we mark | 1877 // job also fails. So to avoid not using QUIC when we otherwise could, we mark |
1872 // it as recently broken, which means that 0-RTT will be disabled but we'll | 1878 // it as recently broken, which means that 0-RTT will be disabled but we'll |
1873 // still race. | 1879 // still race. |
1874 http_server_properties_->MarkAlternativeServiceRecentlyBroken( | 1880 http_server_properties_->MarkAlternativeServiceRecentlyBroken( |
1875 alternative_service); | 1881 alternative_service); |
1876 } | 1882 } |
1877 | 1883 |
1878 } // namespace net | 1884 } // namespace net |
OLD | NEW |