| 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 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 // alternate-protocol state is unknown. | 929 // alternate-protocol state is unknown. |
| 930 if (!http_server_properties_->HasAlternateProtocol(server)) | 930 if (!http_server_properties_->HasAlternateProtocol(server)) |
| 931 return; | 931 return; |
| 932 | 932 |
| 933 // TODO(rch): In the special case where the session has received no | 933 // TODO(rch): In the special case where the session has received no |
| 934 // packets from the peer, we should consider blacklisting this | 934 // packets from the peer, we should consider blacklisting this |
| 935 // differently so that we still race TCP but we don't consider the | 935 // differently so that we still race TCP but we don't consider the |
| 936 // session connected until the handshake has been confirmed. | 936 // session connected until the handshake has been confirmed. |
| 937 HistogramBrokenAlternateProtocolLocation( | 937 HistogramBrokenAlternateProtocolLocation( |
| 938 BROKEN_ALTERNATE_PROTOCOL_LOCATION_QUIC_STREAM_FACTORY); | 938 BROKEN_ALTERNATE_PROTOCOL_LOCATION_QUIC_STREAM_FACTORY); |
| 939 PortAlternateProtocolPair alternate = | 939 AlternateProtocolInfo alternate = |
| 940 http_server_properties_->GetAlternateProtocol(server); | 940 http_server_properties_->GetAlternateProtocol(server); |
| 941 DCHECK_EQ(QUIC, alternate.protocol); | 941 DCHECK_EQ(QUIC, alternate.protocol); |
| 942 | 942 |
| 943 // Since the session was active, there's no longer an | 943 // Since the session was active, there's no longer an |
| 944 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the | 944 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the |
| 945 // TCP job also fails. So to avoid not using QUIC when we otherwise could, | 945 // TCP job also fails. So to avoid not using QUIC when we otherwise could, |
| 946 // we mark it as broken, and then immediately re-enable it. This leaves | 946 // we mark it as broken, and then immediately re-enable it. This leaves |
| 947 // QUIC as "recently broken" which means that 0-RTT will be disabled but | 947 // QUIC as "recently broken" which means that 0-RTT will be disabled but |
| 948 // we'll still race. | 948 // we'll still race. |
| 949 http_server_properties_->SetBrokenAlternateProtocol(server); | 949 http_server_properties_->SetBrokenAlternateProtocol(server); |
| 950 http_server_properties_->ClearAlternateProtocol(server); | 950 http_server_properties_->ClearAlternateProtocol(server); |
| 951 http_server_properties_->SetAlternateProtocol( | 951 http_server_properties_->SetAlternateProtocol( |
| 952 server, alternate.port, alternate.protocol); | 952 server, alternate.port, alternate.protocol, 1); |
| 953 DCHECK_EQ(QUIC, | 953 DCHECK_EQ(QUIC, |
| 954 http_server_properties_->GetAlternateProtocol(server).protocol); | 954 http_server_properties_->GetAlternateProtocol(server).protocol); |
| 955 DCHECK(http_server_properties_->WasAlternateProtocolRecentlyBroken( | 955 DCHECK(http_server_properties_->WasAlternateProtocolRecentlyBroken( |
| 956 server)); | 956 server)); |
| 957 } | 957 } |
| 958 | 958 |
| 959 } // namespace net | 959 } // namespace net |
| OLD | NEW |