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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 // Require HTTP/1.1 on subsequent connections. Not persisted. | 198 // Require HTTP/1.1 on subsequent connections. Not persisted. |
199 virtual void SetHTTP11Required(const HostPortPair& server) = 0; | 199 virtual void SetHTTP11Required(const HostPortPair& server) = 0; |
200 | 200 |
201 // Modify SSLConfig to force HTTP/1.1. | 201 // Modify SSLConfig to force HTTP/1.1. |
202 static void ForceHTTP11(SSLConfig* ssl_config); | 202 static void ForceHTTP11(SSLConfig* ssl_config); |
203 | 203 |
204 // Modify SSLConfig to force HTTP/1.1 if necessary. | 204 // Modify SSLConfig to force HTTP/1.1 if necessary. |
205 virtual void MaybeForceHTTP11(const HostPortPair& server, | 205 virtual void MaybeForceHTTP11(const HostPortPair& server, |
206 SSLConfig* ssl_config) = 0; | 206 SSLConfig* ssl_config) = 0; |
207 | 207 |
208 // Returns the AlternateProtocol for |server| if it has probability equal to | 208 // Returns the alternative service for |origin| if it has probability equal to |
209 // or exceeding threshold, or else the forced AlternateProtocol if there is | 209 // or exceeding threshold, or else the forced AlternateProtocol if there is |
210 // one, or else one with UNINITIALIZED_ALTERNATE_PROTOCOL. | 210 // one, or else one with UNINITIALIZED_ALTERNATE_PROTOCOL. |
211 virtual AlternateProtocolInfo GetAlternateProtocol( | 211 virtual AlternativeService GetAlternativeService( |
212 const HostPortPair& server) = 0; | 212 const HostPortPair& origin) = 0; |
213 | 213 |
214 // Sets the Alternate-Protocol for |server|. | 214 // Sets the Alternate-Protocol for |server|. |
215 virtual void SetAlternateProtocol(const HostPortPair& server, | 215 virtual void SetAlternateProtocol(const HostPortPair& origin, |
216 uint16 alternate_port, | 216 uint16 alternate_port, |
217 AlternateProtocol alternate_protocol, | 217 AlternateProtocol alternate_protocol, |
218 double probability) = 0; | 218 double probability) = 0; |
219 | 219 |
220 // Sets the Alternate-Protocol for |server| to be BROKEN. | 220 // Sets the Alternate-Protocol for |server| to be BROKEN. |
221 virtual void SetBrokenAlternateProtocol(const HostPortPair& server) = 0; | 221 virtual void SetBrokenAlternateProtocol(const HostPortPair& origin) = 0; |
222 | 222 |
223 // Marks |alternative_service| as recently broken. | 223 // Marks |alternative_service| as recently broken. |
224 virtual void MarkAlternativeServiceRecentlyBroken( | 224 virtual void MarkAlternativeServiceRecentlyBroken( |
225 const AlternativeService& alternative_service) = 0; | 225 const AlternativeService& alternative_service) = 0; |
226 | 226 |
227 // Returns true iff |alternative_service| is currently broken. | 227 // Returns true iff |alternative_service| is currently broken. |
228 virtual bool IsAlternativeServiceBroken( | 228 virtual bool IsAlternativeServiceBroken( |
229 const AlternativeService& alternative_service) = 0; | 229 const AlternativeService& alternative_service) = 0; |
230 | 230 |
231 // Returns true if Alternate-Protocol for |server| was recently BROKEN. | 231 // Returns true if Alternate-Protocol for |server| was recently BROKEN. |
232 virtual bool WasAlternateProtocolRecentlyBroken( | 232 virtual bool WasAlternateProtocolRecentlyBroken( |
233 const HostPortPair& server) = 0; | 233 const HostPortPair& origin) = 0; |
234 | 234 |
235 // Confirms that Alternate-Protocol for |server| is working. | 235 // Confirms that Alternate-Protocol for |server| is working. |
236 virtual void ConfirmAlternateProtocol(const HostPortPair& server) = 0; | 236 virtual void ConfirmAlternateProtocol(const HostPortPair& origin) = 0; |
237 | 237 |
238 // Clears the Alternate-Protocol for |server|. | 238 // Clears the Alternate-Protocol for |server|. |
239 virtual void ClearAlternateProtocol(const HostPortPair& server) = 0; | 239 virtual void ClearAlternateProtocol(const HostPortPair& origin) = 0; |
240 | 240 |
241 // Returns all Alternate-Protocol mappings. | 241 // Returns all Alternate-Protocol mappings. |
242 virtual const AlternateProtocolMap& alternate_protocol_map() const = 0; | 242 virtual const AlternateProtocolMap& alternate_protocol_map() const = 0; |
243 | 243 |
244 // Sets the threshold to be used when evaluating Alternate-Protocol | 244 // Sets the threshold to be used when evaluating Alternate-Protocol |
245 // advertisments. Only advertisements with a with a probability | 245 // advertisments. Only advertisements with a with a probability |
246 // greater than |threshold| will be honored. |threshold| must be | 246 // greater than |threshold| will be honored. |threshold| must be |
247 // between 0 and 1 inclusive. Hence, a threshold of 0 implies that | 247 // between 0 and 1 inclusive. Hence, a threshold of 0 implies that |
248 // all advertisements will be honored. | 248 // all advertisements will be honored. |
249 virtual void SetAlternateProtocolProbabilityThreshold( | 249 virtual void SetAlternateProtocolProbabilityThreshold( |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 283 |
284 virtual const ServerNetworkStatsMap& server_network_stats_map() const = 0; | 284 virtual const ServerNetworkStatsMap& server_network_stats_map() const = 0; |
285 | 285 |
286 private: | 286 private: |
287 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); | 287 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); |
288 }; | 288 }; |
289 | 289 |
290 } // namespace net | 290 } // namespace net |
291 | 291 |
292 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ | 292 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
OLD | NEW |