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 b96a4b27d707291d89ce5a9629f96cf4b447cb48..5f855ea1ceeb9024a526eb774e6ca59c35276074 100644 |
| --- a/net/http/http_server_properties_impl.cc |
| +++ b/net/http/http_server_properties_impl.cc |
| @@ -20,17 +20,26 @@ |
| namespace net { |
| +HttpServerPropertiesImpl::HttpServerPropertiesImpl(base::TickClock* clock) |
| + : spdy_servers_map_(SpdyServersMap::NO_AUTO_EVICT), |
| + alternative_service_map_(AlternativeServiceMap::NO_AUTO_EVICT), |
| + broken_alternative_services_(this, clock), |
| + server_network_stats_map_(ServerNetworkStatsMap::NO_AUTO_EVICT), |
| + quic_server_info_map_(QuicServerInfoMap::NO_AUTO_EVICT), |
| + max_server_configs_stored_in_properties_(kMaxQuicServersToPersist) { |
| + canonical_suffixes_.push_back(".ggpht.com"); |
| + canonical_suffixes_.push_back(".c.youtube.com"); |
| + canonical_suffixes_.push_back(".googlevideo.com"); |
| + canonical_suffixes_.push_back(".googleusercontent.com"); |
| +} |
| + |
| +// Can't just call delegate constructor |
| +// HttpServerPropertiesImpl(&default_clock_) due to UBSan; |default_clock_|'s |
| +// lifetime would not have begun yet. |
|
Ryan Hamilton
2017/07/06 16:48:22
Alternatively, you could pass in nullptr and the o
wangyix1
2017/07/06 18:04:29
Done.
|
| HttpServerPropertiesImpl::HttpServerPropertiesImpl() |
| - : HttpServerPropertiesImpl(nullptr) {} |
| - |
| -HttpServerPropertiesImpl::HttpServerPropertiesImpl( |
| - base::TickClock* broken_alternative_services_clock) |
| - : broken_alternative_services_(this, |
| - broken_alternative_services_clock |
| - ? broken_alternative_services_clock |
| - : &broken_alternative_services_clock_), |
| - spdy_servers_map_(SpdyServersMap::NO_AUTO_EVICT), |
| + : spdy_servers_map_(SpdyServersMap::NO_AUTO_EVICT), |
| alternative_service_map_(AlternativeServiceMap::NO_AUTO_EVICT), |
| + broken_alternative_services_(this, &default_clock_), |
| server_network_stats_map_(ServerNetworkStatsMap::NO_AUTO_EVICT), |
| quic_server_info_map_(QuicServerInfoMap::NO_AUTO_EVICT), |
| max_server_configs_stored_in_properties_(kMaxQuicServersToPersist) { |
| @@ -165,6 +174,26 @@ void HttpServerPropertiesImpl::GetSpdyServerList( |
| } |
| } |
| +void HttpServerPropertiesImpl::SetBrokenAndRecentlyBrokenAlternativeServices( |
| + std::unique_ptr<BrokenAlternativeServiceList> |
| + broken_alternative_service_list, |
| + std::unique_ptr<RecentlyBrokenAlternativeServices> |
| + recently_broken_alternative_services) { |
| + broken_alternative_services_.SetBrokenAndRecentlyBrokenAlternativeServices( |
| + std::move(broken_alternative_service_list), |
| + std::move(recently_broken_alternative_services)); |
| +} |
| + |
| +const BrokenAlternativeServiceList& |
| +HttpServerPropertiesImpl::broken_alternative_service_list() const { |
| + return broken_alternative_services_.broken_alternative_service_list(); |
| +} |
| + |
| +const RecentlyBrokenAlternativeServices& |
| +HttpServerPropertiesImpl::recently_broken_alternative_services() const { |
| + return broken_alternative_services_.recently_broken_alternative_services(); |
| +} |
| + |
| void HttpServerPropertiesImpl::Clear() { |
| DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); |
| spdy_servers_map_.Clear(); |