| 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 1665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1676 | 1676 |
| 1677 void QuicStreamFactory::MaybeInitialize() { | 1677 void QuicStreamFactory::MaybeInitialize() { |
| 1678 // We don't initialize data from HttpServerProperties in the constructor | 1678 // We don't initialize data from HttpServerProperties in the constructor |
| 1679 // because HttpServerProperties has not yet initialized. We're guaranteed | 1679 // because HttpServerProperties has not yet initialized. We're guaranteed |
| 1680 // HttpServerProperties has been initialized by the first time a request is | 1680 // HttpServerProperties has been initialized by the first time a request is |
| 1681 // made. | 1681 // made. |
| 1682 if (has_initialized_data_) | 1682 if (has_initialized_data_) |
| 1683 return; | 1683 return; |
| 1684 | 1684 |
| 1685 has_initialized_data_ = true; | 1685 has_initialized_data_ = true; |
| 1686 for (const std::pair<const HostPortPair, AlternativeServiceInfoVector>& | 1686 for (const std::pair<const url::SchemeHostPort, AlternativeServiceInfoVector>& |
| 1687 key_value : http_server_properties_->alternative_service_map()) { | 1687 key_value : http_server_properties_->alternative_service_map()) { |
| 1688 for (const AlternativeServiceInfo& alternative_service_info : | 1688 for (const AlternativeServiceInfo& alternative_service_info : |
| 1689 key_value.second) { | 1689 key_value.second) { |
| 1690 if (alternative_service_info.alternative_service.protocol == QUIC) { | 1690 if (alternative_service_info.alternative_service.protocol == QUIC) { |
| 1691 quic_supported_servers_at_startup_.insert(key_value.first); | 1691 quic_supported_servers_at_startup_.insert( |
| 1692 HostPortPair::FromSchemeHostPort(key_value.first)); |
| 1692 break; | 1693 break; |
| 1693 } | 1694 } |
| 1694 } | 1695 } |
| 1695 } | 1696 } |
| 1696 | 1697 |
| 1697 if (http_server_properties_->max_server_configs_stored_in_properties() == 0) | 1698 if (http_server_properties_->max_server_configs_stored_in_properties() == 0) |
| 1698 return; | 1699 return; |
| 1699 // Create a temporary QuicServerInfo object to deserialize and to populate the | 1700 // Create a temporary QuicServerInfo object to deserialize and to populate the |
| 1700 // in-memory crypto server config cache. | 1701 // in-memory crypto server config cache. |
| 1701 scoped_ptr<QuicServerInfo> server_info; | 1702 scoped_ptr<QuicServerInfo> server_info; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1747 // Since the session was active, there's no longer an | 1748 // Since the session was active, there's no longer an |
| 1748 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP | 1749 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP |
| 1749 // job also fails. So to avoid not using QUIC when we otherwise could, we mark | 1750 // job also fails. So to avoid not using QUIC when we otherwise could, we mark |
| 1750 // it as recently broken, which means that 0-RTT will be disabled but we'll | 1751 // it as recently broken, which means that 0-RTT will be disabled but we'll |
| 1751 // still race. | 1752 // still race. |
| 1752 http_server_properties_->MarkAlternativeServiceRecentlyBroken( | 1753 http_server_properties_->MarkAlternativeServiceRecentlyBroken( |
| 1753 alternative_service); | 1754 alternative_service); |
| 1754 } | 1755 } |
| 1755 | 1756 |
| 1756 } // namespace net | 1757 } // namespace net |
| OLD | NEW |