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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 base::WeakPtr<HttpServerProperties> GetWeakPtr() override; | 81 base::WeakPtr<HttpServerProperties> GetWeakPtr() override; |
82 void Clear() override; | 82 void Clear() override; |
83 bool SupportsRequestPriority(const HostPortPair& server) override; | 83 bool SupportsRequestPriority(const HostPortPair& server) override; |
84 bool GetSupportsSpdy(const HostPortPair& server) override; | 84 bool GetSupportsSpdy(const HostPortPair& server) override; |
85 void SetSupportsSpdy(const HostPortPair& server, bool support_spdy) override; | 85 void SetSupportsSpdy(const HostPortPair& server, bool support_spdy) override; |
86 bool RequiresHTTP11(const HostPortPair& server) override; | 86 bool RequiresHTTP11(const HostPortPair& server) override; |
87 void SetHTTP11Required(const HostPortPair& server) override; | 87 void SetHTTP11Required(const HostPortPair& server) override; |
88 void MaybeForceHTTP11(const HostPortPair& server, | 88 void MaybeForceHTTP11(const HostPortPair& server, |
89 SSLConfig* ssl_config) override; | 89 SSLConfig* ssl_config) override; |
90 AlternativeService GetAlternativeService(const HostPortPair& origin) override; | 90 AlternativeServiceVector GetAlternativeServices( |
91 void SetAlternativeService(const HostPortPair& origin, | 91 const HostPortPair& origin) override; |
| 92 bool SetAlternativeService(const HostPortPair& origin, |
92 const AlternativeService& alternative_service, | 93 const AlternativeService& alternative_service, |
93 double alternative_probability) override; | 94 double alternative_probability) override; |
| 95 bool SetAlternativeServices(const HostPortPair& origin, |
| 96 const AlternativeServiceInfoVector& |
| 97 alternative_service_info_vector) override; |
94 void MarkAlternativeServiceBroken( | 98 void MarkAlternativeServiceBroken( |
95 const AlternativeService& alternative_service) override; | 99 const AlternativeService& alternative_service) override; |
96 void MarkAlternativeServiceRecentlyBroken( | 100 void MarkAlternativeServiceRecentlyBroken( |
97 const AlternativeService& alternative_service) override; | 101 const AlternativeService& alternative_service) override; |
98 bool IsAlternativeServiceBroken( | 102 bool IsAlternativeServiceBroken( |
99 const AlternativeService& alternative_service) const override; | 103 const AlternativeService& alternative_service) const override; |
100 bool WasAlternativeServiceRecentlyBroken( | 104 bool WasAlternativeServiceRecentlyBroken( |
101 const AlternativeService& alternative_service) override; | 105 const AlternativeService& alternative_service) override; |
102 void ConfirmAlternativeService( | 106 void ConfirmAlternativeService( |
103 const AlternativeService& alternative_service) override; | 107 const AlternativeService& alternative_service) override; |
104 void ClearAlternativeService(const HostPortPair& origin) override; | 108 void ClearAlternativeServices(const HostPortPair& origin) override; |
105 const AlternativeServiceMap& alternative_service_map() const override; | 109 const AlternativeServiceMap& alternative_service_map() const override; |
106 scoped_ptr<base::Value> GetAlternativeServiceInfoAsValue() const override; | 110 scoped_ptr<base::Value> GetAlternativeServiceInfoAsValue() const override; |
107 void SetAlternativeServiceProbabilityThreshold(double threshold) override; | 111 void SetAlternativeServiceProbabilityThreshold(double threshold) override; |
108 const SettingsMap& GetSpdySettings( | 112 const SettingsMap& GetSpdySettings( |
109 const HostPortPair& host_port_pair) override; | 113 const HostPortPair& host_port_pair) override; |
110 bool SetSpdySetting(const HostPortPair& host_port_pair, | 114 bool SetSpdySetting(const HostPortPair& host_port_pair, |
111 SpdySettingsIds id, | 115 SpdySettingsIds id, |
112 SpdySettingsFlags flags, | 116 SpdySettingsFlags flags, |
113 uint32 value) override; | 117 uint32 value) override; |
114 void ClearSpdySettings(const HostPortPair& host_port_pair) override; | 118 void ClearSpdySettings(const HostPortPair& host_port_pair) override; |
115 void ClearAllSpdySettings() override; | 119 void ClearAllSpdySettings() override; |
116 const SpdySettingsMap& spdy_settings_map() const override; | 120 const SpdySettingsMap& spdy_settings_map() const override; |
117 bool GetSupportsQuic(IPAddressNumber* last_address) const override; | 121 bool GetSupportsQuic(IPAddressNumber* last_address) const override; |
118 void SetSupportsQuic(bool used_quic, | 122 void SetSupportsQuic(bool used_quic, |
119 const IPAddressNumber& last_address) override; | 123 const IPAddressNumber& last_address) override; |
120 void SetServerNetworkStats(const HostPortPair& host_port_pair, | 124 void SetServerNetworkStats(const HostPortPair& host_port_pair, |
121 ServerNetworkStats stats) override; | 125 ServerNetworkStats stats) override; |
122 const ServerNetworkStats* GetServerNetworkStats( | 126 const ServerNetworkStats* GetServerNetworkStats( |
123 const HostPortPair& host_port_pair) override; | 127 const HostPortPair& host_port_pair) override; |
124 const ServerNetworkStatsMap& server_network_stats_map() const override; | 128 const ServerNetworkStatsMap& server_network_stats_map() const override; |
125 | 129 |
126 protected: | 130 protected: |
127 // The location where ScheduleUpdatePrefsOnNetworkThread was called. | 131 // The location where ScheduleUpdatePrefsOnNetworkThread was called. |
128 enum Location { | 132 enum Location { |
129 SUPPORTS_SPDY = 0, | 133 SUPPORTS_SPDY = 0, |
130 HTTP_11_REQUIRED = 1, | 134 HTTP_11_REQUIRED = 1, |
131 SET_ALTERNATIVE_SERVICE = 2, | 135 SET_ALTERNATIVE_SERVICES = 2, |
132 MARK_ALTERNATIVE_SERVICE_BROKEN = 3, | 136 MARK_ALTERNATIVE_SERVICE_BROKEN = 3, |
133 MARK_ALTERNATIVE_SERVICE_RECENTLY_BROKEN = 4, | 137 MARK_ALTERNATIVE_SERVICE_RECENTLY_BROKEN = 4, |
134 CONFIRM_ALTERNATIVE_SERVICE = 5, | 138 CONFIRM_ALTERNATIVE_SERVICE = 5, |
135 CLEAR_ALTERNATIVE_SERVICE = 6, | 139 CLEAR_ALTERNATIVE_SERVICE = 6, |
136 SET_SPDY_SETTING = 7, | 140 SET_SPDY_SETTING = 7, |
137 CLEAR_SPDY_SETTINGS = 8, | 141 CLEAR_SPDY_SETTINGS = 8, |
138 CLEAR_ALL_SPDY_SETTINGS = 9, | 142 CLEAR_ALL_SPDY_SETTINGS = 9, |
139 SET_SUPPORTS_QUIC = 10, | 143 SET_SUPPORTS_QUIC = 10, |
140 SET_SERVER_NETWORK_STATS = 11, | 144 SET_SERVER_NETWORK_STATS = 11, |
141 DETECTED_CORRUPTED_PREFS = 12, | 145 DETECTED_CORRUPTED_PREFS = 12, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 const HostPortPair& server, | 219 const HostPortPair& server, |
216 const base::DictionaryValue& server_dict, | 220 const base::DictionaryValue& server_dict, |
217 AlternativeServiceMap* alternative_service_map); | 221 AlternativeServiceMap* alternative_service_map); |
218 bool AddToNetworkStatsMap(const HostPortPair& server, | 222 bool AddToNetworkStatsMap(const HostPortPair& server, |
219 const base::DictionaryValue& server_dict, | 223 const base::DictionaryValue& server_dict, |
220 ServerNetworkStatsMap* network_stats_map); | 224 ServerNetworkStatsMap* network_stats_map); |
221 | 225 |
222 void SaveSpdySettingsToServerPrefs(const SettingsMap* spdy_settings_map, | 226 void SaveSpdySettingsToServerPrefs(const SettingsMap* spdy_settings_map, |
223 base::DictionaryValue* server_pref_dict); | 227 base::DictionaryValue* server_pref_dict); |
224 void SaveAlternativeServiceToServerPrefs( | 228 void SaveAlternativeServiceToServerPrefs( |
225 const AlternativeServiceInfo* alternative_service_info, | 229 const AlternativeServiceInfoVector* alternative_service_info_vector, |
226 base::DictionaryValue* server_pref_dict); | 230 base::DictionaryValue* server_pref_dict); |
227 void SaveNetworkStatsToServerPrefs( | 231 void SaveNetworkStatsToServerPrefs( |
228 const ServerNetworkStats* server_network_stats, | 232 const ServerNetworkStats* server_network_stats, |
229 base::DictionaryValue* server_pref_dict); | 233 base::DictionaryValue* server_pref_dict); |
230 | 234 |
231 void SaveSupportsQuicToPrefs( | 235 void SaveSupportsQuicToPrefs( |
232 const IPAddressNumber* last_quic_address, | 236 const IPAddressNumber* last_quic_address, |
233 base::DictionaryValue* http_server_properties_dict); | 237 base::DictionaryValue* http_server_properties_dict); |
234 | 238 |
235 // ----------- | 239 // ----------- |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 // Used to get |weak_ptr_| to self on the network thread. | 273 // Used to get |weak_ptr_| to self on the network thread. |
270 scoped_ptr<base::WeakPtrFactory<HttpServerPropertiesManager> > | 274 scoped_ptr<base::WeakPtrFactory<HttpServerPropertiesManager> > |
271 network_weak_ptr_factory_; | 275 network_weak_ptr_factory_; |
272 | 276 |
273 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesManager); | 277 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesManager); |
274 }; | 278 }; |
275 | 279 |
276 } // namespace net | 280 } // namespace net |
277 | 281 |
278 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_MANAGER_H_ | 282 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_MANAGER_H_ |
OLD | NEW |