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 7a5441c57fbebffea2432701bead388ae51f67cb..c30eece85132daf19a20b461617308cf5515d02f 100644 |
--- a/net/http/http_server_properties_impl.h |
+++ b/net/http/http_server_properties_impl.h |
@@ -96,29 +96,43 @@ class NET_EXPORT HttpServerPropertiesImpl |
// Returns true if |server| has an Alternate-Protocol header. |
bool HasAlternateProtocol(const HostPortPair& server) override; |
- // Returns the Alternate-Protocol and port for |server|. |
+ // Returns the Alternate-Protocols for |server|. |
// HasAlternateProtocol(server) must be true. |
- AlternateProtocolInfo GetAlternateProtocol( |
+ const AlternateProtocols& GetAlternateProtocols( |
const HostPortPair& server) override; |
- // Sets the Alternate-Protocol for |server|. |
- void SetAlternateProtocol(const HostPortPair& server, |
+ // Adds an Alternate-Protocol for |server|. |
+ void AddAlternateProtocol(const HostPortPair& server, |
uint16 alternate_port, |
AlternateProtocol alternate_protocol, |
double probability) override; |
- // Sets the Alternate-Protocol for |server| to be BROKEN. |
- void SetBrokenAlternateProtocol(const HostPortPair& server) override; |
+ // Sets a given Alternate-Protocol for |server| to be BROKEN. |
+ void SetBrokenAlternateProtocol( |
+ const HostPortPair& server, |
+ const AlternateProtocolInfo& broken_alternate_protocol) override; |
- // Returns true if Alternate-Protocol for |server| was recently BROKEN. |
- bool WasAlternateProtocolRecentlyBroken(const HostPortPair& server) override; |
+ // Returns true if given Alternate-Protocol for |server| was recently BROKEN. |
+ bool WasAlternateProtocolRecentlyBroken( |
+ const HostPortPair& server, |
+ const AlternateProtocolInfo& alternate_protocol) override; |
- // Confirms that Alternate-Protocol for |server| is working. |
- void ConfirmAlternateProtocol(const HostPortPair& server) override; |
+ // Confirms that given Alternate-Protocol for |server| is working. |
+ void ConfirmAlternateProtocol( |
+ const HostPortPair& server, |
+ const AlternateProtocolInfo& alternate_protocol) override; |
- // Clears the Alternate-Protocol for |server|. |
+ // Clears all Alternate-Protocols for |server|. |
void ClearAlternateProtocol(const HostPortPair& server) override; |
+ // Clears all Alternate-Protocols that are not broken for |server|. |
+ void ClearNonBrokenAlternateProtocols(const HostPortPair& server) override; |
+ |
+ // Removes an Alternate-Protocol for |server|. |
+ void RemoveAlternateProtocol( |
+ const HostPortPair& server, |
+ const AlternateProtocolInfo& alternate_protocol) override; |
+ |
// Returns all Alternate-Protocol mappings. |
const AlternateProtocolMap& alternate_protocol_map() const override; |
@@ -173,14 +187,18 @@ class NET_EXPORT HttpServerPropertiesImpl |
typedef std::set<HostPortPair> Http11ServerHostPortSet; |
// List of broken host:ports and the times when they can be expired. |
struct BrokenAlternateProtocolEntry { |
- HostPortPair server; |
+ BrokenAlternateProtocolEntry(const AlternativeService& altsvc, |
+ base::TimeTicks when) |
+ : altsvc(altsvc), when(when) {} |
+ |
+ AlternativeService altsvc; |
base::TimeTicks when; |
}; |
typedef std::list<BrokenAlternateProtocolEntry> |
BrokenAlternateProtocolList; |
// Map from host:port to the number of times alternate protocol has |
// been marked broken. |
- typedef std::map<HostPortPair, int> BrokenAlternateProtocolMap; |
+ typedef std::map<AlternativeService, int> BrokenAlternateProtocolMap; |
// Return the iterator for |server|, or for its canonical host, or end. |
AlternateProtocolMap::const_iterator GetAlternateProtocolIterator( |