Chromium Code Reviews| Index: media/audio/audio_output_controller.h |
| =================================================================== |
| --- media/audio/audio_output_controller.h (revision 113173) |
| +++ media/audio/audio_output_controller.h (working copy) |
| @@ -8,6 +8,7 @@ |
| #include "base/callback.h" |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/scoped_ptr.h" |
| +#include "base/memory/weak_ptr.h" |
| #include "base/synchronization/lock.h" |
| #include "base/time.h" |
| #include "media/audio/audio_buffers_state.h" |
| @@ -115,6 +116,7 @@ |
| // will be created on the audio controller thread and when that is done |
| // event handler will receive a OnCreated() call. |
| static scoped_refptr<AudioOutputController> Create( |
| + AudioManager* audio_manager, |
| EventHandler* event_handler, |
| const AudioParameters& params, |
| // Soft limit for buffer capacity in this controller. This parameter |
| @@ -123,6 +125,7 @@ |
| // Factory method for creating a low latency audio stream. |
| static scoped_refptr<AudioOutputController> CreateLowLatency( |
| + AudioManager* audio_manager, |
| EventHandler* event_handler, |
| const AudioParameters& params, |
| // External synchronous reader for audio controller. |
| @@ -186,7 +189,8 @@ |
| static const int kPollNumAttempts; |
| static const int kPollPauseInMilliseconds; |
| - AudioOutputController(EventHandler* handler, |
| + AudioOutputController(AudioManager* audio_manager, |
| + EventHandler* handler, |
| uint32 capacity, SyncReader* sync_reader); |
| // The following methods are executed on the audio controller thread. |
| @@ -208,6 +212,7 @@ |
| // Helper method that stops, closes, and NULLs |*stream_|. |
| void StopCloseAndClearStream(); |
| + scoped_refptr<AudioManager> audio_manager_; |
| // |handler_| may be called only if |state_| is not kClosed. |
| EventHandler* handler_; |
| AudioOutputStream* stream_; |
| @@ -239,9 +244,12 @@ |
| // Number of times left. |
| int number_polling_attempts_left_; |
| + // Used to post delayed tasks to ourselves that we can cancel. |
|
henrika (OOO until Aug 14)
2011/12/07 10:08:34
Can you add some more details on why you had to in
tommi (sloooow) - chröme
2011/12/07 12:26:44
Improved comment.
|
| + base::WeakPtrFactory<AudioOutputController> weak_this_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(AudioOutputController); |
| }; |
| } // namespace media |
| -#endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ |
| +#endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ |