summaryrefslogtreecommitdiffstats
path: root/base/timer_unittest.cc
diff options
context:
space:
mode:
authordarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-03 18:18:14 +0000
committerdarin@google.com <darin@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-03 18:18:14 +0000
commit2d31666a58e746b7a1d415c99e5f68ad9256d236 (patch)
tree144c99d4b80df0f0f9a3ded83f9d21a8b36f17cc /base/timer_unittest.cc
parent90d6958fe2374a00d3c8583cf4d3b8a509ae8e90 (diff)
downloadchromium_src-2d31666a58e746b7a1d415c99e5f68ad9256d236.zip
chromium_src-2d31666a58e746b7a1d415c99e5f68ad9256d236.tar.gz
chromium_src-2d31666a58e746b7a1d415c99e5f68ad9256d236.tar.bz2
Minor cleanup to OneShotTimer and RepeatingTimer: moves more of the member variables into the Task subclass.
Also included in this change: deprecate MessageLoop::timer_manager(), and change consumers over to use OneShotTimer or RepeatingTimer. R=beng BUG=1346553 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1684 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/timer_unittest.cc')
-rw-r--r--base/timer_unittest.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/base/timer_unittest.cc b/base/timer_unittest.cc
index e4b45ec..6645885 100644
--- a/base/timer_unittest.cc
+++ b/base/timer_unittest.cc
@@ -75,12 +75,13 @@ TimerTask::TimerTask(int delay, bool repeating)
timer_(NULL) {
Reset(); // This will just set up the variables to indicate we have a
// running timer.
- timer_ = message_loop()->timer_manager()->StartTimer(delay, this, repeating);
+ timer_ = message_loop()->timer_manager_deprecated()->StartTimer(
+ delay, this, repeating);
}
TimerTask::~TimerTask() {
if (timer_) {
- message_loop()->timer_manager()->StopTimer(timer_);
+ message_loop()->timer_manager_deprecated()->StopTimer(timer_);
delete timer_;
}
if (timer_running_) {
@@ -97,7 +98,7 @@ void TimerTask::Reset() {
}
if (timer_) {
start_ticks_ = TimeTicks::Now();
- message_loop()->timer_manager()->ResetTimer(timer_);
+ message_loop()->timer_manager_deprecated()->ResetTimer(timer_);
}
}
@@ -116,7 +117,7 @@ void TimerTask::Run() {
// If we're done running, shut down the message loop.
if (timer_->repeating() && (iterations_ < 10))
return; // Iterate 10 times before terminating.
- message_loop()->timer_manager()->StopTimer(timer_);
+ message_loop()->timer_manager_deprecated()->StopTimer(timer_);
timer_running_ = false;
if (--timer_count_ <= 0)
QuitMessageLoop();
@@ -224,7 +225,7 @@ void RunTest_BrokenTimer(MessageLoop::Type message_loop_type) {
// Simulate faulty early-firing timers. The tasks in RunTimerTest should
// nevertheless be invoked after their specified delays, regardless of when
// WM_TIMER fires.
- TimerManager* manager = MessageLoop::current()->timer_manager();
+ TimerManager* manager = MessageLoop::current()->timer_manager_deprecated();
manager->set_use_broken_delay(true);
RunTimerTest();
manager->set_use_broken_delay(false);