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

Unified Diff: cc/delay_based_time_source.h

Issue 11344004: Remove WebKit::Platform dependencies from cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix webkit_compositor_bindings_unittests Created 8 years, 2 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 | « cc/cc_tests.gyp ('k') | cc/delay_based_time_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/delay_based_time_source.h
diff --git a/cc/delay_based_time_source.h b/cc/delay_based_time_source.h
index b2944bd86fc7f73060e483279ea5989110dbbe1e..a9229c3f0cc968de83d3ff7916721ded6e0be0e1 100644
--- a/cc/delay_based_time_source.h
+++ b/cc/delay_based_time_source.h
@@ -5,18 +5,16 @@
#ifndef CCDelayBasedTimeSource_h
#define CCDelayBasedTimeSource_h
+#include "base/memory/weak_ptr.h"
#include "cc/time_source.h"
-#include "cc/timer.h"
namespace cc {
-class Thread;
-
// This timer implements a time source that achieves the specified interval
// in face of millisecond-precision delayed callbacks and random queueing delays.
-class DelayBasedTimeSource : public TimeSource, TimerClient {
+class DelayBasedTimeSource : public TimeSource {
public:
- static scoped_refptr<DelayBasedTimeSource> create(base::TimeDelta interval, Thread*);
+ static scoped_refptr<DelayBasedTimeSource> create(base::TimeDelta interval, Thread* thread);
virtual void setClient(TimeSourceClient* client) OVERRIDE;
@@ -31,18 +29,17 @@ public:
virtual base::TimeTicks lastTickTime() OVERRIDE;
virtual base::TimeTicks nextTickTime() OVERRIDE;
- // TimerClient implementation.
- virtual void onTimerFired() OVERRIDE;
// Virtual for testing.
virtual base::TimeTicks now() const;
protected:
- DelayBasedTimeSource(base::TimeDelta interval, Thread*);
+ DelayBasedTimeSource(base::TimeDelta interval, Thread* thread);
virtual ~DelayBasedTimeSource();
base::TimeTicks nextTickTarget(base::TimeTicks now);
void postNextTickTask(base::TimeTicks now);
+ void onTimerFired();
enum State {
STATE_INACTIVE,
@@ -70,8 +67,10 @@ protected:
Parameters m_nextParameters;
State m_state;
+
Thread* m_thread;
- Timer m_timer;
+ base::WeakPtrFactory<DelayBasedTimeSource> m_weakFactory;
+ DISALLOW_COPY_AND_ASSIGN(DelayBasedTimeSource);
};
} // namespace cc
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/delay_based_time_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698