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

Unified Diff: net/http/http_server_properties.h

Issue 1802893002: Revert of Remove support for Alt-Svc/Alternate Protocol Probability (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 44224db76f6b980b1ce8acf6ae687fdddc40b763..4b1f92eada072c4d365d9bc6a36bd21b96c63521 100644
--- a/net/http/http_server_properties.h
+++ b/net/http/http_server_properties.h
@@ -138,18 +138,22 @@
};
struct NET_EXPORT AlternativeServiceInfo {
- AlternativeServiceInfo() : alternative_service() {}
+ AlternativeServiceInfo() : alternative_service(), probability(0.0) {}
AlternativeServiceInfo(const AlternativeService& alternative_service,
+ double probability,
base::Time expiration)
: alternative_service(alternative_service),
+ probability(probability),
expiration(expiration) {}
AlternativeServiceInfo(AlternateProtocol protocol,
const std::string& host,
uint16_t port,
+ double probability,
base::Time expiration)
: alternative_service(protocol, host, port),
+ probability(probability),
expiration(expiration) {}
AlternativeServiceInfo(
@@ -159,7 +163,7 @@
bool operator==(const AlternativeServiceInfo& other) const {
return alternative_service == other.alternative_service &&
- expiration == other.expiration;
+ probability == other.probability && expiration == other.expiration;
}
bool operator!=(const AlternativeServiceInfo& other) const {
@@ -169,6 +173,7 @@
std::string ToString() const;
AlternativeService alternative_service;
+ double probability;
base::Time expiration;
};
@@ -260,7 +265,8 @@
virtual void MaybeForceHTTP11(const HostPortPair& server,
SSLConfig* ssl_config) = 0;
- // Return all alternative services for |origin|, including broken ones.
+ // Return all alternative services for |origin| with probability greater than
+ // or equal to the threshold, including broken ones.
// Returned alternative services never have empty hostnames.
virtual AlternativeServiceVector GetAlternativeServices(
const HostPortPair& origin) = 0;
@@ -272,6 +278,7 @@
virtual bool SetAlternativeService(
const HostPortPair& origin,
const AlternativeService& alternative_service,
+ double alternative_probability,
base::Time expiration) = 0;
// Set alternative services for |origin|. Previous alternative services for
@@ -318,6 +325,13 @@
// Empty alternative service hostnames will be printed as such.
virtual scoped_ptr<base::Value> GetAlternativeServiceInfoAsValue() const = 0;
+ // Sets the threshold to be used when evaluating alternative service
+ // advertisments. Only advertisements with a probability greater than or equal
+ // to |threshold| will be honored. |threshold| must be between 0.0 and 1.0
+ // inclusive. Hence, a threshold of 0.0 implies that all advertisements will
+ // be honored.
+ virtual void SetAlternativeServiceProbabilityThreshold(double threshold) = 0;
+
// Gets a reference to the SettingsMap stored for a host.
// If no settings are stored, returns an empty SettingsMap.
virtual const SettingsMap& GetSpdySettings(
« 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