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 <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 // Returns true if |server| supports SPDY. | 77 // Returns true if |server| supports SPDY. |
78 bool SupportsSpdy(const HostPortPair& server) override; | 78 bool SupportsSpdy(const HostPortPair& server) override; |
79 | 79 |
80 // Add |server| into the persistent store. | 80 // Add |server| into the persistent store. |
81 void SetSupportsSpdy(const HostPortPair& server, bool support_spdy) override; | 81 void SetSupportsSpdy(const HostPortPair& server, bool support_spdy) override; |
82 | 82 |
83 // Returns true if |server| has an Alternate-Protocol header. | 83 // Returns true if |server| has an Alternate-Protocol header. |
84 bool HasAlternateProtocol(const HostPortPair& server) override; | 84 bool HasAlternateProtocol(const HostPortPair& server) override; |
85 | 85 |
86 // Returns the Alternate-Protocol and port for |server|. | 86 // Returns the Alternate-Protocols for |server|. |
87 // HasAlternateProtocol(server) must be true. | 87 // HasAlternateProtocol(server) must be true. |
88 AlternateProtocolInfo GetAlternateProtocol( | 88 AlternateProtocols GetAlternateProtocol(const HostPortPair& server) override; |
89 const HostPortPair& server) override; | |
90 | 89 |
91 // Sets the Alternate-Protocol for |server|. | 90 // Adds an Alternate-Protocol for |server|. |
92 void SetAlternateProtocol(const HostPortPair& server, | 91 void AddAlternateProtocol(const HostPortPair& server, |
93 uint16 alternate_port, | 92 uint16 alternate_port, |
94 AlternateProtocol alternate_protocol, | 93 AlternateProtocol alternate_protocol, |
95 double probability) override; | 94 double probability) override; |
96 | 95 |
97 // Sets the Alternate-Protocol for |server| to be BROKEN. | 96 // Sets a given Alternate-Protocol for |server| to be BROKEN. |
98 void SetBrokenAlternateProtocol(const HostPortPair& server) override; | 97 void SetBrokenAlternateProtocol( |
| 98 const HostPortPair& server, |
| 99 const AlternateProtocolInfo& broken_alternate_protocol) override; |
99 | 100 |
100 // Returns true if Alternate-Protocol for |server| was recently BROKEN. | 101 // Returns true if given Alternate-Protocol for |server| was recently BROKEN. |
101 bool WasAlternateProtocolRecentlyBroken(const HostPortPair& server) override; | 102 bool WasAlternateProtocolRecentlyBroken( |
| 103 const HostPortPair& server, |
| 104 const AlternateProtocolInfo& alternate_protocol) override; |
102 | 105 |
103 // Confirms that Alternate-Protocol for |server| is working. | 106 // Confirms that given Alternate-Protocol for |server| is working. |
104 void ConfirmAlternateProtocol(const HostPortPair& server) override; | 107 void ConfirmAlternateProtocol( |
| 108 const HostPortPair& server, |
| 109 const AlternateProtocolInfo& alternate_protocol) override; |
105 | 110 |
106 // Clears the Alternate-Protocol for |server|. | 111 // Clears all Alternate-Protocols for |server|. |
107 void ClearAlternateProtocol(const HostPortPair& server) override; | 112 void ClearAlternateProtocol(const HostPortPair& server) override; |
108 | 113 |
| 114 // Removes an Alternate-Protocol for |server|. |
| 115 void RemoveAlternateProtocol( |
| 116 const HostPortPair& server, |
| 117 const AlternateProtocolInfo& alternate_protocol) override; |
| 118 |
109 // Returns all Alternate-Protocol mappings. | 119 // Returns all Alternate-Protocol mappings. |
110 const AlternateProtocolMap& alternate_protocol_map() const override; | 120 const AlternateProtocolMap& alternate_protocol_map() const override; |
111 | 121 |
112 void SetAlternateProtocolProbabilityThreshold(double threshold) override; | 122 void SetAlternateProtocolProbabilityThreshold(double threshold) override; |
113 | 123 |
114 // Gets a reference to the SettingsMap stored for a host. | 124 // Gets a reference to the SettingsMap stored for a host. |
115 // If no settings are stored, returns an empty SettingsMap. | 125 // If no settings are stored, returns an empty SettingsMap. |
116 const SettingsMap& GetSpdySettings( | 126 const SettingsMap& GetSpdySettings( |
117 const HostPortPair& host_port_pair) override; | 127 const HostPortPair& host_port_pair) override; |
118 | 128 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 double alternate_protocol_probability_threshold_; | 204 double alternate_protocol_probability_threshold_; |
195 | 205 |
196 base::WeakPtrFactory<HttpServerPropertiesImpl> weak_ptr_factory_; | 206 base::WeakPtrFactory<HttpServerPropertiesImpl> weak_ptr_factory_; |
197 | 207 |
198 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesImpl); | 208 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesImpl); |
199 }; | 209 }; |
200 | 210 |
201 } // namespace net | 211 } // namespace net |
202 | 212 |
203 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ | 213 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ |
OLD | NEW |