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 1a1ab79c48648509c3619fdd757476d62cb5a86c..9d3a0f7b4c1a5b746490c813804cc8b6594a2127 100644 |
--- a/net/http/http_server_properties_manager.cc |
+++ b/net/http/http_server_properties_manager.cc |
@@ -338,8 +338,16 @@ void HttpServerPropertiesManager::SetServerNetworkStats( |
const HostPortPair& host_port_pair, |
ServerNetworkStats stats) { |
DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); |
+ ServerNetworkStats old_stats; |
+ const ServerNetworkStats* old_stats_ptr = |
+ http_server_properties_impl_->GetServerNetworkStats(host_port_pair); |
+ if (http_server_properties_impl_->GetServerNetworkStats(host_port_pair)) |
+ old_stats = *old_stats_ptr; |
http_server_properties_impl_->SetServerNetworkStats(host_port_pair, stats); |
- ScheduleUpdatePrefsOnNetworkThread(SET_SERVER_NETWORK_STATS); |
+ ServerNetworkStats new_stats = |
+ *(http_server_properties_impl_->GetServerNetworkStats(host_port_pair)); |
+ if (old_stats != new_stats) |
+ ScheduleUpdatePrefsOnNetworkThread(SET_SERVER_NETWORK_STATS); |
} |
const ServerNetworkStats* HttpServerPropertiesManager::GetServerNetworkStats( |