| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/policy/delayed_work_scheduler.h" | 5 #include "chrome/browser/policy/delayed_work_scheduler.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 } | 23 } |
| 24 | 24 |
| 25 void DelayedWorkScheduler::CancelDelayedWork() { | 25 void DelayedWorkScheduler::CancelDelayedWork() { |
| 26 timer_.Stop(); | 26 timer_.Stop(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void DelayedWorkScheduler::PostDelayedWork( | 29 void DelayedWorkScheduler::PostDelayedWork( |
| 30 const base::Closure& callback, | 30 const base::Closure& callback, |
| 31 int64 delay) { | 31 int64 delay) { |
| 32 callback_ = callback; | 32 callback_ = callback; |
| 33 timer_.Start(FROM_HERE, | 33 timer_.Start(base::TimeDelta::FromMilliseconds(delay), |
| 34 base::TimeDelta::FromMilliseconds(delay), | |
| 35 this, | 34 this, |
| 36 &DelayedWorkScheduler::DoDelayedWork); | 35 &DelayedWorkScheduler::DoDelayedWork); |
| 37 } | 36 } |
| 38 | 37 |
| 39 } // namespace policy | 38 } // namespace policy |
| OLD | NEW |