Chromium Code Reviews| Index: net/http/http_server_properties.h |
| diff --git a/net/http/http_server_properties.h b/net/http/http_server_properties.h |
| index 88d1f3cefba5978d3456823a69e81cc63ad44464..ebfcd0820798abba153162c931916f70e1ba9600 100644 |
| --- a/net/http/http_server_properties.h |
| +++ b/net/http/http_server_properties.h |
| @@ -92,19 +92,29 @@ NET_EXPORT AlternateProtocol AlternateProtocolFromString( |
| NET_EXPORT_PRIVATE AlternateProtocol AlternateProtocolFromNextProto( |
| NextProto next_proto); |
| -struct NET_EXPORT PortAlternateProtocolPair { |
| - bool Equals(const PortAlternateProtocolPair& other) const { |
| - return port == other.port && protocol == other.protocol; |
| +struct NET_EXPORT AlternateProtocolInfo { |
| + AlternateProtocolInfo(uint16 port, |
| + AlternateProtocol protocol, |
| + double probability) |
|
ramant (doing other things)
2014/06/27 22:38:13
nit: lines 97-98 indentation could be wrong.
Ryan Hamilton
2014/06/30 19:02:34
Doh! Sorry for not catching this.
|
| + : port(port), |
| + protocol(protocol), |
| + probability(probability) {} |
| + |
| + bool Equals(const AlternateProtocolInfo& other) const { |
| + return port == other.port && |
| + protocol == other.protocol && |
| + probability == other.probability; |
| } |
| std::string ToString() const; |
| uint16 port; |
| AlternateProtocol protocol; |
| + double probability; |
| }; |
| typedef base::MRUCache< |
| - HostPortPair, PortAlternateProtocolPair> AlternateProtocolMap; |
| + HostPortPair, AlternateProtocolInfo> AlternateProtocolMap; |
| typedef base::MRUCache<HostPortPair, SettingsMap> SpdySettingsMap; |
| extern const char kAlternateProtocolHeader[]; |
| @@ -143,13 +153,14 @@ class NET_EXPORT HttpServerProperties { |
| // Returns the Alternate-Protocol and port for |server|. |
| // HasAlternateProtocol(server) must be true. |
| - virtual PortAlternateProtocolPair GetAlternateProtocol( |
| + virtual AlternateProtocolInfo GetAlternateProtocol( |
| const HostPortPair& server) = 0; |
| // Sets the Alternate-Protocol for |server|. |
| virtual void SetAlternateProtocol(const HostPortPair& server, |
| uint16 alternate_port, |
| - AlternateProtocol alternate_protocol) = 0; |
| + AlternateProtocol alternate_protocol, |
| + double probability) = 0; |
| // Sets the Alternate-Protocol for |server| to be BROKEN. |
| virtual void SetBrokenAlternateProtocol(const HostPortPair& server) = 0; |
| @@ -170,6 +181,9 @@ class NET_EXPORT HttpServerProperties { |
| virtual void SetAlternateProtocolExperiment( |
| AlternateProtocolExperiment experiment) = 0; |
| + virtual void SetAlternateProtocolProbabilityThreshold( |
| + double threshold) = 0; |
| + |
| virtual AlternateProtocolExperiment GetAlternateProtocolExperiment() |
| const = 0; |