| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 alternative service for |origin| 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 AlternativeService GetAlternativeService( | 211 virtual AlternativeService GetAlternativeService( |
| 212 const HostPortPair& origin) = 0; | 212 const HostPortPair& origin) = 0; |
| 213 | 213 |
| 214 // Sets the Alternate-Protocol for |server|. | 214 // Sets the alternative service for |origin|. |
| 215 virtual void SetAlternateProtocol(const HostPortPair& origin, | 215 // TODO(bnc): alternative_service.host is currently ignored, fix it. |
| 216 uint16 alternate_port, | 216 virtual void SetAlternativeService( |
| 217 AlternateProtocol alternate_protocol, | 217 const HostPortPair& origin, |
| 218 double probability) = 0; | 218 const AlternativeService& alternative_service, |
| 219 double alternative_probability) = 0; |
| 219 | 220 |
| 220 // Sets the Alternate-Protocol for |server| to be BROKEN. | 221 // Marks |alternative_service| as broken. |
| 221 virtual void SetBrokenAlternateProtocol(const HostPortPair& origin) = 0; | 222 virtual void MarkAlternativeServiceBroken( |
| 223 const AlternativeService& alternative_service) = 0; |
| 222 | 224 |
| 223 // Marks |alternative_service| as recently broken. | 225 // Marks |alternative_service| as recently broken. |
| 224 virtual void MarkAlternativeServiceRecentlyBroken( | 226 virtual void MarkAlternativeServiceRecentlyBroken( |
| 225 const AlternativeService& alternative_service) = 0; | 227 const AlternativeService& alternative_service) = 0; |
| 226 | 228 |
| 227 // Returns true iff |alternative_service| is currently broken. | 229 // Returns true iff |alternative_service| is currently broken. |
| 228 virtual bool IsAlternativeServiceBroken( | 230 virtual bool IsAlternativeServiceBroken( |
| 229 const AlternativeService& alternative_service) = 0; | 231 const AlternativeService& alternative_service) = 0; |
| 230 | 232 |
| 231 // Returns true if Alternate-Protocol for |server| was recently BROKEN. | 233 // Returns true iff |alternative_service| was recently broken. |
| 232 virtual bool WasAlternateProtocolRecentlyBroken( | 234 virtual bool WasAlternativeServiceRecentlyBroken( |
| 233 const HostPortPair& origin) = 0; | 235 const AlternativeService& alternative_service) = 0; |
| 234 | 236 |
| 235 // Confirms that Alternate-Protocol for |server| is working. | 237 // Confirms that |alternative_service| is working. |
| 236 virtual void ConfirmAlternateProtocol(const HostPortPair& origin) = 0; | 238 virtual void ConfirmAlternativeService( |
| 239 const AlternativeService& alternative_service) = 0; |
| 237 | 240 |
| 238 // Clears the Alternate-Protocol for |server|. | 241 // Clears the alternative service for |origin|. |
| 239 virtual void ClearAlternateProtocol(const HostPortPair& origin) = 0; | 242 virtual void ClearAlternativeService(const HostPortPair& origin) = 0; |
| 240 | 243 |
| 241 // Returns all Alternate-Protocol mappings. | 244 // Returns all Alternate-Protocol mappings. |
| 242 virtual const AlternateProtocolMap& alternate_protocol_map() const = 0; | 245 virtual const AlternateProtocolMap& alternate_protocol_map() const = 0; |
| 243 | 246 |
| 244 // Sets the threshold to be used when evaluating Alternate-Protocol | 247 // Sets the threshold to be used when evaluating alternative service |
| 245 // advertisments. Only advertisements with a with a probability | 248 // advertisments. Only advertisements with a probability greater than or equal |
| 246 // greater than |threshold| will be honored. |threshold| must be | 249 // to |threshold| will be honored. |threshold| must be between 0.0 and 1.0 |
| 247 // between 0 and 1 inclusive. Hence, a threshold of 0 implies that | 250 // inclusive. Hence, a threshold of 0.0 implies that all advertisements will |
| 248 // all advertisements will be honored. | 251 // be honored. |
| 249 virtual void SetAlternateProtocolProbabilityThreshold( | 252 virtual void SetAlternateProtocolProbabilityThreshold( |
| 250 double threshold) = 0; | 253 double threshold) = 0; |
| 251 | 254 |
| 252 // Gets a reference to the SettingsMap stored for a host. | 255 // Gets a reference to the SettingsMap stored for a host. |
| 253 // If no settings are stored, returns an empty SettingsMap. | 256 // If no settings are stored, returns an empty SettingsMap. |
| 254 virtual const SettingsMap& GetSpdySettings( | 257 virtual const SettingsMap& GetSpdySettings( |
| 255 const HostPortPair& host_port_pair) = 0; | 258 const HostPortPair& host_port_pair) = 0; |
| 256 | 259 |
| 257 // Saves an individual SPDY setting for a host. Returns true if SPDY setting | 260 // Saves an individual SPDY setting for a host. Returns true if SPDY setting |
| 258 // is to be persisted. | 261 // is to be persisted. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 283 | 286 |
| 284 virtual const ServerNetworkStatsMap& server_network_stats_map() const = 0; | 287 virtual const ServerNetworkStatsMap& server_network_stats_map() const = 0; |
| 285 | 288 |
| 286 private: | 289 private: |
| 287 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); | 290 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); |
| 288 }; | 291 }; |
| 289 | 292 |
| 290 } // namespace net | 293 } // namespace net |
| 291 | 294 |
| 292 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ | 295 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
| OLD | NEW |