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

Unified Diff: media/audio/fake_audio_input_stream.h

Issue 399623008: Use audio thread for the fake input audio stream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed the mac bots 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 | media/audio/fake_audio_input_stream.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/fake_audio_input_stream.h
diff --git a/media/audio/fake_audio_input_stream.h b/media/audio/fake_audio_input_stream.h
index e6c625e6b3a2dd843630728667a1e2efd7e5f8ec..4c3c24c55552ed93a5c6c1860bf9b473059503cc 100644
--- a/media/audio/fake_audio_input_stream.h
+++ b/media/audio/fake_audio_input_stream.h
@@ -61,7 +61,7 @@ class MEDIA_EXPORT FakeAudioInputStream
scoped_ptr<uint8[]> buffer_;
int buffer_size_;
AudioParameters params_;
- base::Thread thread_;
+ const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
base::TimeTicks last_callback_time_;
base::TimeDelta callback_interval_;
base::TimeDelta interval_from_last_beep_;
@@ -71,6 +71,10 @@ class MEDIA_EXPORT FakeAudioInputStream
int frames_elapsed_;
scoped_ptr<media::AudioBus> audio_bus_;
+ // Allows us to run tasks on the FakeAudioInputStream instance which are
+ // bound by its lifetime.
+ base::WeakPtrFactory<FakeAudioInputStream> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(FakeAudioInputStream);
};
« no previous file with comments | « no previous file | media/audio/fake_audio_input_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698