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

Unified Diff: net/http/http_server_properties_impl.cc

Issue 892203004: Make HttpServerProperties::GetSupportsQuic not host-specific. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: net/http/http_server_properties_impl.cc
diff --git a/net/http/http_server_properties_impl.cc b/net/http/http_server_properties_impl.cc
index a53e73fded1f969e45a5361f0d7d009d4fd57c87..b971b29218585818dc35ce9d90bf02e4f6fc269f 100644
--- a/net/http/http_server_properties_impl.cc
+++ b/net/http/http_server_properties_impl.cc
@@ -102,12 +102,9 @@ void HttpServerPropertiesImpl::InitializeSpdySettingsServers(
}
void HttpServerPropertiesImpl::InitializeSupportsQuic(
- SupportsQuicMap* supports_quic_map) {
- for (SupportsQuicMap::reverse_iterator it = supports_quic_map->rbegin();
- it != supports_quic_map->rend();
- ++it) {
- supports_quic_map_.insert(std::make_pair(it->first, it->second));
- }
+ IPAddressNumber* last_address) {
+ if (last_address)
+ last_quic_address_ = *last_address;
}
void HttpServerPropertiesImpl::InitializeServerNetworkStats(
@@ -164,7 +161,7 @@ void HttpServerPropertiesImpl::Clear() {
alternate_protocol_map_.Clear();
canonical_host_to_origin_map_.clear();
spdy_settings_map_.Clear();
- supports_quic_map_.clear();
+ last_quic_address_.clear();
server_network_stats_map_.Clear();
}
@@ -423,26 +420,22 @@ HttpServerPropertiesImpl::spdy_settings_map() const {
return spdy_settings_map_;
}
-SupportsQuic HttpServerPropertiesImpl::GetSupportsQuic(
- const HostPortPair& host_port_pair) const {
- SupportsQuicMap::const_iterator it = supports_quic_map_.find(host_port_pair);
- if (it == supports_quic_map_.end()) {
- CR_DEFINE_STATIC_LOCAL(SupportsQuic, kEmptySupportsQuic, ());
- return kEmptySupportsQuic;
- }
- return it->second;
-}
+bool HttpServerPropertiesImpl::GetSupportsQuic(
+ IPAddressNumber* last_address) const {
+ if (last_quic_address_.empty())
+ return false;
-void HttpServerPropertiesImpl::SetSupportsQuic(
- const HostPortPair& host_port_pair,
- bool used_quic,
- const std::string& address) {
- SupportsQuic supports_quic(used_quic, address);
- supports_quic_map_.insert(std::make_pair(host_port_pair, supports_quic));
+ *last_address = last_quic_address_;
+ return true;
}
-const SupportsQuicMap& HttpServerPropertiesImpl::supports_quic_map() const {
- return supports_quic_map_;
+void HttpServerPropertiesImpl::SetSupportsQuic(bool used_quic,
+ const IPAddressNumber& address) {
+ if (!used_quic) {
+ last_quic_address_.clear();
+ } else {
+ last_quic_address_ = address;
+ }
}
void HttpServerPropertiesImpl::SetServerNetworkStats(

Powered by Google App Engine
This is Rietveld 408576698