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

Unified Diff: net/http/http_server_properties_impl.cc

Issue 2932953002: Persist broken and recently-broken alt-svcs to prefs in HttpServerPropertiesManager (Closed)
Patch Set: Added a DCHECK Created 3 years, 6 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 a02cf7869cddd51ffb5310f1d485abae00ecdcfc..9182445f44ce7b868d169fe0d432b2949847eeba 100644
--- a/net/http/http_server_properties_impl.cc
+++ b/net/http/http_server_properties_impl.cc
@@ -21,13 +21,9 @@
namespace net {
HttpServerPropertiesImpl::HttpServerPropertiesImpl()
- : HttpServerPropertiesImpl(&broken_alternative_services_clock_) {}
-
-HttpServerPropertiesImpl::HttpServerPropertiesImpl(
- base::TickClock* broken_alternative_services_clock)
- : broken_alternative_services_(this, 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),
server_network_stats_map_(ServerNetworkStatsMap::NO_AUTO_EVICT),
quic_server_info_map_(QuicServerInfoMap::NO_AUTO_EVICT),
max_server_configs_stored_in_properties_(kMaxQuicServersToPersist) {
@@ -197,10 +193,31 @@ void HttpServerPropertiesImpl::GetSpdyServerList(
}
}
+void HttpServerPropertiesImpl::AddBrokenAndRecentlyBrokenAlternativeServices(
+ std::unique_ptr<BrokenAlternativeServiceList>
+ broken_alternative_service_list,
+ std::unique_ptr<RecentlyBrokenAlternativeServices>
+ recently_broken_alternative_services) {
+ broken_alternative_services_.AddBrokenAndRecentlyBrokenAlternativeServices(
+ 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();
alternative_service_map_.Clear();
+ broken_alternative_services_.Clear();
canonical_host_to_origin_map_.clear();
last_quic_address_ = IPAddress();
server_network_stats_map_.Clear();
@@ -698,4 +715,10 @@ void HttpServerPropertiesImpl::OnExpireBrokenAlternativeService(
}
}
+void HttpServerPropertiesImpl::SetBrokenAlternativeServicesTickClockForTesting(
+ base::TickClock* clock) {
+ DCHECK(clock);
+ broken_alternative_services_.SetTickClockForTesting(clock);
+}
+
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698