| 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/chromium/quic_stream_factory.h" | 5 #include "net/quic/chromium/quic_stream_factory.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <tuple> | 8 #include <tuple> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 bool force_hol_blocking, | 741 bool force_hol_blocking, |
| 742 bool race_cert_verification, | 742 bool race_cert_verification, |
| 743 bool quic_do_not_fragment, | 743 bool quic_do_not_fragment, |
| 744 const QuicTagVector& connection_options, | 744 const QuicTagVector& connection_options, |
| 745 bool enable_token_binding) | 745 bool enable_token_binding) |
| 746 : require_confirmation_(true), | 746 : require_confirmation_(true), |
| 747 net_log_(net_log), | 747 net_log_(net_log), |
| 748 host_resolver_(host_resolver), | 748 host_resolver_(host_resolver), |
| 749 client_socket_factory_(client_socket_factory), | 749 client_socket_factory_(client_socket_factory), |
| 750 http_server_properties_(http_server_properties), | 750 http_server_properties_(http_server_properties), |
| 751 push_delegate_(nullptr), |
| 751 proxy_delegate_(proxy_delegate), | 752 proxy_delegate_(proxy_delegate), |
| 752 transport_security_state_(transport_security_state), | 753 transport_security_state_(transport_security_state), |
| 753 cert_transparency_verifier_(cert_transparency_verifier), | 754 cert_transparency_verifier_(cert_transparency_verifier), |
| 754 quic_crypto_client_stream_factory_(quic_crypto_client_stream_factory), | 755 quic_crypto_client_stream_factory_(quic_crypto_client_stream_factory), |
| 755 random_generator_(random_generator), | 756 random_generator_(random_generator), |
| 756 clock_(clock), | 757 clock_(clock), |
| 757 max_packet_length_(max_packet_length), | 758 max_packet_length_(max_packet_length), |
| 758 clock_skew_detector_(base::TimeTicks::Now(), base::Time::Now()), | 759 clock_skew_detector_(base::TimeTicks::Now(), base::Time::Now()), |
| 759 socket_performance_watcher_factory_(socket_performance_watcher_factory), | 760 socket_performance_watcher_factory_(socket_performance_watcher_factory), |
| 760 config_(InitializeQuicConfig(connection_options, | 761 config_(InitializeQuicConfig(connection_options, |
| (...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1701 socket_performance_watcher_factory_->CreateSocketPerformanceWatcher( | 1702 socket_performance_watcher_factory_->CreateSocketPerformanceWatcher( |
| 1702 SocketPerformanceWatcherFactory::PROTOCOL_QUIC); | 1703 SocketPerformanceWatcherFactory::PROTOCOL_QUIC); |
| 1703 } | 1704 } |
| 1704 | 1705 |
| 1705 *session = new QuicChromiumClientSession( | 1706 *session = new QuicChromiumClientSession( |
| 1706 connection, std::move(socket), this, quic_crypto_client_stream_factory_, | 1707 connection, std::move(socket), this, quic_crypto_client_stream_factory_, |
| 1707 clock_.get(), transport_security_state_, std::move(server_info), | 1708 clock_.get(), transport_security_state_, std::move(server_info), |
| 1708 server_id, yield_after_packets_, yield_after_duration_, cert_verify_flags, | 1709 server_id, yield_after_packets_, yield_after_duration_, cert_verify_flags, |
| 1709 config, &crypto_config_, network_connection_.GetDescription(), | 1710 config, &crypto_config_, network_connection_.GetDescription(), |
| 1710 dns_resolution_start_time, dns_resolution_end_time, &push_promise_index_, | 1711 dns_resolution_start_time, dns_resolution_end_time, &push_promise_index_, |
| 1711 task_runner_, std::move(socket_performance_watcher), net_log.net_log()); | 1712 push_delegate_, task_runner_, std::move(socket_performance_watcher), |
| 1713 net_log.net_log()); |
| 1712 | 1714 |
| 1713 all_sessions_[*session] = key; // owning pointer | 1715 all_sessions_[*session] = key; // owning pointer |
| 1714 writer->set_delegate(*session); | 1716 writer->set_delegate(*session); |
| 1715 | 1717 |
| 1716 (*session)->Initialize(); | 1718 (*session)->Initialize(); |
| 1717 bool closed_during_initialize = !base::ContainsKey(all_sessions_, *session) || | 1719 bool closed_during_initialize = !base::ContainsKey(all_sessions_, *session) || |
| 1718 !(*session)->connection()->connected(); | 1720 !(*session)->connection()->connected(); |
| 1719 UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.ClosedDuringInitializeSession", | 1721 UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.ClosedDuringInitializeSession", |
| 1720 closed_during_initialize); | 1722 closed_during_initialize); |
| 1721 if (closed_during_initialize) { | 1723 if (closed_during_initialize) { |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1924 void QuicStreamFactory::OpenFactory() { | 1926 void QuicStreamFactory::OpenFactory() { |
| 1925 status_ = OPEN; | 1927 status_ = OPEN; |
| 1926 } | 1928 } |
| 1927 | 1929 |
| 1928 void QuicStreamFactory::MaybeClearConsecutiveDisabledCount() { | 1930 void QuicStreamFactory::MaybeClearConsecutiveDisabledCount() { |
| 1929 if (status_ == OPEN) | 1931 if (status_ == OPEN) |
| 1930 consecutive_disabled_count_ = 0; | 1932 consecutive_disabled_count_ = 0; |
| 1931 } | 1933 } |
| 1932 | 1934 |
| 1933 } // namespace net | 1935 } // namespace net |
| OLD | NEW |