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

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: Removed BrokenAlternativeServices::Clear() so it can be added in a separate CL 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 4140e1d6e35ae5dd9ed1ad236a66779aee6d4fcf..aefae2bb16789ec5608d5b53fe1a23cf9c6aebbc 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.
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) {
@@ -200,6 +209,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();

Powered by Google App Engine
This is Rietveld 408576698