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

Unified Diff: net/http/http_server_properties_manager.cc

Issue 2681383002: HttpServerPropertiesManager and tests cleanup (Closed)
Patch Set: simplify tests Created 3 years, 10 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
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 ff1859f8feb62a8cef2d0cf953641bac298514cb..0f737ff0fcb51c749f539286022601e6800ada01 100644
--- a/net/http/http_server_properties_manager.cc
+++ b/net/http/http_server_properties_manager.cc
@@ -375,17 +375,8 @@ void HttpServerPropertiesManager::ScheduleUpdateCacheOnPrefThread() {
if (pref_cache_update_timer_->IsRunning())
return;
- StartCacheUpdateTimerOnPrefThread(
- base::TimeDelta::FromMilliseconds(kUpdateCacheDelayMs));
-}
-
-void HttpServerPropertiesManager::StartCacheUpdateTimerOnPrefThread(
- base::TimeDelta delay) {
- DCHECK(pref_task_runner_->RunsTasksOnCurrentThread());
pref_cache_update_timer_->Start(
- FROM_HERE,
- delay,
- this,
+ FROM_HERE, base::TimeDelta::FromMilliseconds(kUpdateCacheDelayMs), this,
&HttpServerPropertiesManager::UpdateCacheFromPrefsOnPrefThread);
}
@@ -800,24 +791,15 @@ void HttpServerPropertiesManager::ScheduleUpdatePrefsOnNetworkThread(
if (network_prefs_update_timer_->IsRunning())
return;
- StartPrefsUpdateTimerOnNetworkThread(
- base::TimeDelta::FromMilliseconds(kUpdatePrefsDelayMs));
+ network_prefs_update_timer_->Start(
+ FROM_HERE, base::TimeDelta::FromMilliseconds(kUpdatePrefsDelayMs), this,
+ &HttpServerPropertiesManager::UpdatePrefsFromCacheOnNetworkThread);
+
// TODO(rtenneti): Delete the following histogram after collecting some data.
UMA_HISTOGRAM_ENUMERATION("Net.HttpServerProperties.UpdatePrefs", location,
HttpServerPropertiesManager::NUM_LOCATIONS);
}
-void HttpServerPropertiesManager::StartPrefsUpdateTimerOnNetworkThread(
- base::TimeDelta delay) {
- DCHECK(network_task_runner_->RunsTasksOnCurrentThread());
- // This is overridden in tests to post the task without the delay.
- network_prefs_update_timer_->Start(
- FROM_HERE,
- delay,
- this,
- &HttpServerPropertiesManager::UpdatePrefsFromCacheOnNetworkThread);
-}
-
// This is required so we can set this as the callback for a timer.
void HttpServerPropertiesManager::UpdatePrefsFromCacheOnNetworkThread() {
UpdatePrefsFromCacheOnNetworkThread(base::Closure());

Powered by Google App Engine
This is Rietveld 408576698