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

Unified Diff: content/browser/browser_main_loop.cc

Issue 2582703003: Audio output debug recording. (Closed)
Patch Set: Code review. Rebase. Created 3 years, 10 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: content/browser/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index bf849b7102faea1e3a43481ba86002731013d640..5ed41aa6a0548475aef62843c84a70666a426e1f 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -68,6 +68,7 @@
#include "content/browser/media/media_internals.h"
#include "content/browser/memory/memory_coordinator_impl.h"
#include "content/browser/net/browser_online_state_observer.h"
+#include "content/browser/renderer_host/media/audio_debug_file_writer.h"
#include "content/browser/renderer_host/media/media_stream_manager.h"
#include "content/browser/renderer_host/render_process_host_impl.h"
#include "content/browser/service_manager/service_manager_context.h"
@@ -1798,6 +1799,15 @@ void BrowserMainLoop::CreateAudioManager() {
audio_manager_ = media::AudioManager::Create(
audio_thread_->task_runner(), audio_thread_->worker_task_runner(),
MediaInternals::GetInstance());
+#if BUILDFLAG(ENABLE_WEBRTC)
+ // AudioManager is deleted on the audio thread, so it's safe to post
+ // unretained.
+ audio_manager_->GetTaskRunner()->PostTask(
+ FROM_HERE,
+ base::Bind(&media::AudioManager::InitializeOutputDebugRecording,
+ base::Unretained(audio_manager_.get()),
+ base::BindRepeating(&AudioDebugFileWriter::Create)));
Max Morin 2017/02/09 09:47:26 Just use base::MakeUnique<media::AudioFileWriter>,
Henrik Grunell 2017/02/10 09:00:56 It would need to be base::MakeUnique<media::AudioD
+#endif
}
CHECK(audio_manager_);

Powered by Google App Engine
This is Rietveld 408576698