summaryrefslogtreecommitdiffstats
path: root/cc/scheduler/delay_based_time_source.h
diff options
context:
space:
mode:
authorbrianderson@chromium.org <brianderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-04 02:03:19 +0000
committerbrianderson@chromium.org <brianderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-04 02:03:19 +0000
commit50b196c9360f129e7e6903f825f83635b00c272b (patch)
treef3c5b0920080c0f289c78b97a80a170fe43dc9a1 /cc/scheduler/delay_based_time_source.h
parent2ef1827ba2134a500ebe1749c3fdaa2e2291bb6e (diff)
downloadchromium_src-50b196c9360f129e7e6903f825f83635b00c272b.zip
chromium_src-50b196c9360f129e7e6903f825f83635b00c272b.tar.gz
chromium_src-50b196c9360f129e7e6903f825f83635b00c272b.tar.bz2
cc: Fix and simplify DelayBasedTimeSource
- This converts some floating point math to integer math to avoid rounding errors. - Assigns last_tick_time_ to be the time it was *supposed* to tick and no longer uses it as a synonym for "now". - Adds trace events to help debug when the interval or phase changes. BUG=256650 Review URL: https://chromiumcodereview.appspot.com/18589002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@210101 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/scheduler/delay_based_time_source.h')
-rw-r--r--cc/scheduler/delay_based_time_source.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/cc/scheduler/delay_based_time_source.h b/cc/scheduler/delay_based_time_source.h
index 1dc4d6f..009b9a3 100644
--- a/cc/scheduler/delay_based_time_source.h
+++ b/cc/scheduler/delay_based_time_source.h
@@ -47,12 +47,6 @@ class CC_EXPORT DelayBasedTimeSource : public TimeSource {
void PostNextTickTask(base::TimeTicks now);
void OnTimerFired();
- enum State {
- STATE_INACTIVE,
- STATE_STARTING,
- STATE_ACTIVE,
- };
-
struct Parameters {
Parameters(base::TimeDelta interval, base::TimeTicks tick_target)
: interval(interval), tick_target(tick_target) {}
@@ -61,7 +55,6 @@ class CC_EXPORT DelayBasedTimeSource : public TimeSource {
};
TimeSourceClient* client_;
- bool has_tick_target_;
base::TimeTicks last_tick_time_;
// current_parameters_ should only be written by PostNextTickTask.
@@ -71,7 +64,7 @@ class CC_EXPORT DelayBasedTimeSource : public TimeSource {
Parameters current_parameters_;
Parameters next_parameters_;
- State state_;
+ bool active_;
base::SingleThreadTaskRunner* task_runner_;
base::WeakPtrFactory<DelayBasedTimeSource> weak_factory_;