Chromium Code Reviews| 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 9f17afc9ca054a0f9a78a2e6efd03a6db6091016..943d936b589b311690fda10e80513ee027493b92 100644 |
| --- a/net/http/http_server_properties_impl.cc |
| +++ b/net/http/http_server_properties_impl.cc |
| @@ -318,14 +318,14 @@ void HttpServerPropertiesImpl::SetBrokenAlternateProtocol( |
| it = alternate_protocol_map_.Put(server, alternate); |
| } |
| it->second.is_broken = true; |
| - const BrokenAlternateProtocolEntry entry(server, alternate.port, |
| - alternate.protocol); |
| - int count = ++broken_alternate_protocol_map_[entry]; |
| + const AlternativeService altsvc(alternate.protocol, server.host(), |
|
Ryan Hamilton
2015/03/06 23:01:12
same comment here about abbreviations.
Bence
2015/03/08 18:09:04
Same reply here about abbreviations.
|
| + alternate.port); |
| + int count = ++broken_alternate_protocol_map_[altsvc]; |
| base::TimeDelta delay = |
| base::TimeDelta::FromSeconds(kBrokenAlternateProtocolDelaySecs); |
| base::TimeTicks when = base::TimeTicks::Now() + delay * (1 << (count - 1)); |
| broken_alternate_protocol_list_.push_back( |
| - BrokenAlternateProtocolEntryWithTime(entry, when)); |
| + BrokenAlternateProtocolEntryWithTime(altsvc, when)); |
| // Do not leave this host as canonical so that we don't infer the other |
| // hosts are also broken without testing them first. |
| @@ -343,9 +343,9 @@ bool HttpServerPropertiesImpl::WasAlternateProtocolRecentlyBroken( |
| const AlternateProtocolInfo alternate_protocol = GetAlternateProtocol(server); |
| if (alternate_protocol.protocol == UNINITIALIZED_ALTERNATE_PROTOCOL) |
| return false; |
| - const BrokenAlternateProtocolEntry entry(server, alternate_protocol.port, |
| - alternate_protocol.protocol); |
| - return ContainsKey(broken_alternate_protocol_map_, entry); |
| + const AlternativeService altsvc(alternate_protocol.protocol, server.host(), |
| + alternate_protocol.port); |
| + return ContainsKey(broken_alternate_protocol_map_, altsvc); |
| } |
| void HttpServerPropertiesImpl::ConfirmAlternateProtocol( |
| @@ -353,9 +353,9 @@ void HttpServerPropertiesImpl::ConfirmAlternateProtocol( |
| const AlternateProtocolInfo alternate_protocol = GetAlternateProtocol(server); |
| if (alternate_protocol.protocol == UNINITIALIZED_ALTERNATE_PROTOCOL) |
| return; |
| - const BrokenAlternateProtocolEntry entry(server, alternate_protocol.port, |
| - alternate_protocol.protocol); |
| - broken_alternate_protocol_map_.erase(entry); |
| + const AlternativeService altsvc(alternate_protocol.protocol, server.host(), |
| + alternate_protocol.port); |
| + broken_alternate_protocol_map_.erase(altsvc); |
| } |
| void HttpServerPropertiesImpl::ClearAlternateProtocol( |
| @@ -511,9 +511,8 @@ void HttpServerPropertiesImpl::ExpireBrokenAlternateProtocolMappings() { |
| break; |
| } |
| - const BrokenAlternateProtocolEntry& entry = |
| - entry_with_time.broken_alternate_protocol_entry; |
| - ClearAlternateProtocol(entry.server); |
| + const AlternativeService& altsvc = entry_with_time.altsvc; |
| + ClearAlternateProtocol(HostPortPair(altsvc.host, altsvc.port)); |
| broken_alternate_protocol_list_.pop_front(); |
| } |
| ScheduleBrokenAlternateProtocolMappingsExpiration(); |