Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: net/quic/quic_stream_factory.cc

Issue 1824903002: Change the AlternativeServiceMap with SchemeOriginPair key. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unittests Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1669 matching lines...) Expand 10 before | Expand all | Expand 10 after
1680 1680
1681 void QuicStreamFactory::MaybeInitialize() { 1681 void QuicStreamFactory::MaybeInitialize() {
1682 // We don't initialize data from HttpServerProperties in the constructor 1682 // We don't initialize data from HttpServerProperties in the constructor
1683 // because HttpServerProperties has not yet initialized. We're guaranteed 1683 // because HttpServerProperties has not yet initialized. We're guaranteed
1684 // HttpServerProperties has been initialized by the first time a request is 1684 // HttpServerProperties has been initialized by the first time a request is
1685 // made. 1685 // made.
1686 if (has_initialized_data_) 1686 if (has_initialized_data_)
1687 return; 1687 return;
1688 1688
1689 has_initialized_data_ = true; 1689 has_initialized_data_ = true;
1690 for (const std::pair<const HostPortPair, AlternativeServiceInfoVector>& 1690 for (const std::pair<const SchemeOriginPair, AlternativeServiceInfoVector>&
1691 key_value : http_server_properties_->alternative_service_map()) { 1691 key_value : http_server_properties_->alternative_service_map()) {
1692 for (const AlternativeServiceInfo& alternative_service_info : 1692 for (const AlternativeServiceInfo& alternative_service_info :
1693 key_value.second) { 1693 key_value.second) {
1694 if (alternative_service_info.alternative_service.protocol == QUIC) { 1694 if (alternative_service_info.alternative_service.protocol == QUIC) {
1695 quic_supported_servers_at_startup_.insert(key_value.first); 1695 quic_supported_servers_at_startup_.insert(
1696 key_value.first.host_port_pair());
1696 break; 1697 break;
1697 } 1698 }
1698 } 1699 }
1699 } 1700 }
1700 1701
1701 if (http_server_properties_->max_server_configs_stored_in_properties() == 0) 1702 if (http_server_properties_->max_server_configs_stored_in_properties() == 0)
1702 return; 1703 return;
1703 // Create a temporary QuicServerInfo object to deserialize and to populate the 1704 // Create a temporary QuicServerInfo object to deserialize and to populate the
1704 // in-memory crypto server config cache. 1705 // in-memory crypto server config cache.
1705 scoped_ptr<QuicServerInfo> server_info; 1706 scoped_ptr<QuicServerInfo> server_info;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1751 // Since the session was active, there's no longer an 1752 // Since the session was active, there's no longer an
1752 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP 1753 // HttpStreamFactoryImpl::Job running which can mark it broken, unless the TCP
1753 // job also fails. So to avoid not using QUIC when we otherwise could, we mark 1754 // job also fails. So to avoid not using QUIC when we otherwise could, we mark
1754 // it as recently broken, which means that 0-RTT will be disabled but we'll 1755 // it as recently broken, which means that 0-RTT will be disabled but we'll
1755 // still race. 1756 // still race.
1756 http_server_properties_->MarkAlternativeServiceRecentlyBroken( 1757 http_server_properties_->MarkAlternativeServiceRecentlyBroken(
1757 alternative_service); 1758 alternative_service);
1758 } 1759 }
1759 1760
1760 } // namespace net 1761 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698