| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 200 |
| 201 base::TimeDelta srtt; | 201 base::TimeDelta srtt; |
| 202 QuicBandwidth bandwidth_estimate; | 202 QuicBandwidth bandwidth_estimate; |
| 203 }; | 203 }; |
| 204 | 204 |
| 205 typedef std::vector<AlternativeService> AlternativeServiceVector; | 205 typedef std::vector<AlternativeService> AlternativeServiceVector; |
| 206 typedef std::vector<AlternativeServiceInfo> AlternativeServiceInfoVector; | 206 typedef std::vector<AlternativeServiceInfo> AlternativeServiceInfoVector; |
| 207 typedef base::MRUCache<HostPortPair, AlternativeServiceInfoVector> | 207 typedef base::MRUCache<HostPortPair, AlternativeServiceInfoVector> |
| 208 AlternativeServiceMap; | 208 AlternativeServiceMap; |
| 209 typedef base::MRUCache<url::SchemeHostPort, SettingsMap> SpdySettingsMap; | 209 typedef base::MRUCache<url::SchemeHostPort, SettingsMap> SpdySettingsMap; |
| 210 typedef base::MRUCache<HostPortPair, ServerNetworkStats> ServerNetworkStatsMap; | 210 typedef base::MRUCache<url::SchemeHostPort, ServerNetworkStats> |
| 211 ServerNetworkStatsMap; |
| 211 typedef base::MRUCache<QuicServerId, std::string> QuicServerInfoMap; | 212 typedef base::MRUCache<QuicServerId, std::string> QuicServerInfoMap; |
| 212 | 213 |
| 213 // Persist 5 QUIC Servers. This is mainly used by cronet. | 214 // Persist 5 QUIC Servers. This is mainly used by cronet. |
| 214 const int kMaxQuicServersToPersist = 5; | 215 const int kMaxQuicServersToPersist = 5; |
| 215 | 216 |
| 216 extern const char kAlternateProtocolHeader[]; | 217 extern const char kAlternateProtocolHeader[]; |
| 217 extern const char kAlternativeServiceHeader[]; | 218 extern const char kAlternativeServiceHeader[]; |
| 218 | 219 |
| 219 // The interface for setting/retrieving the HTTP server properties. | 220 // The interface for setting/retrieving the HTTP server properties. |
| 220 // Currently, this class manages servers': | 221 // Currently, this class manages servers': |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 | 341 |
| 341 // Returns all persistent SPDY settings. | 342 // Returns all persistent SPDY settings. |
| 342 virtual const SpdySettingsMap& spdy_settings_map() const = 0; | 343 virtual const SpdySettingsMap& spdy_settings_map() const = 0; |
| 343 | 344 |
| 344 virtual bool GetSupportsQuic(IPAddress* last_address) const = 0; | 345 virtual bool GetSupportsQuic(IPAddress* last_address) const = 0; |
| 345 | 346 |
| 346 virtual void SetSupportsQuic(bool used_quic, | 347 virtual void SetSupportsQuic(bool used_quic, |
| 347 const IPAddress& last_address) = 0; | 348 const IPAddress& last_address) = 0; |
| 348 | 349 |
| 349 // Sets |stats| for |host_port_pair|. | 350 // Sets |stats| for |host_port_pair|. |
| 350 virtual void SetServerNetworkStats(const HostPortPair& host_port_pair, | 351 virtual void SetServerNetworkStats(const url::SchemeHostPort& server, |
| 351 ServerNetworkStats stats) = 0; | 352 ServerNetworkStats stats) = 0; |
| 352 | 353 |
| 353 virtual const ServerNetworkStats* GetServerNetworkStats( | 354 virtual const ServerNetworkStats* GetServerNetworkStats( |
| 354 const HostPortPair& host_port_pair) = 0; | 355 const url::SchemeHostPort& server) = 0; |
| 355 | 356 |
| 356 virtual const ServerNetworkStatsMap& server_network_stats_map() const = 0; | 357 virtual const ServerNetworkStatsMap& server_network_stats_map() const = 0; |
| 357 | 358 |
| 358 // Save QuicServerInfo (in std::string form) for the given |server_id|. | 359 // Save QuicServerInfo (in std::string form) for the given |server_id|. |
| 359 // Returns true if the value has changed otherwise it returns false. | 360 // Returns true if the value has changed otherwise it returns false. |
| 360 virtual bool SetQuicServerInfo(const QuicServerId& server_id, | 361 virtual bool SetQuicServerInfo(const QuicServerId& server_id, |
| 361 const std::string& server_info) = 0; | 362 const std::string& server_info) = 0; |
| 362 | 363 |
| 363 // Get QuicServerInfo (in std::string form) for the given |server_id|. | 364 // Get QuicServerInfo (in std::string form) for the given |server_id|. |
| 364 virtual const std::string* GetQuicServerInfo( | 365 virtual const std::string* GetQuicServerInfo( |
| 365 const QuicServerId& server_id) = 0; | 366 const QuicServerId& server_id) = 0; |
| 366 | 367 |
| 367 // Returns all persistent QuicServerInfo objects. | 368 // Returns all persistent QuicServerInfo objects. |
| 368 virtual const QuicServerInfoMap& quic_server_info_map() const = 0; | 369 virtual const QuicServerInfoMap& quic_server_info_map() const = 0; |
| 369 | 370 |
| 370 // Returns the number of server configs (QuicServerInfo objects) persisted. | 371 // Returns the number of server configs (QuicServerInfo objects) persisted. |
| 371 virtual size_t max_server_configs_stored_in_properties() const = 0; | 372 virtual size_t max_server_configs_stored_in_properties() const = 0; |
| 372 | 373 |
| 373 // Sets the number of server configs (QuicServerInfo objects) to be persisted. | 374 // Sets the number of server configs (QuicServerInfo objects) to be persisted. |
| 374 virtual void SetMaxServerConfigsStoredInProperties( | 375 virtual void SetMaxServerConfigsStoredInProperties( |
| 375 size_t max_server_configs_stored_in_properties) = 0; | 376 size_t max_server_configs_stored_in_properties) = 0; |
| 376 | 377 |
| 377 private: | 378 private: |
| 378 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); | 379 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); |
| 379 }; | 380 }; |
| 380 | 381 |
| 381 } // namespace net | 382 } // namespace net |
| 382 | 383 |
| 383 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ | 384 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
| OLD | NEW |