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

Unified Diff: net/http/http_server_properties_impl.h

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.h
diff --git a/net/http/http_server_properties_impl.h b/net/http/http_server_properties_impl.h
index f5eb4bad191afe9b7dcd1e2f94afab8a640ce0a0..153fd2a1a7258b14277db7cc6520e92d0bb4df12 100644
--- a/net/http/http_server_properties_impl.h
+++ b/net/http/http_server_properties_impl.h
@@ -17,7 +17,6 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
-#include "base/time/default_tick_clock.h"
#include "base/values.h"
#include "net/base/host_port_pair.h"
#include "net/base/ip_address.h"
@@ -28,6 +27,7 @@
namespace base {
class ListValue;
+class TickClock;
}
namespace net {
@@ -38,8 +38,6 @@ class NET_EXPORT HttpServerPropertiesImpl
public BrokenAlternativeServices::Delegate {
public:
HttpServerPropertiesImpl();
- explicit HttpServerPropertiesImpl(
- base::TickClock* broken_alternative_services_clock);
~HttpServerPropertiesImpl() override;
// Sets |spdy_servers_map_| with the servers (host/port) from
@@ -61,6 +59,17 @@ class NET_EXPORT HttpServerPropertiesImpl
void GetSpdyServerList(base::ListValue* spdy_server_list,
size_t max_size) const;
+ void AddBrokenAndRecentlyBrokenAlternativeServices(
+ std::unique_ptr<BrokenAlternativeServiceList>
+ broken_alternative_service_list,
+ std::unique_ptr<RecentlyBrokenAlternativeServices>
+ recently_broken_alternative_services);
+
+ const BrokenAlternativeServiceList& broken_alternative_service_list() const;
+
+ const RecentlyBrokenAlternativeServices&
+ recently_broken_alternative_services() const;
+
// Returns flattened string representation of the |host_port_pair|. Used by
// unittests.
static std::string GetFlattenedSpdyServer(const HostPortPair& host_port_pair);
@@ -124,6 +133,9 @@ class NET_EXPORT HttpServerPropertiesImpl
void OnExpireBrokenAlternativeService(
const AlternativeService& expired_alternative_service) override;
+ // |clock| is unowned.
+ void SetBrokenAlternativeServicesTickClockForTesting(base::TickClock* clock);
Ryan Hamilton 2017/06/12 18:57:33 The constructor-based method for setting the clock
wangyix1 2017/06/14 00:01:25 Acknowledged. Will go back to using a TickClock* c
+
private:
// TODO (wangyix): modify HttpServerPropertiesImpl unit tests so this
// friendness is no longer required.
@@ -147,14 +159,13 @@ class NET_EXPORT HttpServerPropertiesImpl
// Remove the cononical host for |server|.
void RemoveCanonicalHost(const url::SchemeHostPort& server);
- base::DefaultTickClock broken_alternative_services_clock_;
- BrokenAlternativeServices broken_alternative_services_;
-
SpdyServersMap spdy_servers_map_;
Http11ServerHostPortSet http11_servers_;
AlternativeServiceMap alternative_service_map_;
+ BrokenAlternativeServices broken_alternative_services_;
+
IPAddress last_quic_address_;
ServerNetworkStatsMap server_network_stats_map_;
// Contains a map of servers which could share the same alternate protocol.

Powered by Google App Engine
This is Rietveld 408576698