Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(490)

Side by Side Diff: net/http/http_server_properties_manager.cc

Issue 1017453008: Make GetAlternateProtocol return AlternativeService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/server/origin/g in other methods too. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "net/http/http_server_properties_manager.h" 5 #include "net/http/http_server_properties_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 http_server_properties_impl_->SetHTTP11Required(server); 173 http_server_properties_impl_->SetHTTP11Required(server);
174 ScheduleUpdatePrefsOnNetworkThread(); 174 ScheduleUpdatePrefsOnNetworkThread();
175 } 175 }
176 176
177 void HttpServerPropertiesManager::MaybeForceHTTP11(const HostPortPair& server, 177 void HttpServerPropertiesManager::MaybeForceHTTP11(const HostPortPair& server,
178 SSLConfig* ssl_config) { 178 SSLConfig* ssl_config) {
179 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 179 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
180 http_server_properties_impl_->MaybeForceHTTP11(server, ssl_config); 180 http_server_properties_impl_->MaybeForceHTTP11(server, ssl_config);
181 } 181 }
182 182
183 AlternateProtocolInfo HttpServerPropertiesManager::GetAlternateProtocol( 183 AlternativeService HttpServerPropertiesManager::GetAlternativeService(
184 const HostPortPair& server) { 184 const HostPortPair& origin) {
185 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 185 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
186 return http_server_properties_impl_->GetAlternateProtocol(server); 186 return http_server_properties_impl_->GetAlternativeService(origin);
187 } 187 }
188 188
189 void HttpServerPropertiesManager::SetAlternateProtocol( 189 void HttpServerPropertiesManager::SetAlternateProtocol(
190 const HostPortPair& server, 190 const HostPortPair& origin,
191 uint16 alternate_port, 191 uint16 alternate_port,
192 AlternateProtocol alternate_protocol, 192 AlternateProtocol alternate_protocol,
193 double alternate_probability) { 193 double alternate_probability) {
194 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 194 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
195 http_server_properties_impl_->SetAlternateProtocol( 195 http_server_properties_impl_->SetAlternateProtocol(
196 server, alternate_port, alternate_protocol, alternate_probability); 196 origin, alternate_port, alternate_protocol, alternate_probability);
197 ScheduleUpdatePrefsOnNetworkThread(); 197 ScheduleUpdatePrefsOnNetworkThread();
198 } 198 }
199 199
200 void HttpServerPropertiesManager::SetBrokenAlternateProtocol( 200 void HttpServerPropertiesManager::SetBrokenAlternateProtocol(
201 const HostPortPair& server) { 201 const HostPortPair& origin) {
202 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 202 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
203 http_server_properties_impl_->SetBrokenAlternateProtocol(server); 203 http_server_properties_impl_->SetBrokenAlternateProtocol(origin);
204 ScheduleUpdatePrefsOnNetworkThread(); 204 ScheduleUpdatePrefsOnNetworkThread();
205 } 205 }
206 206
207 void HttpServerPropertiesManager::MarkAlternativeServiceRecentlyBroken( 207 void HttpServerPropertiesManager::MarkAlternativeServiceRecentlyBroken(
208 const AlternativeService& alternative_service) { 208 const AlternativeService& alternative_service) {
209 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 209 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
210 http_server_properties_impl_->MarkAlternativeServiceRecentlyBroken( 210 http_server_properties_impl_->MarkAlternativeServiceRecentlyBroken(
211 alternative_service); 211 alternative_service);
212 ScheduleUpdatePrefsOnNetworkThread(); 212 ScheduleUpdatePrefsOnNetworkThread();
213 } 213 }
214 214
215 bool HttpServerPropertiesManager::IsAlternativeServiceBroken( 215 bool HttpServerPropertiesManager::IsAlternativeServiceBroken(
216 const AlternativeService& alternative_service) { 216 const AlternativeService& alternative_service) {
217 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 217 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
218 return http_server_properties_impl_->IsAlternativeServiceBroken( 218 return http_server_properties_impl_->IsAlternativeServiceBroken(
219 alternative_service); 219 alternative_service);
220 } 220 }
221 221
222 bool HttpServerPropertiesManager::WasAlternateProtocolRecentlyBroken( 222 bool HttpServerPropertiesManager::WasAlternateProtocolRecentlyBroken(
223 const HostPortPair& server) { 223 const HostPortPair& origin) {
224 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 224 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
225 return http_server_properties_impl_->WasAlternateProtocolRecentlyBroken( 225 return http_server_properties_impl_->WasAlternateProtocolRecentlyBroken(
226 server); 226 origin);
227 } 227 }
228 228
229 void HttpServerPropertiesManager::ConfirmAlternateProtocol( 229 void HttpServerPropertiesManager::ConfirmAlternateProtocol(
230 const HostPortPair& server) { 230 const HostPortPair& origin) {
231 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 231 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
232 http_server_properties_impl_->ConfirmAlternateProtocol(server); 232 http_server_properties_impl_->ConfirmAlternateProtocol(origin);
233 ScheduleUpdatePrefsOnNetworkThread(); 233 ScheduleUpdatePrefsOnNetworkThread();
234 } 234 }
235 235
236 void HttpServerPropertiesManager::ClearAlternateProtocol( 236 void HttpServerPropertiesManager::ClearAlternateProtocol(
237 const HostPortPair& server) { 237 const HostPortPair& origin) {
238 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 238 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
239 http_server_properties_impl_->ClearAlternateProtocol(server); 239 http_server_properties_impl_->ClearAlternateProtocol(origin);
240 ScheduleUpdatePrefsOnNetworkThread(); 240 ScheduleUpdatePrefsOnNetworkThread();
241 } 241 }
242 242
243 const AlternateProtocolMap& 243 const AlternateProtocolMap&
244 HttpServerPropertiesManager::alternate_protocol_map() const { 244 HttpServerPropertiesManager::alternate_protocol_map() const {
245 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 245 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
246 return http_server_properties_impl_->alternate_protocol_map(); 246 return http_server_properties_impl_->alternate_protocol_map();
247 } 247 }
248 248
249 void HttpServerPropertiesManager::SetAlternateProtocolProbabilityThreshold( 249 void HttpServerPropertiesManager::SetAlternateProtocolProbabilityThreshold(
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 server_network_stats_dict); 889 server_network_stats_dict);
890 } 890 }
891 891
892 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { 892 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() {
893 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread()); 893 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread());
894 if (!setting_prefs_) 894 if (!setting_prefs_)
895 ScheduleUpdateCacheOnPrefThread(); 895 ScheduleUpdateCacheOnPrefThread();
896 } 896 }
897 897
898 } // namespace net 898 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_server_properties_manager.h ('k') | net/http/http_server_properties_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698