diff options
Diffstat (limited to 'net/disk_cache/stress_cache.cc')
-rw-r--r-- | net/disk_cache/stress_cache.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/net/disk_cache/stress_cache.cc b/net/disk_cache/stress_cache.cc index 10058f0..864309a 100644 --- a/net/disk_cache/stress_cache.cc +++ b/net/disk_cache/stress_cache.cc @@ -143,6 +143,9 @@ class CrashTask : public Task { ~CrashTask() {} virtual void Run() { + // Keep trying to run. + RunSoon(MessageLoop::current()); + if (g_crashing) return; @@ -151,6 +154,12 @@ class CrashTask : public Task { TerminateProcess(GetCurrentProcess(), kExpectedCrash); } } + + static void RunSoon(MessageLoop* target_loop) { + int task_delay = 10000; // 10 seconds + CrashTask* task = new CrashTask(); + target_loop->PostDelayedTask(FROM_HERE, task, task_delay); + } }; // We leak everything here :) @@ -159,11 +168,7 @@ bool StartCrashThread() { if (!thread->Start()) return false; - // Create a recurrent timer of 10 secs. - int timer_delay = 10000; - CrashTask* task = new CrashTask(); - thread->message_loop()->timer_manager()->StartTimer(timer_delay, task, true); - + CrashTask::RunSoon(thread->message_loop()); return true; } |