| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 probability == other.probability; | 106 probability == other.probability; |
| 107 } | 107 } |
| 108 | 108 |
| 109 std::string ToString() const; | 109 std::string ToString() const; |
| 110 | 110 |
| 111 uint16 port; | 111 uint16 port; |
| 112 AlternateProtocol protocol; | 112 AlternateProtocol protocol; |
| 113 double probability; | 113 double probability; |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 struct NET_EXPORT SupportsQuic { |
| 117 SupportsQuic() : used_quic(false) {} |
| 118 SupportsQuic(bool used_quic, const std::string& address) |
| 119 : used_quic(used_quic), |
| 120 address(address) {} |
| 121 |
| 122 bool Equals(const SupportsQuic& other) const { |
| 123 return used_quic == other.used_quic && address == other.address; |
| 124 } |
| 125 |
| 126 bool used_quic; |
| 127 std::string address; |
| 128 }; |
| 129 |
| 116 typedef base::MRUCache< | 130 typedef base::MRUCache< |
| 117 HostPortPair, AlternateProtocolInfo> AlternateProtocolMap; | 131 HostPortPair, AlternateProtocolInfo> AlternateProtocolMap; |
| 118 typedef base::MRUCache<HostPortPair, SettingsMap> SpdySettingsMap; | 132 typedef base::MRUCache<HostPortPair, SettingsMap> SpdySettingsMap; |
| 133 typedef std::map<HostPortPair, SupportsQuic> SupportsQuicMap; |
| 119 | 134 |
| 120 extern const char kAlternateProtocolHeader[]; | 135 extern const char kAlternateProtocolHeader[]; |
| 121 | 136 |
| 122 // The interface for setting/retrieving the HTTP server properties. | 137 // The interface for setting/retrieving the HTTP server properties. |
| 123 // Currently, this class manages servers': | 138 // Currently, this class manages servers': |
| 124 // * SPDY support (based on NPN results) | 139 // * SPDY support (based on NPN results) |
| 125 // * Alternate-Protocol support | 140 // * Alternate-Protocol support |
| 126 // * Spdy Settings (like CWND ID field) | 141 // * Spdy Settings (like CWND ID field) |
| 127 class NET_EXPORT HttpServerProperties { | 142 class NET_EXPORT HttpServerProperties { |
| 128 public: | 143 public: |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 221 |
| 207 // Clears all SPDY settings for a host. | 222 // Clears all SPDY settings for a host. |
| 208 virtual void ClearSpdySettings(const HostPortPair& host_port_pair) = 0; | 223 virtual void ClearSpdySettings(const HostPortPair& host_port_pair) = 0; |
| 209 | 224 |
| 210 // Clears all SPDY settings for all hosts. | 225 // Clears all SPDY settings for all hosts. |
| 211 virtual void ClearAllSpdySettings() = 0; | 226 virtual void ClearAllSpdySettings() = 0; |
| 212 | 227 |
| 213 // Returns all persistent SPDY settings. | 228 // Returns all persistent SPDY settings. |
| 214 virtual const SpdySettingsMap& spdy_settings_map() const = 0; | 229 virtual const SpdySettingsMap& spdy_settings_map() const = 0; |
| 215 | 230 |
| 231 // TODO(rtenneti): Make SupportsQuic a global (instead of per host_port_pair). |
| 232 virtual SupportsQuic GetSupportsQuic( |
| 233 const HostPortPair& host_port_pair) const = 0; |
| 234 |
| 235 virtual void SetSupportsQuic(const HostPortPair& host_port_pair, |
| 236 bool used_quic, |
| 237 const std::string& address) = 0; |
| 238 |
| 239 virtual const SupportsQuicMap& supports_quic_map() const = 0; |
| 240 |
| 216 virtual void SetServerNetworkStats(const HostPortPair& host_port_pair, | 241 virtual void SetServerNetworkStats(const HostPortPair& host_port_pair, |
| 217 NetworkStats stats) = 0; | 242 NetworkStats stats) = 0; |
| 218 | 243 |
| 219 virtual const NetworkStats* GetServerNetworkStats( | 244 virtual const NetworkStats* GetServerNetworkStats( |
| 220 const HostPortPair& host_port_pair) const = 0; | 245 const HostPortPair& host_port_pair) const = 0; |
| 221 | 246 |
| 222 private: | 247 private: |
| 223 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); | 248 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); |
| 224 }; | 249 }; |
| 225 | 250 |
| 226 } // namespace net | 251 } // namespace net |
| 227 | 252 |
| 228 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ | 253 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
| OLD | NEW |