Index: net/http/broken_alternative_services.h |
diff --git a/net/http/broken_alternative_services.h b/net/http/broken_alternative_services.h |
index 6a51222ee3fba09bd3b6bdfa3a889f79251d2b62..7f50e9cd3e865850c6875d900576625f0f3eb01e 100644 |
--- a/net/http/broken_alternative_services.h |
+++ b/net/http/broken_alternative_services.h |
@@ -24,6 +24,14 @@ struct AlternativeServiceHash { |
} |
}; |
+typedef std::list<std::pair<AlternativeService, base::TimeTicks>> |
+ BrokenAlternativeServiceList; |
+ |
+typedef std::unordered_map<AlternativeService, |
+ BrokenAlternativeServiceList::iterator, |
+ AlternativeServiceHash> |
+ BrokenAlternativeServiceMap; |
Zhongyi Shi
2017/06/02 18:19:44
Hrm, if I remembered this correctly, the BrokenAlt
wangyix1
2017/06/05 19:16:25
Done.
I don't see it defined in http_server_prope
Zhongyi Shi
2017/06/06 22:17:49
Ah.. I was referring to your previous CL which def
wangyix1
2017/06/09 19:26:41
Hmm, I figured I would keep AlternativeServiceHash
|
+ |
// This class tracks HTTP alternative services that have been marked as broken. |
// The brokenness of an alt-svc will expire after some time according to an |
// exponential back-off formula: each time an alt-svc is marked broken, the |
@@ -85,29 +93,27 @@ class NET_EXPORT_PRIVATE BrokenAlternativeServices { |
// Marks |alternative_service| as not broken and not recently broken. |
void ConfirmAlternativeService(const AlternativeService& alternative_service); |
+ // Adds broken and recently broken alternative services. |
+ // |broken_alternative_service_list| must be sorted from earliest to latest |
+ // expiration time. |
+ // All AlternativeServices in |broken_alternative_service_list| must exist in |
+ // |recently_broken_alternative_services|. |
+ void AddBrokenAndRecentlyBrokenAlternativeServices( |
Zhongyi Shi
2017/06/02 18:19:44
The return type of this method should be a boolean
wangyix1
2017/06/05 19:16:25
Hmm I didn't think of that. I'm assuming it should
Zhongyi Shi
2017/06/06 22:17:49
If you go a step further, the return type will be
wangyix1
2017/06/09 19:26:41
Acknowledged.
wangyix1
2017/06/10 01:07:17
The current code will only schedule an update to d
wangyix1
2017/06/12 22:28:45
Discussed in person. Will rename this function to
|
+ 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; |
+ |
private: |
// TODO (wangyix): modify HttpServerPropertiesImpl unit tests so this |
// friendness is no longer required. |
friend class HttpServerPropertiesImplPeer; |
- // A pair containing a broken AlternativeService and the expiration time of |
- // its brokenness. |
- struct BrokenAltSvcExpireInfo { |
- BrokenAltSvcExpireInfo(const AlternativeService& alt_svc, |
- base::TimeTicks expire) |
- : alternative_service(alt_svc), expiration(expire) {} |
- |
- AlternativeService alternative_service; |
- base::TimeTicks expiration; |
- }; |
- |
- typedef std::list<BrokenAltSvcExpireInfo> BrokenAlternativeServiceList; |
- |
- typedef std::unordered_map<AlternativeService, |
- BrokenAlternativeServiceList::iterator, |
- AlternativeServiceHash> |
- BrokenAlternativeServiceMap; |
- |
// Inserts |alternative_service| and its |expiration| time into |
// |broken_alternative_service_list_| and |broken_alternative_service_map_|. |
// |it| is the position in |broken_alternative_service_list_| where it was |