| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_HTTP_HTTP_SERVER_PROPERTIES_H_ | 5 #ifndef NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
| 6 #define NET_HTTP_HTTP_SERVER_PROPERTIES_H_ | 6 #define NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 ALTERNATE_PROTOCOL_MAXIMUM_VALID_VERSION - | 79 ALTERNATE_PROTOCOL_MAXIMUM_VALID_VERSION - |
| 80 ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION + 1, | 80 ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION + 1, |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 NET_EXPORT const char* AlternateProtocolToString(AlternateProtocol protocol); | 83 NET_EXPORT const char* AlternateProtocolToString(AlternateProtocol protocol); |
| 84 NET_EXPORT AlternateProtocol AlternateProtocolFromString( | 84 NET_EXPORT AlternateProtocol AlternateProtocolFromString( |
| 85 const std::string& str); | 85 const std::string& str); |
| 86 NET_EXPORT_PRIVATE AlternateProtocol AlternateProtocolFromNextProto( | 86 NET_EXPORT_PRIVATE AlternateProtocol AlternateProtocolFromNextProto( |
| 87 NextProto next_proto); | 87 NextProto next_proto); |
| 88 | 88 |
| 89 struct NET_EXPORT AlternativeService { |
| 90 AlternativeService() |
| 91 : protocol(UNINITIALIZED_ALTERNATE_PROTOCOL), host(), port(0) {} |
| 92 |
| 93 AlternativeService(AlternateProtocol protocol, |
| 94 const std::string& host, |
| 95 uint16 port) |
| 96 : protocol(protocol), host(host), port(port) {} |
| 97 |
| 98 AlternativeService(const AlternativeService& alternative_service) = default; |
| 99 AlternativeService& operator=(const AlternativeService& alternative_service) = |
| 100 default; |
| 101 |
| 102 bool operator<(const AlternativeService& other) const { |
| 103 if (protocol != other.protocol) |
| 104 return protocol < other.protocol; |
| 105 if (host != other.host) |
| 106 return host < other.host; |
| 107 return port < other.port; |
| 108 } |
| 109 |
| 110 AlternateProtocol protocol; |
| 111 std::string host; |
| 112 uint16 port; |
| 113 }; |
| 114 |
| 89 struct NET_EXPORT AlternateProtocolInfo { | 115 struct NET_EXPORT AlternateProtocolInfo { |
| 90 AlternateProtocolInfo() | 116 AlternateProtocolInfo() |
| 91 : port(0), | 117 : port(0), |
| 92 protocol(UNINITIALIZED_ALTERNATE_PROTOCOL), | 118 protocol(UNINITIALIZED_ALTERNATE_PROTOCOL), |
| 93 probability(0), | 119 probability(0), |
| 94 is_broken(false) {} | 120 is_broken(false) {} |
| 95 | 121 |
| 96 AlternateProtocolInfo(uint16 port, | 122 AlternateProtocolInfo(uint16 port, |
| 97 AlternateProtocol protocol, | 123 AlternateProtocol protocol, |
| 98 double probability) | 124 double probability) |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 286 |
| 261 virtual const ServerNetworkStatsMap& server_network_stats_map() const = 0; | 287 virtual const ServerNetworkStatsMap& server_network_stats_map() const = 0; |
| 262 | 288 |
| 263 private: | 289 private: |
| 264 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); | 290 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); |
| 265 }; | 291 }; |
| 266 | 292 |
| 267 } // namespace net | 293 } // namespace net |
| 268 | 294 |
| 269 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ | 295 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
| OLD | NEW |