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

Unified Diff: media/base/clock.h

Issue 11607003: Add a Clock and TickClock interface for mocking out time (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix warnings Created 7 years, 10 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 | « base/time/tick_clock.cc ('k') | media/base/clock.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/clock.h
diff --git a/media/base/clock.h b/media/base/clock.h
index 5b2a90c28e8f6b9aa069564bdee661664b16dbf4..267666f668aeefc63682b7dcd4fc0e24ec7d2d14 100644
--- a/media/base/clock.h
+++ b/media/base/clock.h
@@ -9,6 +9,10 @@
#include "base/time.h"
#include "media/base/media_export.h"
+namespace base {
+class Clock;
+} // namespace base
+
namespace media {
// A clock represents a single source of time to allow audio and video streams
@@ -26,10 +30,7 @@ namespace media {
// we'll keep using a poll-and-sleep solution.
class MEDIA_EXPORT Clock {
public:
- // Type for a static function pointer that acts as a time source.
- typedef base::Time(TimeProvider)();
-
- explicit Clock(TimeProvider* time_provider);
+ explicit Clock(base::Clock* clock);
~Clock();
// Returns true if the clock is running.
@@ -91,12 +92,9 @@ class MEDIA_EXPORT Clock {
// value as returned by |time_provider_|.
base::TimeDelta ElapsedViaProvidedTime(const base::Time& time) const;
- base::Time GetTimeFromProvider() const;
-
base::TimeDelta ClampToValidTimeRange(base::TimeDelta time) const;
- // Function returning current time in base::Time units.
- TimeProvider* time_provider_;
+ base::Clock* const clock_;
// Whether the clock is running.
bool playing_;
« no previous file with comments | « base/time/tick_clock.cc ('k') | media/base/clock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698