| 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_IMPL_H_ | 5 #ifndef NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ |
| 6 #define NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ | 6 #define NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // Require HTTP/1.1 on subsequent connections. Not persisted. | 89 // Require HTTP/1.1 on subsequent connections. Not persisted. |
| 90 void SetHTTP11Required(const HostPortPair& server) override; | 90 void SetHTTP11Required(const HostPortPair& server) override; |
| 91 | 91 |
| 92 // Modify SSLConfig to force HTTP/1.1 if necessary. | 92 // Modify SSLConfig to force HTTP/1.1 if necessary. |
| 93 void MaybeForceHTTP11(const HostPortPair& server, | 93 void MaybeForceHTTP11(const HostPortPair& server, |
| 94 SSLConfig* ssl_config) override; | 94 SSLConfig* ssl_config) override; |
| 95 | 95 |
| 96 // Returns true if |server| has an Alternate-Protocol header. | 96 // Returns true if |server| has an Alternate-Protocol header. |
| 97 bool HasAlternateProtocol(const HostPortPair& server) override; | 97 bool HasAlternateProtocol(const HostPortPair& server) override; |
| 98 | 98 |
| 99 // Returns the Alternate-Protocol and port for |server|. | 99 // Returns the Alternate-Protocols for |server|. |
| 100 // HasAlternateProtocol(server) must be true. | 100 // HasAlternateProtocol(server) must be true. |
| 101 AlternateProtocolInfo GetAlternateProtocol( | 101 const AlternateProtocols& GetAlternateProtocols( |
| 102 const HostPortPair& server) override; | 102 const HostPortPair& server) override; |
| 103 | 103 |
| 104 // Sets the Alternate-Protocol for |server|. | 104 // Adds an Alternate-Protocol for |server|. |
| 105 void SetAlternateProtocol(const HostPortPair& server, | 105 void AddAlternateProtocol(const HostPortPair& server, |
| 106 uint16 alternate_port, | 106 uint16 alternate_port, |
| 107 AlternateProtocol alternate_protocol, | 107 AlternateProtocol alternate_protocol, |
| 108 double probability) override; | 108 double probability) override; |
| 109 | 109 |
| 110 // Sets the Alternate-Protocol for |server| to be BROKEN. | 110 // Sets a given Alternate-Protocol for |server| to be BROKEN. |
| 111 void SetBrokenAlternateProtocol(const HostPortPair& server) override; | 111 void SetBrokenAlternateProtocol( |
| 112 const HostPortPair& server, |
| 113 const AlternateProtocolInfo& broken_alternate_protocol) override; |
| 112 | 114 |
| 113 // Returns true if Alternate-Protocol for |server| was recently BROKEN. | 115 // Returns true if given Alternate-Protocol for |server| was recently BROKEN. |
| 114 bool WasAlternateProtocolRecentlyBroken(const HostPortPair& server) override; | 116 bool WasAlternateProtocolRecentlyBroken( |
| 117 const HostPortPair& server, |
| 118 const AlternateProtocolInfo& alternate_protocol) override; |
| 115 | 119 |
| 116 // Confirms that Alternate-Protocol for |server| is working. | 120 // Confirms that given Alternate-Protocol for |server| is working. |
| 117 void ConfirmAlternateProtocol(const HostPortPair& server) override; | 121 void ConfirmAlternateProtocol( |
| 122 const HostPortPair& server, |
| 123 const AlternateProtocolInfo& alternate_protocol) override; |
| 118 | 124 |
| 119 // Clears the Alternate-Protocol for |server|. | 125 // Clears all Alternate-Protocols for |server|. |
| 120 void ClearAlternateProtocol(const HostPortPair& server) override; | 126 void ClearAlternateProtocol(const HostPortPair& server) override; |
| 121 | 127 |
| 128 // Clears all Alternate-Protocols that are not broken for |server|. |
| 129 void ClearNonBrokenAlternateProtocols(const HostPortPair& server) override; |
| 130 |
| 131 // Removes an Alternate-Protocol for |server|. |
| 132 void RemoveAlternateProtocol( |
| 133 const HostPortPair& server, |
| 134 const AlternateProtocolInfo& alternate_protocol) override; |
| 135 |
| 122 // Returns all Alternate-Protocol mappings. | 136 // Returns all Alternate-Protocol mappings. |
| 123 const AlternateProtocolMap& alternate_protocol_map() const override; | 137 const AlternateProtocolMap& alternate_protocol_map() const override; |
| 124 | 138 |
| 125 void SetAlternateProtocolProbabilityThreshold(double threshold) override; | 139 void SetAlternateProtocolProbabilityThreshold(double threshold) override; |
| 126 | 140 |
| 127 // Gets a reference to the SettingsMap stored for a host. | 141 // Gets a reference to the SettingsMap stored for a host. |
| 128 // If no settings are stored, returns an empty SettingsMap. | 142 // If no settings are stored, returns an empty SettingsMap. |
| 129 const SettingsMap& GetSpdySettings( | 143 const SettingsMap& GetSpdySettings( |
| 130 const HostPortPair& host_port_pair) override; | 144 const HostPortPair& host_port_pair) override; |
| 131 | 145 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 double alternate_protocol_probability_threshold_; | 224 double alternate_protocol_probability_threshold_; |
| 211 | 225 |
| 212 base::WeakPtrFactory<HttpServerPropertiesImpl> weak_ptr_factory_; | 226 base::WeakPtrFactory<HttpServerPropertiesImpl> weak_ptr_factory_; |
| 213 | 227 |
| 214 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesImpl); | 228 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesImpl); |
| 215 }; | 229 }; |
| 216 | 230 |
| 217 } // namespace net | 231 } // namespace net |
| 218 | 232 |
| 219 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ | 233 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ |
| OLD | NEW |