| 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 CHROME_BROWSER_NET_HTTP_SERVER_PROPERTIES_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_NET_HTTP_SERVER_PROPERTIES_MANAGER_H_ |
| 6 #define CHROME_BROWSER_NET_HTTP_SERVER_PROPERTIES_MANAGER_H_ | 6 #define CHROME_BROWSER_NET_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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 virtual void ConfirmAlternateProtocol( | 122 virtual void ConfirmAlternateProtocol( |
| 123 const net::HostPortPair& server) OVERRIDE; | 123 const net::HostPortPair& server) OVERRIDE; |
| 124 | 124 |
| 125 // Clears the Alternate-Protocol for |server|. | 125 // Clears the Alternate-Protocol for |server|. |
| 126 virtual void ClearAlternateProtocol(const net::HostPortPair& server) OVERRIDE; | 126 virtual void ClearAlternateProtocol(const net::HostPortPair& server) OVERRIDE; |
| 127 | 127 |
| 128 // Returns all Alternate-Protocol mappings. | 128 // Returns all Alternate-Protocol mappings. |
| 129 virtual const net::AlternateProtocolMap& | 129 virtual const net::AlternateProtocolMap& |
| 130 alternate_protocol_map() const OVERRIDE; | 130 alternate_protocol_map() const OVERRIDE; |
| 131 | 131 |
| 132 virtual void SetAlternateProtocolExperiment( |
| 133 net::AlternateProtocolExperiment experiment) OVERRIDE; |
| 134 |
| 135 virtual net::AlternateProtocolExperiment GetAlternateProtocolExperiment() |
| 136 const OVERRIDE; |
| 137 |
| 132 // Gets a reference to the SettingsMap stored for a host. | 138 // Gets a reference to the SettingsMap stored for a host. |
| 133 // If no settings are stored, returns an empty SettingsMap. | 139 // If no settings are stored, returns an empty SettingsMap. |
| 134 virtual const net::SettingsMap& GetSpdySettings( | 140 virtual const net::SettingsMap& GetSpdySettings( |
| 135 const net::HostPortPair& host_port_pair) OVERRIDE; | 141 const net::HostPortPair& host_port_pair) OVERRIDE; |
| 136 | 142 |
| 137 // Saves an individual SPDY setting for a host. Returns true if SPDY setting | 143 // Saves an individual SPDY setting for a host. Returns true if SPDY setting |
| 138 // is to be persisted. | 144 // is to be persisted. |
| 139 virtual bool SetSpdySetting(const net::HostPortPair& host_port_pair, | 145 virtual bool SetSpdySetting(const net::HostPortPair& host_port_pair, |
| 140 net::SpdySettingsIds id, | 146 net::SpdySettingsIds id, |
| 141 net::SpdySettingsFlags flags, | 147 net::SpdySettingsFlags flags, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 // UpdateSpdyServersFromPrefsOnIO() to perform the update on IO thread. | 192 // UpdateSpdyServersFromPrefsOnIO() to perform the update on IO thread. |
| 187 virtual void UpdateCacheFromPrefsOnUI(); | 193 virtual void UpdateCacheFromPrefsOnUI(); |
| 188 | 194 |
| 189 // Starts the update of cached prefs in |http_server_properties_impl_| on the | 195 // Starts the update of cached prefs in |http_server_properties_impl_| on the |
| 190 // IO thread. Protected for testing. | 196 // IO thread. Protected for testing. |
| 191 void UpdateCacheFromPrefsOnIO( | 197 void UpdateCacheFromPrefsOnIO( |
| 192 std::vector<std::string>* spdy_servers, | 198 std::vector<std::string>* spdy_servers, |
| 193 net::SpdySettingsMap* spdy_settings_map, | 199 net::SpdySettingsMap* spdy_settings_map, |
| 194 net::AlternateProtocolMap* alternate_protocol_map, | 200 net::AlternateProtocolMap* alternate_protocol_map, |
| 195 net::PipelineCapabilityMap* pipeline_capability_map, | 201 net::PipelineCapabilityMap* pipeline_capability_map, |
| 202 net::AlternateProtocolExperiment alternate_protocol_experiment, |
| 196 bool detected_corrupted_prefs); | 203 bool detected_corrupted_prefs); |
| 197 | 204 |
| 198 // These are used to delay updating the preferences when cached data in | 205 // These are used to delay updating the preferences when cached data in |
| 199 // |http_server_properties_impl_| is changing, and execute only one update per | 206 // |http_server_properties_impl_| is changing, and execute only one update per |
| 200 // simultaneous spdy_servers or spdy_settings or alternate_protocol changes. | 207 // simultaneous spdy_servers or spdy_settings or alternate_protocol changes. |
| 201 void ScheduleUpdatePrefsOnIO(); | 208 void ScheduleUpdatePrefsOnIO(); |
| 202 | 209 |
| 203 // Starts the timers to update the prefs from cache. This are overridden in | 210 // Starts the timers to update the prefs from cache. This are overridden in |
| 204 // tests to prevent the delay. | 211 // tests to prevent the delay. |
| 205 virtual void StartPrefsUpdateTimerOnIO(base::TimeDelta delay); | 212 virtual void StartPrefsUpdateTimerOnIO(base::TimeDelta delay); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 io_prefs_update_timer_; | 264 io_prefs_update_timer_; |
| 258 | 265 |
| 259 scoped_ptr<net::HttpServerPropertiesImpl> http_server_properties_impl_; | 266 scoped_ptr<net::HttpServerPropertiesImpl> http_server_properties_impl_; |
| 260 | 267 |
| 261 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesManager); | 268 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesManager); |
| 262 }; | 269 }; |
| 263 | 270 |
| 264 } // namespace chrome_browser_net | 271 } // namespace chrome_browser_net |
| 265 | 272 |
| 266 #endif // CHROME_BROWSER_NET_HTTP_SERVER_PROPERTIES_MANAGER_H_ | 273 #endif // CHROME_BROWSER_NET_HTTP_SERVER_PROPERTIES_MANAGER_H_ |
| OLD | NEW |