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

Unified Diff: net/http/http_server_properties.h

Issue 1216703002: Implement multiple alternative services per origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
Index: net/http/http_server_properties.h
diff --git a/net/http/http_server_properties.h b/net/http/http_server_properties.h
index 4192361187cdbb0684d3ceeb56193d4bcb937764..79957b34b577dba106e7ec2fdbb6c4d8dc116fcf 100644
--- a/net/http/http_server_properties.h
+++ b/net/http/http_server_properties.h
@@ -7,6 +7,8 @@
#include <map>
#include <string>
+#include <vector>
+
#include "base/basictypes.h"
#include "base/containers/mru_cache.h"
#include "base/memory/weak_ptr.h"
@@ -199,7 +201,9 @@ struct NET_EXPORT ServerNetworkStats {
QuicBandwidth bandwidth_estimate;
};
-typedef base::MRUCache<HostPortPair, AlternativeServiceInfo>
+typedef std::vector<AlternativeService> AlternativeServiceVector;
+typedef std::vector<AlternativeServiceInfo> AlternativeServiceInfoVector;
+typedef base::MRUCache<HostPortPair, AlternativeServiceInfoVector>
AlternativeServiceMap;
typedef base::MRUCache<HostPortPair, SettingsMap> SpdySettingsMap;
typedef base::MRUCache<HostPortPair, ServerNetworkStats> ServerNetworkStatsMap;
@@ -247,45 +251,53 @@ class NET_EXPORT HttpServerProperties {
virtual void MaybeForceHTTP11(const HostPortPair& server,
SSLConfig* ssl_config) = 0;
- // Returns the alternative service for |origin| if it has probability equal to
- // or exceeding threshold, or else the forced AlternateProtocol if there is
- // one, or else one with UNINITIALIZED_ALTERNATE_PROTOCOL.
- virtual AlternativeService GetAlternativeService(
+ // 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;
- // Sets the alternative service for |origin|.
- virtual void SetAlternativeService(
+ // Add an alternative service for |origin|.
+ // |alternative_service.host| may be empty.
+ virtual void AddAlternativeService(
const HostPortPair& origin,
const AlternativeService& alternative_service,
double alternative_probability) = 0;
// Marks |alternative_service| as broken.
+ // |alternative_service.host| must not be empty.
virtual void MarkAlternativeServiceBroken(
const AlternativeService& alternative_service) = 0;
// Marks |alternative_service| as recently broken.
+ // |alternative_service.host| must not be empty.
virtual void MarkAlternativeServiceRecentlyBroken(
const AlternativeService& alternative_service) = 0;
// Returns true iff |alternative_service| is currently broken.
+ // |alternative_service.host| must not be empty.
virtual bool IsAlternativeServiceBroken(
const AlternativeService& alternative_service) const = 0;
// Returns true iff |alternative_service| was recently broken.
+ // |alternative_service.host| must not be empty.
virtual bool WasAlternativeServiceRecentlyBroken(
const AlternativeService& alternative_service) = 0;
// Confirms that |alternative_service| is working.
+ // |alternative_service.host| must not be empty.
virtual void ConfirmAlternativeService(
const AlternativeService& alternative_service) = 0;
- // Clears the alternative service for |origin|.
- virtual void ClearAlternativeService(const HostPortPair& origin) = 0;
+ // Clear all alternative services for |origin|.
+ virtual void ClearAlternativeServices(const HostPortPair& origin) = 0;
// Returns all alternative service mappings.
+ // Returned alternative services may have empty hostnames.
virtual const AlternativeServiceMap& alternative_service_map() const = 0;
// Returns all alternative service mappings as human readable strings.
+ // 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

Powered by Google App Engine
This is Rietveld 408576698