summaryrefslogtreecommitdiffstats
path: root/base/timer
diff options
context:
space:
mode:
authorchirantan <chirantan@chromium.org>2014-10-24 12:44:42 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-24 19:45:08 +0000
commit26436e402e6e1b780f6565539ae0acb3e2976fb9 (patch)
tree74bcbbae19ab7c21897ebee81621c063661408c8 /base/timer
parent4a526b4276b4165a68be177a84686f6c51c30959 (diff)
downloadchromium_src-26436e402e6e1b780f6565539ae0acb3e2976fb9.zip
chromium_src-26436e402e6e1b780f6565539ae0acb3e2976fb9.tar.gz
chromium_src-26436e402e6e1b780f6565539ae0acb3e2976fb9.tar.bz2
components: Introduce AlarmTimer class and use it for GCM heartbeat
This adds the AlarmTimer class to components, which is capable of waking up the system from suspend on platforms that support this operation (currently only Chrome OS with linux version 3.11 or higher). On all other platforms, the AlarmTimer behaves exactly the same as a regular Timer. BUG=crosbug.com/p/32272 Review URL: https://codereview.chromium.org/641943002 Cr-Commit-Position: refs/heads/master@{#301175}
Diffstat (limited to 'base/timer')
-rw-r--r--base/timer/timer.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/base/timer/timer.h b/base/timer/timer.h
index 6d282ee..4ef2f45 100644
--- a/base/timer/timer.h
+++ b/base/timer/timer.h
@@ -111,8 +111,14 @@ class BASE_EXPORT Timer {
TimeDelta delay,
const base::Closure& user_task);
+ void set_user_task(const Closure& task) { user_task_ = task; }
+ void set_desired_run_time(TimeTicks desired) { desired_run_time_ = desired; }
+ void set_is_running(bool running) { is_running_ = running; }
+
+ const tracked_objects::Location& posted_from() const { return posted_from_; }
bool retain_user_task() const { return retain_user_task_; }
bool is_repeating() const { return is_repeating_; }
+ bool is_running() const { return is_running_; }
private:
friend class BaseTimerTaskInternal;