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

Unified Diff: net/http/http_server_properties_manager.h

Issue 2932953002: Persist broken and recently-broken alt-svcs to prefs in HttpServerPropertiesManager (Closed)
Patch Set: Fixed rch's comments from PS14 Created 3 years, 5 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
« no previous file with comments | « net/http/http_server_properties_impl.cc ('k') | net/http/http_server_properties_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_server_properties_manager.h
diff --git a/net/http/http_server_properties_manager.h b/net/http/http_server_properties_manager.h
index a2a753ac059b3a32b4aa287756735fba20916ca3..32ca82ffa7c624bd3574014c7971bc52489eea78 100644
--- a/net/http/http_server_properties_manager.h
+++ b/net/http/http_server_properties_manager.h
@@ -15,6 +15,7 @@
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "base/time/default_tick_clock.h"
#include "base/timer/timer.h"
#include "base/values.h"
#include "net/base/host_port_pair.h"
@@ -93,6 +94,17 @@ class NET_EXPORT HttpServerPropertiesManager : public HttpServerProperties {
// cache update to the pref thread;
// |network_task_runner| should be bound with the network thread and is used
// to post pref update to the cache thread.
+ //
+ // |clock| is used for setting expiration times and scheduling the
+ // expiration of broken alternative services. It must not be null.
Zhongyi Shi 2017/07/06 23:13:53 nit: If null, default clock will be used.
wangyix1 2017/07/07 00:17:42 Done.
+ HttpServerPropertiesManager(
+ PrefDelegate* pref_delegate,
+ scoped_refptr<base::SingleThreadTaskRunner> pref_task_runner,
+ scoped_refptr<base::SingleThreadTaskRunner> network_task_runner,
+ NetLog* net_log,
+ base::TickClock* clock);
+
+ // Default clock will be used.
HttpServerPropertiesManager(
PrefDelegate* pref_delegate,
scoped_refptr<base::SingleThreadTaskRunner> pref_task_runner,
@@ -213,6 +225,10 @@ class NET_EXPORT HttpServerPropertiesManager : public HttpServerProperties {
std::unique_ptr<IPAddress> last_quic_address,
std::unique_ptr<ServerNetworkStatsMap> server_network_stats_map,
std::unique_ptr<QuicServerInfoMap> quic_server_info_map,
+ std::unique_ptr<BrokenAlternativeServiceList>
+ broken_alternative_service_list,
+ std::unique_ptr<RecentlyBrokenAlternativeServices>
+ recently_broken_alternative_services,
bool detected_corrupted_prefs);
// These are used to delay updating the preferences when cached data in
@@ -240,6 +256,10 @@ class NET_EXPORT HttpServerPropertiesManager : public HttpServerProperties {
std::unique_ptr<IPAddress> last_quic_address,
std::unique_ptr<ServerNetworkStatsMap> server_network_stats_map,
std::unique_ptr<QuicServerInfoMap> quic_server_info_map,
+ std::unique_ptr<BrokenAlternativeServiceList>
+ broken_alternative_service_list,
+ std::unique_ptr<RecentlyBrokenAlternativeServices>
+ recently_broken_alternative_services,
const base::Closure& completion);
private:
@@ -256,8 +276,12 @@ class NET_EXPORT HttpServerPropertiesManager : public HttpServerProperties {
AlternativeServiceMap* alternative_service_map,
ServerNetworkStatsMap* network_stats_map,
int version);
- bool ParseAlternativeServiceDict(
- const base::DictionaryValue& alternative_service_dict,
+ bool ParseAlternativeServiceDict(const base::DictionaryValue& dict,
+ bool host_required,
+ const std::string& parsing_under,
+ AlternativeService* alternative_service);
+ bool ParseAlternativeServiceInfoExpiration(
+ const base::DictionaryValue& dict,
const std::string& server_str,
AlternativeServiceInfo* alternative_service_info);
bool AddToAlternativeServiceMap(
@@ -271,7 +295,10 @@ class NET_EXPORT HttpServerPropertiesManager : public HttpServerProperties {
ServerNetworkStatsMap* network_stats_map);
bool AddToQuicServerInfoMap(const base::DictionaryValue& server_dict,
QuicServerInfoMap* quic_server_info_map);
-
+ bool AddToBrokenAlternativeServices(
+ const base::DictionaryValue& broken_alt_svc_entry_dict,
+ BrokenAlternativeServiceList* broken_alternative_service_list,
+ RecentlyBrokenAlternativeServices* recently_broken_alternative_services);
void SaveAlternativeServiceToServerPrefs(
const AlternativeServiceInfoVector& alternative_service_info_vector,
base::DictionaryValue* server_pref_dict);
@@ -284,8 +311,16 @@ class NET_EXPORT HttpServerPropertiesManager : public HttpServerProperties {
void SaveQuicServerInfoMapToServerPrefs(
const QuicServerInfoMap& quic_server_info_map,
base::DictionaryValue* http_server_properties_dict);
+ void SaveBrokenAlternativeServicesToPrefs(
+ const BrokenAlternativeServiceList* broken_alternative_service_list,
+ const RecentlyBrokenAlternativeServices*
+ recently_broken_alternative_services,
+ base::DictionaryValue* http_server_properties_dict);
+
void SetInitialized();
+ base::DefaultTickClock default_clock_;
+
// -----------
// Pref thread
// -----------
@@ -300,6 +335,8 @@ class NET_EXPORT HttpServerPropertiesManager : public HttpServerProperties {
std::unique_ptr<PrefDelegate> pref_delegate_;
bool setting_prefs_;
+ base::TickClock* clock_; // Unowned
+
// --------------
// Network thread
// --------------
« no previous file with comments | « net/http/http_server_properties_impl.cc ('k') | net/http/http_server_properties_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698