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

Unified Diff: net/http/http_server_properties.cc

Issue 2932503005: Change AlternativeServiceInfo to a class (Closed)
Patch Set: 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.cc » ('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 386a00d0fe3e53c356865c2ce47088f3e245e1b0..15947b2a49e9dbb1bcbe1195953aa4d8587c37ea 100644
--- a/net/http/http_server_properties.cc
+++ b/net/http/http_server_properties.cc
@@ -78,6 +78,25 @@ bool IsAlternateProtocolValid(NextProto protocol) {
return false;
}
+AlternativeServiceInfo::AlternativeServiceInfo() : alternative_service_() {}
+
+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) {}
+
+AlternativeServiceInfo::AlternativeServiceInfo(
+ const AlternativeServiceInfo& alternative_service_info) = default;
+
+AlternativeServiceInfo& AlternativeServiceInfo::operator=(
+ const AlternativeServiceInfo& alternative_service_info) = default;
+
std::string AlternativeService::ToString() const {
return base::StringPrintf("%s %s:%d", NextProtoToString(protocol),
host.c_str(), port);
@@ -85,10 +104,10 @@ std::string AlternativeService::ToString() const {
std::string AlternativeServiceInfo::ToString() const {
base::Time::Exploded exploded;
- expiration.LocalExplode(&exploded);
+ expiration_.LocalExplode(&exploded);
return base::StringPrintf(
"%s, expires %04d-%02d-%02d %02d:%02d:%02d",
- alternative_service.ToString().c_str(), exploded.year, exploded.month,
+ alternative_service_.ToString().c_str(), exploded.year, exploded.month,
exploded.day_of_month, exploded.hour, exploded.minute, exploded.second);
}
« no previous file with comments | « net/http/http_server_properties.h ('k') | net/http/http_server_properties_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698