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

Unified Diff: media/audio/audio_output_controller.h

Issue 8818012: Remove the AudioManager singleton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Address comments from Avi Created 9 years 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/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_

Powered by Google App Engine
This is Rietveld 408576698