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

Unified Diff: media/audio/fake_audio_input_stream.h

Issue 9692038: stopping the audio thread before destroying the AudioManager<Platform> (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: used the correct way to delete the fake streams & addressed Tommi's comment Created 8 years, 9 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/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 6bc4374a162ba41f24518a3a76ed232b7f72302b..daa7344b643f7b650ab5d90dd5c39f50f3650a74 100644
--- a/media/audio/fake_audio_input_stream.h
+++ b/media/audio/fake_audio_input_stream.h
@@ -9,18 +9,21 @@
#include <vector>
-#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/threading/thread.h"
#include "base/time.h"
#include "media/audio/audio_io.h"
#include "media/audio/audio_parameters.h"
+class AudioManagerBase;
+
class FakeAudioInputStream
- : public AudioInputStream,
- public base::RefCountedThreadSafe<FakeAudioInputStream> {
+ : public AudioInputStream {
public:
- static AudioInputStream* MakeFakeStream(const AudioParameters& params);
+ static AudioInputStream* MakeFakeStream(AudioManagerBase* manager,
+ const AudioParameters& params);
+
+ virtual ~FakeAudioInputStream();
tommi (sloooow) - chröme 2012/03/13 14:16:52 make the destructor private so that tests can't ma
no longer working on chromium 2012/03/13 15:03:39 Done.
virtual bool Open() OVERRIDE;
virtual void Start(AudioInputCallback* callback) OVERRIDE;
@@ -31,14 +34,13 @@ class FakeAudioInputStream
virtual double GetVolume() OVERRIDE;
private:
- // Give RefCountedThreadSafe access our destructor.
- friend class base::RefCountedThreadSafe<FakeAudioInputStream>;
- FakeAudioInputStream(const AudioParameters& params);
- virtual ~FakeAudioInputStream();
+ FakeAudioInputStream(AudioManagerBase* manager,
+ const AudioParameters& params);
void DoCallback();
+ AudioManagerBase* audio_manager_;
AudioInputCallback* callback_;
scoped_array<uint8> buffer_;
int buffer_size_;

Powered by Google App Engine
This is Rietveld 408576698