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

Unified Diff: net/http/http_server_properties.h

Issue 339663010: Add a probability to Alternate-Protocol support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: eliminate static initializer Created 6 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_network_transaction_unittest.cc ('k') | net/http/http_server_properties.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..718f4c5a4e54dee5b455cd55cd71432423a33350 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)
+ : 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;
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/http_server_properties.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698