[email protected] | 39c48fc | 2012-03-12 18:42:12 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | db96a88 | 2011-10-09 02:01:54 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
| 6 | #define NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
| 7 | |
[email protected] | 17291a02 | 2011-10-10 07:32:53 | [diff] [blame] | 8 | #include <map> |
[email protected] | db96a88 | 2011-10-09 02:01:54 | [diff] [blame] | 9 | #include <string> |
jsbell | cea42a5 | 2015-11-30 23:50:25 | [diff] [blame] | 10 | #include <tuple> |
bnc | d9b132e | 2015-07-08 05:16:10 | [diff] [blame] | 11 | #include <vector> |
| 12 | |
Matt Menke | dce5056 | 2017-12-19 22:12:20 | [diff] [blame] | 13 | #include "base/callback.h" |
[email protected] | 9801e370 | 2014-03-07 09:33:55 | [diff] [blame] | 14 | #include "base/containers/mru_cache.h" |
Avi Drissman | 13fc893 | 2015-12-20 04:40:46 | [diff] [blame] | 15 | #include "base/macros.h" |
[email protected] | 3b8cf7f | 2014-01-27 22:08:51 | [diff] [blame] | 16 | #include "base/time/time.h" |
[email protected] | db96a88 | 2011-10-09 02:01:54 | [diff] [blame] | 17 | #include "net/base/net_export.h" |
Matt Menke | 2890796e | 2019-08-02 16:55:23 | [diff] [blame^] | 18 | #include "net/http/alternative_service.h" |
Victor Vasiliev | 6bb59d2 | 2019-03-08 21:34:51 | [diff] [blame] | 19 | #include "net/third_party/quiche/src/quic/core/quic_bandwidth.h" |
| 20 | #include "net/third_party/quiche/src/quic/core/quic_server_id.h" |
| 21 | #include "net/third_party/quiche/src/quic/core/quic_versions.h" |
Victor Vasiliev | 27cc771 | 2019-01-24 11:50:14 | [diff] [blame] | 22 | #include "net/third_party/quiche/src/spdy/core/spdy_framer.h" // TODO(willchan): Reconsider this. |
| 23 | #include "net/third_party/quiche/src/spdy/core/spdy_protocol.h" |
zhongyi | 3d4a55e7 | 2016-04-22 20:36:46 | [diff] [blame] | 24 | #include "url/scheme_host_port.h" |
[email protected] | db96a88 | 2011-10-09 02:01:54 | [diff] [blame] | 25 | |
bnc | 8ba74a178 | 2015-04-14 17:42:08 | [diff] [blame] | 26 | namespace base { |
| 27 | class Value; |
| 28 | } |
| 29 | |
[email protected] | db96a88 | 2011-10-09 02:01:54 | [diff] [blame] | 30 | namespace net { |
| 31 | |
Matt Menke | 2890796e | 2019-08-02 16:55:23 | [diff] [blame^] | 32 | class HostPortPair; |
martijn | fe9636e | 2016-02-06 14:33:32 | [diff] [blame] | 33 | class IPAddress; |
bnc | facdd85 | 2015-01-09 19:22:54 | [diff] [blame] | 34 | struct SSLConfig; |
| 35 | |
rtenneti | 1c863aa | 2014-09-25 18:39:33 | [diff] [blame] | 36 | struct NET_EXPORT SupportsQuic { |
| 37 | SupportsQuic() : used_quic(false) {} |
| 38 | SupportsQuic(bool used_quic, const std::string& address) |
| 39 | : used_quic(used_quic), |
| 40 | address(address) {} |
| 41 | |
| 42 | bool Equals(const SupportsQuic& other) const { |
| 43 | return used_quic == other.used_quic && address == other.address; |
| 44 | } |
| 45 | |
| 46 | bool used_quic; |
| 47 | std::string address; |
| 48 | }; |
| 49 | |
rtenneti | 338cd36a | 2015-01-06 00:20:07 | [diff] [blame] | 50 | struct NET_EXPORT ServerNetworkStats { |
Ryan Hamilton | 8d9ee76e | 2018-05-29 23:52:52 | [diff] [blame] | 51 | ServerNetworkStats() : bandwidth_estimate(quic::QuicBandwidth::Zero()) {} |
rtenneti | 338cd36a | 2015-01-06 00:20:07 | [diff] [blame] | 52 | |
rtenneti | cce34d5 | 2015-06-05 23:36:29 | [diff] [blame] | 53 | bool operator==(const ServerNetworkStats& other) const { |
| 54 | return srtt == other.srtt && bandwidth_estimate == other.bandwidth_estimate; |
| 55 | } |
| 56 | |
| 57 | bool operator!=(const ServerNetworkStats& other) const { |
| 58 | return !this->operator==(other); |
| 59 | } |
| 60 | |
rtenneti | 338cd36a | 2015-01-06 00:20:07 | [diff] [blame] | 61 | base::TimeDelta srtt; |
Ryan Hamilton | 8d9ee76e | 2018-05-29 23:52:52 | [diff] [blame] | 62 | quic::QuicBandwidth bandwidth_estimate; |
rtenneti | 338cd36a | 2015-01-06 00:20:07 | [diff] [blame] | 63 | }; |
| 64 | |
bnc | d9b132e | 2015-07-08 05:16:10 | [diff] [blame] | 65 | typedef std::vector<AlternativeService> AlternativeServiceVector; |
| 66 | typedef std::vector<AlternativeServiceInfo> AlternativeServiceInfoVector; |
Yixin Wang | 4a227aa2 | 2017-11-30 21:33:01 | [diff] [blame] | 67 | |
Yixin Wang | 4a227aa2 | 2017-11-30 21:33:01 | [diff] [blame] | 68 | // Store at most 300 MRU SupportsSpdyServerHostPortPairs in memory and disk. |
| 69 | const int kMaxSupportsSpdyServerEntries = 300; |
| 70 | |
| 71 | // Store at most 200 MRU AlternateProtocolHostPortPairs in memory and disk. |
| 72 | const int kMaxAlternateProtocolEntries = 200; |
| 73 | |
| 74 | // Store at most 200 MRU ServerNetworkStats in memory and disk. |
| 75 | const int kMaxServerNetworkStatsEntries = 200; |
| 76 | |
| 77 | // Store at most 200 MRU RecentlyBrokenAlternativeServices in memory and disk. |
Matt Menke | 2890796e | 2019-08-02 16:55:23 | [diff] [blame^] | 78 | // This ideally would be with the other constants in HttpServerProperties, but |
| 79 | // has to go here instead of prevent a circular dependency. |
Yixin Wang | 4a227aa2 | 2017-11-30 21:33:01 | [diff] [blame] | 80 | const int kMaxRecentlyBrokenAlternativeServiceEntries = 200; |
| 81 | |
| 82 | // Store at most 5 MRU QUIC servers by default. This is mainly used by cronet. |
| 83 | const int kDefaultMaxQuicServerEntries = 5; |
| 84 | |
| 85 | // Stores flattened representation of servers (scheme, host, port) and whether |
| 86 | // or not they support SPDY. |
| 87 | class SpdyServersMap : public base::MRUCache<std::string, bool> { |
| 88 | public: |
| 89 | SpdyServersMap() |
| 90 | : base::MRUCache<std::string, bool>(kMaxSupportsSpdyServerEntries) {} |
| 91 | }; |
| 92 | |
| 93 | class AlternativeServiceMap |
| 94 | : public base::MRUCache<url::SchemeHostPort, AlternativeServiceInfoVector> { |
| 95 | public: |
| 96 | AlternativeServiceMap() |
| 97 | : base::MRUCache<url::SchemeHostPort, AlternativeServiceInfoVector>( |
| 98 | kMaxAlternateProtocolEntries) {} |
| 99 | }; |
| 100 | |
| 101 | class ServerNetworkStatsMap |
| 102 | : public base::MRUCache<url::SchemeHostPort, ServerNetworkStats> { |
| 103 | public: |
| 104 | ServerNetworkStatsMap() |
| 105 | : base::MRUCache<url::SchemeHostPort, ServerNetworkStats>( |
| 106 | kMaxServerNetworkStatsEntries) {} |
| 107 | }; |
| 108 | |
Yixin Wang | 4a227aa2 | 2017-11-30 21:33:01 | [diff] [blame] | 109 | // Max number of quic servers to store is not hardcoded and can be set. |
| 110 | // Because of this, QuicServerInfoMap will not be a subclass of MRUCache. |
Ryan Hamilton | 8d9ee76e | 2018-05-29 23:52:52 | [diff] [blame] | 111 | typedef base::MRUCache<quic::QuicServerId, std::string> QuicServerInfoMap; |
[email protected] | 17291a02 | 2011-10-10 07:32:53 | [diff] [blame] | 112 | |
[email protected] | db96a88 | 2011-10-09 02:01:54 | [diff] [blame] | 113 | // The interface for setting/retrieving the HTTP server properties. |
[email protected] | 17291a02 | 2011-10-10 07:32:53 | [diff] [blame] | 114 | // Currently, this class manages servers': |
Bence Béky | ffb237f | 2017-06-29 12:17:39 | [diff] [blame] | 115 | // * HTTP/2 support; |
| 116 | // * Alternative Service support; |
rtenneti | cd2aaa15b | 2015-10-10 20:29:33 | [diff] [blame] | 117 | // * QUIC data (like ServerNetworkStats and QuicServerInfo). |
| 118 | // |
| 119 | // Embedders must ensure that HttpServerProperites is completely initialized |
| 120 | // before the first request is issued. |
[email protected] | db96a88 | 2011-10-09 02:01:54 | [diff] [blame] | 121 | class NET_EXPORT HttpServerProperties { |
| 122 | public: |
[email protected] | 41c3696d | 2012-04-08 15:22:31 | [diff] [blame] | 123 | HttpServerProperties() {} |
| 124 | virtual ~HttpServerProperties() {} |
[email protected] | db96a88 | 2011-10-09 02:01:54 | [diff] [blame] | 125 | |
Matt Menke | dce5056 | 2017-12-19 22:12:20 | [diff] [blame] | 126 | // Deletes all data. If |callback| is non-null, flushes data to disk |
| 127 | // and invokes the callback asynchronously once changes have been written to |
| 128 | // disk. |
| 129 | virtual void Clear(base::OnceClosure callback) = 0; |
[email protected] | 17291a02 | 2011-10-10 07:32:53 | [diff] [blame] | 130 | |
rch | 9c3e338 | 2015-01-30 23:57:32 | [diff] [blame] | 131 | // Returns true if |server| supports a network protocol which honors |
| 132 | // request prioritization. |
rdsmith | c31e060 | 2016-08-30 06:27:23 | [diff] [blame] | 133 | // Note that this also implies that the server supports request |
| 134 | // multiplexing, since priorities imply a relationship between |
| 135 | // multiple requests. |
zhongyi | 3d4a55e7 | 2016-04-22 20:36:46 | [diff] [blame] | 136 | virtual bool SupportsRequestPriority(const url::SchemeHostPort& server) = 0; |
[email protected] | db96a88 | 2011-10-09 02:01:54 | [diff] [blame] | 137 | |
rtenneti | e267d6a | 2015-06-05 21:55:23 | [diff] [blame] | 138 | // Returns the value set by SetSupportsSpdy(). If not set, returns false. |
zhongyi | 3d4a55e7 | 2016-04-22 20:36:46 | [diff] [blame] | 139 | virtual bool GetSupportsSpdy(const url::SchemeHostPort& server) = 0; |
rtenneti | e267d6a | 2015-06-05 21:55:23 | [diff] [blame] | 140 | |
[email protected] | db96a88 | 2011-10-09 02:01:54 | [diff] [blame] | 141 | // Add |server| into the persistent store. Should only be called from IO |
| 142 | // thread. |
zhongyi | 3d4a55e7 | 2016-04-22 20:36:46 | [diff] [blame] | 143 | virtual void SetSupportsSpdy(const url::SchemeHostPort& server, |
[email protected] | db96a88 | 2011-10-09 02:01:54 | [diff] [blame] | 144 | bool support_spdy) = 0; |
| 145 | |
bnc | facdd85 | 2015-01-09 19:22:54 | [diff] [blame] | 146 | // Returns true if |server| has required HTTP/1.1 via HTTP/2 error code. |
| 147 | virtual bool RequiresHTTP11(const HostPortPair& server) = 0; |
| 148 | |
| 149 | // Require HTTP/1.1 on subsequent connections. Not persisted. |
| 150 | virtual void SetHTTP11Required(const HostPortPair& server) = 0; |
| 151 | |
| 152 | // Modify SSLConfig to force HTTP/1.1. |
| 153 | static void ForceHTTP11(SSLConfig* ssl_config); |
| 154 | |
| 155 | // Modify SSLConfig to force HTTP/1.1 if necessary. |
| 156 | virtual void MaybeForceHTTP11(const HostPortPair& server, |
| 157 | SSLConfig* ssl_config) = 0; |
| 158 | |
rch | dc7b905 | 2016-03-17 20:51:50 | [diff] [blame] | 159 | // Return all alternative services for |origin|, including broken ones. |
bnc | d9b132e | 2015-07-08 05:16:10 | [diff] [blame] | 160 | // Returned alternative services never have empty hostnames. |
zhongyi | c4de0303 | 2017-05-19 04:07:34 | [diff] [blame] | 161 | virtual AlternativeServiceInfoVector GetAlternativeServiceInfos( |
zhongyi | 3d4a55e7 | 2016-04-22 20:36:46 | [diff] [blame] | 162 | const url::SchemeHostPort& origin) = 0; |
[email protected] | 17291a02 | 2011-10-10 07:32:53 | [diff] [blame] | 163 | |
zhongyi | e537a00 | 2017-06-27 16:48:21 | [diff] [blame] | 164 | // Set a single HTTP/2 alternative service for |origin|. Previous |
| 165 | // alternative services for |origin| are discarded. |
| 166 | // |alternative_service.host| may be empty. |
| 167 | // Return true if |alternative_service_map_| has changed significantly enough |
| 168 | // that it should be persisted to disk. |
| 169 | virtual bool SetHttp2AlternativeService( |
| 170 | const url::SchemeHostPort& origin, |
| 171 | const AlternativeService& alternative_service, |
| 172 | base::Time expiration) = 0; |
| 173 | |
| 174 | // Set a single QUIC alternative service for |origin|. Previous alternative |
bnc | d9b132e | 2015-07-08 05:16:10 | [diff] [blame] | 175 | // services for |origin| are discarded. |
| 176 | // |alternative_service.host| may be empty. |
bnc | 4b91d83 | 2016-07-27 23:36:12 | [diff] [blame] | 177 | // Return true if |alternative_service_map_| has changed significantly enough |
| 178 | // that it should be persisted to disk. |
zhongyi | e537a00 | 2017-06-27 16:48:21 | [diff] [blame] | 179 | virtual bool SetQuicAlternativeService( |
zhongyi | 3d4a55e7 | 2016-04-22 20:36:46 | [diff] [blame] | 180 | const url::SchemeHostPort& origin, |
bnc | cacc099 | 2015-03-20 20:22:22 | [diff] [blame] | 181 | const AlternativeService& alternative_service, |
zhongyi | e537a00 | 2017-06-27 16:48:21 | [diff] [blame] | 182 | base::Time expiration, |
Nick Harper | 23290b8 | 2019-05-02 00:02:56 | [diff] [blame] | 183 | const quic::ParsedQuicVersionVector& advertised_versions) = 0; |
[email protected] | 17291a02 | 2011-10-10 07:32:53 | [diff] [blame] | 184 | |
bnc | d9b132e | 2015-07-08 05:16:10 | [diff] [blame] | 185 | // Set alternative services for |origin|. Previous alternative services for |
| 186 | // |origin| are discarded. |
| 187 | // Hostnames in |alternative_service_info_vector| may be empty. |
bnc | 4b91d83 | 2016-07-27 23:36:12 | [diff] [blame] | 188 | // |alternative_service_info_vector| may be empty. |
| 189 | // Return true if |alternative_service_map_| has changed significantly enough |
| 190 | // that it should be persisted to disk. |
bnc | d9b132e | 2015-07-08 05:16:10 | [diff] [blame] | 191 | virtual bool SetAlternativeServices( |
zhongyi | 3d4a55e7 | 2016-04-22 20:36:46 | [diff] [blame] | 192 | const url::SchemeHostPort& origin, |
bnc | d9b132e | 2015-07-08 05:16:10 | [diff] [blame] | 193 | const AlternativeServiceInfoVector& alternative_service_info_vector) = 0; |
| 194 | |
bnc | cacc099 | 2015-03-20 20:22:22 | [diff] [blame] | 195 | // Marks |alternative_service| as broken. |
bnc | d9b132e | 2015-07-08 05:16:10 | [diff] [blame] | 196 | // |alternative_service.host| must not be empty. |
bnc | cacc099 | 2015-03-20 20:22:22 | [diff] [blame] | 197 | virtual void MarkAlternativeServiceBroken( |
| 198 | const AlternativeService& alternative_service) = 0; |
[email protected] | 17291a02 | 2011-10-10 07:32:53 | [diff] [blame] | 199 | |
Zhongyi Shi | 826b1d2 | 2018-08-28 21:45:15 | [diff] [blame] | 200 | // Marks |alternative_service| as broken until the default network changes. |
| 201 | // |alternative_service.host| must not be empty. |
| 202 | virtual void MarkAlternativeServiceBrokenUntilDefaultNetworkChanges( |
| 203 | const AlternativeService& alternative_service) = 0; |
| 204 | |
bnc | d1e0aa2 | 2015-03-13 10:14:31 | [diff] [blame] | 205 | // Marks |alternative_service| as recently broken. |
bnc | d9b132e | 2015-07-08 05:16:10 | [diff] [blame] | 206 | // |alternative_service.host| must not be empty. |
bnc | d1e0aa2 | 2015-03-13 10:14:31 | [diff] [blame] | 207 | virtual void MarkAlternativeServiceRecentlyBroken( |
| 208 | const AlternativeService& alternative_service) = 0; |
| 209 | |
bnc | 8445b300 | 2015-03-13 01:57:09 | [diff] [blame] | 210 | // Returns true iff |alternative_service| is currently broken. |
bnc | d9b132e | 2015-07-08 05:16:10 | [diff] [blame] | 211 | // |alternative_service.host| must not be empty. |
bnc | 8445b300 | 2015-03-13 01:57:09 | [diff] [blame] | 212 | virtual bool IsAlternativeServiceBroken( |
bnc | 8ba74a178 | 2015-04-14 17:42:08 | [diff] [blame] | 213 | const AlternativeService& alternative_service) const = 0; |
bnc | 8445b300 | 2015-03-13 01:57:09 | [diff] [blame] | 214 | |
bnc | cacc099 | 2015-03-20 20:22:22 | [diff] [blame] | 215 | // Returns true iff |alternative_service| was recently broken. |
bnc | d9b132e | 2015-07-08 05:16:10 | [diff] [blame] | 216 | // |alternative_service.host| must not be empty. |
bnc | cacc099 | 2015-03-20 20:22:22 | [diff] [blame] | 217 | virtual bool WasAlternativeServiceRecentlyBroken( |
| 218 | const AlternativeService& alternative_service) = 0; |
[email protected] | f5716e3 | 2014-04-18 00:44:16 | [diff] [blame] | 219 | |
bnc | cacc099 | 2015-03-20 20:22:22 | [diff] [blame] | 220 | // Confirms that |alternative_service| is working. |
bnc | d9b132e | 2015-07-08 05:16:10 | [diff] [blame] | 221 | // |alternative_service.host| must not be empty. |
bnc | cacc099 | 2015-03-20 20:22:22 | [diff] [blame] | 222 | virtual void ConfirmAlternativeService( |
| 223 | const AlternativeService& alternative_service) = 0; |
[email protected] | f5716e3 | 2014-04-18 00:44:16 | [diff] [blame] | 224 | |
Zhongyi Shi | 826b1d2 | 2018-08-28 21:45:15 | [diff] [blame] | 225 | // Called when the default network changes. |
| 226 | // Clears all the alternative services that were marked broken until the |
| 227 | // default network changed. |
| 228 | // Returns true if there is any broken alternative service affected by the |
| 229 | // default network change. |
| 230 | virtual bool OnDefaultNetworkChanged() = 0; |
| 231 | |
bnc | 4988e43 | 2015-03-31 03:06:25 | [diff] [blame] | 232 | // Returns all alternative service mappings. |
bnc | d9b132e | 2015-07-08 05:16:10 | [diff] [blame] | 233 | // Returned alternative services may have empty hostnames. |
bnc | 4988e43 | 2015-03-31 03:06:25 | [diff] [blame] | 234 | virtual const AlternativeServiceMap& alternative_service_map() const = 0; |
[email protected] | db96a88 | 2011-10-09 02:01:54 | [diff] [blame] | 235 | |
bnc | 8ba74a178 | 2015-04-14 17:42:08 | [diff] [blame] | 236 | // Returns all alternative service mappings as human readable strings. |
bnc | d9b132e | 2015-07-08 05:16:10 | [diff] [blame] | 237 | // Empty alternative service hostnames will be printed as such. |
danakj | 1fd259a0 | 2016-04-16 03:17:09 | [diff] [blame] | 238 | virtual std::unique_ptr<base::Value> GetAlternativeServiceInfoAsValue() |
| 239 | const = 0; |
bnc | 8ba74a178 | 2015-04-14 17:42:08 | [diff] [blame] | 240 | |
martijn | fe9636e | 2016-02-06 14:33:32 | [diff] [blame] | 241 | virtual bool GetSupportsQuic(IPAddress* last_address) const = 0; |
rtenneti | 1c863aa | 2014-09-25 18:39:33 | [diff] [blame] | 242 | |
rch | a5a10a8 | 2015-02-04 23:04:41 | [diff] [blame] | 243 | virtual void SetSupportsQuic(bool used_quic, |
martijn | fe9636e | 2016-02-06 14:33:32 | [diff] [blame] | 244 | const IPAddress& last_address) = 0; |
rtenneti | 1c863aa | 2014-09-25 18:39:33 | [diff] [blame] | 245 | |
rch | ac7f35e | 2017-03-15 20:42:30 | [diff] [blame] | 246 | // Sets |stats| for |server|. |
zhongyi | 3d4a55e7 | 2016-04-22 20:36:46 | [diff] [blame] | 247 | virtual void SetServerNetworkStats(const url::SchemeHostPort& server, |
rtenneti | 338cd36a | 2015-01-06 00:20:07 | [diff] [blame] | 248 | ServerNetworkStats stats) = 0; |
[email protected] | 3b8cf7f | 2014-01-27 22:08:51 | [diff] [blame] | 249 | |
rch | ac7f35e | 2017-03-15 20:42:30 | [diff] [blame] | 250 | // Clears any stats for |server|. |
| 251 | virtual void ClearServerNetworkStats(const url::SchemeHostPort& server) = 0; |
| 252 | |
| 253 | // Returns any stats for |server| or nullptr if there are none. |
rtenneti | 338cd36a | 2015-01-06 00:20:07 | [diff] [blame] | 254 | virtual const ServerNetworkStats* GetServerNetworkStats( |
zhongyi | 3d4a55e7 | 2016-04-22 20:36:46 | [diff] [blame] | 255 | const url::SchemeHostPort& server) = 0; |
rtenneti | 338cd36a | 2015-01-06 00:20:07 | [diff] [blame] | 256 | |
| 257 | virtual const ServerNetworkStatsMap& server_network_stats_map() const = 0; |
[email protected] | 3b8cf7f | 2014-01-27 22:08:51 | [diff] [blame] | 258 | |
rtenneti | 8b673f7 | 2015-10-08 23:45:37 | [diff] [blame] | 259 | // Save QuicServerInfo (in std::string form) for the given |server_id|. |
| 260 | // Returns true if the value has changed otherwise it returns false. |
Ryan Hamilton | 8d9ee76e | 2018-05-29 23:52:52 | [diff] [blame] | 261 | virtual bool SetQuicServerInfo(const quic::QuicServerId& server_id, |
rtenneti | 8b673f7 | 2015-10-08 23:45:37 | [diff] [blame] | 262 | const std::string& server_info) = 0; |
| 263 | |
| 264 | // Get QuicServerInfo (in std::string form) for the given |server_id|. |
| 265 | virtual const std::string* GetQuicServerInfo( |
Ryan Hamilton | 8d9ee76e | 2018-05-29 23:52:52 | [diff] [blame] | 266 | const quic::QuicServerId& server_id) = 0; |
rtenneti | 8b673f7 | 2015-10-08 23:45:37 | [diff] [blame] | 267 | |
| 268 | // Returns all persistent QuicServerInfo objects. |
| 269 | virtual const QuicServerInfoMap& quic_server_info_map() const = 0; |
| 270 | |
rtenneti | 6971c17 | 2016-01-15 20:12:10 | [diff] [blame] | 271 | // Returns the number of server configs (QuicServerInfo objects) persisted. |
| 272 | virtual size_t max_server_configs_stored_in_properties() const = 0; |
| 273 | |
| 274 | // Sets the number of server configs (QuicServerInfo objects) to be persisted. |
| 275 | virtual void SetMaxServerConfigsStoredInProperties( |
| 276 | size_t max_server_configs_stored_in_properties) = 0; |
| 277 | |
xunjieli | 1df4de1 | 2017-02-09 17:21:19 | [diff] [blame] | 278 | // Returns whether HttpServerProperties is initialized. |
| 279 | virtual bool IsInitialized() const = 0; |
| 280 | |
[email protected] | db96a88 | 2011-10-09 02:01:54 | [diff] [blame] | 281 | private: |
[email protected] | db96a88 | 2011-10-09 02:01:54 | [diff] [blame] | 282 | DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); |
| 283 | }; |
| 284 | |
| 285 | } // namespace net |
| 286 | |
| 287 | #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |