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

Unified Diff: net/http/http_server_properties_manager.cc

Issue 1156513004: HttpServerProperties - Don't persist if ClearAlternativeService is (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/http/http_server_properties_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_server_properties_manager.cc
diff --git a/net/http/http_server_properties_manager.cc b/net/http/http_server_properties_manager.cc
index c4d1a1ac7613638c03de1f233446fc08c1ce84c2..cab6a156cfb1d35457396e2b11a1382109cda0fe 100644
--- a/net/http/http_server_properties_manager.cc
+++ b/net/http/http_server_properties_manager.cc
@@ -244,8 +244,14 @@ void HttpServerPropertiesManager::ConfirmAlternativeService(
void HttpServerPropertiesManager::ClearAlternativeService(
const HostPortPair& origin) {
DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
+ const AlternativeServiceMap& map =
+ http_server_properties_impl_->alternative_service_map();
+ size_t old_size = map.size();
http_server_properties_impl_->ClearAlternativeService(origin);
- ScheduleUpdatePrefsOnNetworkThread(CLEAR_ALTERNATIVE_SERVICE);
+ size_t new_size = map.size();
+ // Persist only if we have deleted an entry.
+ if (old_size != new_size)
+ ScheduleUpdatePrefsOnNetworkThread(CLEAR_ALTERNATIVE_SERVICE);
}
const AlternativeServiceMap&
« 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