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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 return used_quic == other.used_quic && address == other.address; | 180 return used_quic == other.used_quic && address == other.address; |
181 } | 181 } |
182 | 182 |
183 bool used_quic; | 183 bool used_quic; |
184 std::string address; | 184 std::string address; |
185 }; | 185 }; |
186 | 186 |
187 struct NET_EXPORT ServerNetworkStats { | 187 struct NET_EXPORT ServerNetworkStats { |
188 ServerNetworkStats() : bandwidth_estimate(QuicBandwidth::Zero()) {} | 188 ServerNetworkStats() : bandwidth_estimate(QuicBandwidth::Zero()) {} |
189 | 189 |
| 190 bool operator==(const ServerNetworkStats& other) const { |
| 191 return srtt == other.srtt && bandwidth_estimate == other.bandwidth_estimate; |
| 192 } |
| 193 |
| 194 bool operator!=(const ServerNetworkStats& other) const { |
| 195 return !this->operator==(other); |
| 196 } |
| 197 |
190 base::TimeDelta srtt; | 198 base::TimeDelta srtt; |
191 QuicBandwidth bandwidth_estimate; | 199 QuicBandwidth bandwidth_estimate; |
192 }; | 200 }; |
193 | 201 |
194 typedef base::MRUCache<HostPortPair, AlternativeServiceInfo> | 202 typedef base::MRUCache<HostPortPair, AlternativeServiceInfo> |
195 AlternativeServiceMap; | 203 AlternativeServiceMap; |
196 typedef base::MRUCache<HostPortPair, SettingsMap> SpdySettingsMap; | 204 typedef base::MRUCache<HostPortPair, SettingsMap> SpdySettingsMap; |
197 typedef base::MRUCache<HostPortPair, ServerNetworkStats> ServerNetworkStatsMap; | 205 typedef base::MRUCache<HostPortPair, ServerNetworkStats> ServerNetworkStatsMap; |
198 | 206 |
199 extern const char kAlternateProtocolHeader[]; | 207 extern const char kAlternateProtocolHeader[]; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 virtual void ClearAllSpdySettings() = 0; | 314 virtual void ClearAllSpdySettings() = 0; |
307 | 315 |
308 // Returns all persistent SPDY settings. | 316 // Returns all persistent SPDY settings. |
309 virtual const SpdySettingsMap& spdy_settings_map() const = 0; | 317 virtual const SpdySettingsMap& spdy_settings_map() const = 0; |
310 | 318 |
311 virtual bool GetSupportsQuic(IPAddressNumber* last_address) const = 0; | 319 virtual bool GetSupportsQuic(IPAddressNumber* last_address) const = 0; |
312 | 320 |
313 virtual void SetSupportsQuic(bool used_quic, | 321 virtual void SetSupportsQuic(bool used_quic, |
314 const IPAddressNumber& last_address) = 0; | 322 const IPAddressNumber& last_address) = 0; |
315 | 323 |
| 324 // Sets |stats| for |host_port_pair|. |
316 virtual void SetServerNetworkStats(const HostPortPair& host_port_pair, | 325 virtual void SetServerNetworkStats(const HostPortPair& host_port_pair, |
317 ServerNetworkStats stats) = 0; | 326 ServerNetworkStats stats) = 0; |
318 | 327 |
319 virtual const ServerNetworkStats* GetServerNetworkStats( | 328 virtual const ServerNetworkStats* GetServerNetworkStats( |
320 const HostPortPair& host_port_pair) = 0; | 329 const HostPortPair& host_port_pair) = 0; |
321 | 330 |
322 virtual const ServerNetworkStatsMap& server_network_stats_map() const = 0; | 331 virtual const ServerNetworkStatsMap& server_network_stats_map() const = 0; |
323 | 332 |
324 private: | 333 private: |
325 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); | 334 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); |
326 }; | 335 }; |
327 | 336 |
328 } // namespace net | 337 } // namespace net |
329 | 338 |
330 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ | 339 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
OLD | NEW |