| 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 <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/cpu.h" | 9 #include "base/cpu.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 network_stats.srtt = base::TimeDelta::FromMicroseconds(stats.srtt_us); | 827 network_stats.srtt = base::TimeDelta::FromMicroseconds(stats.srtt_us); |
| 828 network_stats.bandwidth_estimate = stats.estimated_bandwidth; | 828 network_stats.bandwidth_estimate = stats.estimated_bandwidth; |
| 829 http_server_properties_->SetServerNetworkStats(server_id.host_port_pair(), | 829 http_server_properties_->SetServerNetworkStats(server_id.host_port_pair(), |
| 830 network_stats); | 830 network_stats); |
| 831 return; | 831 return; |
| 832 } | 832 } |
| 833 | 833 |
| 834 UMA_HISTOGRAM_COUNTS("Net.QuicHandshakeNotConfirmedNumPacketsReceived", | 834 UMA_HISTOGRAM_COUNTS("Net.QuicHandshakeNotConfirmedNumPacketsReceived", |
| 835 stats.packets_received); | 835 stats.packets_received); |
| 836 | 836 |
| 837 if (session_was_active) { | 837 if (!session_was_active) |
| 838 // TODO(rch): In the special case where the session has received no | 838 return; |
| 839 // packets from the peer, we should consider blacklisting this | 839 |
| 840 // differently so that we still race TCP but we don't consider the | 840 // TODO(rch): In the special case where the session has received no |
| 841 // session connected until the handshake has been confirmed. | 841 // packets from the peer, we should consider blacklisting this |
| 842 HistogramBrokenAlternateProtocolLocation( | 842 // differently so that we still race TCP but we don't consider the |
| 843 BROKEN_ALTERNATE_PROTOCOL_LOCATION_QUIC_STREAM_FACTORY); | 843 // session connected until the handshake has been confirmed. |
| 844 http_server_properties_->SetBrokenAlternateProtocol( | 844 HistogramBrokenAlternateProtocolLocation( |
| 845 server_id.host_port_pair()); | 845 BROKEN_ALTERNATE_PROTOCOL_LOCATION_QUIC_STREAM_FACTORY); |
| 846 } | 846 const HostPortPair& server = server_id.host_port_pair(); |
| 847 PortAlternateProtocolPair alternate = |
| 848 http_server_properties_->GetAlternateProtocol(server); |
| 849 DCHECK_EQ(QUIC, alternate.protocol); |
| 850 |
| 851 // Since the session was active, there's no longer an |
| 852 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the |
| 853 // TCP job also fails. So to avoid not using QUIC when we otherwise could, |
| 854 // we mark it as broken, and then immediately re-enable it. This leaves |
| 855 // QUIC as "recently broken" which means that 0-RTT will be disabled but |
| 856 // we'll still race. |
| 857 http_server_properties_->SetBrokenAlternateProtocol(server); |
| 858 http_server_properties_->ClearAlternateProtocol(server); |
| 859 http_server_properties_->SetAlternateProtocol( |
| 860 server, alternate.port, alternate.protocol); |
| 861 DCHECK_EQ(QUIC, |
| 862 http_server_properties_->GetAlternateProtocol(server).protocol); |
| 863 DCHECK(http_server_properties_->WasAlternateProtocolRecentlyBroken( |
| 864 server)); |
| 847 } | 865 } |
| 848 | 866 |
| 849 } // namespace net | 867 } // namespace net |
| OLD | NEW |