Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3339)

Unified Diff: cc/CCDelayBasedTimeSource.h

Issue 10956006: Convert CC scheduler logic to use base::TimeTicks/Delta instead of doubles (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/CCDelayBasedTimeSource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/CCDelayBasedTimeSource.h
diff --git a/cc/CCDelayBasedTimeSource.h b/cc/CCDelayBasedTimeSource.h
index d9c9c28dcb3042125f691d1b6b90d3b6a87695d2..51fd0743006092f156ddce5083a58739746f18be 100644
--- a/cc/CCDelayBasedTimeSource.h
+++ b/cc/CCDelayBasedTimeSource.h
@@ -17,32 +17,32 @@ class CCThread;
// in face of millisecond-precision delayed callbacks and random queueing delays.
class CCDelayBasedTimeSource : public CCTimeSource, CCTimerClient {
public:
- static PassRefPtr<CCDelayBasedTimeSource> create(double intervalSeconds, CCThread*);
+ static PassRefPtr<CCDelayBasedTimeSource> create(base::TimeDelta interval, CCThread*);
virtual ~CCDelayBasedTimeSource() { }
virtual void setClient(CCTimeSourceClient* client) OVERRIDE { m_client = client; }
// CCTimeSource implementation
- virtual void setTimebaseAndInterval(double timebase, double intervalSeconds) OVERRIDE;
+ virtual void setTimebaseAndInterval(base::TimeTicks timebase, base::TimeDelta interval) OVERRIDE;
virtual void setActive(bool) OVERRIDE;
virtual bool active() const OVERRIDE { return m_state != STATE_INACTIVE; }
// Get the last and next tick times.
- virtual double lastTickTime() OVERRIDE;
- virtual double nextTickTimeIfActivated() OVERRIDE;
+ virtual base::TimeTicks lastTickTime() OVERRIDE;
+ virtual base::TimeTicks nextTickTimeIfActivated() OVERRIDE;
// CCTimerClient implementation.
virtual void onTimerFired() OVERRIDE;
// Virtual for testing.
- virtual double monotonicTimeNow() const;
+ virtual base::TimeTicks now() const;
protected:
- CCDelayBasedTimeSource(double interval, CCThread*);
- double nextTickTarget(double now);
- void postNextTickTask(double now);
+ CCDelayBasedTimeSource(base::TimeDelta interval, CCThread*);
+ base::TimeTicks nextTickTarget(base::TimeTicks now);
+ void postNextTickTask(base::TimeTicks now);
enum State {
STATE_INACTIVE,
@@ -51,16 +51,16 @@ protected:
};
struct Parameters {
- Parameters(double interval, double tickTarget)
+ Parameters(base::TimeDelta interval, base::TimeTicks tickTarget)
: interval(interval), tickTarget(tickTarget)
{ }
- double interval;
- double tickTarget;
+ base::TimeDelta interval;
+ base::TimeTicks tickTarget;
};
CCTimeSourceClient* m_client;
bool m_hasTickTarget;
- double m_lastTickTime;
+ base::TimeTicks m_lastTickTime;
// m_currentParameters should only be written by postNextTickTask.
// m_nextParameters will take effect on the next call to postNextTickTask.
« no previous file with comments | « no previous file | cc/CCDelayBasedTimeSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698