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

Unified Diff: net/http/http_server_properties_impl.cc

Issue 895853003: Update from https://crrev.com/314320 (Closed) Base URL: https://github.com/domokit/mojo.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
« no previous file with comments | « net/http/http_server_properties_impl.h ('k') | net/http/http_server_properties_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d048e98871acba04071ccae2c0c81d51d494bc26..a53e73fded1f969e45a5361f0d7d009d4fd57c87 100644
--- a/net/http/http_server_properties_impl.cc
+++ b/net/http/http_server_properties_impl.cc
@@ -168,7 +168,7 @@ void HttpServerPropertiesImpl::Clear() {
server_network_stats_map_.Clear();
}
-bool HttpServerPropertiesImpl::SupportsSpdy(
+bool HttpServerPropertiesImpl::SupportsRequestPriority(
const HostPortPair& host_port_pair) {
DCHECK(CalledOnValidThread());
if (host_port_pair.host().empty())
@@ -176,9 +176,14 @@ bool HttpServerPropertiesImpl::SupportsSpdy(
SpdyServerHostPortMap::iterator spdy_host_port =
spdy_servers_map_.Get(host_port_pair.ToString());
- if (spdy_host_port != spdy_servers_map_.end())
- return spdy_host_port->second;
- return false;
+ if (spdy_host_port != spdy_servers_map_.end() && spdy_host_port->second)
+ return true;
+
+ if (!HasAlternateProtocol(host_port_pair))
+ return false;
+
+ AlternateProtocolInfo info = GetAlternateProtocol(host_port_pair);
+ return info.protocol == QUIC;
}
void HttpServerPropertiesImpl::SetSupportsSpdy(
@@ -234,12 +239,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;
}
}
@@ -341,8 +346,7 @@ void HttpServerPropertiesImpl::SetBrokenAlternateProtocol(
RemoveCanonicalHost(server);
// If this is the only entry in the list, schedule an expiration task.
- // Otherwse it will be rescheduled automatically when the pending
- // task runs.
+ // Otherwise it will be rescheduled automatically when the pending task runs.
if (broken_alternate_protocol_list_.size() == 1) {
ScheduleBrokenAlternateProtocolMappingsExpiration();
}
« no previous file with comments | « net/http/http_server_properties_impl.h ('k') | net/http/http_server_properties_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698