| 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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 } | 783 } |
| 784 | 784 |
| 785 if (http_server_properties_) { | 785 if (http_server_properties_) { |
| 786 // We mark it as recently broken, which means that 0-RTT will be disabled | 786 // We mark it as recently broken, which means that 0-RTT will be disabled |
| 787 // but we'll still race. | 787 // but we'll still race. |
| 788 http_server_properties_->MarkAlternativeServiceRecentlyBroken( | 788 http_server_properties_->MarkAlternativeServiceRecentlyBroken( |
| 789 AlternativeService(QUIC, session->server_id().host(), port)); | 789 AlternativeService(QUIC, session->server_id().host(), port)); |
| 790 } | 790 } |
| 791 | 791 |
| 792 // We abandon the connection if packet loss rate is too bad. | 792 // We abandon the connection if packet loss rate is too bad. |
| 793 session->CloseSessionOnError(ERR_ABORTED, QUIC_BAD_PACKET_LOSS_RATE); | 793 session->CloseSessionOnErrorAndNotifyFactoryLater(ERR_ABORTED, |
| 794 QUIC_BAD_PACKET_LOSS_RATE); |
| 794 | 795 |
| 795 if (IsQuicDisabled(port)) | 796 if (IsQuicDisabled(port)) |
| 796 return true; // Exit if Quic is already disabled for this port. | 797 return true; // Exit if Quic is already disabled for this port. |
| 797 | 798 |
| 798 if (++number_of_lossy_connections_[port] >= | 799 if (++number_of_lossy_connections_[port] >= |
| 799 max_number_of_lossy_connections_) { | 800 max_number_of_lossy_connections_) { |
| 800 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicStreamFactory.QuicIsDisabled", port); | 801 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicStreamFactory.QuicIsDisabled", port); |
| 801 } | 802 } |
| 802 | 803 |
| 803 return true; | 804 return true; |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1205 // Since the session was active, there's no longer an | 1206 // Since the session was active, there's no longer an |
| 1206 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP | 1207 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP |
| 1207 // job also fails. So to avoid not using QUIC when we otherwise could, we mark | 1208 // job also fails. So to avoid not using QUIC when we otherwise could, we mark |
| 1208 // it as recently broken, which means that 0-RTT will be disabled but we'll | 1209 // it as recently broken, which means that 0-RTT will be disabled but we'll |
| 1209 // still race. | 1210 // still race. |
| 1210 http_server_properties_->MarkAlternativeServiceRecentlyBroken( | 1211 http_server_properties_->MarkAlternativeServiceRecentlyBroken( |
| 1211 alternative_service); | 1212 alternative_service); |
| 1212 } | 1213 } |
| 1213 | 1214 |
| 1214 } // namespace net | 1215 } // namespace net |
| OLD | NEW |