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

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

Issue 1159853005: HttpServerProperties - Don't persist if SetSupportsSpdy is called with (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@persist_SET_SERVER_NETWORK_STATS
Patch Set: Minor cleanup 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
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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 http_server_properties_impl_->Clear(); 148 http_server_properties_impl_->Clear();
149 UpdatePrefsFromCacheOnNetworkThread(completion); 149 UpdatePrefsFromCacheOnNetworkThread(completion);
150 } 150 }
151 151
152 bool HttpServerPropertiesManager::SupportsRequestPriority( 152 bool HttpServerPropertiesManager::SupportsRequestPriority(
153 const HostPortPair& server) { 153 const HostPortPair& server) {
154 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 154 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
155 return http_server_properties_impl_->SupportsRequestPriority(server); 155 return http_server_properties_impl_->SupportsRequestPriority(server);
156 } 156 }
157 157
158 bool HttpServerPropertiesManager::GetSupportsSpdy(const HostPortPair& server) {
159 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
160 return http_server_properties_impl_->GetSupportsSpdy(server);
161 }
162
158 void HttpServerPropertiesManager::SetSupportsSpdy(const HostPortPair& server, 163 void HttpServerPropertiesManager::SetSupportsSpdy(const HostPortPair& server,
159 bool support_spdy) { 164 bool support_spdy) {
160 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 165 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
161 166
167 bool old_support_spdy = http_server_properties_impl_->GetSupportsSpdy(server);
162 http_server_properties_impl_->SetSupportsSpdy(server, support_spdy); 168 http_server_properties_impl_->SetSupportsSpdy(server, support_spdy);
163 ScheduleUpdatePrefsOnNetworkThread(SUPPORTS_SPDY); 169 bool new_support_spdy = http_server_properties_impl_->GetSupportsSpdy(server);
170 if (old_support_spdy != new_support_spdy)
171 ScheduleUpdatePrefsOnNetworkThread(SUPPORTS_SPDY);
164 } 172 }
165 173
166 bool HttpServerPropertiesManager::RequiresHTTP11(const HostPortPair& server) { 174 bool HttpServerPropertiesManager::RequiresHTTP11(const HostPortPair& server) {
167 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 175 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
168 return http_server_properties_impl_->RequiresHTTP11(server); 176 return http_server_properties_impl_->RequiresHTTP11(server);
169 } 177 }
170 178
171 void HttpServerPropertiesManager::SetHTTP11Required( 179 void HttpServerPropertiesManager::SetHTTP11Required(
172 const HostPortPair& server) { 180 const HostPortPair& server) {
173 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); 181 DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
961 server_network_stats_dict); 969 server_network_stats_dict);
962 } 970 }
963 971
964 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { 972 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() {
965 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread()); 973 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread());
966 if (!setting_prefs_) 974 if (!setting_prefs_)
967 ScheduleUpdateCacheOnPrefThread(); 975 ScheduleUpdateCacheOnPrefThread();
968 } 976 }
969 977
970 } // namespace net 978 } // 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