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

Unified Diff: chrome/browser/chromeos/system/automatic_reboot_manager.cc

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 3 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: chrome/browser/chromeos/system/automatic_reboot_manager.cc
diff --git a/chrome/browser/chromeos/system/automatic_reboot_manager.cc b/chrome/browser/chromeos/system/automatic_reboot_manager.cc
index a15e3a733755cbafa610020362c5466d4ee65e39..050b767edea3d551e27e021654b329a0f8487f01 100644
--- a/chrome/browser/chromeos/system/automatic_reboot_manager.cc
+++ b/chrome/browser/chromeos/system/automatic_reboot_manager.cc
@@ -178,8 +178,7 @@ AutomaticRebootManager::AutomaticRebootManager(
ui::UserActivityDetector::Get()->AddObserver(this);
notification_registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_CHANGED,
content::NotificationService::AllSources());
- login_screen_idle_timer_.reset(
- new base::OneShotTimer<AutomaticRebootManager>);
+ login_screen_idle_timer_.reset(new base::OneShotTimer);
OnUserActivity(NULL);
}
@@ -252,8 +251,7 @@ void AutomaticRebootManager::OnUserActivity(const ui::Event* event) {
// Destroying and re-creating the timer ensures that Start() posts a fresh
// task with a delay of exactly |kLoginManagerIdleTimeoutMs|, ensuring that
// the timer fires predictably in tests.
- login_screen_idle_timer_.reset(
- new base::OneShotTimer<AutomaticRebootManager>);
+ login_screen_idle_timer_.reset(new base::OneShotTimer);
login_screen_idle_timer_->Start(
FROM_HERE,
base::TimeDelta::FromMilliseconds(kLoginManagerIdleTimeoutMs),
@@ -363,7 +361,7 @@ void AutomaticRebootManager::Reschedule() {
// Set up a timer for the start of the grace period. If the grace period
// started in the past, the timer is still used with its delay set to zero.
if (!grace_start_timer_)
- grace_start_timer_.reset(new base::OneShotTimer<AutomaticRebootManager>);
+ grace_start_timer_.reset(new base::OneShotTimer);
grace_start_timer_->Start(FROM_HERE,
std::max(grace_start_time - now, kZeroTimeDelta),
base::Bind(&AutomaticRebootManager::RequestReboot,
@@ -374,7 +372,7 @@ void AutomaticRebootManager::Reschedule() {
// Set up a timer for the end of the grace period. If the grace period ended
// in the past, the timer is still used with its delay set to zero.
if (!grace_end_timer_)
- grace_end_timer_.reset(new base::OneShotTimer<AutomaticRebootManager>);
+ grace_end_timer_.reset(new base::OneShotTimer);
grace_end_timer_->Start(FROM_HERE,
std::max(grace_end_time - now, kZeroTimeDelta),
base::Bind(&AutomaticRebootManager::Reboot,

Powered by Google App Engine
This is Rietveld 408576698