| 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" |
| 11 #include "base/containers/mru_cache.h" | 11 #include "base/containers/mru_cache.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "net/base/host_port_pair.h" | 14 #include "net/base/host_port_pair.h" |
| 15 #include "net/base/net_export.h" | 15 #include "net/base/net_export.h" |
| 16 #include "net/base/net_util.h" |
| 16 #include "net/quic/quic_bandwidth.h" | 17 #include "net/quic/quic_bandwidth.h" |
| 17 #include "net/socket/next_proto.h" | 18 #include "net/socket/next_proto.h" |
| 18 #include "net/spdy/spdy_framer.h" // TODO(willchan): Reconsider this. | 19 #include "net/spdy/spdy_framer.h" // TODO(willchan): Reconsider this. |
| 19 #include "net/spdy/spdy_protocol.h" | 20 #include "net/spdy/spdy_protocol.h" |
| 20 | 21 |
| 21 namespace net { | 22 namespace net { |
| 22 | 23 |
| 23 struct SSLConfig; | 24 struct SSLConfig; |
| 24 | 25 |
| 25 enum AlternateProtocolUsage { | 26 enum AlternateProtocolUsage { |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 struct NET_EXPORT ServerNetworkStats { | 135 struct NET_EXPORT ServerNetworkStats { |
| 135 ServerNetworkStats() : bandwidth_estimate(QuicBandwidth::Zero()) {} | 136 ServerNetworkStats() : bandwidth_estimate(QuicBandwidth::Zero()) {} |
| 136 | 137 |
| 137 base::TimeDelta srtt; | 138 base::TimeDelta srtt; |
| 138 QuicBandwidth bandwidth_estimate; | 139 QuicBandwidth bandwidth_estimate; |
| 139 }; | 140 }; |
| 140 | 141 |
| 141 typedef base::MRUCache< | 142 typedef base::MRUCache< |
| 142 HostPortPair, AlternateProtocolInfo> AlternateProtocolMap; | 143 HostPortPair, AlternateProtocolInfo> AlternateProtocolMap; |
| 143 typedef base::MRUCache<HostPortPair, SettingsMap> SpdySettingsMap; | 144 typedef base::MRUCache<HostPortPair, SettingsMap> SpdySettingsMap; |
| 144 typedef std::map<HostPortPair, SupportsQuic> SupportsQuicMap; | |
| 145 typedef base::MRUCache<HostPortPair, ServerNetworkStats> ServerNetworkStatsMap; | 145 typedef base::MRUCache<HostPortPair, ServerNetworkStats> ServerNetworkStatsMap; |
| 146 | 146 |
| 147 extern const char kAlternateProtocolHeader[]; | 147 extern const char kAlternateProtocolHeader[]; |
| 148 | 148 |
| 149 // The interface for setting/retrieving the HTTP server properties. | 149 // The interface for setting/retrieving the HTTP server properties. |
| 150 // Currently, this class manages servers': | 150 // Currently, this class manages servers': |
| 151 // * SPDY support (based on NPN results) | 151 // * SPDY support (based on NPN results) |
| 152 // * Alternate-Protocol support | 152 // * Alternate-Protocol support |
| 153 // * Spdy Settings (like CWND ID field) | 153 // * Spdy Settings (like CWND ID field) |
| 154 class NET_EXPORT HttpServerProperties { | 154 class NET_EXPORT HttpServerProperties { |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 | 236 |
| 237 // Clears all SPDY settings for a host. | 237 // Clears all SPDY settings for a host. |
| 238 virtual void ClearSpdySettings(const HostPortPair& host_port_pair) = 0; | 238 virtual void ClearSpdySettings(const HostPortPair& host_port_pair) = 0; |
| 239 | 239 |
| 240 // Clears all SPDY settings for all hosts. | 240 // Clears all SPDY settings for all hosts. |
| 241 virtual void ClearAllSpdySettings() = 0; | 241 virtual void ClearAllSpdySettings() = 0; |
| 242 | 242 |
| 243 // Returns all persistent SPDY settings. | 243 // Returns all persistent SPDY settings. |
| 244 virtual const SpdySettingsMap& spdy_settings_map() const = 0; | 244 virtual const SpdySettingsMap& spdy_settings_map() const = 0; |
| 245 | 245 |
| 246 // TODO(rtenneti): Make SupportsQuic a global (instead of per host_port_pair). | 246 virtual bool GetSupportsQuic(IPAddressNumber* last_address) const = 0; |
| 247 virtual SupportsQuic GetSupportsQuic( | |
| 248 const HostPortPair& host_port_pair) const = 0; | |
| 249 | 247 |
| 250 virtual void SetSupportsQuic(const HostPortPair& host_port_pair, | 248 virtual void SetSupportsQuic(bool used_quic, |
| 251 bool used_quic, | 249 const IPAddressNumber& last_address) = 0; |
| 252 const std::string& address) = 0; | |
| 253 | |
| 254 virtual const SupportsQuicMap& supports_quic_map() const = 0; | |
| 255 | 250 |
| 256 virtual void SetServerNetworkStats(const HostPortPair& host_port_pair, | 251 virtual void SetServerNetworkStats(const HostPortPair& host_port_pair, |
| 257 ServerNetworkStats stats) = 0; | 252 ServerNetworkStats stats) = 0; |
| 258 | 253 |
| 259 virtual const ServerNetworkStats* GetServerNetworkStats( | 254 virtual const ServerNetworkStats* GetServerNetworkStats( |
| 260 const HostPortPair& host_port_pair) = 0; | 255 const HostPortPair& host_port_pair) = 0; |
| 261 | 256 |
| 262 virtual const ServerNetworkStatsMap& server_network_stats_map() const = 0; | 257 virtual const ServerNetworkStatsMap& server_network_stats_map() const = 0; |
| 263 | 258 |
| 264 private: | 259 private: |
| 265 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); | 260 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); |
| 266 }; | 261 }; |
| 267 | 262 |
| 268 } // namespace net | 263 } // namespace net |
| 269 | 264 |
| 270 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ | 265 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
| OLD | NEW |