OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_MANAGER_H_ | 5 #ifndef NET_HTTP_HTTP_SERVER_PROPERTIES_MANAGER_H_ |
6 #define NET_HTTP_HTTP_SERVER_PROPERTIES_MANAGER_H_ | 6 #define NET_HTTP_HTTP_SERVER_PROPERTIES_MANAGER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // Returns true if |server| has required HTTP/1.1 via HTTP/2 error code. | 95 // Returns true if |server| has required HTTP/1.1 via HTTP/2 error code. |
96 bool RequiresHTTP11(const HostPortPair& server) override; | 96 bool RequiresHTTP11(const HostPortPair& server) override; |
97 | 97 |
98 // Require HTTP/1.1 on subsequent connections. Not persisted. | 98 // Require HTTP/1.1 on subsequent connections. Not persisted. |
99 void SetHTTP11Required(const HostPortPair& server) override; | 99 void SetHTTP11Required(const HostPortPair& server) override; |
100 | 100 |
101 // Modify SSLConfig to force HTTP/1.1 if necessary. | 101 // Modify SSLConfig to force HTTP/1.1 if necessary. |
102 void MaybeForceHTTP11(const HostPortPair& server, | 102 void MaybeForceHTTP11(const HostPortPair& server, |
103 SSLConfig* ssl_config) override; | 103 SSLConfig* ssl_config) override; |
104 | 104 |
105 // Returns true if |server| has an Alternate-Protocol header. | 105 // Returns true iff |server| has a non-broken AlternateProtocol with |
| 106 // probability exceeding threshold, or if AlternateProtocol is forced. |
| 107 // TODO(bnc): Rename to HasAlternativeService. |
106 bool HasAlternateProtocol(const HostPortPair& server) override; | 108 bool HasAlternateProtocol(const HostPortPair& server) override; |
107 | 109 |
108 // Returns the Alternate-Protocol and port for |server|. | 110 // Returns the first non-broken AlternateProtocol with probability exceeding |
109 // HasAlternateProtocol(server) must be true. | 111 // threshold for |server|, or forced AlternateProtocol, or one with |
| 112 // UNINITIALIZED_ALTERNATE_PROTOCOL. |
110 AlternateProtocolInfo GetAlternateProtocol( | 113 AlternateProtocolInfo GetAlternateProtocol( |
111 const HostPortPair& server) override; | 114 const HostPortPair& server) override; |
112 | 115 |
113 // Sets the Alternate-Protocol for |server|. | 116 // Adds an Alternate-Protocol for |server|. |
114 void SetAlternateProtocol(const HostPortPair& server, | 117 void AddAlternateProtocol(const HostPortPair& server, |
115 uint16 alternate_port, | 118 uint16 alternate_port, |
116 AlternateProtocol alternate_protocol, | 119 AlternateProtocol alternate_protocol, |
117 double alternate_probability) override; | 120 double alternate_probability) override; |
118 | 121 |
119 // Sets the Alternate-Protocol for |server| to be BROKEN. | 122 // Sets a given Alternate-Protocol for |server| to be broken. |
120 void SetBrokenAlternateProtocol(const HostPortPair& server) override; | 123 void SetBrokenAlternateProtocol( |
| 124 const HostPortPair& server, |
| 125 const AlternateProtocolInfo& broken_alternate_protocol) override; |
121 | 126 |
122 // Returns true if Alternate-Protocol for |server| was recently BROKEN. | 127 // Returns true if given Alternate-Protocol for |server| was recently broken. |
123 bool WasAlternateProtocolRecentlyBroken(const HostPortPair& server) override; | 128 bool WasAlternateProtocolRecentlyBroken( |
| 129 const HostPortPair& server, |
| 130 const AlternateProtocolInfo& alternate_protocol) override; |
124 | 131 |
125 // Confirms that Alternate-Protocol for |server| is working. | 132 // Confirms that given Alternate-Protocol for |server| is working. |
126 void ConfirmAlternateProtocol(const HostPortPair& server) override; | 133 void ConfirmAlternateProtocol( |
| 134 const HostPortPair& server, |
| 135 const AlternateProtocolInfo& alternate_protocol) override; |
127 | 136 |
128 // Clears the Alternate-Protocol for |server|. | 137 // Clears all Alternate-Protocols for |server|. |
129 void ClearAlternateProtocol(const HostPortPair& server) override; | 138 void ClearAlternateProtocol(const HostPortPair& server) override; |
130 | 139 |
| 140 // Clears all Alternate-Protocols that are not broken for |server|. |
| 141 void ClearNonBrokenAlternateProtocols(const HostPortPair& server) override; |
| 142 |
| 143 // Removes an Alternate-Protocol for |server|. |
| 144 void RemoveAlternateProtocol( |
| 145 const HostPortPair& server, |
| 146 const AlternateProtocolInfo& alternate_protocol) override; |
| 147 |
131 // Returns all Alternate-Protocol mappings. | 148 // Returns all Alternate-Protocol mappings. |
132 const AlternateProtocolMap& alternate_protocol_map() const override; | 149 const AlternateProtocolMap& alternate_protocol_map() const override; |
133 | 150 |
134 void SetAlternateProtocolProbabilityThreshold(double threshold) override; | 151 void SetAlternateProtocolProbabilityThreshold(double threshold) override; |
135 | 152 |
136 // Gets a reference to the SettingsMap stored for a host. | 153 // Gets a reference to the SettingsMap stored for a host. |
137 // If no settings are stored, returns an empty SettingsMap. | 154 // If no settings are stored, returns an empty SettingsMap. |
138 const SettingsMap& GetSpdySettings( | 155 const SettingsMap& GetSpdySettings( |
139 const HostPortPair& host_port_pair) override; | 156 const HostPortPair& host_port_pair) override; |
140 | 157 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 // Used to get |weak_ptr_| to self on the network thread. | 287 // Used to get |weak_ptr_| to self on the network thread. |
271 scoped_ptr<base::WeakPtrFactory<HttpServerPropertiesManager> > | 288 scoped_ptr<base::WeakPtrFactory<HttpServerPropertiesManager> > |
272 network_weak_ptr_factory_; | 289 network_weak_ptr_factory_; |
273 | 290 |
274 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesManager); | 291 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesManager); |
275 }; | 292 }; |
276 | 293 |
277 } // namespace net | 294 } // namespace net |
278 | 295 |
279 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_MANAGER_H_ | 296 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_MANAGER_H_ |
OLD | NEW |