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

Unified Diff: net/http/http_server_properties_manager.cc

Issue 2554723003: Always persist data to disk after 60s from the receiving update request. (Closed)
Patch Set: rebase with upstream committed Created 4 years 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 9653e9269ba1d72827d8ecd4c1191ae66a1f7cfd..e8fac4a0438f38609738b2bfbff39aafa051e638 100644
--- a/net/http/http_server_properties_manager.cc
+++ b/net/http/http_server_properties_manager.cc
@@ -781,8 +781,10 @@ void HttpServerPropertiesManager::UpdateCacheFromPrefsOnNetworkThread(
void HttpServerPropertiesManager::ScheduleUpdatePrefsOnNetworkThread(
Location location) {
DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
- // Cancel pending updates, if any.
- network_prefs_update_timer_->Stop();
+ // Do not schedule a new update if there is already one scheduled.
+ if (network_prefs_update_timer_->IsRunning())
+ return;
+
StartPrefsUpdateTimerOnNetworkThread(
base::TimeDelta::FromMilliseconds(kUpdatePrefsDelayMs));
// TODO(rtenneti): Delete the following histogram after collecting some data.
« 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