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

Unified Diff: net/http/http_server_properties_impl.h

Issue 888943003: Add AlternateProtocol to broken_altproto_list_ and map_. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 10 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 | « no previous file | net/http/http_server_properties_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9c2a73c3974a137b78bc33eeffaf1ee1310d0734..cffdf7998cfa871edc0bb59b91629369e13001cb 100644
--- a/net/http/http_server_properties_impl.h
+++ b/net/http/http_server_properties_impl.h
@@ -5,6 +5,7 @@
#ifndef NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_
#define NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_
+#include <deque>
#include <map>
#include <set>
#include <string>
@@ -119,16 +120,48 @@ class NET_EXPORT HttpServerPropertiesImpl
typedef std::map<HostPortPair, HostPortPair> CanonicalHostMap;
typedef std::vector<std::string> CanonicalSufficList;
typedef std::set<HostPortPair> Http11ServerHostPortSet;
- // List of broken host:ports and the times when they can be expired.
+
+ // Server, port, and AlternateProtocol: an entity that can be broken. (Once
+ // we use AlternativeService, the same AltSvc can be broken for one server but
+ // not for another depending on what certificate it can offer.)
struct BrokenAlternateProtocolEntry {
+ BrokenAlternateProtocolEntry(const BrokenAlternateProtocolEntry&) = default;
+ BrokenAlternateProtocolEntry(const HostPortPair& server,
+ uint16 port,
+ AlternateProtocol protocol)
+ : server(server), port(port), protocol(protocol) {}
+
+ bool operator<(const BrokenAlternateProtocolEntry& other) const {
+ if (!server.Equals(other.server))
+ return server < other.server;
+ if (port != other.port)
+ return port < other.port;
+ return protocol < other.protocol;
+ }
+
HostPortPair server;
+ uint16 port;
+ AlternateProtocol protocol;
+ };
+ // BrokenAlternateProtocolEntry with expiration time.
+ struct BrokenAlternateProtocolEntryWithTime {
+ BrokenAlternateProtocolEntryWithTime(
+ const BrokenAlternateProtocolEntry& broken_alternate_protocol_entry,
+ base::TimeTicks when)
+ : broken_alternate_protocol_entry(broken_alternate_protocol_entry),
+ when(when) {}
+
+ BrokenAlternateProtocolEntry broken_alternate_protocol_entry;
base::TimeTicks when;
};
- typedef std::list<BrokenAlternateProtocolEntry>
+ // Deque of BrokenAlternateProtocolEntryWithTime items, ordered by expiration
+ // time.
+ typedef std::deque<BrokenAlternateProtocolEntryWithTime>
BrokenAlternateProtocolList;
- // Map from host:port to the number of times alternate protocol has
- // been marked broken.
- typedef std::map<HostPortPair, int> BrokenAlternateProtocolMap;
+ // Map from (server, alternate protocol and port) to the number of
+ // times that alternate protocol has been marked broken for that server.
+ typedef std::map<BrokenAlternateProtocolEntry, int>
+ BrokenAlternateProtocolMap;
// Return the iterator for |server|, or for its canonical host, or end.
AlternateProtocolMap::const_iterator GetAlternateProtocolIterator(
« no previous file with comments | « no previous file | net/http/http_server_properties_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698