| 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 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // thread. | 87 // thread. |
| 88 bool SupportsSpdy(const HostPortPair& server) override; | 88 bool SupportsSpdy(const HostPortPair& server) override; |
| 89 | 89 |
| 90 // Add |server| as the SPDY server which supports SPDY protocol into the | 90 // Add |server| as the SPDY server which supports SPDY protocol into the |
| 91 // persisitent store. Should only be called from IO thread. | 91 // persisitent store. Should only be called from IO thread. |
| 92 void SetSupportsSpdy(const HostPortPair& server, bool support_spdy) override; | 92 void SetSupportsSpdy(const HostPortPair& server, bool support_spdy) override; |
| 93 | 93 |
| 94 // Returns true if |server| has an Alternate-Protocol header. | 94 // Returns true if |server| has an Alternate-Protocol header. |
| 95 bool HasAlternateProtocol(const HostPortPair& server) override; | 95 bool HasAlternateProtocol(const HostPortPair& server) override; |
| 96 | 96 |
| 97 // Returns the Alternate-Protocol and port for |server|. | 97 // Returns the Alternate-Protocols for |server|. |
| 98 // HasAlternateProtocol(server) must be true. | 98 // HasAlternateProtocol(server) must be true. |
| 99 AlternateProtocolInfo GetAlternateProtocol( | 99 AlternateProtocols GetAlternateProtocol(const HostPortPair& server) override; |
| 100 const HostPortPair& server) override; | |
| 101 | 100 |
| 102 // Sets the Alternate-Protocol for |server|. | 101 // Adds an Alternate-Protocol for |server|. |
| 103 void SetAlternateProtocol(const HostPortPair& server, | 102 void AddAlternateProtocol(const HostPortPair& server, |
| 104 uint16 alternate_port, | 103 uint16 alternate_port, |
| 105 AlternateProtocol alternate_protocol, | 104 AlternateProtocol alternate_protocol, |
| 106 double alternate_probability) override; | 105 double alternate_probability) override; |
| 107 | 106 |
| 108 // Sets the Alternate-Protocol for |server| to be BROKEN. | 107 // Sets a given Alternate-Protocol for |server| to be BROKEN. |
| 109 void SetBrokenAlternateProtocol(const HostPortPair& server) override; | 108 void SetBrokenAlternateProtocol( |
| 109 const HostPortPair& server, |
| 110 const AlternateProtocolInfo& broken_alternate_protocol) override; |
| 110 | 111 |
| 111 // Returns true if Alternate-Protocol for |server| was recently BROKEN. | 112 // Returns true if given Alternate-Protocol for |server| was recently BROKEN. |
| 112 bool WasAlternateProtocolRecentlyBroken(const HostPortPair& server) override; | 113 bool WasAlternateProtocolRecentlyBroken( |
| 114 const HostPortPair& server, |
| 115 const AlternateProtocolInfo& alternate_protocol) override; |
| 113 | 116 |
| 114 // Confirms that Alternate-Protocol for |server| is working. | 117 // Confirms that given Alternate-Protocol for |server| is working. |
| 115 void ConfirmAlternateProtocol(const HostPortPair& server) override; | 118 void ConfirmAlternateProtocol( |
| 119 const HostPortPair& server, |
| 120 const AlternateProtocolInfo& alternate_protocol) override; |
| 116 | 121 |
| 117 // Clears the Alternate-Protocol for |server|. | 122 // Clears all Alternate-Protocols for |server|. |
| 118 void ClearAlternateProtocol(const HostPortPair& server) override; | 123 void ClearAlternateProtocol(const HostPortPair& server) override; |
| 119 | 124 |
| 125 // Removes an Alternate-Protocol for |server|. |
| 126 void RemoveAlternateProtocol( |
| 127 const HostPortPair& server, |
| 128 const AlternateProtocolInfo& alternate_protocol) override; |
| 129 |
| 120 // Returns all Alternate-Protocol mappings. | 130 // Returns all Alternate-Protocol mappings. |
| 121 const AlternateProtocolMap& alternate_protocol_map() const override; | 131 const AlternateProtocolMap& alternate_protocol_map() const override; |
| 122 | 132 |
| 123 void SetAlternateProtocolProbabilityThreshold(double threshold) override; | 133 void SetAlternateProtocolProbabilityThreshold(double threshold) override; |
| 124 | 134 |
| 125 // Gets a reference to the SettingsMap stored for a host. | 135 // Gets a reference to the SettingsMap stored for a host. |
| 126 // If no settings are stored, returns an empty SettingsMap. | 136 // If no settings are stored, returns an empty SettingsMap. |
| 127 const SettingsMap& GetSpdySettings( | 137 const SettingsMap& GetSpdySettings( |
| 128 const HostPortPair& host_port_pair) override; | 138 const HostPortPair& host_port_pair) override; |
| 129 | 139 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 // Used to get |weak_ptr_| to self on the network thread. | 265 // Used to get |weak_ptr_| to self on the network thread. |
| 256 scoped_ptr<base::WeakPtrFactory<HttpServerPropertiesManager> > | 266 scoped_ptr<base::WeakPtrFactory<HttpServerPropertiesManager> > |
| 257 network_weak_ptr_factory_; | 267 network_weak_ptr_factory_; |
| 258 | 268 |
| 259 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesManager); | 269 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesManager); |
| 260 }; | 270 }; |
| 261 | 271 |
| 262 } // namespace net | 272 } // namespace net |
| 263 | 273 |
| 264 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_MANAGER_H_ | 274 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_MANAGER_H_ |
| OLD | NEW |