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

Unified Diff: media/audio/test_audio_input_controller_factory.cc

Issue 2624403002: Refactor AudioInputController and related interfaces. (Closed)
Patch Set: Don't report errors that occur after (or rather while) closing the stream Created 3 years, 11 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/test_audio_input_controller_factory.cc
diff --git a/media/audio/test_audio_input_controller_factory.cc b/media/audio/test_audio_input_controller_factory.cc
index 024e7adee732a2cd16c3be7420a4f42a5cfba86f..94398d8085c8ed1003692ac0d8f60946aa20dc47 100644
--- a/media/audio/test_audio_input_controller_factory.cc
+++ b/media/audio/test_audio_input_controller_factory.cc
@@ -15,16 +15,16 @@ TestAudioInputController::TestAudioInputController(
EventHandler* event_handler,
SyncWriter* sync_writer,
UserInputMonitor* user_input_monitor)
- : AudioInputController(event_handler,
+ : AudioInputController(audio_manager->GetTaskRunner(),
+ event_handler,
sync_writer,
nullptr,
user_input_monitor,
false),
audio_parameters_(audio_parameters),
factory_(factory),
- event_handler_(event_handler) {
- task_runner_ = audio_manager->GetTaskRunner();
-}
+ event_handler_(event_handler),
+ sync_writer_(sync_writer) {}
TestAudioInputController::~TestAudioInputController() {
// Inform the factory so that it allows creating new instances in future.
@@ -37,7 +37,7 @@ void TestAudioInputController::Record() {
}
void TestAudioInputController::Close(const base::Closure& closed_task) {
- task_runner_->PostTask(FROM_HERE, closed_task);
+ GetTaskRunnerForTesting()->PostTask(FROM_HERE, closed_task);
if (factory_->delegate_)
factory_->delegate_->TestAudioControllerClosed(this);
}
@@ -59,8 +59,9 @@ AudioInputController* TestAudioInputControllerFactory::Create(
AudioParameters params,
UserInputMonitor* user_input_monitor) {
DCHECK(!controller_); // Only one test instance managed at a time.
- controller_ = new TestAudioInputController(
- this, audio_manager, params, event_handler, NULL, user_input_monitor);
+ controller_ =
+ new TestAudioInputController(this, audio_manager, params, event_handler,
+ sync_writer, user_input_monitor);
return controller_;
}

Powered by Google App Engine
This is Rietveld 408576698