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

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

Issue 1160823007: HttpServerProperties - Don't persist if SetSupportsQuic is called with (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | net/http/http_server_properties_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 319 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 bool HttpServerPropertiesManager::GetSupportsQuic( 330 bool HttpServerPropertiesManager::GetSupportsQuic(
331 IPAddressNumber* last_address) const { 331 IPAddressNumber* last_address) const {
332 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 332 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
333 return http_server_properties_impl_->GetSupportsQuic(last_address); 333 return http_server_properties_impl_->GetSupportsQuic(last_address);
334 } 334 }
335 335
336 void HttpServerPropertiesManager::SetSupportsQuic( 336 void HttpServerPropertiesManager::SetSupportsQuic(
337 bool used_quic, 337 bool used_quic,
338 const IPAddressNumber& address) { 338 const IPAddressNumber& address) {
339 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 339 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
340 IPAddressNumber old_last_quic_addr;
341 http_server_properties_impl_->GetSupportsQuic(&old_last_quic_addr);
340 http_server_properties_impl_->SetSupportsQuic(used_quic, address); 342 http_server_properties_impl_->SetSupportsQuic(used_quic, address);
341 ScheduleUpdatePrefsOnNetworkThread(SET_SUPPORTS_QUIC); 343 IPAddressNumber new_last_quic_addr;
344 http_server_properties_impl_->GetSupportsQuic(&new_last_quic_addr);
345 if (old_last_quic_addr != new_last_quic_addr)
346 ScheduleUpdatePrefsOnNetworkThread(SET_SUPPORTS_QUIC);
342 } 347 }
343 348
344 void HttpServerPropertiesManager::SetServerNetworkStats( 349 void HttpServerPropertiesManager::SetServerNetworkStats(
345 const HostPortPair& host_port_pair, 350 const HostPortPair& host_port_pair,
346 ServerNetworkStats stats) { 351 ServerNetworkStats stats) {
347 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 352 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
348 ServerNetworkStats old_stats; 353 ServerNetworkStats old_stats;
349 const ServerNetworkStats* old_stats_ptr = 354 const ServerNetworkStats* old_stats_ptr =
350 http_server_properties_impl_->GetServerNetworkStats(host_port_pair); 355 http_server_properties_impl_->GetServerNetworkStats(host_port_pair);
351 if (http_server_properties_impl_->GetServerNetworkStats(host_port_pair)) 356 if (http_server_properties_impl_->GetServerNetworkStats(host_port_pair))
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after
986 server_network_stats_dict); 991 server_network_stats_dict);
987 } 992 }
988 993
989 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { 994 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() {
990 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread()); 995 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread());
991 if (!setting_prefs_) 996 if (!setting_prefs_)
992 ScheduleUpdateCacheOnPrefThread(); 997 ScheduleUpdateCacheOnPrefThread();
993 } 998 }
994 999
995 } // namespace net 1000 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/http/http_server_properties_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698