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

Unified Diff: net/http/http_server_properties.h

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_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 fc19d24e18b103a384f34507ddf30a277dd5582c..27d8b078c8aa2c9ac210329f114af43c467c58f7 100644
--- a/net/http/http_server_properties.h
+++ b/net/http/http_server_properties.h
@@ -114,28 +114,26 @@ NET_EXPORT_PRIVATE std::ostream& operator<<(
std::ostream& os,
const AlternativeService& alternative_service);
-struct NET_EXPORT AlternativeServiceInfo {
- AlternativeServiceInfo() : alternative_service() {}
+class NET_EXPORT_PRIVATE AlternativeServiceInfo {
+ public:
+ AlternativeServiceInfo();
AlternativeServiceInfo(const AlternativeService& alternative_service,
- base::Time expiration)
- : alternative_service(alternative_service),
- expiration(expiration) {}
+ base::Time expiration);
AlternativeServiceInfo(NextProto protocol,
const std::string& host,
uint16_t port,
- base::Time expiration)
- : alternative_service(protocol, host, port), expiration(expiration) {}
+ base::Time expiration);
AlternativeServiceInfo(
- const AlternativeServiceInfo& alternative_service_info) = default;
+ const AlternativeServiceInfo& alternative_service_info);
AlternativeServiceInfo& operator=(
- const AlternativeServiceInfo& alternative_service_info) = default;
+ const AlternativeServiceInfo& alternative_service_info);
bool operator==(const AlternativeServiceInfo& other) const {
- return alternative_service == other.alternative_service &&
- expiration == other.expiration;
+ return alternative_service_ == other.alternative_service() &&
+ expiration_ == other.expiration();
}
bool operator!=(const AlternativeServiceInfo& other) const {
@@ -144,8 +142,31 @@ struct NET_EXPORT AlternativeServiceInfo {
std::string ToString() const;
- AlternativeService alternative_service;
- base::Time expiration;
+ void set_alternative_service(const AlternativeService& alternative_service) {
+ alternative_service_ = alternative_service;
+ }
+
+ void set_protocol(const NextProto& protocol) {
+ alternative_service_.protocol = protocol;
+ }
+
+ void set_host(const std::string& host) { alternative_service_.host = host; }
+
+ void set_port(uint16_t port) { alternative_service_.port = port; }
+
+ void set_expiration(const base::Time& expiration) {
+ expiration_ = expiration;
+ }
+
+ const AlternativeService& alternative_service() const {
+ return alternative_service_;
+ }
+
+ base::Time expiration() const { return expiration_; }
+
+ private:
+ AlternativeService alternative_service_;
+ base::Time expiration_;
};
struct NET_EXPORT SupportsQuic {
« 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