| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 1684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1695 | 1695 |
| 1696 void QuicStreamFactory::MaybeInitialize() { | 1696 void QuicStreamFactory::MaybeInitialize() { |
| 1697 // We don't initialize data from HttpServerProperties in the constructor | 1697 // We don't initialize data from HttpServerProperties in the constructor |
| 1698 // because HttpServerProperties has not yet initialized. We're guaranteed | 1698 // because HttpServerProperties has not yet initialized. We're guaranteed |
| 1699 // HttpServerProperties has been initialized by the first time a request is | 1699 // HttpServerProperties has been initialized by the first time a request is |
| 1700 // made. | 1700 // made. |
| 1701 if (has_initialized_data_) | 1701 if (has_initialized_data_) |
| 1702 return; | 1702 return; |
| 1703 | 1703 |
| 1704 has_initialized_data_ = true; | 1704 has_initialized_data_ = true; |
| 1705 for (const std::pair<const HostPortPair, AlternativeServiceInfoVector>& | 1705 for (const std::pair<const url::SchemeHostPort, AlternativeServiceInfoVector>& |
| 1706 key_value : http_server_properties_->alternative_service_map()) { | 1706 key_value : http_server_properties_->alternative_service_map()) { |
| 1707 HostPortPair host_port_pair(key_value.first.host(), key_value.first.port()); |
| 1707 for (const AlternativeServiceInfo& alternative_service_info : | 1708 for (const AlternativeServiceInfo& alternative_service_info : |
| 1708 key_value.second) { | 1709 key_value.second) { |
| 1709 if (alternative_service_info.alternative_service.protocol == QUIC) { | 1710 if (alternative_service_info.alternative_service.protocol == QUIC) { |
| 1710 quic_supported_servers_at_startup_.insert(key_value.first); | 1711 quic_supported_servers_at_startup_.insert(host_port_pair); |
| 1711 break; | 1712 break; |
| 1712 } | 1713 } |
| 1713 } | 1714 } |
| 1714 } | 1715 } |
| 1715 | 1716 |
| 1716 if (http_server_properties_->max_server_configs_stored_in_properties() == 0) | 1717 if (http_server_properties_->max_server_configs_stored_in_properties() == 0) |
| 1717 return; | 1718 return; |
| 1718 // Create a temporary QuicServerInfo object to deserialize and to populate the | 1719 // Create a temporary QuicServerInfo object to deserialize and to populate the |
| 1719 // in-memory crypto server config cache in the MRU order. | 1720 // in-memory crypto server config cache in the MRU order. |
| 1720 std::unique_ptr<QuicServerInfo> server_info; | 1721 std::unique_ptr<QuicServerInfo> server_info; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1773 // Since the session was active, there's no longer an | 1774 // Since the session was active, there's no longer an |
| 1774 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP | 1775 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP |
| 1775 // job also fails. So to avoid not using QUIC when we otherwise could, we mark | 1776 // job also fails. So to avoid not using QUIC when we otherwise could, we mark |
| 1776 // it as recently broken, which means that 0-RTT will be disabled but we'll | 1777 // it as recently broken, which means that 0-RTT will be disabled but we'll |
| 1777 // still race. | 1778 // still race. |
| 1778 http_server_properties_->MarkAlternativeServiceRecentlyBroken( | 1779 http_server_properties_->MarkAlternativeServiceRecentlyBroken( |
| 1779 alternative_service); | 1780 alternative_service); |
| 1780 } | 1781 } |
| 1781 | 1782 |
| 1782 } // namespace net | 1783 } // namespace net |
| OLD | NEW |