summaryrefslogtreecommitdiffstats
path: root/base/timer_unittest.cc
diff options
context:
space:
mode:
authorjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-02 01:38:59 +0000
committerjbates@chromium.org <jbates@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-02 01:38:59 +0000
commit400d323d53525a13fbfc47efa8a95c4b13cbccb9 (patch)
treef647ecce497271c180d9e62d88a4fcfb73328dc9 /base/timer_unittest.cc
parent95d9e253aeb47ef0004edc29c9a8c442106b9488 (diff)
downloadchromium_src-400d323d53525a13fbfc47efa8a95c4b13cbccb9.zip
chromium_src-400d323d53525a13fbfc47efa8a95c4b13cbccb9.tar.gz
chromium_src-400d323d53525a13fbfc47efa8a95c4b13cbccb9.tar.bz2
Currently, base/timer.cc calls PostTask with FROM_HERE as the Location, so the original code that created the delayed callback is lost.
This change adds a tracked_objects::Location parameter to the APIs in base/timer.h so we can trace the PostTask callbacks. The other files are touched to add the FROM_HERE Location parameter. Review URL: http://codereview.chromium.org/7812036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99284 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/timer_unittest.cc')
-rw-r--r--base/timer_unittest.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/base/timer_unittest.cc b/base/timer_unittest.cc
index bb0eade..0013bcc 100644
--- a/base/timer_unittest.cc
+++ b/base/timer_unittest.cc
@@ -19,7 +19,7 @@ class OneShotTimerTester {
delay_ms_(milliseconds) {
}
void Start() {
- timer_.Start(TimeDelta::FromMilliseconds(delay_ms_), this,
+ timer_.Start(FROM_HERE, TimeDelta::FromMilliseconds(delay_ms_), this,
&OneShotTimerTester::Run);
}
private:
@@ -39,7 +39,7 @@ class OneShotSelfDeletingTimerTester {
timer_(new base::OneShotTimer<OneShotSelfDeletingTimerTester>()) {
}
void Start() {
- timer_->Start(TimeDelta::FromMilliseconds(10), this,
+ timer_->Start(FROM_HERE, TimeDelta::FromMilliseconds(10), this,
&OneShotSelfDeletingTimerTester::Run);
}
private:
@@ -59,7 +59,7 @@ class RepeatingTimerTester {
}
void Start() {
- timer_.Start(TimeDelta::FromMilliseconds(10), this,
+ timer_.Start(FROM_HERE, TimeDelta::FromMilliseconds(10), this,
&RepeatingTimerTester::Run);
}
private:
@@ -176,7 +176,7 @@ void RunTest_DelayTimer_NoCall(MessageLoop::Type message_loop_type) {
// If Delay is never called, the timer shouldn't go off.
DelayTimerTarget target;
- base::DelayTimer<DelayTimerTarget> timer(
+ base::DelayTimer<DelayTimerTarget> timer(FROM_HERE,
TimeDelta::FromMilliseconds(1), &target, &DelayTimerTarget::Signal);
bool did_run = false;
@@ -191,7 +191,7 @@ void RunTest_DelayTimer_OneCall(MessageLoop::Type message_loop_type) {
MessageLoop loop(message_loop_type);
DelayTimerTarget target;
- base::DelayTimer<DelayTimerTarget> timer(
+ base::DelayTimer<DelayTimerTarget> timer(FROM_HERE,
TimeDelta::FromMilliseconds(1), &target, &DelayTimerTarget::Signal);
timer.Reset();
@@ -225,7 +225,7 @@ void RunTest_DelayTimer_Reset(MessageLoop::Type message_loop_type) {
// If Delay is never called, the timer shouldn't go off.
DelayTimerTarget target;
- base::DelayTimer<DelayTimerTarget> timer(
+ base::DelayTimer<DelayTimerTarget> timer(FROM_HERE,
TimeDelta::FromMilliseconds(50), &target, &DelayTimerTarget::Signal);
timer.Reset();
@@ -233,8 +233,8 @@ void RunTest_DelayTimer_Reset(MessageLoop::Type message_loop_type) {
base::OneShotTimer<ResetHelper> timers[20];
for (size_t i = 0; i < arraysize(timers); ++i) {
- timers[i].Start(TimeDelta::FromMilliseconds(i * 10), &reset_helper,
- &ResetHelper::Reset);
+ timers[i].Start(FROM_HERE, TimeDelta::FromMilliseconds(i * 10),
+ &reset_helper, &ResetHelper::Reset);
}
bool did_run = false;
@@ -260,7 +260,7 @@ void RunTest_DelayTimer_Deleted(MessageLoop::Type message_loop_type) {
{
base::DelayTimer<DelayTimerFatalTarget> timer(
- TimeDelta::FromMilliseconds(50), &target,
+ FROM_HERE, TimeDelta::FromMilliseconds(50), &target,
&DelayTimerFatalTarget::Signal);
timer.Reset();
}