summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/http/http_server_properties_impl.cc4
-rw-r--r--net/http/http_server_properties_impl.h4
-rw-r--r--net/http/http_server_properties_impl_unittest.cc6
-rw-r--r--net/http/http_server_properties_manager.cc2
4 files changed, 9 insertions, 7 deletions
diff --git a/net/http/http_server_properties_impl.cc b/net/http/http_server_properties_impl.cc
index 8dd6256..08a77e4 100644
--- a/net/http/http_server_properties_impl.cc
+++ b/net/http/http_server_properties_impl.cc
@@ -234,12 +234,12 @@ bool HttpServerPropertiesImpl::HasAlternateProtocol(
}
std::string HttpServerPropertiesImpl::GetCanonicalSuffix(
- const HostPortPair& server) {
+ const std::string& host) {
// If this host ends with a canonical suffix, then return the canonical
// suffix.
for (size_t i = 0; i < canonical_suffixes_.size(); ++i) {
std::string canonical_suffix = canonical_suffixes_[i];
- if (EndsWith(server.host(), canonical_suffixes_[i], false)) {
+ if (EndsWith(host, canonical_suffixes_[i], false)) {
return canonical_suffix;
}
}
diff --git a/net/http/http_server_properties_impl.h b/net/http/http_server_properties_impl.h
index 0c2f27d..7d2248f 100644
--- a/net/http/http_server_properties_impl.h
+++ b/net/http/http_server_properties_impl.h
@@ -63,9 +63,9 @@ class NET_EXPORT HttpServerPropertiesImpl
static void ForceAlternateProtocol(const AlternateProtocolInfo& pair);
static void DisableForcedAlternateProtocol();
- // Returns the canonical host suffix for |server|, or std::string() if none
+ // Returns the canonical host suffix for |host|, or std::string() if none
// exists.
- std::string GetCanonicalSuffix(const HostPortPair& server);
+ std::string GetCanonicalSuffix(const std::string& host);
// -----------------------------
// HttpServerProperties methods:
diff --git a/net/http/http_server_properties_impl_unittest.cc b/net/http/http_server_properties_impl_unittest.cc
index 0fb87b6..5aed233 100644
--- a/net/http/http_server_properties_impl_unittest.cc
+++ b/net/http/http_server_properties_impl_unittest.cc
@@ -428,8 +428,10 @@ TEST_F(AlternateProtocolServerPropertiesTest, Canonical) {
EXPECT_EQ(canonical_protocol.protocol, alternate.protocol);
// Verify the canonical suffix.
- EXPECT_EQ(".c.youtube.com", impl_.GetCanonicalSuffix(test_host_port_pair));
- EXPECT_EQ(".c.youtube.com", impl_.GetCanonicalSuffix(canonical_port_pair));
+ EXPECT_EQ(".c.youtube.com",
+ impl_.GetCanonicalSuffix(test_host_port_pair.host()));
+ EXPECT_EQ(".c.youtube.com",
+ impl_.GetCanonicalSuffix(canonical_port_pair.host()));
}
TEST_F(AlternateProtocolServerPropertiesTest, CanonicalBelowThreshold) {
diff --git a/net/http/http_server_properties_manager.cc b/net/http/http_server_properties_manager.cc
index a9652aa..292407a 100644
--- a/net/http/http_server_properties_manager.cc
+++ b/net/http/http_server_properties_manager.cc
@@ -612,7 +612,7 @@ void HttpServerPropertiesManager::UpdatePrefsFromCacheOnNetworkThread(
it != map.end() && count < kMaxAlternateProtocolHostsToPersist; ++it) {
const HostPortPair& server = it->first;
std::string canonical_suffix =
- http_server_properties_impl_->GetCanonicalSuffix(server);
+ http_server_properties_impl_->GetCanonicalSuffix(server.host());
if (!canonical_suffix.empty()) {
if (persisted_map.find(canonical_suffix) != persisted_map.end())
continue;