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& |