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

Unified Diff: media/base/wall_clock_time_source.h

Issue 1136513004: Switch GetWallClockTime to using vectors for input and output. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use vector. Cleanup. Created 5 years, 7 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
Index: media/base/wall_clock_time_source.h
diff --git a/media/base/wall_clock_time_source.h b/media/base/wall_clock_time_source.h
index 1de651889f45441640e52bed0d725ca4542c0564..5cdb0f7ba5adfec297ed6bcc002e6ac8250c4bb2 100644
--- a/media/base/wall_clock_time_source.h
+++ b/media/base/wall_clock_time_source.h
@@ -7,13 +7,10 @@
#include "base/memory/scoped_ptr.h"
#include "base/synchronization/lock.h"
+#include "base/time/default_tick_clock.h"
#include "media/base/media_export.h"
#include "media/base/time_source.h"
-namespace base {
-class TickClock;
-}
-
namespace media {
// A time source that uses interpolation based on the system clock.
@@ -28,14 +25,23 @@ class MEDIA_EXPORT WallClockTimeSource : public TimeSource {
void SetPlaybackRate(double playback_rate) override;
void SetMediaTime(base::TimeDelta time) override;
base::TimeDelta CurrentMediaTime() override;
- base::TimeTicks GetWallClockTime(base::TimeDelta time) override;
+ bool GetWallClockTime(
+ const std::vector<base::TimeDelta>& media_timestamps,
+ std::vector<base::TimeTicks>* wall_clock_times) override;
- void SetTickClockForTesting(scoped_ptr<base::TickClock> tick_clock);
+ void set_tick_clock_for_testing(base::TickClock* tick_clock) {
DaleCurtis 2015/05/12 01:32:34 Required for use in VideoRendererImpl unittest sin
+ tick_clock_ = tick_clock;
+ }
private:
base::TimeDelta CurrentMediaTime_Locked();
- scoped_ptr<base::TickClock> tick_clock_;
+ // Allow for an injectable tick clock for testing.
+ base::DefaultTickClock default_tick_clock_;
+
+ // If specified, used instead of |default_tick_clock_|.
+ base::TickClock* tick_clock_;
+
bool ticking_;
// While ticking we can interpolate the current media time by measuring the

Powered by Google App Engine
This is Rietveld 408576698