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

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

Issue 1018943002: Update HttpServerProperties::*AlternateProtocol* interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 AlternativeService HttpServerPropertiesManager::GetAlternativeService( 183 AlternativeService HttpServerPropertiesManager::GetAlternativeService(
184 const HostPortPair& origin) { 184 const HostPortPair& origin) {
185 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 185 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
186 return http_server_properties_impl_->GetAlternativeService(origin); 186 return http_server_properties_impl_->GetAlternativeService(origin);
187 } 187 }
188 188
189 void HttpServerPropertiesManager::SetAlternateProtocol( 189 void HttpServerPropertiesManager::SetAlternativeService(
190 const HostPortPair& origin, 190 const HostPortPair& origin,
191 uint16 alternate_port, 191 const AlternativeService& alternative_service,
192 AlternateProtocol alternate_protocol, 192 double alternative_probability) {
193 double alternate_probability) {
194 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 193 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
195 http_server_properties_impl_->SetAlternateProtocol( 194 http_server_properties_impl_->SetAlternativeService(
196 origin, alternate_port, alternate_protocol, alternate_probability); 195 origin, alternative_service, alternative_probability);
197 ScheduleUpdatePrefsOnNetworkThread(); 196 ScheduleUpdatePrefsOnNetworkThread();
198 } 197 }
199 198
200 void HttpServerPropertiesManager::SetBrokenAlternateProtocol( 199 void HttpServerPropertiesManager::MarkAlternativeServiceBroken(
201 const HostPortPair& origin) { 200 const AlternativeService& alternative_service) {
202 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 201 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
203 http_server_properties_impl_->SetBrokenAlternateProtocol(origin); 202 http_server_properties_impl_->MarkAlternativeServiceBroken(
203 alternative_service);
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::WasAlternativeServiceRecentlyBroken(
223 const HostPortPair& origin) { 223 const AlternativeService& alternative_service) {
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_->WasAlternativeServiceRecentlyBroken(
226 origin); 226 alternative_service);
227 } 227 }
228 228
229 void HttpServerPropertiesManager::ConfirmAlternateProtocol( 229 void HttpServerPropertiesManager::ConfirmAlternativeService(
230 const HostPortPair& origin) { 230 const AlternativeService& alternative_service) {
231 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 231 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
232 http_server_properties_impl_->ConfirmAlternateProtocol(origin); 232 http_server_properties_impl_->ConfirmAlternativeService(alternative_service);
233 ScheduleUpdatePrefsOnNetworkThread(); 233 ScheduleUpdatePrefsOnNetworkThread();
234 } 234 }
235 235
236 void HttpServerPropertiesManager::ClearAlternateProtocol( 236 void HttpServerPropertiesManager::ClearAlternativeService(
237 const HostPortPair& origin) { 237 const HostPortPair& origin) {
238 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 238 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
239 http_server_properties_impl_->ClearAlternateProtocol(origin); 239 http_server_properties_impl_->ClearAlternativeService(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

Powered by Google App Engine
This is Rietveld 408576698