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

Unified Diff: trunk/src/media/filters/audio_renderer_impl.h

Issue 380303004: Revert 282424 "Remove media::AudioRendererImpl::now_cb_ and clea..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 5 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 | trunk/src/media/filters/audio_renderer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/media/filters/audio_renderer_impl.h
===================================================================
--- trunk/src/media/filters/audio_renderer_impl.h (revision 282435)
+++ trunk/src/media/filters/audio_renderer_impl.h (working copy)
@@ -80,6 +80,12 @@
virtual void StartPlayingFrom(base::TimeDelta timestamp) OVERRIDE;
virtual void SetVolume(float volume) OVERRIDE;
+ // Allows injection of a custom time callback for non-realtime testing.
+ typedef base::Callback<base::TimeTicks()> NowCB;
+ void set_now_cb_for_testing(const NowCB& now_cb) {
+ now_cb_ = now_cb;
+ }
+
private:
friend class AudioRendererImplTest;
@@ -215,6 +221,9 @@
// Callback provided to Flush().
base::Closure flush_cb_;
+ // Typically calls base::TimeTicks::Now() but can be overridden by a test.
+ NowCB now_cb_;
+
// After Initialize() has completed, all variables below must be accessed
// under |lock_|. ------------------------------------------------------------
base::Lock lock_;
« no previous file with comments | « no previous file | trunk/src/media/filters/audio_renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698