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

Unified Diff: net/http/http_server_properties.cc

Issue 2901093004: Add and persist a new field in AlternativeServiceInfo to list QUIC verisons advertised (Closed)
Patch Set: fix Canonical test Created 3 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
« no previous file with comments | « net/http/http_server_properties.h ('k') | net/http/http_server_properties_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_server_properties.cc
diff --git a/net/http/http_server_properties.cc b/net/http/http_server_properties.cc
index 15947b2a49e9dbb1bcbe1195953aa4d8587c37ea..a1289cae280ae14875a98cada08e1f21dec78642 100644
--- a/net/http/http_server_properties.cc
+++ b/net/http/http_server_properties.cc
@@ -7,6 +7,7 @@
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/stringprintf.h"
+#include "net/http/http_network_session.h"
#include "net/socket/ssl_client_socket.h"
#include "net/ssl/ssl_config.h"
@@ -78,18 +79,40 @@ bool IsAlternateProtocolValid(NextProto protocol) {
return false;
}
+// static
+AlternativeServiceInfo
+AlternativeServiceInfo::CreateHttp2AlternativeServiceInfo(
+ const AlternativeService& alternative_service,
+ base::Time expiration) {
+ DCHECK_EQ(alternative_service.protocol, kProtoHTTP2);
+ return AlternativeServiceInfo(alternative_service, expiration,
+ QuicVersionVector());
+}
+
+// static
+AlternativeServiceInfo AlternativeServiceInfo::CreateQuicAlternativeServiceInfo(
+ const AlternativeService& alternative_service,
+ base::Time expiration,
+ const QuicVersionVector& advertised_versions) {
+ DCHECK_EQ(alternative_service.protocol, kProtoQUIC);
+ return AlternativeServiceInfo(alternative_service, expiration,
+ advertised_versions);
+}
+
AlternativeServiceInfo::AlternativeServiceInfo() : alternative_service_() {}
+AlternativeServiceInfo::~AlternativeServiceInfo() {}
+
AlternativeServiceInfo::AlternativeServiceInfo(
const AlternativeService& alternative_service,
- base::Time expiration)
- : alternative_service_(alternative_service), expiration_(expiration) {}
-
-AlternativeServiceInfo::AlternativeServiceInfo(NextProto protocol,
- const std::string& host,
- uint16_t port,
- base::Time expiration)
- : alternative_service_(protocol, host, port), expiration_(expiration) {}
+ base::Time expiration,
+ const QuicVersionVector& advertised_versions)
+ : alternative_service_(alternative_service), expiration_(expiration) {
+ if (alternative_service_.protocol == kProtoQUIC) {
+ advertised_versions_ = advertised_versions;
+ std::sort(advertised_versions_.begin(), advertised_versions_.end());
+ }
+}
AlternativeServiceInfo::AlternativeServiceInfo(
const AlternativeServiceInfo& alternative_service_info) = default;
« no previous file with comments | « net/http/http_server_properties.h ('k') | net/http/http_server_properties_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698